/* ==========================================================================
   TrinkFit – Haupt-Stylesheet
   Enthält alle Layout- und Design-Regeln für Header, Inhalte, Diagramme, Footer
   inkl. responsivem Verhalten, Farben, Typografie und Popup-Styling.
   ========================================================================= */

/* =====================
   Allgemeine Grundstyles
   ===================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  color: #17296d;
  line-height: 1.5;
  background-color: #f7f8fc;
}

h1, h2, h3 {
  font-family: "oso-sans", sans-serif;
  font-weight: 600;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1em;
}

/* =====================
   Header mit Welle
   ===================== */
.site-header {
  position: relative;
  background: #102A71;
  padding: 20px 20px 80px; /* Platz für Welle unten */
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  overflow: hidden;
  z-index: 1;
}

.header-content {
  display: flex;
  justify-content: space-between; /* Linksbündiges Icon und rechts Textlogo */
  align-items: center;
  flex-wrap: wrap;
  gap: 2em;
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
  z-index: 2;
}

.logo-img {
  height: 100px;
  width: auto;
  order: 1;
}

.logo-text {
  height: 60px;
  width: auto;
  order: 2;
}

.header-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  line-height: 0;
  z-index: 1;
}

.header-wave svg {
  display: block;
  width: 100%;
  height: 120px;
}

/* =====================
   Hauptinhalt
   ===================== */
.image-content {
  text-align: center;
  margin: 1em 0;
}

.image-content img {
  max-width: 100%;
  height: auto;
}

.note {
  font-style: italic;
}

/* Diagramm Umschaltung */
.chart-toggle {
  display: flex;
  gap: 1em;
  justify-content: center;
  margin: 2em 0;
}

.chart-toggle button {
  border-radius: 999px;
  padding: 0.6em 1.8em;
  font-weight: bold;
  font-family: 'Roboto', sans-serif;
  background: #f0f3fa;
  color: #17296d;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 12pt;
}

.chart-toggle button.active {
  background: white;
  border: 2px solid #F5C400;
}

/* Tipp-Box (Aside) */
aside.tip-box, .tip-box {
  background: #17296d;
  color: #ffffff;
  padding: 1em;
  border-radius: 10px;
  margin: 2em 0;
  font-family: 'Roboto', sans-serif;
}

.tip-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  align-items: center;
  border-radius: 30px;
  padding: 2em;
  max-width: 20%;
  width: 100%;
}

.tip-box h3 {
  font-family: 'oso-sans', sans-serif;
  font-size: 1.5em;
  margin-bottom: 0.5em;
}

.tip-box p {
  font-size: 1em;
  margin: 0.5em 0;
}

.tip-box strong {
  font-weight: bold;
}

/* Vorteile-Box */
.advantages {
  background: #F5C400;
  font-weight: bold;
  color: #ffffff;
  padding: 2em 10em;
  border-radius: 15px;
  clear: both;
  margin: 1em 0;
}

.advantages h2 {
  margin: 0 0 0.5em 0;
}

.advantages ul {
  margin: 0;
  padding-left: 1.2em;
}

.advantages li {
  margin-bottom: 0.3em;
}

/* Fortschrittsbalken */
.trinkfortschritt-box {
  text-align: center;
  margin: 2em auto;
  max-width: 600px;
}

.trinkfortschritt {
  width: 100%;
  height: 40px;
  background: #dde1f4;
  border-radius: 999px;
  overflow: hidden;
}

.trinkfortschritt-fill {
  height: 100%;
  width: 0%;
  background-color: #102A71;
  border-radius: 999px 0 0 999px;
  transition: width 1s ease;
}

#trinkInfo,
.hidden {
  display: none !important;
}

/* Trinkstatistik */
.trink-statistik {
  margin: 2em 0 1em;
  text-align: left;
  color: #17296d;
}

.trink-statistik h2 {
  margin-bottom: 0.5em;
}

#trinkSummary {
  font-weight: bold;
}

.statistik-labels {
  display: flex;
  gap: 1em;
  margin-top: 0.5em;
  flex-wrap: wrap;
}

#datumBox, #zielBox {
  padding: 0.4em 1em;
  border-radius: 4px;
  font-weight: bold;
}

#datumBox {
  background-color: #17296d;
  color: #F5C400;
}

#zielBox {
  background-color: #F5C400;
  color: #17296d;
}

/* Diagrammbereich und Tipp-Box nebeneinander */
.chart-tip-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  align-items: stretch;
  margin: 2em 0;
}

.chart-area {
  flex: 2;
  min-width: 300px;
  overflow-x: auto;
}

.chart-area canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =====================
   Footer mit Welle
   ===================== */
footer {
  position: relative;
  background: #102A71;
  color: white;
  text-align: center;
  padding: 80px 1em 20px;
  min-height: 160px;
  overflow: hidden;
}

.footer-wave-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  line-height: 0;
  transform: rotate(180deg); /* Welle zeigt nach unten */
}

.footer-wave-top svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* =====================
   PopUp Overlay
   ===================== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup-box {
  background: #17296d;
  padding: 2em;
  border-radius: 30px;
  width: 90%;
  max-width: 400px;
  color: white;
  text-align: left;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  font-family: 'Roboto', sans-serif;
}

.popup-box h3 {
  margin-top: 0;
}

.popup-box .highlight {
  color: #EDC643;
  font-weight: bold;
}

.popup-box p {
  font-size: 0.95em;
  color: #dde1f4;
  margin-bottom: 1.5em;
}

.popup-box label {
  font-weight: bold;
  display: block;
  margin: 0.8em 0 0.2em;
}

.input-row {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

.input-row input {
  border: none;
  padding: 0.6em;
  width: 100%;
  font-size: 1em;
}

.input-row .unit {
  padding: 0.6em;
  font-weight: bold;
  color: #17296d;
  background: white;
  white-space: nowrap;
}

.btn-yellow {
  margin-top: 2em;
  background: #F5C400;
  border: none;
  padding: 0.8em 1.5em;
  width: 100%;
  color: #17296d;
  font-weight: bold;
  font-size: 1em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-yellow:hover {
  background: #f1d34d;
}

/* =====================
   Responsive Design
   ===================== */
@media (min-width: 768px) {
  .intro-section {
    display: flex;
    align-items: flex-start;
    gap: 2em;
  }

  .text-content {
    flex: 1;
  }

  .image-content {
    flex: 0 0 auto;
    text-align: center;
    margin: 40px 0;
    width: 35%;
  }
}

@media (max-width: 1023px) {
  .chart-tip-wrapper {
    flex-direction: column;
  }

  .tip-box {
    max-width: 100%;
    width: 100%;
  }

  .chart-area {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .logo-img {
    display: none;
  }

  .logo-text {
    margin: 0 auto;
    height: 80px;
  }

  .site-header {
    justify-content: center;
    padding: 20px 0 60px; /* Platz für Welle */
  }

  .advantages {
    padding: 2em 3em;
  }
}
