/* Startseite: Suche, Kacheln, Kategorien-Browser, Ämter und Gemeinden. */
body { overflow-x: hidden; }

/* ── Suchbereich ─────────────────────────────────── */
.search-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1rem 1rem;
}

.search-inner { width: 100%; }

/* Auf breiten Bildschirmen wirkt der Suchbereich sonst verloren am linken
   Rand — hier zentriert und etwas größer, damit er als Blickfang steht. */
@media (min-width: 900px) {
  .search-inner {
    max-width: 900px;
    margin: 0 auto;
  }

  .search-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
  }

  .search-label-wrap { flex: none; }

  .search-eyebrow { font-size: 0.8rem; }
  .search-label { font-size: 3.4rem; }

  .search-sub {
    margin-left: auto;
    margin-right: auto;
    font-size: 1.15rem;
    max-width: 52ch;
  }

  .stats-bar { justify-content: center; font-size: 0.8rem; gap: 1.4rem; }

  .radar-widget { width: 120px; height: 120px; }

  .example-chips { justify-content: center; }
  .search-controls { justify-content: center; }
}

.search-label-wrap { flex: 1; min-width: 0; }

.search-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  opacity: 0.85;
}

.search-label {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.15;
}

.search-label span { color: var(--accent); }

.search-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
  max-width: 46ch;
}

.search-row {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.search-row:focus-within {
  border-color: var(--accent);
}

.was-field, .wo-field {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
}

.was-field { flex: 1; }
.wo-field { flex: 0 0 220px; }

.pill-divider {
  width: 1px;
  flex-shrink: 0;
  background: var(--border);
  margin: 0.55rem 0;
}

#search-input, #ort-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.85rem 0;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}

#search-input:focus, #ort-input:focus {
  outline: none;
}

#ort-input { padding-right: 1.9rem; }

#ort-gps-btn {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#ort-gps-btn svg { width: 16px; height: 16px; }
#ort-gps-btn:hover { background: var(--surface-hover); color: var(--accent); }
#ort-gps-btn.active { color: var(--success); }
#ort-gps-btn.loading { animation: spin 0.9s linear infinite; }

.wo-field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  min-height: 1em;
}

.wo-field-hint.error { color: var(--danger); }

#search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0 999px 999px 0;
  margin: -1px -1px -1px 0;
  padding: 0 1.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: background 0.15s;
  flex-shrink: 0;
}

#search-btn:hover { background: var(--accent-hover); }

@media (max-width: 680px) {
  .search-row { flex-direction: column; border-radius: var(--radius-lg); }
  .pill-divider { width: auto; height: 1px; margin: 0 1.1rem; }
  .was-field, .wo-field { padding: 0.15rem 1.1rem; }
  /* Untereinander wirkt die Breitenvorgabe der Suchzeile auf die Höhe: Ortsfeld sonst 220 px hoch. */
  .was-field, .wo-field { flex: 0 0 auto; }
  #search-btn {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin: 0 -1px -1px -1px;
    padding: 0.85rem 1rem;
  }
}

/* Beispiel-Chips */
.example-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.example-chips-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
}

.example-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Autocomplete */
.autocomplete-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  display: none;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.1s;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--surface-hover);
}

.ac-amt-badge {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.85;
  white-space: nowrap;
  flex-shrink: 0;
}

.autocomplete-item .emoji { font-size: 1.1rem; width: 1.4rem; text-align: center; flex-shrink: 0; }

/* Kontroll-Leiste */
.search-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.radius-group {
  display: flex;
  gap: 0.25rem;
}

.radius-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}

.radius-btn.active,
.radius-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(249,115,22,0.08);
}

/* ── Schnellzugriff-Kacheln ──────────────────────── */
.hub-tiles {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.hub-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hub-tile:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hub-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
}

.hub-tile-icon svg { width: 20px; height: 20px; }

.hub-tile-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.hub-tile-title { font-weight: 700; font-size: 0.98rem; }
.hub-tile-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }

@media (max-width: 780px) {
  .hub-tiles { grid-template-columns: 1fr; }
}

/* Sticky Nav ausgleichen, wenn per Anker hierher gesprungen wird */
#aemter-section, #gemeinden-section, #browse-section {
  scroll-margin-top: 72px;
}

/* ── Karte ───────────────────────────────────────── */
.map-wrap {
  position: relative;
}

.map-wrap[hidden] {
  display: none;
}

#map {
  width: 100%;
  height: 36vh;
  min-height: 260px;
  max-height: 420px;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
}

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.map-hint.hidden {
  opacity: 0;
}

@media (max-width: 480px) {
  .map-hint { display: none; }
}

/* ── Ergebnisse ──────────────────────────────────── */
#results-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

#results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

#results-count strong { color: var(--accent); }

.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.result-item:hover { border-color: var(--accent); }

.result-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.result-body { flex: 1; min-width: 0; }

.result-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-addr {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.result-dist {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.result-hours {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-gmaps {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  align-self: center;
}

.result-gmaps:hover {
  border-color: #4285f4;
  color: #4285f4;
}

/* ── Leer / Fehler ───────────────────────────────── */
.search-placeholder {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-placeholder .big { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

/* ── Stats-Bar ───────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stats-bar span { display: flex; align-items: center; gap: 0.25rem; }

/* ── Kategorien-Browser ──────────────────────────── */
.browse-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 0.25rem;
}

.browse-group { margin-bottom: 0.9rem; }

.browse-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.browse-chips-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.quick-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font);
}

.quick-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(249,115,22,0.06);
}

/* ── Ämter-Sektion ───────────────────────────────── */
.aemter-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 1rem 0.5rem;
}

.section-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  opacity: 0.85;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.aemter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.gemeinden-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1rem;
}

.gemeinden-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.gemeinde-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.gemeinde-chip:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text);
}

.gemeinden-alle {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.gemeinden-alle:hover { text-decoration: underline; }

.amt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.85rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}

.amt-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.amt-card-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  padding-right: 3rem;
}

.amt-icon { font-size: 1.3rem; flex-shrink: 0; }

.amt-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.amt-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  line-height: 1.4;
}

.amt-addr {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.amt-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}

.amt-card:hover .amt-arrow { opacity: 1; }

.amt-badge {
  display: inline-block;
  font-size: 0.62rem;
  background: rgba(249,115,22,0.12);
  color: var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

@media (max-width: 560px) {
  .aemter-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.1rem; }
}

/* ── Modul-Shortcuts ─────────────────────────────── */
.modules-row {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.module-shortcut {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}

.module-shortcut:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.module-shortcut .icon { font-size: 1.6rem; display: block; margin-bottom: 0.3rem; }
.module-shortcut .name { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

/* ── Radar-Widget ────────────────────────────────── */
.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.radar-widget {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
}

.radar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.radar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.radar-trail {
  position: absolute;
  inset: 0;
  background: conic-gradient(
    transparent 0deg,
    transparent 255deg,
    rgba(249,115,22,0.04) 278deg,
    rgba(249,115,22,0.14) 305deg,
    rgba(249,115,22,0.36) 338deg,
    rgba(249,115,22,0.55) 358deg,
    transparent 360deg
  );
  animation: radarSpin 4s linear infinite;
}

.radar-arm-wrapper {
  position: absolute;
  inset: 0;
  animation: radarSpin 4s linear infinite;
}

.radar-arm {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.5px;
  height: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(249,115,22,0.05), rgba(249,115,22,0.95));
  border-radius: 1px;
}

.radar-ping {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #f97316;
  border-radius: 50%;
  box-shadow: 0 0 7px 2px rgba(249,115,22,0.7);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.ping-1 { top: 20%; left: 66%; animation: pingFade 4s 0.37s ease-out infinite; }
.ping-2 { top: 65%; left: 74%; animation: pingFade 4s 1.44s ease-out infinite; }
.ping-3 { top: 72%; left: 26%; animation: pingFade 4s 2.44s ease-out infinite; }

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pingFade {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.4); }
  4%   { opacity: 1;   transform: translate(-50%, -50%) scale(1.4); }
  14%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1);   }
  40%  { opacity: 0; }
  100% { opacity: 0; }
}

@media (max-width: 480px) {
  .search-label { font-size: 1.3rem; }
  .modules-row { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .module-shortcut { padding: 0.75rem 0.5rem; }
  .radar-widget { width: 68px; height: 68px; }
  .stats-bar { gap: 0.75rem; }
}

/* Leaflet Popup anpassen */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 12px 14px !important; min-width: 180px; }

/* ── Behördengänge: Zahlenleiste und Kacheln (modules/behoerden/uebersicht.js) ── */
.erledigen-section { max-width: 900px; margin: 0 auto; padding: 1rem 1rem 0.5rem; }
.zahlenleiste { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.zahl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.6rem 0.4rem; text-align: center; }
.zahl-wert { display: block; font-size: 1.35rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.zahl-label { display: block; font-size: 0.72rem; color: var(--text-muted); }
.erledigen-gruppe { margin-bottom: 0.75rem; }
.erledigen-gruppe-titel { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin: 0.6rem 0 0.45rem; }
.erledigen-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; margin-bottom: 0.5rem; }
.erledigen-tile { padding: 0.85rem 1rem; }
.erledigen-tile .tile-title { font-size: 0.95rem; }
.tile-kosten { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-top: 0.25rem; }
@media (max-width: 480px) {
  .zahlenleiste { grid-template-columns: repeat(2, 1fr); }
  .erledigen-grid { grid-template-columns: 1fr; }
}

/* Spritpreis-Teaser über der Suchzeile (modules/spritpreise/teaser.js).
   Ohne Preise rendert der Server nichts, dann fehlt der Block ganz. */
.sprit-teaser {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  margin: 0 0 0.7rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sprit-teaser-kopf { font-weight: 600; color: var(--text); }
.sprit-teaser-preis strong { color: var(--accent); }
.sprit-teaser-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.sprit-teaser-link:hover { text-decoration: underline; }
.sprit-teaser-quelle { font-size: 0.72rem; }
.sprit-teaser-quelle a { color: inherit; }

/* Preise in den Tankstellen-Treffern */
.result-preise {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  margin-top: 0.25rem;
}

.result-preis {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.result-preis-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-right: 0.25rem;
}

.result-preis-stand { font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 680px) {
  .sprit-teaser { font-size: 0.78rem; }
  .sprit-teaser-quelle { width: 100%; }
}
