/* ==========================================
   1. GLOBAL & DESIGN TOKENS
   ========================================== */
:root {
  --bg: #080d18;
  --panel: #111827;
  --panel2: #172033;
  --line: #273449;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #e11d48;
  --accent2: #fb7185;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

/* Verhindert weiße Ränder in Safari/iOS beim Scrollen */
html, body {
  background-color: var(--bg) !important;
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   9. FEEDBACK SECTION
   ========================================== */
.feedback-section {
  margin: 34px 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.feedback-section h2 {
  margin: 0 0 7px;
  font-size: 25px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
}

.feedback-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: white;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.feedback-form textarea:focus {
  border-color: var(--accent2);
}

.feedback-status {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.feedback-status.success {
  color: #86efac;
}

.feedback-status.error {
  color: #f87171;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg), #0f172a);
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

/* ==========================================
   2. HEADER & NAVIGATION
   ========================================== */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 18, 32, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top); /* Schutz vor der iPhone Notch */
}

.top {
  max-width: 1200px;
  margin: auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px; /* Abstand zwischen Logo und Text */
  font-weight: 800;
  font-size: 21px;
}

.brand-logo {
  height: 32px; /* Höhe des Logos – beliebig anpassbar */
  width: auto;
  object-fit: contain;
}

.brand span {
  color: var(--accent2);
}

.status {
  font-size: 12px;
  color: #86efac;
  background: #12301f;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 600;
}

main {
  max-width: 1200px;
  margin: auto;
  padding: 24px 20px 50px;
}

/* ==========================================
   3. HERO, HINWEISE & TABS
   ========================================== */
.hero {
  padding: 18px 0 24px;
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 8px;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.warning {
  border: 1px solid #713f12;
  background: #27170b;
  color: #fed7aa;
  padding: 12px 14px;
  border-radius: var(--radius);
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.4;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px 0 22px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 14px 12px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

/* ==========================================
   4. SUCHFELD & STANDORT
   ========================================== */
.search-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}

.search-controls .search {
  margin-bottom: 0;
  flex: 1;
}

.search {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: white;
  border-radius: var(--radius);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.search:focus {
  border-color: var(--accent2);
}

.location-btn {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #1e293b;
  color: white;
  border-radius: var(--radius);
  padding: 0 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.location-btn:hover {
  background: #263449;
}

.location-status {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ==========================================
   5. ERGEBNIS-CARDS GRID
   ========================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, var(--panel), #0f172a);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.card h3 {
  margin: 0 0 7px;
  font-size: 17px;
}

.area {
  color: var(--accent2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.distance {
  color: #86efac;
  font-size: 12px;
  font-weight: 700;
  margin: -3px 0 8px;
}

.addr {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 8px 0 14px;
}

.note {
  font-size: 12px;
  color: #cbd5e1;
  background: #111c2e;
  border-radius: 99px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: inline-block;
}

.specialty-list {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 12px;
  background: #0b1322;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #1a2638;
}

.actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 11px 9px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.8;
}

.route {
  background: var(--accent);
  color: white;
}

.copy {
  background: #1e293b;
  color: white;
  border: 1px solid var(--line);
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  display: none;
}

/* ==========================================
   6. KARTE & MAẞGESCHNEIDERTE FILTER-CHIPS
   ========================================== */
.map-section {
  margin: 34px 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.map-section h2 {
  margin: 0 0 7px;
  font-size: 25px;
}

.section-sub {
  margin: 0 0 17px;
  color: var(--muted);
}

#map {
  height: 420px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  z-index: 1;
  margin-top: 15px;
}

/* Dark Mode Overrides für Leaflet Popups */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.leaflet-popup-content {
  margin: 14px;
  font-family: inherit;
}

.map-popup-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: white;
}

.map-popup-addr {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Filter Container */
.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: #1e293b;
  border-color: #334155;
}

/* Styling der Farbpunkte */
.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

/* ------------------------------------------
   GESTALTUNG DER CUSTOM CHECKBOXEN
   ------------------------------------------ */
.filter-chip input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background-color: #0f172a;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s ease-in-out;
  margin: 0;
  flex-shrink: 0;
}

/* Haken-Icon (SVG-Pfad via Clip-Path) */
.filter-chip input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  background-color: #ffffff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Aktivierter Zustand der Checkbox */
.filter-chip input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(225, 29, 72, 0.4);
}

.filter-chip input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* Focus-State für Barrierefreiheit */
.filter-chip input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

/* ==========================================
   7. MODAL (NAVIGATIONS-AUSWAHL)
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.modal-addr {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 20px;
  word-break: break-word;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-buttons .btn {
  padding: 14px;
  font-size: 15px;
  display: block;
}

.btn-gmaps {
  background: #4285F4;
  color: white;
}

.btn-gmaps:hover {
  background: #3367d6;
}

.btn-amaps {
  background: #2c2c2e;
  border: 1px solid #444;
  color: white;
}

.btn-amaps:hover {
  background: #3a3a3c;
}

.modal-close {
  width: 100%;
  background: #1e293b;
  border: 1px solid var(--line);
  color: white;
}

/* ==========================================
   8. FOOTER & MEDIA QUERIES
   ========================================== */
footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 30px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 650px) {
  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero h1 {
    font-size: 28px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .top {
    padding: 14px 16px;
  }
  main {
    padding: 18px 16px 40px;
  }
  .search-controls {
    flex-direction: column;
  }
  .location-btn {
    padding: 12px;
  }
}
