:root {
  --main-color: #344256;
  --open-bg: #d4f8e8;
  --closed-bg: #ffe3e3;
  --today-bg: #eef3f7;
}

#betriebszeiten-container {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #222;
  padding: 0;         /* kein Innenabstand */
  background: none;   /* kein grauer Hintergrund */
  width: 100%;        /* volle Breite */
}

.tooltip-box {
  position: absolute;
  background: #344256;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transform: translate(-50%, -110%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.tooltip-box.visible {
  opacity: 1;
  pointer-events: auto;
}

#betriebszeiten-container td.open:hover,
#betriebszeiten-container td.closed:hover {
  cursor: pointer;
  filter: brightness(0.95);
}



#betriebszeiten-container h1 {
  color: var(--main-color);
  text-align: center;
  margin-bottom: 1rem;
}

#betriebszeiten-container .controls {
  text-align: center;
  margin-bottom: 1.5rem;
}

#betriebszeiten-container select {
  padding: 0.4rem 1rem;
  border: 2px solid var(--main-color);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--main-color);
  background: #fff;
  cursor: pointer;
}

#betriebszeiten-container .table-wrapper {
  position: relative;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  -webkit-overflow-scrolling: touch; /* iOS scroll fix */
}

#betriebszeiten-container table {
  border-collapse: collapse;
  background: #fff;
  width: 100%;
  min-width: 100%;
}

#betriebszeiten-container th,
#betriebszeiten-container td {
  border: 1px solid #eee;
  text-align: center;
  padding: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}

#betriebszeiten-container th {
  background: var(--main-color);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

#betriebszeiten-container th.titel-anlage {
  background-color: #344256 !important;
}

#betriebszeiten-container th.weekend {
  background: #596477;
}

#betriebszeiten-container th.today {
  background: #000;
  border-bottom: 3px solid var(--main-color);
}

#betriebszeiten-container td.open {
  background: var(--open-bg);
  color: #098d3c;
  font-weight: bold;
}

#betriebszeiten-container td.closed {
  background: var(--closed-bg);
  color: #c10000;
  font-weight: bold;
}

#betriebszeiten-container td.weekend {
  background-color: #f9f9f9;
}

#betriebszeiten-container td.today {
  background: var(--today-bg);
  border-left: 2px solid var(--main-color);
  border-right: 2px solid var(--main-color);
}

/* Datenzellen: weisser Hintergrund */
#betriebszeiten-container td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 3;
  text-align: left;
  font-weight: 600;
  box-shadow: 2px 0 3px rgba(0,0,0,0.05);
}

/* Kopfzelle "Anlage": Hauptfarbe der Bergbahnen */
#betriebszeiten-container th:first-child {
  position: sticky;
  left: 0;
  background: var(--main-color);
  color: #fff;
  z-index: 4;
  text-align: left;
  font-weight: 600;
}

#betriebszeiten-container .lift-time {
  display: block;
  font-size: 0.75rem;
  color: #666;
}

#betriebszeiten-container .weekday-label {
  display: block;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 400;
}

#betriebszeiten-container .resort-header td {
  background: #f5f5f5;
  color: #000;
  font-weight: bold;
}

#betriebszeiten-container .resort-name {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #f5f5f5;
}

#betriebszeiten-container .loading {
  text-align: center;
  color: #999;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  #betriebszeiten-container th,
  #betriebszeiten-container td {
    font-size: 0.75rem;
    padding: 6px;
  }
  #betriebszeiten-container .weekday-label {
    font-size: 0.7rem;
  }
}

#betriebszeiten-container .lift-remark {
  display: block;
  font-size: 0.75rem;
  color: #666;
  font-weight: 400;
  margin-top: 1px;
  white-space: normal;       /* Zeilenumbruch erlauben */
  word-break: break-word;    /* Lange Wörter umbrechen */
  line-height: 1.1;
}

#betriebszeiten-container .remark-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #344256;
  transition: transform 0.15s ease, color 0.15s ease;
}

#betriebszeiten-container .remark-icon:hover {
  transform: scale(1.15);
  color: #f2213b; /* Bike Kingdom Rot */
}

#betriebszeiten-container .bike-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85rem;
  color: #c10000; /* rot, damit "kein Biketransport" klar signalisiert wird */
  vertical-align: middle;
  cursor: pointer;
  transition: transform 0.15s ease;
}

#betriebszeiten-container .bike-icon:hover {
  transform: scale(1.1);
}

#betriebszeiten-container .lift-type-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  margin-bottom: 2px;
  display: inline-block;
}

.season-indicator {
  font-weight: bold;
  margin-left: 1rem;
}
.season-indicator.summer {
  color: #f2a900;
}
.season-indicator.winter {
  color: #00aaff;
}

/* --- Saison-Toggle Switch Styling --- */
.switch {
  position: relative;
  display: inline-block;
  width: 90px;
  height: 32px;
  vertical-align: middle;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f2a900, #ffd86b);
  transition: 0.4s;
  border-radius: 24px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.slider::before {
  position: absolute;
  content: "☀️";
  height: 22px;
  width: 22px;
  left: 6px;
  bottom: 5px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Aktiv (Winter) */
.switch input:checked + .slider {
  background: linear-gradient(90deg, #00aaff, #6ed3ff);
}

.switch input:checked + .slider::before {
  transform: translateX(50px);
  content: "❄️";
}

/* --- Mobile Filterbar --- */
.filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  flex: 1 1 30%;
  background: #fff;
  border: 2px solid var(--main-color);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  color: var(--main-color);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--today-bg);
}

/* Overlay / Modal für Filter */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.filter-overlay.hidden {
  display: none;
}

.filter-panel {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  text-align: center;
}

.filter-panel h3 {
  margin-bottom: 1rem;
  color: var(--main-color);
}

.filter-panel button {
  margin-top: 1rem;
}

.filter-option {
  display: block;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.6rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-option:hover {
  background: #eef3f7;
}

.filter-option.active {
  background: var(--open-bg);
  border-color: var(--main-color);
  font-weight: 600;
}

/* ===========================================================
   RESPONSIVE VISIBILITY: DESKTOP vs MOBILE
   =========================================================== */

/* Standard (Desktop): nur Desktop-Steuerung sichtbar */
.desktop-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.mobile-controls {
  display: none;
}

/* Unter 768px → Mobile Filterbar aktiv, Desktop ausblenden */
@media (max-width: 768px) {
  .desktop-controls {
    display: none !important;
  }

@media (max-width: 768px) {
  /* Mobile Ansicht: Filterbar horizontal anordnen */
  .mobile-controls {
    display: flex !important;
    flex-direction: row; /* nebeneinander */
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.3rem;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* falls Bildschirm zu schmal -> automatische Zeilen */
  }

  .filter-bar {
    width: 100%;
    display: flex;
    flex: 1;
    gap: 0.5rem;
    justify-content: space-between;
  }

  .filter-btn {
    flex: 1 1 30%;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
  }

  /* Optional: Sticky Filterbar (App-Style) */
  .filter-bar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #eee;
    z-index: 50;
    padding: 0.4rem;
  }
}
}

/* ===========================================================
   STICKY HEADER + STICKY FIRST COLUMN (v3.8 – kein Blur)
   =========================================================== */

/* Scrollbarer Container */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 80vh;
  position: relative;
  contain: layout paint;
}

/* Erste Zeile (Header) bleibt oben sichtbar */
#betriebszeiten-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid #ddd;
}

/* Erste Spalte bleibt beim Sidescrolling fixiert */
#betriebszeiten-table th:first-child,
#betriebszeiten-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 30;
  font-weight: 600;
  background: #fff; /* ← Fix: fester Hintergrund, kein Blur */
}

/* Kopfzelle "Anlage" oben links mit höherem Layer */
#betriebszeiten-table thead th:first-child {
  z-index: 40;
  text-align: left;
  background: #fff; /* bleibt weiss, kein Durchscheinen */
}

/* Dezenter Schatten, um Übergang zu markieren */
#betriebszeiten-table td:first-child {
  box-shadow: 2px 0 3px rgba(0, 0, 0, 0.05);
}

#betriebszeiten-table th:first-child,
#betriebszeiten-table td:first-child {
  min-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

@media (max-width: 768px) {
  #betriebszeiten-table th:first-child,
  #betriebszeiten-table td:first-child {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 150px;
  }
}


/* ===========================================================
   ROW HIGHLIGHT BEI HOVER (nur Desktop)
   =========================================================== */

@media (hover: hover) and (pointer: fine) {
  #betriebszeiten-table tr.highlight {
    background-color: #e2e7eb; /* dezentes Grau */
    transition: background-color 0.15s ease;
  }

  #betriebszeiten-table tr.highlight td:first-child {
    background-color: #e2e7eb; /* gleiche Farbe für Spalte */
    font-weight: 600;
  }
}

/* ===========================================================
   SUCHFELD FÜR ANLAGEN
   =========================================================== */
.search-bar {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

#search-input {
  width: 90%;
  max-width: 320px;
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

#search-input:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 4px rgba(52, 66, 86, 0.3);
}

/* ===========================================================
   LEGENDE UNTEN RECHTS
   =========================================================== */
.legend-container {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-top: 0.5rem;
  padding-right: 1rem;
}

.legend-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.legend span {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

/* ===========================================================
   UPDATE-INFO (unterhalb Legende)
   =========================================================== */
.update-info {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #999;
  text-align: right;
}

#betriebszeiten-container td.preparation {
  background: #fff8d1; /* hellgelb */
  color: #c49a00;
  font-weight: bold;
}

.today-btn {
  background: #fff;
  border: 2px solid var(--main-color);
  color: var(--main-color);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  margin-left: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background: var(--today-bg);
  color: #000;
}

@media (max-width: 768px) {
  .today-btn {
    margin: 0.5rem auto;
    display: block;
    width: 90%;
    text-align: center;
  }
}

/* Heute-Button (mobil sichtbar, Desktop & Mobile abgestimmt) */
.today-btn {
  background: #fff;
  border: 2px solid var(--main-color);
  color: var(--main-color);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-btn:hover {
  background: var(--today-bg);
  color: #000;
}

/* Desktop: Button rechts neben Dropdown */
.desktop-controls .today-btn {
  margin-left: 1rem;
}

/* Mobile: Vollbreite innerhalb Filterbar */
@media (max-width: 768px) {
  .today-btn.mobile-only {
    flex: 1 1 100%;
    margin-top: 0.3rem;
    text-align: center;
    background: #fff;
  }
}
/* === Monatsnavigation === */
.month-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  vertical-align: middle;
}

.month-nav-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #344256;
  cursor: pointer;
  padding: 0 0.4rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.month-nav-btn:hover {
  transform: scale(1.2);
  color: #f2213b; /* Lenzerheide Rot */
}

/* === Suchleiste allgemein === */
.search-bar {
  display: flex;
  align-items: center;
  justify-content: center;        /* Zentrierung für Desktop */
  gap: 0.4rem;
  margin: 1rem auto;
  width: 100%;
  max-width: 400px;               /* Begrenzung, damit sie in der Mitte bleibt */
}

.search-bar input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: left;
}

.clear-btn {
  background: #eee;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: #aaa;
}

/* Tooltip-Interaktion */
#betriebszeiten-table td[title],
.remark-icon,
.bike-icon {
  cursor: pointer;
}

/* Hover-Highlight für Zellen des heutigen Tages */
#betriebszeiten-table td.today:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transition: background-color 0.2s ease;
}

/* Tooltip / Interaktion */
#betriebszeiten-table td[title],
.remark-icon,
.bike-icon {
  cursor: pointer;
}

.lift-time {
  display: none !important;
}

/*
.switch,
.season-indicator,
#filter-season {
  display: none !important;
}

/* ===========================================================
   TEMPORÄR BIS ENDE APRIL: Sommermonate ausblenden (Mai–September)
   Gilt für Desktop- und Mobile-Auswahlfelder
   =========================================================== */

/* Desktop-Dropdown 
#month-select option[value="5"],
#month-select option[value="6"],
#month-select option[value="7"],
#month-select option[value="8"],
#month-select option[value="9"] {
  display: none !important;
}

/* Mobile Varianten (alle bekannten Selektoren abgedeckt)
#month-select-mobile option[value="5"],
#month-select-mobile option[value="6"],
#month-select-mobile option[value="7"],
#month-select-mobile option[value="8"],
#month-select-mobile option[value="9"],
.mobile-controls select option[value="5"],
.mobile-controls select option[value="6"],
.mobile-controls select option[value="7"],
.mobile-controls select option[value="8"],
.mobile-controls select option[value="9"],
.filter-panel select option[value="5"],
.filter-panel select option[value="6"],
.filter-panel select option[value="7"],
.filter-panel select option[value="8"],
.filter-panel select option[value="9"] {
  display: none !important;
}

*/