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

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


.icon-menu {
    width: 32px;          
    height: 32px;        
    stroke-width: 1px;   
    fill: none;          
    stroke: white;
    display: inline-block;
    vertical-align: middle; 
    position: relative;        
}


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

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

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

.layer-buttons.open {
  transform: translateX(0px);
}

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

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

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

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


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


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

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



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



/* Statusindikator für Live-Daten */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 14px;
    vertical-align: middle;
}

.status-green {
    background-color: #22c55e; /* Tailwind green-500 */
}

.status-red {
    background-color: #ef4444; /* Tailwind red-500 */
}

.pulsating {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); /* green-500 with opacity */
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}


/* ======================= 
  Offshore: H&F Challenge
   ======================= */

.table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  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);
}

.close-details-btn {
  position: fixed; /* fixed statt absolute */
  top: 3%;
  right: 5%;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  color: rgb(255, 255, 255);
  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: calc(3% + 50px);
  right: 5%;
  background: rgb(255, 255, 255);
  border: 3px solid;
  border-radius: 50%;
  border-color: var(--primary-color);
  width: 40px;
  height: 40px;
  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 */