/* style.css */

:root {
  --ink: #000;
  --paper: #fffdf7;
  --pink: #ffb3d9;
  --dry: rgb(from #edf8ed r g b / 60%);
  --wet: rgb(from #fff8c9 r g b / 60%);
  --full: rgb(from #ffd6dc r g b / 60%);
}


body {
  margin: 0;
  min-height: 100vh;
  font-family: "Patrick Hand", "comic sans ms", cursive;
  font-weight: 400;
  font-style: normal;

  background-color: #fffdf7;
  background-image:
    repeating-linear-gradient(to bottom,
      transparent,
      transparent 31px,
      rgba(120, 160, 220, 0.35) 32px),

    linear-gradient(to right,
      rgba(220, 80, 80, 0.5) 2px,
      transparent 2px);

  background-size:
    100% 32px,
    100% 100%;

  background-position:
    0 0,
    30px 0;

  background-repeat:
    repeat,
    no-repeat;
}

.image_diaperkid {
  display: block;
  margin: 0 auto;
  margin-top: 40px;
  max-width: 100%;
  height: auto;
  width: 100px;
}

h2 {
  font-size: 1.2em;
  margin: 0.5em 0;
}

form>div {
  margin-bottom: 1em;
}

label {
  display: none;
}

p {
  margin-top: 1em;
}

.section_register,
.section_login {
  display: flex;
  flex-direction: column;
  align-items: center;
}

form {
  width: 70%;
  flex-direction: column;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background-color: #ffffff;
  border: 2px solid #000000;
}

input::placeholder {
  color: #666;
}

input:focus {
  border-color: #ffb8d1;
  outline: none;
}

button {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 8px;
  margin-top: 5px;
  border: 2px solid #000000;
  cursor: pointer;
  text-transform: uppercase;
  transition: 0.5s ease;
  color: #000000;
}

button:hover {
  box-shadow: 3px 3px 0px #000000;
}

button[type="submit"] {
  background-color: #FFB3D9;
}

button[type="button"] {
  background-color: #ffffff;
}


/* Dashboard */
.app-header {
  display: grid;
  grid-template-columns: auto 1fr 48px;
  align-items: center;
  min-height: 60px;
  padding: 5px 16px;
  background: var(--paper);
  border-bottom: 2.5px solid var(--ink);
}

.app-logo {
  display: grid;
  grid-template-columns: 70px 1fr 48px;
  width: 70px;
  object-fit: contain;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8rem;
  text-transform: uppercase;
}

.dashboard {
  max-width: 560px;
  margin: 0 auto;
}

.dashboard>h2 {
  margin: 28px 0 18px;
  text-align: center;
  text-transform: uppercase;
}

.dashboard-section {
  padding: 40px 20px;
  margin: 20px;

}

.dashboard-section h3,
.section-title h3,
.chart-section h3 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.chart-section h3 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
  text-transform: uppercase;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  gap: 7px;
}

.logo_small {
  width: 65px;
  object-fit: contain;
}

.icon{
  width: 30px;
}

.children-switcher {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.status-box {
  min-height: 58px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.05rem;
  display: grid;
  align-items: center;
  justify-content: center;
}

.add-child-button {
  width: max-content;
  min-height: 58px;
  margin: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.05rem;
}

.status-box.active,
.bottom-nav a.active {
  background: var(--pink);
}

.diaper-status-section {
  background: var(--dry);
}

.status-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stock-section {
  background: var(--wet);
}

.stock-grid,
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-box {
  min-height: 100px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.55);
}

.info-box.wide {
  grid-column: 1 / -1;
}

.info-box p {
  margin: 0 0 12px;
  color: #555;
  font-size: 0.9rem;
}

.info-box strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.05;
}

.stock-status {
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--ink);
  text-align: center;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.statistics-section {
  background: transparent;
}

.chart-section {
  margin-top: 26px;
}

#diaperChart {
  min-height: 280px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 560px;
  margin: 32px auto 0;
  padding: 14px 44px 12px;
  background: var(--paper);
  border-top: 2.5px solid var(--ink);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  min-height: 64px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}

/* Profil */
.profile-page {
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.profile-link {
  display: grid;
  place-items: center;
  color: inherit;
  text-decoration: none;
}

.profile-page>h2 {
  margin: 28px 0 18px;
  text-align: center;
  text-transform: uppercase;
}

.profile-avatar-section,
.profile-section {
  padding: 20px 16px;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.profile-primary-button,
.profile-action-button,
.logout-button,
.delete-button {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.profile-primary-button {
  min-height: 58px;
  background: var(--pink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.profile-panel {
  border: 2px solid var(--ink);
  padding: 14px 16px;
  background: rgba(255, 253, 247, 0.45);
}

.profile-panel h4 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.profile-panel p,
.profile-help-text {
  margin: 0 0 14px;
  color: #555;
  font-size: 0.95rem;
}

.profile-row,
.profile-panel-header {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 12px;
  align-items: center;
}

.sensor-field {
  min-height: 42px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.profile-action-button,
.delete-button {
  min-height: 54px;
  margin: 0;
}

.connection-status {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  background: #77b96a;
  color: #fff;
}

.profile-form {
  width: 100%;
}

.profile-form label {
  display: block;
  margin: 16px 0 6px;
  font-size: 1.1rem;
}

.profile-form input {
  margin-bottom: 10px;
}

.logout-button {
  width: calc(100% - 32px);
  margin: 20px 16px 80px;
  min-height: 58px;
  background: var(--paper);
}

.add-child-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border: 2px solid var(--ink);
}

.add-child-form[hidden] {
  display: none;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chart-wrapper {
  height: 280px;
  padding: 12px;
}

#diaperChart {
  width: 100%;
  height: 100%;
}


.brand-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.avatar-options[hidden] {
  display: none;
}

.avatar-options button {
  margin: 0;
  padding: 8px;
}

.avatar-options img {
  width: 100%;
  height: 54px;
  object-fit: contain;
}

.header-avatar {
    width: 44px;          
    height: 44px;
    border-radius: 50%;   
    border: 1.5px solid var(--ink); 
    object-fit: cover;
    background-color: var(--paper);
}

.section-avatar-icon {
    width: 36px;          
    height: 36px;
    border-radius: 50%;   
    border: 1.5px solid var(--ink); 
    object-fit: cover;
    background-color: var(--paper);
}

.stock-status a {
  color: var(--ink);
  text-decoration: underline;
}


@media (min-width: 700px) {
  .dashboard,
  .profile-page,
  .bottom-nav {
    max-width: 640px;
  }

  .dashboard-section,
  .profile-section,
  .profile-avatar-section {
    margin-left: 24px;
    margin-right: 24px;
  }

  .app-header {
    padding-left: 32px;
    padding-right: 32px;
  }

  .children-switcher {
    grid-template-columns: repeat(3, max-content);
  }

  .add-child-button,
  .child-button {
    min-width: 120px;
  }

  .stock-grid,
  .statistics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-options {
    gap: 18px;
  }

  .chart-wrapper {
    height: 340px;
  }

  .bottom-nav {
    padding-left: 80px;
    padding-right: 80px;
  }
}
