/* ===========================================================================
   Projekt: AI basierte Softwareentwicklung – René Frutiger, Juli 2025
   Konsolidiertes Stylesheet
============================================================================ */

/* ===========================================================================
   1. CSS-Variablen
============================================================================ */
:root {
  /* Farben Header & Footer */
  --header-bg:           #005f73;
  --header-text:         #ffffff;
  --header-bg-light:     rgba(0, 95, 115, 0.6);

  /* Seitenhintergrund & Tabelle */
  --page-bg:             linear-gradient(to bottom right, #e0fbfc, #f0fdfa);
  --table-text:          var(--header-bg);
  --row-odd-bg:          #ecfdf5;

  /* Windklassen */
  --speed-0-bg:          #ffffff;
  --speed-1-bg:          #e6ffe6;
  --speed-2-bg:          #3cb371;
  --speed-2-text:        #ffffff;

  /* Transparenzen Overlay & Modal */
  --overlay-bg-alpha:    0.5;

  /* Layout-Höhen */
  --header-height:       80px;
  --footer-height:       3rem;
}


/* Alle Links auf der Seite */
a {
  color: #2a9d8f;         /* Türkisfarbton, passend zu #005f73 */
  text-decoration: none;  /* Unterstreichung entfernen */
}

/* Optional: Hover-Effekt */
a:hover {
  color: #005f73;         /* Dunklerer Farbton beim Überfahren */
  text-decoration: underline;
}



/* ===========================================================================
   2. Reset & Grundlegendes
============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background-color: var(--header-bg); /* gleiche Farbe wie Header */
  margin: 0;
  padding: 0;
  height: 100%;
}

ul {
  list-style: none;
}

body {
  display: grid;
  grid-template-rows: var(--header-height) 1fr var(--footer-height);
  min-height: 100vh;
  margin: 0;
  font-family: 'Aboreto', sans-serif;
  /* background: var(--header-bg); */  /* entfernt, damit Main-Hintergrund sichtbar bleibt */
  color: #233c42;
}

/* ===========================================================================
   3. Header
============================================================================ */
header {
  height: 100px;
  grid-row: 1;
  position: relative;           /* Hier ergänzt */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.header-logo {
  max-height: 70px;         /* größer als vorher */
  height: auto;
  width: auto;
  display: block;
  margin: 0 auto;
}

.header-center {
  text-align: center;
}


/* ===========================================================================
   Header-Titel & Back Button
============================================================================ */
.header-center {
  position: absolute;     /* bleibt relativ zum Header */
  top: 0;                 /* volle Höhe des Headers abdecken */
  left: 0;
  width: 100%;
  height: 100%;
  
  display: flex;          /* Flexbox für zentrierten Content */
  align-items: center;    /* vertikal zentrieren */
  justify-content: center;/* horizontal zentrieren */

  pointer-events: none;   /* Klicks passieren lassen */
}

.header-center a {
  pointer-events: auto;   /* Link wieder klickbar */
}

header .white-link {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 400;    /* setzt auf „normal“ zurück */
  font-size: 1.8rem;
}

#backBtn {
    background-color: rgba(255, 255, 255, 0.1); /* leicht weißer Hintergrund */
    border: none;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
  }

  #backBtn:hover {
    background-color: rgba(255, 255, 255, 0.4); /* etwas heller beim Hover */
  }

  #backBtn svg {
    stroke: white; /* optional: dunkle Farbe für das Icon */
    stroke-width: 2;
    fill: none;
  }

/* ===================================================================
   TITEL Erste Überschtift und Zeile darunter
=================================================================== */
.lake-title {
  color: var(--header-bg);
  text-align: center;
  font-size: 1.4rem;
  margin: 2rem 0 1.5rem;
  font-weight: 500;
}

#lastUpdate {
    color: var(--header-bg);
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding: 0 2rem;
}

/* ===========================================================================
   4. Main (zweite, flexible Zeile)
============================================================================ */
main {
  grid-row: 2;
  background: var(--page-bg);
  padding: 4rem 2rem;
  overflow-y: auto;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ===========================================================================
   5. Footer (dritte Zeile)
============================================================================ */
footer {
  grid-row: 3;
  display: flex;
  flex-direction: column;    /* Stapelt <p> untereinander */
  align-items: center;       /* Horizontale Zentrierung */
  justify-content: center;   /* Vertikale Zentrierung */
  
  padding: 0.5em 0;          /* Innenabstand statt fixer Höhe */
  background: var(--header-bg-light);
  color: var(--header-text);
  font-size: 0.7rem;
  font-weight: 300;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

footer p {
  margin: 0.2em 0;           /* Abstand zwischen den Zeilen */
  line-height: normal;       /* Standard-Zeilenabstand */
}

/* FIXIERTER FOOTER MIT KONSTANTER HÖHE */

footer {
  position: fixed;       /* Footer aus dem Flow und am Viewport fixiert */
  bottom: 0;             /* ganz unten ansetzen */
  left: 0;               /* linksbündig */
  width: 100%;           /* volle Breite */

  height: 3rem;          /* feste Höhe (z. B. 3 rem) */
  padding: 0;            /* kein zusätzliches vertikales Padding */
  line-height: 3rem;     /* Text vertikal zentrieren */

  background: var(--header-bg-light);
  color: var(--header-text);
  font-size: 0.7rem;
  font-weight: 300;
  text-align: center;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
  z-index: 100;          /* über dem Main-Content, falls nötig */
}

/* Abstand am Seitenende, damit Main-Inhalt nicht vom Footer überlappt wird */
body {
  padding-bottom: 3rem;  /* exakt so hoch wie der Footer */
}


/* FOOTER-BUTTON: Datenquellen-Link */

/* Stil für den Button im Footer, der wie ein Link aussieht */
.footer-info-btn {
  background: none;              /* Kein Hintergrund, wirkt wie ein Link */
  border: none;                  /* Keine Rahmenlinie */
  color: inherit;                /* Erbt die Textfarbe vom Eltern-Element */
  font: inherit;                 /* Erbt Schriftart und -größe */
  cursor: pointer;              /* Zeigt Hand-Cursor beim Hover */
  padding: 0;                    /* Kein Innenabstand */
  display: inline-flex;          /* Ermöglicht Icon und Text nebeneinander */
  align-items: center;           /* Vertikale Zentrierung */
  gap: 4px;                      /* Abstand zwischen Text und Icon */
}

/* Icon-Größe leicht verkleinert für harmonisches Layout */
.footer-info-btn i {
  font-size: 0.9em;
}


/* ================================
   MODAL / OVERLAY (zentriert & global)
   ================================ */
.modal,
.info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6); /* oder var(--overlay-bg-alpha) */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Sichtbar bei Öffnung */
.modal.open,
.info-modal.open {
  display: flex;
}

/* Modal-Inhalt */
.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--header-bg-light);
  color: var(--header-text);
  border: 2px solid var(--header-bg-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Info-Modal spezifisch */
.info-modal .modal-content {
  padding: 1.5rem 0rem;
  text-align: left;
}

/* Schließen-Button */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

/* Modal-Body */
.modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  overflow: auto;
}
.modal-body img,
.modal-body iframe {
  max-width: 100%;
  max-height: 100%;
  border: none;
}

/* Quellen-Hinweis */
.modal-content .modal-source {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  font-size: 0.8em;
  font-weight: 300;
}

/* Link im Modal */
.modal-source-link {
  color: var(--header-text);
  background: var(--header-bg);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.3s ease;
}
.modal-source-link:hover {
  background: #0a4a57;
}

/* Info-Modal Body als Block */
.info-modal .modal-body {
  display: block;
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem 2rem;
  color: var(--header-text);
}

/* Typografie im Modal */
.info-text p {
  margin-bottom: 1rem;
  line-height: 1.5;
  white-space: normal;
}
.info-text ul {
  list-style: disc;
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}
.info-text li {
  margin-bottom: 0.5rem;
}
.info-text a {
  color: var(--header-text);
  text-decoration: underline;
}


/* ================================
   Animation (optional)
   ================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ================================
   Animation (optional)
   ================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =================================================================== */
/* Grafik & Button =================================================== */
.payment-section {
  text-align: center;
  margin: 2em 0;
}

.payment-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.payment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 600px;
  height: 50px; /* Fixe Breite */
  padding: 0.75em 1.5em;
  background-color: rgba(8, 176, 80, 0.5);
  color: #005f73;
  font-size: 0.75em;
  text-align: center;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-family: 'Aboreto', sans-serif;
  flex-shrink: 0;            /* Verhindert Schrumpfen bei Flex-Layouts */
}


.payment-button:hover {
  background-color: rgba(8, 176, 80, 0.7);
}

.payment-button-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem; /* Abstand nach oben */
}



@media (max-width: 600px) {
  .payment-button {
    width: 350px;
    max-width: 500px;
  }

  .payment-button-wrapper {
    justify-content: center;
  }
}


/* =================================================================== */
/* INFOBOX ========================================================= */

.custom-textbox {
  background-color: #e0f2f1;
  color: #005f73;
  border-radius: 22px;
  padding: 1.8em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: left !important;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 200;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

/* SERVICE-LINKS =================================================== */
.service-links {
  margin-top: 1em;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.service-links ul {
  list-style-type: disc;
  padding-left: 1.2em;
  margin: 0;
}

.service-links li {
  margin-bottom: 8px;
}



/* ===================================================================
   RESPONSIVE ANPASSUNGEN
=================================================================== */
@media (max-width: 480px) {
  main { padding: 1rem 0.5rem; }
  header .white-link { font-size: 1.5rem; }
  th, td { padding: 0.6rem 0.5rem; font-size: 0.9rem; }
}


/* ----------------------------------
   Icon Back-Buttons Unterseiten
   ---------------------------------- */
.icon-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--header-text);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
