/* Löschzug Eickel — Live-Tracker Styles
   Moderner, "floating glass" Look über einer full-bleed Karte.
   Feuerwehr-Farbwelt: tiefes Anthrazit + kräftiges Rot als Akzent. */

:root {
  --fw-accent: #ff3b3b;
  --fw-accent-dark: #b8271f;
  --fw-ink: #14171a;
  --fw-surface: rgba(20, 23, 26, 0.72);
  --fw-surface-solid: #1b1e22;
  --fw-border: rgba(255, 255, 255, 0.08);
  --fw-text: #f5f6f7;
  --fw-text-muted: rgba(245, 246, 247, 0.62);
  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--fw-ink);
  color: var(--fw-text);
  overscroll-behavior: none;
}

/* Karte ist immer full-bleed; Header/Footer schweben als Glass-Layer darüber. */
#map {
  position: fixed;
  inset: 0;
}

/* ---------- View-Umschaltung (Landing / Live / Outro, siehe gate.js) ---------- */
.hidden {
  display: none !important;
}

#view-landing,
#view-outro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 59, 59, 0.12), transparent 60%), var(--fw-ink);
}

.landing,
.outro {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.landing__card,
.outro {
  width: 100%;
  padding: 32px 28px;
  border-radius: 24px;
  background: var(--fw-surface-solid);
  border: 1px solid var(--fw-border);
  box-shadow: var(--shadow-float);
}

.landing__card .app-header__badge,
.outro .app-header__badge {
  display: inline-block;
  margin-bottom: 14px;
}

.landing__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.landing__sub {
  margin: 4px 0 0;
  color: var(--fw-text-muted);
  font-size: 14.5px;
  font-weight: 600;
}

.outro p {
  color: var(--fw-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 22px 0 4px;
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--fw-border);
}

.countdown__value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--fw-text);
}

.countdown__label {
  margin-top: 2px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fw-text-muted);
}

.landing__waiting {
  margin: 18px 0 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid rgba(255, 59, 59, 0.25);
  font-size: 14px;
  line-height: 1.5;
}

.landing__hint {
  margin: 16px 0 0;
  color: var(--fw-text-muted);
  font-size: 12.5px;
}

/* ---------- Vorschau-Karte auf der Landing Page ---------- */
.landing-map {
  width: 100%;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--fw-border);
  box-shadow: var(--shadow-float);
}

/* ---------- Outro Social-Links ---------- */
.outro__social {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.outro__social a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--fw-border);
  color: var(--fw-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.outro__social a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.maplibregl-ctrl-top-right {
  top: calc(70px + var(--safe-top));
}

.maplibregl-ctrl-group {
  background: var(--fw-surface) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--fw-border) !important;
  box-shadow: var(--shadow-float) !important;
}

.maplibregl-ctrl-group button {
  background: transparent !important;
}

.maplibregl-ctrl-group button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- Header (floating glass bar) ---------- */
.app-header {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  border-radius: 18px;
  background: var(--fw-surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--fw-border);
  box-shadow: var(--shadow-float);
}

.app-header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-header__badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--fw-accent);
  box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.18), 0 0 10px rgba(255, 59, 59, 0.7);
}

.app-header h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__sub {
  color: var(--fw-text-muted);
  font-weight: 500;
}

.app-header__social {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.app-header__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--fw-text-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-header__social a:hover,
.app-header__social a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fw-text);
  transform: translateY(-1px);
}

/* ---------- Footer (dezente Glass-Leiste) ---------- */
.app-footer {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--fw-text-muted);
  background: var(--fw-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--fw-border);
  box-shadow: var(--shadow-float);
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  z-index: 15;
  pointer-events: none;
}

.overlay > * {
  pointer-events: auto;
}

.overlay--top {
  top: calc(78px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
}

.overlay--bottom-right {
  bottom: calc(64px + var(--safe-bottom));
  right: 12px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: var(--fw-surface);
  color: var(--fw-text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--fw-border);
  white-space: nowrap;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.status-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 8px rgba(53, 208, 127, 0.8);
  flex-shrink: 0;
  animation: dot-breathe 2.4s ease-in-out infinite;
}

.status-chip--stale {
  background: rgba(184, 39, 31, 0.85);
  border-color: rgba(255, 255, 255, 0.14);
}

.status-chip--stale .status-chip__dot {
  background: #ffb4b4;
  box-shadow: 0 0 8px rgba(255, 180, 180, 0.8);
  animation: none;
}

@keyframes dot-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.follow-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--fw-border);
  background: var(--fw-surface);
  color: var(--fw-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.follow-btn--active {
  background: linear-gradient(135deg, var(--fw-accent), var(--fw-accent-dark));
  color: #fff;
  border-color: transparent;
}

.follow-btn:hover {
  transform: translateY(-1px);
}

.follow-btn:active {
  transform: translateY(0);
}

/* ---------- Aktuelle-Position-Marker ---------- */
.current-marker {
  position: relative;
  width: 30px;
  height: 30px;
}

.current-marker__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8080, var(--fw-accent) 60%, var(--fw-accent-dark));
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(255, 59, 59, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.current-marker__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--fw-accent);
  opacity: 0.5;
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.5;
  }
  70% {
    transform: scale(2.8);
    opacity: 0;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* ---------- Wegpunkt-Marker ---------- */
.waypoint-marker {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--fw-surface-solid);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.waypoint-marker::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fw-text-muted);
  transform: rotate(45deg);
  transition: background 0.2s ease;
}

.waypoint-marker--reached {
  background: #1f8a4c;
  border-color: #7be0a4;
}

.waypoint-marker--reached::after {
  background: #d9ffe6;
}

/* ---------- Popups ---------- */
.maplibregl-popup-content {
  background: var(--fw-surface-solid);
  color: var(--fw-text);
  border-radius: 14px;
  font-size: 13px;
  padding: 12px 14px;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--fw-border);
}

.maplibregl-popup-content strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13.5px;
}

.maplibregl-popup-tip {
  border-top-color: var(--fw-surface-solid) !important;
  border-bottom-color: var(--fw-surface-solid) !important;
}

.maplibregl-popup-close-button {
  color: var(--fw-text-muted);
  font-size: 18px;
  padding: 4px 8px;
}

/* ---------- Datenschutz-Link (Footer / Landing / Outro) ---------- */
.app-footer__link {
  color: var(--fw-text-muted);
  text-decoration: none;
}

.app-footer__link:hover {
  color: var(--fw-text);
  text-decoration: underline;
}

.legal-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--fw-text-muted);
  text-decoration: underline;
  text-decoration-color: rgba(245, 246, 247, 0.25);
  font-size: 12px;
}

.legal-link:hover {
  color: var(--fw-text);
}

/* ---------- Datenschutzerklärung (eigenständige Seite) ---------- */
.legal-page {
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.legal-page__card {
  width: 100%;
  max-width: 640px;
  padding: 32px 28px 40px;
  border-radius: 24px;
  background: var(--fw-surface-solid);
  border: 1px solid var(--fw-border);
  box-shadow: var(--shadow-float);
}

.legal-page__back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--fw-text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.legal-page__back:hover {
  color: var(--fw-text);
}

.legal-page__card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.legal-page__intro {
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--fw-border);
  color: var(--fw-text-muted);
  font-size: 13.5px;
}

.legal-page__card h2 {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.legal-page__card p,
.legal-page__card li {
  color: var(--fw-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.legal-page__card ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

/* ---------- Responsive Feintuning ---------- */
@media (max-width: 420px) {
  .app-header h1 {
    font-size: 14.5px;
  }
  .app-header {
    padding: 8px 8px 8px 14px;
  }
  .follow-btn span {
    display: none;
  }
  .follow-btn {
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .current-marker__pulse,
  .status-chip__dot {
    animation: none;
  }
}
