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

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

:root {
  /* Zentrale CI Definitionen */
  --primary-color: rgb(50, 53, 73);
  --secondary-color: rgb(200, 53, 73);
  --tertiary-color: rgb(240, 240,240);
}

/* CI Hilfsklassen für flexible Anwendung */
.text-primary { color: var(--primary-color) !important; }
.bg-primary   { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; border-style: solid; }

.text-secondary { color: var(--secondary-color) !important; }
.bg-secondary   { background-color: var(--secondary-color) !important; }
.border-secondary { border-color: var(--secondary-color) !important; border-style: solid; }

.text-tertiary { color: var(--tertiary-color) !important; }
.bg-tertiary   { background-color: var(--tertiary-color) !important; }
.border-tertiary { border-color: var(--tertiary-color) !important; border-style: solid; }

.primarycolor { color: var(--primary-color); }
.secondarycolor { color: var(--secondary-color); }
.tertiarycolor { color: var(--tertiary-color); }



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

h1 {
  font-family: "Quicksand", sans-serif;
  font-size: 32px; /* größte Überschrift */
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

h2 {
  font-family: "Quicksand", sans-serif;
  font-size: 26px; /* etwas kleiner */
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.3;
}

h3 {
  font-family: "Quicksand", sans-serif;
  font-size: 20px; /* mittlere Überschrift */
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.3;
}

h4 {
  font-family: "Quicksand", sans-serif;
  font-size: 16px; /* kleinere Überschrift */
  font-weight: 500;
  color: var(--primary-color);
  line-height: 1.2;
}

h5 {
  font-family: "Quicksand", sans-serif;
  font-size: 14px; /* kleinste Überschrift */
  font-weight: 500;
  color: rgba(50, 53, 70, 0.9); /* etwas abgeschwächt */
  line-height: 1.4;
}

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

.fontwhite {
  color: white;
}

/* Label innerhalb des Menu */


.menu-item {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center; 
  line-height: 1; 
  margin-top: 15px;
}

.menu-item svg {
  display: block; /* Entfernt den Inline-Abstand unter dem SVG */
  flex-shrink: 0; /* Verhindert, dass das Icon bei Platzmangel schmaler wird */
}

.menu-label {
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--primary-color);
  text-align: center;
  margin-left: 5px;
}

.icon-style {
  width: 18px;
  height: 18px;
  stroke-width: 2px; /* Dünnere Linien wirken oft moderner */
  color: var(--primary-color);    /* Ein schönes Blau für Wind */
}

/* Label innerhalb der Box (früher H2/H3) */
.stat-label {
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 5px;
  text-align: center;
}

/* Label für die Track-Distanz */
.stat-label-track {
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--primary-color);
  opacity: 0.8;
  text-align: center;
}

/* Wert innerhalb der Box (früher H1/H2) */
.stat-value {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--primary-color);
  text-align: center;
}

.stat-value-big {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 48px;
  color: var(--primary-color);
  text-align: center;
  display: block;
}

/* =======================
   Andere Stlye Definitionen
   ======================= */
hr {
  border: 0;
  border-top: 1px solid var(--primary-color);
  margin-top: 20px; /* Optional: Um Standard-Abstände oben zu nullen */
  margin-bottom: 20px;
  display: block; /* Stellt sicher, dass es sich wie ein Block-Element verhält */
}

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

.slogan {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--primary-color);
}

.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: 8%;
  right: 30px;
  z-index: 1100; /* Erhöht, um über Leaflet-Elementen (1000) zu liegen */
  background-color: #323546;
  color: white; /* Stellt sicher, dass das Icon-SVG die Farbe erbt */
  border-radius: 50%;
  border:none;
  width: 70px;
  height: 70px;
  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: currentColor; /* Farbe wird vom Text geerbt */
  stroke-width: 2.5;
  stroke-linecap: round;
}

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

/* 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(8% + 80px); /* sitzt über dem Menü-Button */
  right: 0;
  width: 140px;
  gap: 10px;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;


  text-align: center;

  display: flex;
  flex-direction: column;
  padding: 20px;
  background-color: white;

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

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

/* Hauptbuttons im Panel */
.layer-buttons button.layer-main-btn {
  background-color: var(--tertiary-color);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  transition:
    background-color 0.3s,
    transform 0.2s;
}

.layer-buttons button.layer-main-btn.active {
  background-color: var(--primary-color);
  color: white;
}

/* App-Buttons (XC Planner, GlideArea) - dunkler & kein Active-Status */
#xcPlannerBtn,
#xcFlightsBtn,
#glideAreaBtn {
  background-color: var(--tertiary-color);
  color: var(--primary-color);
}

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

.planner-file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  background-color: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
  color: rgb(80, 83, 100);
  gap: 8px;
  margin-top: 8px;
}

/* Sub-Buttons im Panel */
.layer-buttons button.sub-button {
  background-color: rgba(220, 223, 250, 1);
  color: rgba(50, 53, 70, 1);
  border: none;
  padding: 8px 16px; /* identisch zu Hauptbuttons */
  border-radius: 999px;
  cursor: pointer;
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  width: 80px;
  align-self: flex-end;
  transition:
    background-color 0.3s,
    transform 0.2s;
}

.layer-buttons button.sub-button:hover {
  transform: translateX(-10px);
}

#info-button {
  background-color: white;
  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;
}

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

.leaflet-right {
  padding: 20px;
}

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

.hillshade-layer {
      mix-blend-mode: multiply;
      image-rendering: auto; 
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}
  
.grid-values-icon {
      border: none;
      background: none;
  }

.grid-cell-label {
    width: 80px;  
    height: 80px;  
    display: flex;
    flex-direction: column;    /* Stapelt Druck und Trend übereinander */
    justify-content: center;   /* Zentriert vertikal */
    align-items: center;       /* Zentriert horizontal */
    line-height: 1.4;
    pointer-events: none;
    background-color: var(--tertiary-color);
    border-radius: 50%;
    
}


.p-val-text {
    font-size: 10px; /* Smaller font size */
    color: var(--primary-color); /* Default color */
    margin-top: 2px;
    opacity: 0.8;
}

  .p-val {
      font-size: 10px;
      color: var(--primary-color);
  }

  .t-val {
      font-size: 16px;
      font-weight: bold;
      color: var(--primary-color);
      margin-top: 2px;
  }

/* =======================
   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: var(--primary-color);
  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);
}

.foehn-arrow-style {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Klicks gehen zur Linie durch */
}

/* Optional: Damit die Pfeile bei Zoom-Out nicht alles verstopfen */
.leaflet-zoom-animated .foehn-arrow-style {
    transition: transform 0.2s;
}


/* 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 */
  top: 3%;
  right: 5%;
  background: var(--primary-color);
  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 */

.other-details-btn {
  position: fixed; /* fixed statt absolute */
  top: 3%;
  right: calc(5% + 70px);
  background: rgb(255, 255, 255);
  border: 3px solid;
  border-radius: 50%;
  border-color: var(--primary-color);
  width: 60px;
  height: 60px;
  font-size: 32px;
  color: rgb(50, 53, 73);
  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 {
  box-sizing: border-box;
  overflow-y: auto;
  padding: 20px;
  width: 100%;
}

.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-overview {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Links große Box, rechts Grid */
  gap: 20px;
  padding: 15px;
  background: rgb(50, 53, 70);
  border-radius: 12px;
  margin-bottom: 100px;
}

.station-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Spalten für kleine Cards */
  gap: 15px;
}

.stat-card {
  background-color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  min-height: 100px;

  /* Vertikal + horizontal zentrieren */
  display: flex;
  flex-direction: column; /* Inhalt untereinander */
  justify-content: center; /* vertikal zentrieren */
  align-items: center; /* horizontal zentrieren */
}

.stat-card-box {
  background: white;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1/1; /* quadratisch */
  width: auto;
}

.stat-card-box-value {
  font-size: 50px;
}

/* Für mobile kannst du optional z.B. die Breite kleiner setzen */
@media (max-width: 768px) {
  .stat-card-box {
    width: auto; /* kleiner als Desktop */
    aspect-ratio: 1 / 1;
  }

  .station-overview {
    display: grid;
  }
}

.stat-card-box canvas {
  width: 80%;
  aspect-ratio: 1 / 1;
}

.wind-arrow {
  font-size: 40px;
  transition: transform 0.3s;
}

@media (max-width: 850px) {
  .station-overview {
    grid-template-columns: 1fr;
  }
}

.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: 100vw;
    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: 20px;
  border-radius: 10px;
}
.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;
  margin-bottom: 70px;
}

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

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

/* ======================= 
   Tabelle für H&F Challenge
   ======================= */

.table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background: rgb(60, 63, 80);
  color: white;
  padding: 5%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-align: center; /* Alle Werte zentriert */
}


.table th,
.table td {
  padding: 12px 15px;
  text-align: center; /* Alle Werte zentriert */
}

.table th {
  cursor: pointer;
  background: rgb(70, 73, 90);
  font-weight: 600;
}

.table th:hover {
  background: rgb(90, 93, 110);
}

.table tr:nth-child(even) {
  background: rgb(55, 58, 75);
}

.table tr:hover {
  background: rgb(75, 78, 95);
}

/* ======================= 
   XC Planner
   ======================= */

#plannerInfo {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;

    display: none; /* unsichtbar */
    text-align: center;

    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 8px;

    padding: 15px 20px;
    width: 210px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #ffffff;

    transition: all 0.3s ease;
}

/* Aktiv → Grid + sichtbar */
#plannerInfo.active {
    display: grid;
}
 
.custom-marker {
    background: #ffffff;
    border: 2px solid rgb(50, 53, 70);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgb(50, 53, 70);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-family: sans-serif;
    font-size: 12px;
}

/* Midpoint-Marker (+) */
.midpoint-marker {
    background: rgba(50, 53, 70, 0.8);
    border: 1px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.midpoint-marker:hover {
    transform: scale(1.2);
    background: rgb(50, 53, 70);
}

/* --- XC Planner Info Box Details --- */

.planner-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.planner-text-btn {
    background: none;
    border: none;
    color: rgb(80, 83, 100);
    font-family: "Quicksand", sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
}

.planner-text-btn:hover {
    color: rgb(50, 53, 70);
}

.planner-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 22px;
    height: 22px;
    color: rgb(120, 120, 120);
    transition: color 0.2s;
}

.planner-icon-btn:hover {
    color: rgb(50, 53, 70);
}

.planner-icon-btn svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.planner-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding-top 0.3s ease-out, margin-top 0.3s ease-out;
    font-size: 13px;
    color: #333;
}

#plannerInfo.details-open .planner-details-content {
    max-height: 120px; /* Genug Platz für Details */
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 5px;
}

.detail-row span:first-child {
    color: #777;
}

.detail-row span:last-child {
    font-weight: 600;
}

/* --- XC Planner & Glide Area Control Row --- */

.planner-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-top: 8px;
    border-top: 1px solid #eee;
}

.planner-control-row label {
    font-family: "Quicksand", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgb(80, 83, 100);
}

.planner-select {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: "Quicksand", sans-serif;
    font-size: 13px;
    color: rgb(50, 53, 70);
    cursor: pointer;
}



/* Der Container für die Animation */
  .wind-line-animated {
      /* Erzeugt kurze Partikel statt langer Striche */
      stroke-dasharray: 4, 100; 
      stroke-linecap: round;
      stroke-width: 10;
      filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
      
      animation: dash-flow linear infinite;
      transition: opacity 0.5s ease;
  }

  @keyframes dash-flow {
      from {
          stroke-dashoffset: 104; /* Summe aus dasharray (4+100) */
      }
      to {
          stroke-dashoffset: 0;
      }
  }

  /* Optional: Verschiedene Geschwindigkeiten je nach Windstärke */
  .wind-fast { animation-duration: 1s !important; stroke-width: 4; }
  .wind-medium { animation-duration: 2.5s !important; }
  .wind-slow { animation-duration: 5s !important; opacity: 0.6; }