
:root {
  color-scheme: light dark;
  --color-bg: #f5f6fa;
  --color-card: #fff;
  --color-text: #222;
  --color-card-shadow: rgba(60,60,60,0.09);
  
  /* ------------------------------
  Tags definieren -> light
  ------------------------------ */
  --color-tag-high-bg:   #fff3f3;
  --color-tag-high-text: #d63031;
  --color-tag-normal-bg: #D9F1FF;
  --color-tag-normal-text: #00348F;
  --color-tag-low-bg:    #e8fcf9;
  --color-tag-low-text:  #33E2D1;

  /* ------------------------------
  Anomalie definieren -> light
  ------------------------------ */
  --chart-label-color: #00348F;
  --chart-label-bg: transparent;

/* ------------------------------
  Button definieren -> light
------------------------------ */
  --btn-bg-color: #000099;
  --btn-border-color: #000099;
  --btn-text-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #181a1b;
    --color-card: #23272a;
    --color-text: #f5f6fa;
    --color-card-shadow: rgba(0,0,0,0.22);

  /* ------------------------------
  Tags definieren -> dark
  ------------------------------ */
    --color-tag-high-bg:   #2a1517;
    --color-tag-high-text: #FF6B6B;
    --color-tag-normal-bg: #17232a;
    --color-tag-normal-text: #1E90FF;
    --color-tag-low-bg:    #1a2420;
    --color-tag-low-text:  #27E2C0;

  /* ------------------------------
    Tags definieren -> dark
  ------------------------------ */
    --chart-label-color: #fff;

/* ------------------------------
  Button definieren -> dark
------------------------------ */
  --btn-bg-color: rgba(0,0,153, 0);
  --btn-border-color: #ffffff;
  --btn-text-color: #ffffff;
  }
}

.anomaly-high {
  background: var(--color-tag-high-bg);
  color: var(--color-tag-high-text);
}
.anomaly-normal {
  background: var(--color-tag-normal-bg);
  color: var(--color-tag-normal-text);
}
.anomaly-low {
  background: var(--color-tag-low-bg);
  color: var(--color-tag-low-text);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
}
header {
  text-align: center;
  padding: 1rem;
}
main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  max-width: 500px;
  margin: auto;
}

section.title h1 {
  font-size: 32px;
  font-weight: 700;
  font-style: normal;
  margin: 0px 0 24px 0px;
}

.card {
  background: var(--color-card);
  border-radius: 1rem;
  box-shadow: 0 4px 12px var(--color-card-shadow);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.card-title.pd24 {
  padding-bottom: 24px;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1 0 0;
}

.title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title h4 {
/* Mobile/Header/H4 */
font-size: 19px;
font-weight: 500;
font-style: normal;
line-height: 19px; /* 118.75% */
margin: 0;
}

.card-title h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 200;
    opacity: .5;
}

.add-value-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--btn-bg-color);
  color: var(--btn-text-color);
  border-radius: 20px;
  border: 2px solid var(--btn-border-color);
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  -ms-border-radius: 20px;
  -o-border-radius: 20px;
}
.add-value-btn:hover { background: #222; }

span.btn-icon {
    position: relative;
    width: 10px;
    height: 10px;
}
span.btn-icon::after {
    content: "+";
    position: absolute;
    font-size: 20px;
    font-weight: 600;
    top: 50%;
    transform: translate(-8px, -54%);
    -webkit-transform: translate(-8px, -54%);
    -moz-transform: translate(-8px, -54%);
    -ms-transform: translate(-8px, -54%);
    -o-transform: translate(-8px, -54%);
}

.anomaly-tag {
  /* Body/S2 Medium */
font-size: 12px;
font-style: normal;
font-weight: 500;
display: flex;
padding: 6px 8px;
border-radius: var(--Radius-08, 8px);
}

#chart-labels {
    display: flex;
    justify-content: space-around;
    flex: 1 0 0;
    gap: 29px;
    margin: 8px 0 0 0;
    font-size: 14px;
    padding: 20px 10px 0 24px;
}
.chart-label {
  color: var(--color-text);
  opacity: 0.85;
  text-align: center;
}
.chart-label.is-today {
  color: #e17055;          /* Orange oder Wunschfarbe für aktuellen Tag */
  font-weight: bold;
  text-decoration: underline;
}
.chart-label.is-forecast {
  color: #888;             /* abgesetzte Farbe für Prognose */
  font-style: italic;
}

ul#usage-list {
  padding-left: 1rem;
}
footer {
  text-align: center;
  font-size: 0.95em;
  margin: 2rem 0 1rem 0;
  color: var(--color-text);
}
#pwa-install-hint {
  background: #ffeaa7;
  border-radius: 0.5rem;
  padding: 0.6em;
  margin: 1em 0 0 0;
  color: #222;
}

/* Sticky Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 101; /* Höher als das Overlay */
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1.2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  pointer-events: auto;
}


.logo {
  height: 24px; /* oder was du brauchst */
  transition: opacity 0.2s;
}
.logo-dark {
  display: none;
}
.logo-light {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  .logo-light {
    display: none;
  }
  .logo-dark {
    display: inline;
  }
}

#nav-burger {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
}
.burger-bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-text);
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.3s;
}
.bar1 {
  transform-origin: left;
}
.bar2 {
  transform-origin: left;
}

/* Burger zu X animieren */
#nav-burger.active .bar1 {
  transform: rotate(45deg) translateY(-5px);
}
#nav-burger.active .bar2 {
  transform: rotate(-45deg) translateY(5px);
}

/* Overlay-Menu */
#nav-overlay {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30,30,35,0.98);
  color: #fff;
  z-index: 100;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s;
  padding-top: 56px; /* Höhe des Headers, damit nichts verdeckt wird */
  height: calc(100% - 56px);
  pointer-events: auto;
}
#nav-overlay ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#nav-overlay li {
  margin: 1.3em 0;
}
#nav-overlay button {
  background: none;
  color: #fff;
  border: none;
  font-size: 1.2em;
  padding: 0.6em 2em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
#nav-overlay button:hover,
#nav-overlay button:focus {
  background: rgba(255,255,255,0.08);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
