/*
=========================================================
Datei: style.css
=========================================================

Projekt: THI Wetterapp – „Himmelsblick“
---------------------------------------------------------
Beschreibung:
Diese Datei definiert das visuelle Erscheinungsbild (CSS)
der THI Wetterapp. Sie enthält alle Stilregeln für Layout,
Farben, Schriftarten und Animationen.

Hauptfunktionen:
1. Fester animierter Hintergrund (Vanta.js)
2. Scrollbarer Vordergrund-Bereich (#app-content)
3. Glassmorphism-Design mit Schatten und Unschärfe
4. Responsive Gestaltung für Desktop & Mobile
=========================================================
*/


/* ------------------------------------------------------
   1. Grunddesign und Farbdefinitionen
------------------------------------------------------ */
:root {
  --primary: #0055ff;
  --accent: #00b7ff;
  --glass: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --blur: blur(20px);
  --text-dark: #1e1e1e;

  /* Skalierbare Logo-Größen */
  --himmelsblick-logo-size: 240px;
  --thi-logo-size: 180px;
}

/* Basis-Stile und Schriftarten */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", Arial, sans-serif;
  color: var(--text-dark);
  background: none;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}


/* ------------------------------------------------------
   2. Hintergrund (Vanta.js) – fixiert
------------------------------------------------------ */
#vanta-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Leichte Abdunkelung für bessere Lesbarkeit */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.3),
    rgba(0, 0, 0, 0.3)
  );
  z-index: -1;
}


/* ------------------------------------------------------
   3. Vordergrund-Container (scrollbarer Inhalt)
------------------------------------------------------ */
#app-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 2rem;
}


/* ------------------------------------------------------
   4. HEADER – Logos und Titelzeile
------------------------------------------------------ */
header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(240, 245, 255, 0.65) 0%,
    rgba(180, 210, 255, 0.4) 100%
  );
  backdrop-filter: var(--blur);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 95px;
}

/* Logos */
.header-logo {
  display: flex;
  align-items: center;
}

.himmelsblick-logo {
  height: var(--himmelsblick-logo-size);
  width: auto;
  object-fit: contain;
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
  transition: transform 0.25s ease;
}

.himmelsblick-logo:hover {
  transform: scale(1.08);
}

.thi-logo {
  height: var(--thi-logo-size);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.2));
  transition: transform 0.25s ease;
}

.thi-logo:hover {
  transform: scale(1.08);
}


/* ------------------------------------------------------
   5. Wetter-Assistent (Chatbereich)
------------------------------------------------------ */
#assistant-section {
  width: min(92%, 900px);
  background: var(--glass);
  backdrop-filter: var(--blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

#assistant-section h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.assistant-btn {
  border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1rem 1.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.assistant-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}


/* ------------------------------------------------------
   6. Hauptbereich (Wetter, Suche, Karte)
------------------------------------------------------ */
main {
  margin-top: 1rem;
  width: min(92%, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Karten im Glass-Design */
.glass-card {
  width: 100%;
  background: var(--glass);
  backdrop-filter: var(--blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

/* Suchleiste */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

/* Eingabefelder & Buttons */
input {
  flex: 1 1 240px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

button {
  border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}


/* ------------------------------------------------------
   7. Wetteranzeige & Vorhersage
------------------------------------------------------ */
.weather-card {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(15px);
  box-shadow: var(--shadow);
  display: none;
}

.weather-card img {
  width: 80px;
  margin-bottom: 0.5rem;
}

.forecast {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.day {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  transition: 0.2s;
}

.day:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.4);
}


/* ------------------------------------------------------
   8. Lernwetter-Hinweis (Visuelle Kennzeichnung)
------------------------------------------------------ */
.learn-info {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1.1rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.learn-good {
  background: rgba(255, 255, 200, 0.4);
  color: #665c00;
}

.learn-bad {
  background: rgba(180, 220, 255, 0.5);
  color: #004080;
}


/* ------------------------------------------------------
   9. Karte (Leaflet)
------------------------------------------------------ */
#map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}


/* ------------------------------------------------------
   10. Chat-Komponente (Dialogfeld)
------------------------------------------------------ */
.chat-log {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bubble {
  max-width: 80%;
  padding: 0.8rem 1rem;
  border-radius: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  line-height: 1.45;
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
}

.user-bubble {
  align-self: flex-end;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  border-bottom-right-radius: 6px;
}

.bot-bubble {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-dark);
  border-bottom-left-radius: 6px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ------------------------------------------------------
   11. Footer
------------------------------------------------------ */
footer {
  margin-top: auto;
  text-align: center;
  color: #444;
  font-size: 0.9rem;
  opacity: 0.8;
  padding-top: 2rem;
}


/* ------------------------------------------------------
   12. Responsive Design (Mobile & Tablet)
------------------------------------------------------ */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    text-align: center;
    padding: 1rem 1rem;
    height: auto;
    gap: 0.8rem;
  }

  .himmelsblick-logo {
    height: calc(var(--himmelsblick-logo-size) * 0.65);
  }

  .thi-logo {
    height: calc(var(--thi-logo-size) * 0.7);
  }

  .search-bar {
    flex-direction: column;
  }

  input,
  button {
    width: 100%;
  }

  #assistant-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
  }
}


/* ------------------------------------------------------
   13. Lucide Icons – visuelle Anpassung
------------------------------------------------------ */
i[data-lucide] {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
  stroke: var(--primary);
  stroke-width: 1.8;
  transition: all 0.25s ease;
}

button i[data-lucide] {
  stroke: white;
  margin-right: 8px;
}

button:hover i[data-lucide] {
  transform: scale(1.15);
  opacity: 0.9;
}

h2 i[data-lucide],
h3 i[data-lucide] {
  margin-right: 8px;
  stroke: var(--primary);
  stroke-width: 2;
}

footer i[data-lucide] {
  width: 16px;
  height: 16px;
  stroke: #444;
  margin-right: 4px;
  vertical-align: text-bottom;
}

@media (max-width: 700px) {
  i[data-lucide] {
    width: 18px;
    height: 18px;
  }
}


/* ------------------------------------------------------
   14. Wetterkachel – strukturierte Darstellung & AQI-Farben
------------------------------------------------------ */
.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.detail-tile {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.detail-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.detail-tile .label {
  font-size: 0.9rem;
  color: #444;
}

.detail-tile .value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.detail-tile .subvalue {
  font-size: 0.8rem;
  color: #333;
  opacity: 0.8;
  margin-top: 0.3rem;
}

/* Luftqualitätsfarben */
.air-quality.good {
  background: rgba(0, 200, 0, 0.25);
}

.air-quality.moderate {
  background: rgba(255, 200, 0, 0.25);
}

.air-quality.unhealthy {
  background: rgba(255, 120, 0, 0.25);
}

.air-quality.bad {
  background: rgba(255, 0, 0, 0.25);
}

/* ------------------------------------------------------
  Wetter-Icons verkleinern
------------------------------------------------------ */
.weather-details-grid .detail-icon {
  width: 22px !important;          /* ixierte effektive Breite */
  max-width: 22px !important;      /* kein automatisches Hochskalieren */
  height: auto !important;         /* behält Proportionen */
  margin: 0 auto 0.25rem auto !important;
  display: block !important;
  object-fit: contain !important;
  transform: scale(1) !important;
  opacity: 0.9 !important;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08)) !important;
  transition: transform 0.25s ease, opacity 0.25s ease !important;
}

.weather-details-grid .detail-icon:hover {
  transform: scale(1.05) !important;
  opacity: 1 !important;
}

/* Mobile Ansicht */
@media (max-width: 700px) {
  .weather-details-grid .detail-icon {
    width: 18px !important;
    max-width: 18px !important;
  }
}

/* ------------------------------------------------------
   15. 3-Stunden-Vorhersage-Kachel (heutiger Tag)
------------------------------------------------------ */
#hourlyForecast {
  background: var(--glass);
  backdrop-filter: var(--blur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
  display: none; /* wird durch JS eingeblendet */
}

#hourlyForecast h2 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hourly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.hour-tile {
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.hour-tile:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.45);
}

.hour-tile .time {
  font-weight: 600;
  color: #222;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.hour-tile .hour-icon {
  width: 42px;
  height: 42px;
  margin: 0.3rem auto;
  display: block;
}

.hour-tile .temp {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.2rem 0;
}

.hour-tile .desc {
  font-size: 0.85rem;
  color: #444;
  text-transform: capitalize;
}

/* Mobile Darstellung */
@media (max-width: 700px) {
  #hourlyForecast {
    padding: 1.2rem;
  }

  .hourly-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.6rem;
  }

  .hour-tile {
    padding: 0.8rem;
  }

  .hour-tile .hour-icon {
    width: 36px;
    height: 36px;
  }

  .hour-tile .temp {
    font-size: 1rem;
  }

  .hour-tile .desc {
    font-size: 0.8rem;
  }
}



