/* ═══════════════════════════════════════════════════════════
   FST Training – Frontend / Teilnehmer-Lagekarte
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow:wght@300;400;600&family=Barlow+Condensed:wght@600;700&display=swap');

:root {
  --fe-bg:        #0a0d12;
  --fe-bg2:       #111827;
  --fe-bg3:       #1a2332;
  --fe-border:    rgba(255,255,255,.08);
  --fe-green:     #00e5a0;
  --fe-amber:     #f59e0b;
  --fe-red:       #ef4444;
  --fe-blue:      #3b82f6;
  --fe-text:      #c8d8e8;
  --fe-text-dim:  rgba(200,216,232,.45);
  --fe-mono:      'Share Tech Mono', monospace;
  --fe-sans:      'Barlow', sans-serif;
  --fe-cond:      'Barlow Condensed', sans-serif;
  --sidebar-w:    320px;
}

/* ── Root Layout ─────────────────────────────────────────── */
#fst-frontend-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  width: 100%;
  font-family: var(--fe-sans);
  background: var(--fe-bg);
  overflow: hidden;
}

/* ── Karte ───────────────────────────────────────────────── */
#fst-fe-map {
  width: 100%;
  height: 100%;
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#fst-fe-sidebar {
  grid-column: 1;
  grid-row: 1;
  background: var(--fe-bg);
  border-right: 1px solid var(--fe-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

/* ── Header ──────────────────────────────────────────────── */
.fst-fe-header {
  padding: 14px 16px;
  background: var(--fe-bg2);
  border-bottom: 1px solid var(--fe-border);
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,229,160,.015) 2px, rgba(0,229,160,.015) 4px
  );
}
.fst-fe-logo {
  font-family: var(--fe-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fe-green);
  margin-bottom: 4px;
}
.fst-fe-session-name {
  font-family: var(--fe-sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fst-fe-status-badge {
  display: inline-block;
  font-family: var(--fe-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--fe-green);
  color: var(--fe-green);
  margin-top: 6px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.fst-fe-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--fe-border);
}
.fst-fe-tab {
  padding: 8px 4px;
  font-family: var(--fe-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fe-text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.fst-fe-tab:hover { color: var(--fe-text); }
.fst-fe-tab.active { color: var(--fe-green); border-bottom-color: var(--fe-green); }
.fst-fe-tab-content { display: none; flex: 1; overflow-y: auto; }
.fst-fe-tab-content.active { display: block; }

/* ── Statistiken ─────────────────────────────────────────── */
.fst-fe-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--fe-border);
  margin: 1px;
}
.fst-fe-stat {
  padding: 12px 10px;
  background: var(--fe-bg);
  text-align: center;
}
.fst-fe-stat-val {
  font-family: var(--fe-mono);
  font-size: 20px;
  color: var(--fe-green);
  line-height: 1.2;
}
.fst-fe-stat-lbl {
  font-family: var(--fe-cond);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fe-text-dim);
  margin-top: 2px;
}

/* ── Sections ────────────────────────────────────────────── */
.fst-fe-section { padding: 8px 0; }
.fst-fe-section-title {
  font-family: var(--fe-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fe-text-dim);
  padding: 8px 14px 4px;
}

/* ── Closure Items ───────────────────────────────────────── */
.fe-closure {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--fe-border);
  font-size: 12px;
}
.fe-closure-icon { font-size: 16px; flex-shrink: 0; }
.fe-closure-name { font-weight: 600; color: var(--fe-text); }
.fe-closure-type { font-family: var(--fe-mono); font-size: 10px; color: var(--fe-amber); text-transform: uppercase; }

/* ── Area Items ──────────────────────────────────────────── */
.fe-area {
  padding: 10px 14px;
  border-bottom: 1px solid var(--fe-border);
}
.fe-area-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--fe-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fe-area-color {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.fe-area-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 6px;
}
.fe-area-kv {
  font-size: 11px;
  display: flex;
  gap: 4px;
}
.fe-area-kv .k { color: var(--fe-text-dim); }
.fe-area-kv .v { font-family: var(--fe-mono); color: var(--fe-text); }

/* ── Shelter Items ───────────────────────────────────────── */
.fe-shelter {
  padding: 10px 14px;
  border-bottom: 1px solid var(--fe-border);
}
.fe-shelter-name { font-weight: 600; font-size: 13px; }
.fe-shelter-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.fe-shelter-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.fe-shelter-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .5s ease;
}
.fe-shelter-meta { font-size: 11px; color: var(--fe-text-dim); margin-top: 2px; }

/* ── Vehicle Items ───────────────────────────────────────── */
.fe-vehicle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--fe-border);
  font-size: 12px;
}
.fe-vehicle-icon { font-size: 18px; }
.fe-vehicle-name { font-weight: 600; font-size: 12px; color: var(--fe-text); }
.fe-vehicle-call { font-family: var(--fe-mono); font-size: 10px; color: var(--fe-green); }
.fe-vehicle-status {
  margin-left: auto;
  font-family: var(--fe-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}
.vs-en_route   { color: var(--fe-green); animation: fe-blink 1.5s infinite; }
.vs-idle       { color: var(--fe-text-dim); }
.vs-at_destination { color: var(--fe-blue); }
.vs-returning  { color: var(--fe-amber); }

@keyframes fe-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Footer ──────────────────────────────────────────────── */
.fst-fe-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--fe-border);
  display: flex;
  justify-content: space-between;
  font-family: var(--fe-mono);
  font-size: 10px;
  color: var(--fe-text-dim);
  background: var(--fe-bg2);
  flex-shrink: 0;
}

/* ── Leaflet Overrides ───────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(10,13,18,.95) !important;
  border: 1px solid rgba(0,229,160,.4) !important;
  border-radius: 0 !important;
  color: #c8d8e8 !important;
  backdrop-filter: blur(8px);
}
.leaflet-popup-content h4 {
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  color: #00e5a0;
  margin: 0 0 6px;
}
.leaflet-popup-content p { margin: 3px 0; font-size: 12px; }
.leaflet-popup-tip { background: rgba(0,229,160,.3) !important; }
.leaflet-control-zoom a { background: rgba(10,13,18,.9) !important; border-color: rgba(255,255,255,.1) !important; color: #c8d8e8 !important; }

/* ── Login Notice ────────────────────────────────────────── */
.fst-fe-login-notice {
  background: #0a0d12;
  color: #c8d8e8;
  padding: 40px;
  text-align: center;
  font-family: 'Barlow', sans-serif;
  border: 1px solid rgba(0,229,160,.3);
}
.fst-fe-login-notice a { color: #00e5a0; }

/* ── Scrollbar ───────────────────────────────────────────── */
#fst-fe-sidebar *::-webkit-scrollbar { width: 4px; }
#fst-fe-sidebar *::-webkit-scrollbar-track { background: var(--fe-bg); }
#fst-fe-sidebar *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #fst-frontend-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #fst-fe-sidebar { max-height: 45vh; grid-column: 1; grid-row: 1; border-right: none; border-bottom: 1px solid var(--fe-border); }
  #fst-fe-map { grid-column: 1; grid-row: 2; }
  :root { --sidebar-w: 100%; }
}

/* ── Vehicle Markers ─────────────────────────────────────── */
.fst-vmarker {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border-radius: 50%;
  border: 2px solid #00e5a0;
  background: rgba(10,13,18,.85);
  cursor: pointer;
  transition: transform .2s;
}
.fst-vmarker:hover { transform: scale(1.2); }
@keyframes fst-marker-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,229,160,.6); }
  50%      { box-shadow: 0 0 0 8px rgba(0,229,160,0); }
}
.fst-pulse { animation: fst-marker-pulse 1.4s infinite; }

/* ── Shelter Marker ──────────────────────────────────────── */
.fst-shelter-marker {
  font-size: 20px; cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
}

/* ── Tooltip ─────────────────────────────────────────────── */
.fst-fe-tooltip {
  background: rgba(10,13,18,.92) !important;
  border: 1px solid rgba(0,229,160,.4) !important;
  color: #c8d8e8 !important;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; line-height: 1.5;
  border-radius: 4px;
  padding: 6px 10px;
}
.fst-fe-tooltip::before { border-top-color: rgba(0,229,160,.4) !important; }

/* ── Population tab ──────────────────────────────────────── */
.fst-fe-area-row {
  padding: 8px; margin-bottom: 6px;
  background: rgba(255,255,255,.04);
  border-left: 3px solid rgba(0,229,160,.5);
  border-radius: 2px;
  cursor: pointer; transition: background .15s;
}
.fst-fe-area-row:hover { background: rgba(0,229,160,.08); }
.fst-fe-area-name { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.fst-fe-pop-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.fst-fe-pop-table td { padding: 1px 4px; }
.fst-fe-pop-table td:first-child { opacity: .7; }
.fst-fe-pop-table td:last-child { text-align: right; font-family: 'Share Tech Mono',monospace; }
.fst-fe-area-total {
  padding: 8px; margin-top: 4px;
  font-size: 11px; font-family: 'Share Tech Mono',monospace;
  border-top: 1px solid rgba(255,255,255,.1);
  opacity: .8;
}

/* ── Shelters tab ────────────────────────────────────────── */
.fst-fe-shelter-row {
  padding: 8px; margin-bottom: 6px;
  background: rgba(255,255,255,.04);
  border-radius: 3px; cursor: pointer;
  transition: background .15s;
}
.fst-fe-shelter-row:hover { background: rgba(0,229,160,.08); }
.fst-fe-shelter-name { font-weight: 600; font-size: 12px; }
.fst-fe-shelter-addr { font-size: 10px; opacity: .6; margin-bottom: 5px; }
.fst-fe-shelter-bar-wrap {
  height: 4px; background: rgba(255,255,255,.1);
  border-radius: 2px; overflow: hidden; margin-bottom: 4px;
}
.fst-fe-shelter-bar { height: 100%; border-radius: 2px; transition: width .4s; }
.fst-fe-shelter-meta { font-size: 11px; font-family: 'Share Tech Mono',monospace; }

/* ── Vehicles tab ────────────────────────────────────────── */
.fst-fe-vgroup-title {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: .08em; opacity: .5;
  padding: 6px 0 2px; border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 2px;
}
.fst-fe-vehicle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; cursor: pointer; border-radius: 3px;
  transition: background .15s;
}
.fst-fe-vehicle-row:hover { background: rgba(255,255,255,.06); }
.fst-fe-vrow-active { background: rgba(0,229,160,.07); }
.fst-fe-v-icon  { font-size: 15px; }
.fst-fe-v-label { flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fst-fe-v-status{ font-size: 10px; opacity: .65; white-space: nowrap; }

/* ── Closures list ───────────────────────────────────────── */
.fst-fe-closure-item {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 0; cursor: pointer; font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.fst-fe-c-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fst-fe-c-type { font-weight: 600; white-space: nowrap; }
.fst-fe-c-desc { opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Popup ───────────────────────────────────────────────── */
.fst-fe-popup { font-family: 'Barlow Condensed',sans-serif; font-size: 12px; line-height: 1.6; }
.fst-fe-popup strong { color: #00e5a0; font-size: 13px; }
