/* ================================================================
   STAMMTISCH FINDEN - Seiten-spezifisches CSS
   ================================================================ */

:root {
  --st-panel-w: 380px;
}

/* ================================================================
   CONTROLS SECTION (Search, Filter, Toggle)
   ================================================================ */
.st-controls-section {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  padding: 4rem 0 0 0;
  width: 1400px;
  max-width: calc(100% - var(--sp-lg) * 2);
  margin: 0 auto var(--sp-lg);
}

/* Left: Search Bar */
.st-controls-section .st-search-bar {
  flex: 0 0 auto;
  max-width: 320px;
}

/* Center: Filter Bar (takes up remaining space, centered) */
.st-controls-section .st-filter-bar {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: var(--sp-xs);
}

/* Right: View Toggle */
.st-controls-section .st-view-toggle {
  flex: 0 0 auto;
  display: flex;
  gap: var(--sp-sm);
}

/* Variante ohne Search-Bar (Suche liegt im Hero):
   Filter links, Toggle rechts – kompakter Top-Padding, da Hero darüber. */
.st-controls-section--no-search {
  padding-top: var(--sp-lg);
}

.st-controls-section--no-search .st-filter-bar {
  flex: 1;
  justify-content: flex-start;
}

/* ================================================================
   VIEW TOGGLE
   ================================================================ */
.st-view-toggle {
  display: flex;
  gap: var(--sp-sm);
}

.st-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
}

.st-toggle-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.st-toggle-btn--active {
  background: #0D2B6E;
  color: var(--white);
  border-color: #0D2B6E;
}

.st-toggle-btn[data-view="list"] {
  background: #ffffff;
  color: var(--navy);
  border-color: var(--border);
}

.st-toggle-btn[data-view="list"]:hover,
.st-toggle-btn[data-view="list"].st-toggle-btn--active {
  background: #ffffff;
  color: var(--blue);
  border-color: var(--blue);
}

/* ================================================================
   MAP WRAPPER
   ================================================================ */
.st-map-wrapper {
  width: 1400px;
  max-width: calc(100% - var(--sp-lg) * 2);
  margin: 0 auto clamp(48px, 6vw, 96px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border);
  height: 650px;
  position: relative;
}

/* ================================================================
   CONTAINER
   ================================================================ */
.st-container {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 0;
  overflow: visible;
  z-index: 1;
}

/* ================================================================
   LAYOUT STRUKTUR
   ================================================================ */
.st-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #ffffff;
  padding-top: 0;
}

/* In der Kartenansicht den 100vh-Stretch entfernen, damit der Footer
   direkt unter der Karte sitzt. Die Karten-Höhe wird per JS so gesetzt,
   dass der Footer auf großen Bildschirmen am Viewport-Rand klebt
   (siehe adjustMapHeight() in js/stammtisch.js). */
.st-page.st-page--map {
  min-height: 0;
}

/* ================================================================
   MAP - 75% of container
   ================================================================ */
.st-map {
  width: 75%;
  height: 100%;
  background: #e5e3df;
  flex-shrink: 0;
  box-shadow: none;
}

#st-map {
  box-shadow: none;
}

.st-map .leaflet-tile-pane {
  filter: brightness(1.1) saturate(0.75) contrast(1.05);
}

/* Leaflet overrides */
.st-map .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.75rem !important;
}

.st-map .leaflet-control-zoom {
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

.st-map .leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 1.4rem !important;
  color: var(--navy) !important;
  border: none !important;
}

.st-map .leaflet-control-zoom a:hover {
  background: var(--blue-light) !important;
  color: var(--blue) !important;
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.st-search-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  width: 100%;
  max-width: 400px;
  height: 44px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: none;
}

.st-search-bar__input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  padding: 0 var(--sp-sm);
  outline: none;
}

.st-search-bar__input::placeholder {
  color: var(--text-light);
}

.st-search-bar__btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #0d2b6e;
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}

.st-search-bar__btn:hover {
  background: #0a1f4d;
  opacity: 0.9;
}


/* ================================================================
   DETAILS CONTAINER (no longer used - panel is inside st-container)
   ================================================================ */
.st-details-container {
  display: none;
}

/* ================================================================
   RIGHT PANEL (25% of container)
   ================================================================ */
.st-right-panel {
  width: 25%;
  height: 100%;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  flex-shrink: 0;
  border-left: 1px solid #e0e7ff;
}

/* Banner: Auswahl-Modus für die Gastanmeldung */
.st-gastpick-banner {
  flex-shrink: 0;
  padding: .75rem var(--sp-lg);
  background: var(--blue-light);
  color: var(--navy);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
  border-bottom: 1px solid #e0e7ff;
}

/* Panel Header */
.st-panel-header {
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
}

.st-panel-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 var(--sp-xs) 0;
}

.st-panel-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ================================================================
   FILTER BAR
   ================================================================ */
.st-filter-bar {
  display: flex;
  gap: var(--sp-xs);
}

.st-filter-bar--vertical {
  flex-direction: column;
}

.st-filter-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
}

.st-filter-bar--vertical .st-filter-btn {
  width: 100%;
  text-align: left;
}

.st-filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.st-filter-btn--active {
  background: #0D2B6E;
  color: var(--white);
  border-color: #0D2B6E;
}

.st-filter-btn[data-filter="aktiv"],
.st-filter-btn[data-filter="geplant"] {
  background: #ffffff;
  color: var(--navy);
  border-color: var(--border);
}

.st-filter-btn[data-filter="aktiv"]:hover,
.st-filter-btn[data-filter="geplant"]:hover,
.st-filter-btn[data-filter="aktiv"].st-filter-btn--active,
.st-filter-btn[data-filter="geplant"].st-filter-btn--active {
  background: #ffffff;
  color: var(--blue);
  border-color: var(--blue);
}

/* ================================================================
   DETAIL SECTION (shown when pin is clicked)
   ================================================================ */
.st-panel-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.st-panel-top-section {
  background: #0d2b6e;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  flex-shrink: 0;
}

.st-panel-bottom-section {
  background: #ffffff;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  flex: 1;
  overflow-y: auto;
}

.st-status-badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  border: 1px solid rgba(21, 101, 192, 0.2);
  width: fit-content;
  margin-bottom: var(--sp-sm);
}

.st-status-badge.status-aktiv {
  background: #dff6e8;
  color: #1f8f56;
  border-color: rgba(31, 143, 86, 0.2);
}

.st-panel-top-section .st-status-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.st-panel-top-section .st-status-badge.status-aktiv {
  background: rgba(31, 143, 86, 0.3);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}

.st-status-badge.status-geplant {
  background: #fef3c7;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
}

.st-panel-top-section .st-status-badge.status-geplant {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.st-panel-detail-name {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.st-panel-top-section .st-panel-detail-name {
  color: #ffffff;
}

.st-panel-detail-venue {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.st-panel-detail-address {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-style: normal;
  color: #5c687d;
  margin: 0;
  line-height: 1.55;
  white-space: pre-line;
}

.st-panel-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-md);
  margin: 0;
}

.st-panel-schedule__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.st-panel-schedule__label {
  font-family: var(--font-head);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.st-panel-schedule__value {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--blue);
  margin: 0;
}

.st-panel-detail-description {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #5c687d;
  margin-top: -8px;
  margin-bottom: -4px;
  line-height: 1.5;
}

.st-panel-top-section .st-panel-detail-description {
  color: rgba(255, 255, 255, 0.8);
}

.st-panel-section-divider {
  height: 1px;
  background: #e0e7ff;
  margin: 12px 0 8px 0;
  margin-top: 0px;
}

.st-panel-section-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 8px 0;
}

.st-panel-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding-top: var(--sp-lg);
}

.st-detail-availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.st-detail-availability__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Default = freie Plätze (grün) */
.st-detail-availability {
  background: rgba(31, 143, 86, 0.08);
  color: #1f8f56;
  border-color: rgba(31, 143, 86, 0.2);
}

.st-detail-availability .st-detail-availability__dot {
  background: #1f8f56;
  box-shadow: 0 0 0 4px rgba(31, 143, 86, 0.15);
}

/* Belegt = rot */
.st-detail-availability.is-full {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.2);
}

.st-detail-availability.is-full .st-detail-availability__dot {
  background: #c0392b;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.15);
}

.st-detail-btns {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin: 0;
}

.st-detail-btns .btn {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
}

.st-detail-btns .btn--primary {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.st-detail-btns .btn--primary:hover {
  background: #0a1f4d;
  border-color: #0a1f4d;
}

.st-detail-btns .btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}

.st-detail-btns .btn--outline:hover {
  background: var(--blue-light);
  border-color: var(--blue);
}

/* ================================================================
   CTA BOX (Jetzt teilnehmen)
   ================================================================ */
.st-cta-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding: var(--sp-lg);
  background: linear-gradient(135deg, #f8f9fb 0%, #f4f7fb 100%);
  border-radius: 12px;
  margin: var(--sp-lg);
  margin-top: auto;
}

.st-cta-box__title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.st-cta-box__text {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.st-cta-box__counter {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.st-cta-box__counter svg {
  color: var(--blue);
  flex-shrink: 0;
}

.st-cta-box__number {
  display: block;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.st-cta-box__label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   LIST VIEW
   ================================================================ */
.st-list-view {
  padding: var(--sp-lg) 0 clamp(48px, 6vw, 96px);
}

.st-list-container {
  width: 1400px;
  max-width: calc(100% - var(--sp-lg) * 2);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.st-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-lg);
  padding: var(--sp-lg);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--tr);
  cursor: pointer;
}

.st-list-item:hover {
  border-color: var(--blue);
  box-shadow: none;
}

.st-list-item__content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.st-list-item__header {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.st-list-item__status {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(21, 101, 192, 0.18);
}

.st-list-item__status.status-geplant {
  background: rgba(136, 153, 176, 0.1);
  color: var(--text-light);
}

.st-list-item__name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.st-list-item__address {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.st-list-item__time {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 500;
  margin: 0;
}

.st-list-item__meta {
  display: flex;
  gap: var(--sp-sm);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--border-light);
}

.st-list-item__availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.st-list-item__availability-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #1f8f56;
  box-shadow: 0 0 0 3px rgba(31, 143, 86, 0.12);
}

.st-list-item__availability--low .st-list-item__availability-dot {
  background: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14);
}

.st-list-item__availability--full .st-list-item__availability-dot {
  background: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.st-list-item__meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.st-list-item__meta-item .value {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.st-list-item__meta-item .label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.st-list-item__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  justify-content: flex-start;
}

.st-list-item__actions .btn {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ================================================================
   CUSTOM MAP MARKERS
   ================================================================ */
.st-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--navy);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(13, 43, 110, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.st-marker::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
}

.st-marker:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 16px rgba(13, 43, 110, 0.4);
}

.st-marker.geplant {
  background: var(--text-light);
}

.st-marker.neu {
  background: var(--blue);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
  :root {
    --st-panel-w: 320px;
  }

  .st-map-wrapper {
    height: 500px;
  }

  .st-container {
    flex-direction: column;
  }

  .st-map {
    width: 100%;
    height: 60%;
  }

  .st-right-panel {
    width: 100%;
    height: 40%;
    border-left: none;
    box-shadow: none;
  }

  .st-list-container {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--sp-lg);
  }

  .st-list-item {
    grid-template-columns: 1fr;
  }

  .st-list-item__actions {
    flex-direction: row;
  }
}

/* Tablets & Mobile - Nur Listenansicht */
@media (max-width: 1024px) {
  .st-map-wrapper {
    display: none;
  }

  .st-controls-section .st-view-toggle {
    display: none !important;
  }

  .st-view-toggle {
    display: none !important;
  }

  .st-list-view {
    display: block !important;
  }
}

/* Mobile ≤ 640px */
@media (max-width: 640px) {
  .st-map-wrapper {
    height: 350px;
  }

  .st-container {
    flex-direction: column;
  }

  .st-map {
    width: 100%;
    height: 100%;
  }

  .st-right-panel {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-left: none;
    box-shadow: none;
    border-radius: 16px 16px 0 0;
    z-index: 200;
  }

  .st-right-panel.is-visible {
    display: flex;
  }

  .st-search-bar {
    width: calc(100% - 2 * var(--sp-lg));
    max-width: none;
  }

  .st-filter-bar {
    flex-direction: row;
  }

  .st-filter-bar--vertical {
    flex-direction: row;
  }

  .st-controls-section {
    flex-direction: column;
    gap: var(--sp-md);
    width: 100%;
    max-width: 100%;
  }

  .st-controls-section > * {
    width: 100%;
  }

  .st-controls-section .st-search-bar {
    max-width: 100%;
  }

  .st-controls-section .st-view-toggle {
    display: none !important;
  }

  .st-view-toggle {
    display: none !important;
  }

  .st-filter-btn {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .st-cta-box {
    margin: var(--sp-md);
    margin-top: var(--sp-lg);
  }
}
