/* ===========================================================================
   Projekt: AI basierte Softwareentwicklung – René Frutiger, Juli 2025
   Konsolidiertes Stylesheet (angepasst auf schwarzes Demo-Layout)
============================================================================ */

/* ===========================================================================
   1. CSS-Variablen
============================================================================ */
:root {
  /* Farben Header & Footer – jetzt wie Vorlage (schwarz / transparent) */
  --header-bg:           rgba(0, 0, 0, 0.75);
  --header-text:         #3AF7C3;
  --header-bg-light:     rgba(0, 0, 0, 0.55);

  /* Seitenhintergrund & Tabelle */
  --page-bg:             linear-gradient(to bottom right, #f5f5f5, #eaeaea);
  --table-text:          #111111;
  --row-odd-bg:          #f7f7f7;

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

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

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

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

html,
body {
  height: 100%;
}

ul {
  list-style: none;
}

/* ===========================================================================
   BODY – Grid + Hintergrund + Overlay
============================================================================ */
body {
  display: grid;
  grid-template-rows: var(--header-height) 1fr var(--footer-height);
  min-height: 100vh;
  margin: 0;

  font-family: 'Hanken Grotesk', sans-serif;
  color: #233c42;
  background: #233c42;
  position: relative;
  padding-bottom: 3rem;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('assets/background.png') center/contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: -1;
}



/* ===========================================================================
   3. Header
============================================================================ */
header {
  grid-row: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(4px);
  }

}

/* ===========================================================================
   Header-Titel
============================================================================ */
.header-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.header-center a {
  pointer-events: auto;
}

header .white-link {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.8rem;
  font-family: 'Aboreto', serif;
}


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

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

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

/* ===========================================================================
   5. Footer – Fixiert, Glass-Style wie Header
============================================================================ */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    height: 3rem;
    line-height: 3rem;
    padding: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--header-text);
    font-size: 0.7rem;
    font-weight: 300;
    text-align: center;

    /* Glass-Look identisch zum Header */
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* dezenter Schatten wie oben */
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);

    z-index: 100;
}

footer p {
    margin: 0.2em 0;
    line-height: normal;
}

/* Footer-Button (Datenquelle) – komplett transparent */
.footer-info-btn {
    background-color: transparent !important;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;

    display: inline-flex;
    align-items: center;
    gap: 4px;

    appearance: none;
    -webkit-appearance: none;
}

.footer-info-btn i {
    font-size: 0.9em;
}


/* ================================
   MODAL / OVERLAY
================================ */
.modal,
.info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  /* halbtransparentes Overlay */
  background-color: rgba(0, 0, 0, 0.45);

  justify-content: center;
  align-items: center;
  z-index: 1000;
}

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

/* ================================
   MODAL-INHALT (Glass-Style)
================================ */
.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;

  /* Glass-Look wie Header/Footer */
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  color: var(--header-text); /* neutraler Text */
  border-radius: 20px;
  overflow: hidden;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

/* ================================
   CLOSE BUTTON
================================ */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;

  /* Dunkler, transparenter Glass-Look */
  background: rgba(0, 0, 0, 0.28);
  border: none;

  font-size: 1.0rem;
  color: var(--header-text);

  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  transition: background 0.2s ease;
}

/* Optional: Hover-Effekt */
.modal-close:hover {
  background: rgba(0, 0, 0, 0.38);
}


/* ================================
   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;
}

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

/* ================================
   INFO-TEXT
================================ */
.info-text {
  text-align: left !important;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 200;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.8px;
}

.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;
}

/* ================================
   QUELLEN-HINWEIS
================================ */
.modal-content .modal-source {
  background: rgba(255, 255, 255, 0.12);
  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.2);

  text-align: center;
  font-size: 0.8em;
  font-weight: 300;

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Link im Modal */
.modal-source-link {
  color: var(--header-text);
  background: rgba(0,0,0,0.4);

  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;

  transition: background 0.3s ease;
}

.modal-source-link:hover {
  background: rgba(0,0,0,0.6);
}

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


/* ===================================================================
   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;
}


/* ===========================================================================
   MENÜ-BUTTON (modern, clean)
============================================================================ */
#menuBtn {
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  z-index: 20;

  transition: opacity 0.2s ease;
}

#menuBtn:hover {
  opacity: 0.7;
}

/* ===========================================================================
   DROPDOWN: Liquid Glass Style (optimiert)
============================================================================ */
#menuList {
  display: none;
  position: absolute;
  top: 100%;
  right: 0.5rem;
  margin-top: 8px;

  /* Dunklerer, moderner Liquid-Glass Hintergrund */
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 14px;
  padding: 0.5rem 0;
  min-width: 190px;

  /* Weicher, tiefer Schatten */
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);

  z-index: 19;

  /* Smooth Fade + Slide Animation */
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#menuList.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================================================
   MENÜ-EINTRÄGE
============================================================================ */
#menuList li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#menuList li a {
  display: block;
  padding: 12px 20px;

  /* Etwas hellere Schrift für besseren Kontrast */
  color: rgba(255, 255, 255, 0.92);

  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.3px;

  transition: background 0.22s ease, padding-left 0.22s ease;
}

/* ===========================================================================
   Hover-Effekt: sanftes Aufleuchten + leichte Bewegung
============================================================================ */
#menuList li a:hover {
  background: rgba(255, 255, 255, 0.14);
  padding-left: 26px;
}

/* ===========================================================================
   FEEDBACK-BOX (unten im Menü)
============================================================================ */
#menuList li.feedback-box {
  margin-top: 0.4rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);

  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-radius: 0 0 12px 12px;
}

#menuList li.feedback-box a {
  color: var(--header-text);
  padding: 0;
}

#menuList li.feedback-box a:hover {
  background: none;
  opacity: 0.7;
}


/* ===================================================================
   Titel Anpassung für Temp & Pegel
=================================================================== */

/* Pegel-Tabelle Styling */
.legend-table#seeLevelTable {
  background: none !important;
  background-color: var(--header-bg-light) !important;
  color: var(--header-text) !important;
}

/* Textfarbe auch für Icons und Inhalte im td */
.legend-table#seeLevelTable td,
.legend-table#seeLevelTable td i {
  color: var(--header-text) !important;
}

.legend-table#seeLevelTable td {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  font-size: 1.5em;
  color: var(--header-text);
}

.icon-water i {
  margin-right: 8px;
  font-size: 1.2em;
  color: var(--header-text);
}


/* ===================================================================
   REFRESH-BUTTON
=================================================================== */
#refreshBtn {
  background: var(--header-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
#refreshBtn:hover {
  transform: rotate(90deg);
}
#refreshBtn svg {
  stroke: var(--header-text);
  width: 24px;
  height: 24px;
}

/* ===================================================================
   WEBCAM-ICON
=================================================================== */
.webcam-link {
  color: var(--header-text);
  text-decoration: none;
}
.webcam-link svg {
  width: 1.6em;
  height: 1.6em;
  vertical-align: middle;
  stroke: currentColor;
  fill: currentColor;
  transition: fill 0.2s ease;
}

/* ===================================================================
   WINDGESCHWINDIGKEITSKLASSEN
=================================================================== */
tr.speed-0 { background-color: var(--speed-0-bg); }
tr.speed-1 { background-color: var(--speed-1-bg); }
tr.speed-2 {
  background-color: var(--speed-2-bg);
  color: var(--speed-2-text);
}

/* ===================================================================
   WIND-TABELLE
=================================================================== */

main table {
  width: 90%;
  max-width: 800px;
  margin: 1rem auto;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Tabellenkopf */
main table thead {
  background: var(--header-bg-light);
}

main table thead th {
  color: var(--header-text);
  font-weight: normal;
  padding: 0.75rem 1rem;
  text-align: center;
  white-space: nowrap;
  font-size: 0.75rem;
}

/* ============================================================
   DYNAMISCHE WIND-SPEED-FARBEN (transparent, harmonisch)
   ============================================================ */

tr.speed-0 {
  background: rgba(255, 255, 255, 0.10) !important; /* leicht transparent weiß */
}

tr.speed-1 {
  background: rgba(0, 255, 0, 0.18) !important; /* hellgrün transparent */
}

tr.speed-2 {
  background: rgba(60, 179, 113, 0.28) !important; /* kräftigeres grün transparent */
}

/* ============================================================
   ZELLEN
   ============================================================ */

main table tbody td {
  padding: 0.6rem 1rem;
  color: var(--header-text);
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
  font-size: 0.9rem;
}

main table tbody tr:last-child td {
  border-bottom: none;
}

/* Ausrichtung */
main table tbody td:nth-child(1),
main table tbody td:nth-child(2),
main table thead th:nth-child(1),
main table thead th:nth-child(2) {
  text-align: left;
}

main table tbody td:nth-child(n+3) {
  text-align: center;
}

/* ============================================
   Liquid Glass Effekt für Tabellenzeilen
   (ergänzt Speed-Farben, überschreibt sie NICHT)
============================================ */
main table tbody tr {
    position: relative;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Hover-Effekt */
main table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

/* Zellen selbst bleiben transparent */
main table tbody td {
    background: transparent !important;
}


/* ===================================================================
   Info-Menü
=================================================================== */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#infoBtn,
#menuBtn {
  background: none;
  border: none;
  color: var(--header-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 10.25rem;
}

#menuBtn {
  font-size: 2.0rem;
}


/* ===================================================================
   Legende
=================================================================== */
.table-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 10px;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.data-table td:nth-child(2),
.data-table th:nth-child(2) {
  text-align: center;
}

.legend-table {
  margin-top: 10px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.5em;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #e6ffe6 50%,
    #3cb371 100%
  );
}

.legend-table td i {
  font-size: 1.4em;
}

.legend-table td.icon-sad {
  padding-left: 80px;
}

/* Icon-Grundstyle */
.icon-sad i,
.icon-laugh i {
  color: rgba(0, 95, 115, 0.6);
  font-size: 1.8em;
  line-height: 1;
}

/* Sad-Icon: links ausrichten + Padding */
td.icon-sad {
  text-align: left;
  padding-left: 1em;
}

/* Laugh-Icon: rechts ausrichten + Padding */
td.icon-laugh {
  text-align: right;
  padding-right: 1em;
}

/* ===================================================================
   Last Update
=================================================================== */
#lastUpdate {
  color: var(--header-text);
}

