/* =======================
   Basis-Layout
   ======================= */

body {
  font-family: "Quicksand", sans-serif;
  margin: 0;
  height: 100vh;
}

/* =======================
   Typografie
   ======================= */

h1 {
  font-family: "Quicksand", sans-serif;
  font-size: 30px;
  color: rgba(50, 53, 70, 1);
}

h2 {
  font-family: "Quicksand", sans-serif;
  font-size: 22px;
  color: rgba(50, 53, 70, 1);
}

h3 {
  font-family: "Quicksand", sans-serif;
  font-size: 16px;
  color: rgba(50, 53, 70, 1);
}

p {
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
}

.fontwhite {
  color: white;
}

/* =======================
   Header / Logo Bereich
   ======================= */

.logo-container {
  position: fixed;
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
}

.logo-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-image {
  height: 35px;
  width: 35px;
  object-fit: contain;
}

.headline {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: rgba(50, 53, 70, 1);
}

.slogan {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.4;
  color: rgb(50, 53, 70);
}

.fade-out-background {
  background-color: transparent;
}

.fade-out-background .slogan {
  opacity: 0;
  transition: opacity 1s ease;
}

/* =======================
   Buttons
   ======================= */

/* Toggle Button */
.menu-toggle-btn {
  position: fixed;
  bottom: 5%;
  left: 30px;
  z-index: 950;
  background-color: #323546;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
}

.menu-toggle-btn:hover {
  background-color: #50546a;
  transform: scale(1.05);
}

.icon {
  width: 28px;
  height: 28px;
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Linien-Animation vorbereiten */
.line {
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Burger → X */
.menu-toggle-btn.open .top {
  transform: translateY(4px) translateX(4px) rotate(-45deg);
}

.menu-toggle-btn.open .middle {
  opacity: 0; /* verschwindet */
}

.menu-toggle-btn.open .bottom {
  transform: translateY(-4px) translateX(4px) rotate(45deg);
}

/* Layer Buttons als Slide-In Panel */
.layer-buttons {
  position: fixed;
  bottom: calc(5% + 60px); /* sitzt über dem Menü-Button */
  left: 0;
  width: 120px;
  max-height: 60vh; /* Höhe begrenzen */
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;

  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;

  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 940;
}

/* Wenn geöffnet */
.layer-buttons.open {
  transform: translateX(0);
}

/* Hauptbuttons im Panel */
.layer-buttons button.layer-main-btn {
  background-color: rgba(50, 53, 70, 1);
  color: white;
  border: 1px solid rgb(50, 53, 73);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  transition: background-color 0.3s, transform 0.2s;
}

.layer-buttons button.layer-main-btn:hover {
  background-color: rgba(50, 53, 70, 1);
  transform: translateX(5px);
}

.layer-buttons button.layer-main-btn.active {
  background-color: #ffffff;
  color: rgb(50, 53, 70);
  border: 2px solid rgb(50, 53, 73);
}

.layer-buttons button.layer-main-btn:focus {
  outline: none;
}

/* Sub-Buttons im Panel */
.layer-buttons button.sub-button {
  background-color: rgba(100, 103, 120, 1);
  color: white;
  border: none;
  padding: 8px 16px; /* identisch zu Hauptbuttons */
  border-radius: 999px;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  transition: background-color 0.3s, transform 0.2s;
}

.layer-buttons button.sub-button:hover {
  background-color: rgba(50, 53, 70, 1);
  transform: translateX(5px);
}

.layer-buttons button.sub-button.active {
  background-color: rgba(100, 103, 120, 1);
  color: white;
  border: 2px solid rgb(255, 255, 255);
}

.layer-buttons button.sub-button:focus {
  outline: none;
}

#refreshBtn {
  background-color: rgba(50, 53, 70, 1);
  color: white;
  border: 1px solid rgb(50, 53, 73);
  line-height: 1.4em;
}

#info-button {
  background-color: rgb(255, 255, 255);
  color: rgb(50, 53, 70);
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  transition: background-color 0.3s, transform 0.2s;
}

/* Alle Zoom-Buttons frei platzieren */
.leaflet-control-zoom {
  position: absolute !important; /* wichtig: kein Leaflet-Flow */
  top: 100%; /* Abstand von oben */
  left: 20px; /* Abstand von links */
  z-index: 1000 !important; /* über Karte & Menü */
  display: flex !important;
  flex-direction: column !important;
}

/* ------------------------------
   Leaflet Zoom Control Container
   ------------------------------ */
.leaflet-control-zoom.leaflet-bar,
.leaflet-touch .leaflet-control-zoom.leaflet-bar {
  background: rgba(247, 248, 255, 0.9) !important;
  border-radius: 30px !important;
  border: none !important; /* überschreibt leaflet.css */
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* ------------------------------
   Zoom-In / Zoom-Out Buttons
   ------------------------------ */
.leaflet-control-zoom a.leaflet-control-zoom-in,
.leaflet-control-zoom a.leaflet-control-zoom-out,
.leaflet-touch .leaflet-control-zoom a.leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom a.leaflet-control-zoom-out {
  background: rgba(50, 53, 70, 1) !important;
  color: #fff !important;
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 24px !important;
  text-align: center !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.2s, transform 0.2s !important;
}

/* Hover */
.leaflet-control-zoom a.leaflet-control-zoom-in:hover,
.leaflet-control-zoom a.leaflet-control-zoom-out:hover,
.leaflet-touch .leaflet-control-zoom a.leaflet-control-zoom-in:hover,
.leaflet-touch .leaflet-control-zoom a.leaflet-control-zoom-out:hover {
  background: rgb(231, 233, 237) !important;
  transform: scale(1.05) !important;
}

/* =======================
   Kartenbereich
   ======================= */

#map {
  height: 100vh;
}

/* =======================
   Spezielle Map Icons
   ======================= */

.gradient-label-icon,
.foehn-label-icon {
  background-color: transparent;
  border-radius: 50%;
  text-align: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  pointer-events: auto;
}

.gradient-label-content,
.foehn-label-content {
  width: 50px;
  height: 50px;
  background-color: rgba(80, 83, 100, 1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Föhn Linienendpunkte */
.foehn-endpoint {
  width: 10px;
  height: 10px;
  background-color: rgb(80, 83, 100);
  border-radius: 50%;
}

/* Gradient Linienendpunkte */
.gradient-endpoint {
  width: 10px;
  height: 10px;
  background-color: rgb(80, 83, 100);
  border-radius: 50%;
}

/* Slider und Inhalt zu Wind, Föhn, Gradient und Cloudbase */

.station-details-container {
  position: fixed;
  top: 0;
  right: 0;
  width: 60vw;
  min-width: 1200px; /* Desktop */
  height: 100vh; /* gesamte Höhe */
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.5s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* 📱 Mobile: überschreiben */
@media (max-width: 1024px) {
  .station-details-container {
    width: 100vw; /* volle Breite */
    min-width: 0; /* kein Minimum */
    height: 100vh; /* gesamte Höhe */
  }
}

.station-details-container.show {
  transform: translateX(0);
}

.station-details-content {
  flex: 1; /* ← WICHTIG: füllt den Container */
  overflow: hidden;
  position: relative;
}

.station-details-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 1024px) {
  .station-details-container {
    touch-action: pan-y; /* erlaubt vertikales Scrollen innerhalb */
    transition: transform 0.3s ease;
  }

  .station-details-container.swiping {
    transition: none; /* beim Ziehen keine Animation */
  }
}

.close-details-btn {
  position: fixed; /* fixed statt absolute */
  bottom: calc(5% + env(safe-area-inset-bottom));
  right: 50px;
  background: rgb(50, 53, 73);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 32px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* noch höher, sicherstellen dass er oben liegt */
  cursor: pointer;
}

/* Optional: Styling für den Inhalt des Containers */
.station-details-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.details-content {
  overflow-y: auto;
  padding: 25px;
  width: 95%;
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.details-header h2,
.details-header h3 {
  display: inline;
}

.station-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  justify-content: flex-start;
  padding: 15px;
  background: rgb(50, 53, 70);
  border-radius: 10px;
  margin-bottom: 50px;
}

.stat-card {
  min-width: 40px;
  background-color: white;
  padding: 5px;
  border-radius: 10px;
  text-align: center;
}

.chart-container {
  height: 300px;
  margin-bottom: 50px;
  margin-top: 25px;
}

.socialicon {
  color: #333;
  font-size: 20px;
  margin-right: 5px;
}

.big-value {
  font-size: 18px;
}

@media (max-width: 768px) {
  .details-container {
    width: 90vw;
    height: 70vh;
  }
}

.station-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  justify-content: flex-start;
  border-radius: 10px;
}

.details-card {
  color: white !important;
  padding: 20px;
  margin-bottom: 50px;
  border-radius: 10px;
  background: rgb(50, 53, 70);
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.spinner-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.rotating-loader {
  animation: spin 2s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.chart-wrapper {
  overflow-x: auto; /* horizontal scrollen */
  -webkit-overflow-scrolling: touch; /* smooth scroll auf iOS */
  width: 100%; /* Container füllt Bildschirmbreite */
  height: 350px;
}

.chart-wrapper canvas {
  display: block; /* entfernt unnötige Inline-Abstände */
}

.max-width-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
