/* ══════════════════════════════════════════════════════
   AED Leitstellen-Finder – Stylesheet
   Bootstrap 5 + Font Awesome 6 + Roboto
   ══════════════════════════════════════════════════════ */

:root {
  --red:        #d41317;
  --red-dark:   #93130a;
  --black:      #000000;
  --dark:       #3d3d3d;
  --gray:       #9c9c9c;
  --light:      #dadada;
  --white:      #ffffff;
  --green:      #289b38;
  --bg:         #f4f4f4;

  --font:       'Roboto', sans-serif;
  --font-cond:  'Roboto Condensed', sans-serif;
  --radius:     6px;
  --shadow:     0 2px 12px rgba(0,0,0,.10);
  --shadow-lg:  0 6px 32px rgba(0,0,0,.13);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────── */
.aed-navbar {
  background: var(--black);
  padding: .75rem 0;
  display: flex;
  align-items: center;
}
.aed-navbar .container-fluid {
  display: flex;
  align-items: center;
}

.badge-112 {
  background: var(--red);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cond);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  flex-shrink: 0;
  gap: 1px;
}
.badge-112 i { font-size: 1.1rem; }
.badge-112 span { line-height: 1; }

.site-title {
  font-family: var(--font-cond);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
.site-sub {
  font-size: .72rem;
  color: var(--gray);
  font-weight: 300;
}

.verified-badge {
  background: rgba(40,155,56,.15);
  color: #5cd970;
  border: 1px solid rgba(40,155,56,.35);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .72rem;
  font-weight: 500;
}

/* ── Status-Banner ───────────────────────────────────── */
.status-banner {
  padding: .55rem 1.5rem;
  font-size: .8rem;
  font-weight: 500;
  text-align: center;
  transition: all .3s ease;
}
.status-loading { background: #2a2a2a; color: var(--gray); }
.status-ok      { background: #1a3320; color: #5cd970; }
.status-warn    { background: #332a00; color: #ffc107; }
.status-error   { background: #2d1010; color: #ff6b6b; }

/* ── Hero ────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(160deg, var(--black) 0%, #1a0a0a 50%, #2a0808 100%);
  padding: 3.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(212,19,23,.12) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(147,19,10,.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-cond);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: .5rem;
}
.hero-title i { color: var(--red); }

.hero-sub {
  color: var(--gray);
  font-weight: 300;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Suchkarte */
.search-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  margin-bottom: 1.25rem;
}

.input-group-text.search-prefix {
  background: var(--red);
  border: none;
  color: #fff;
  font-size: 1rem;
  border-radius: var(--radius) 0 0 var(--radius) !important;
}

.plz-input {
  background: rgba(255,255,255,.08) !important;
  border: none !important;
  border-left: 1px solid rgba(255,255,255,.1) !important;
  color: #fff !important;
  font-family: var(--font-cond);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .1em;
  border-radius: 0 !important;
}
.plz-input::placeholder { color: rgba(255,255,255,.3) !important; font-weight: 300; letter-spacing: 0; }
.plz-input:focus { box-shadow: none !important; background: rgba(255,255,255,.12) !important; }

.btn-search {
  background: var(--red);
  border: none;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-cond);
  letter-spacing: .05em;
  padding: 0 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  transition: background .2s;
}
.btn-search:hover { background: var(--red-dark); color: #fff; }

/* Ergebnisbereich */
.result-idle {
  text-align: center;
  color: rgba(255,255,255,.35);
  padding: 2rem 1rem;
  font-weight: 300;
  font-size: .9rem;
  line-height: 1.7;
}

.result-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  animation: slideIn .25s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.plz-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .35rem;
}
.ls-name {
  font-family: var(--font-cond);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .3rem;
}
.ls-addr {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  line-height: 1.5;
  margin-bottom: .75rem;
}
.ls-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 3px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.tag-c3 { background: rgba(40,155,56,.25); color: #5cd970; }
.tag-c2 { background: rgba(212,19,23,.25); color: #ff8080; }

.aed-link-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-cond);
  letter-spacing: .05em;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: background .2s, transform .1s;
}
.aed-link-btn:hover { background: #1e7a2a; color: #fff; transform: translateY(-1px); }
.aed-link-btn svg { width: 16px; height: 16px; }

.aed-placeholder {
  font-size: .8rem;
  color: rgba(255,255,255,.35);
  font-style: italic;
}

.error-card {
  background: rgba(212,19,23,.12);
  border: 1px solid rgba(212,19,23,.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: #ff8080;
  font-size: .88rem;
  line-height: 1.6;
  animation: slideIn .25s ease;
}
.error-card strong { color: #ffaaaa; display: block; margin-bottom: .25rem; }

/* ── Content-Karten ──────────────────────────────────── */
.content-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.card-section-title {
  font-family: var(--font-cond);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--light);
}
.card-section-title i { color: var(--red); }

/* Steps */
.steps { display: flex; flex-direction: column; gap: .85rem; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.step-num {
  background: var(--red);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--black);
  margin-bottom: .1rem;
}
.step-text {
  font-size: .8rem;
  color: var(--gray);
  line-height: 1.5;
}

/* BL-Grid */
.bl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .5rem;
}
.bl-item {
  background: var(--bg);
  border: 1px solid var(--light);
  border-radius: var(--radius);
  padding: .6rem .5rem;
  text-align: center;
  cursor: default;
  transition: all .2s;
}
.bl-item:hover {
  border-color: var(--red);
  background: #fff0f0;
}
.bl-item.active {
  background: var(--red);
  border-color: var(--red-dark);
  color: #fff;
}
.bl-code {
  display: block;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .05em;
}
.bl-count {
  display: block;
  font-size: .65rem;
  color: var(--gray);
  margin-top: 1px;
}
.bl-item.active .bl-count { color: rgba(255,255,255,.75); }

/* Statistiken */
.stat-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.stat-icon { color: var(--red); font-size: 1.2rem; }
.stat-num {
  font-family: var(--font-cond);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1;
}
.stat-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray); }

/* ── Footer ──────────────────────────────────────────── */
.aed-footer {
  background: var(--dark);
  color: var(--gray);
  padding: 1.25rem 0;
  margin-top: 2rem;
}
.legend-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 3px;
}
.legend-badge.c3 { background: rgba(40,155,56,.25); color: #5cd970; }
.legend-badge.c2 { background: rgba(212,19,23,.25); color: #ff8080; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 576px) {
  .hero-section { padding: 2rem 0 2.5rem; }
  .site-title { font-size: 1rem; }
  .site-sub { display: none; }
  .verified-badge { display: none; }
  .stat-num { font-size: 1.25rem; }
}

/* ══════════════════════════════════════════════════════
   Eingebettete Karte (index.html)
   ══════════════════════════════════════════════════════ */

/* Karten-Header */
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1rem;
  background: var(--dark);
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
  gap: .5rem;
  min-height: 44px;
}
.map-header-title {
  font-family: var(--font-cond);
  font-size: .82rem;
  font-weight: 700;
  color: #ccc;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.map-legend-inline {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  color: #888;
  flex-wrap: wrap;
}
.mli-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Leaflet-Overrides für eingebettete Karte */
#mainMap .leaflet-control-attribution {
  background: rgba(0,0,0,.6) !important;
  color: #555 !important;
  font-size: .55rem !important;
}
#mainMap .leaflet-control-attribution a { color: #777 !important; }

#mainMap .leaflet-control-zoom a {
  background: #1a1a1a !important;
  color: #aaa !important;
  border-color: #333 !important;
}
#mainMap .leaflet-control-zoom a:hover {
  background: #2a2a2a !important;
  color: #fff !important;
}

/* Tooltip Styling */
.leaflet-tooltip.tt-kreis {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.leaflet-tooltip.tt-kreis::before { display: none; }

.tt-box {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: .75rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
  min-width: 220px;
  max-width: 340px;         /* genug Platz auch für lange Namen */
  width: max-content;       /* wächst mit dem Inhalt */
}
.tt-head {
  padding: .4rem .7rem;
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: normal;      /* Umbruch erlauben bei sehr langen Namen */
  word-break: break-word;
}
.tt-content {
  padding: .45rem .7rem;
}
.tt-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;  /* bei Umbruch oben ausrichten */
  gap: .75rem;
  padding: .12rem 0;
  border-bottom: 1px solid #222;
  font-size: .72rem;
}
.tt-line:last-child { border-bottom: none; }
.tt-lbl { color: #666; flex-shrink: 0; }
.tt-val {
  color: #ddd;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}
.tt-name {
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.2;
}
.tt-type {
  font-weight: 400;
  font-size: .65rem;
  opacity: .75;
  margin-top: 1px;
}
.tt-badge-yes { color: #5cd970; }
.tt-badge-no  { color: #888; }

/* Popup Overrides */
.leaflet-popup-content-wrapper {
  background: #1a1a1a !important;
  border: 1px solid #333 !important;
  border-radius: 8px !important;
  color: #fff !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.7) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  font-family: 'Roboto', sans-serif;
  min-width: 240px;
}
.leaflet-popup-tip { background: #1a1a1a !important; }
.leaflet-popup-close-button {
  color: #666 !important;
  top: 8px !important;
  right: 10px !important;
  font-size: 1rem !important;
}
.popup-head {
  padding: .7rem 2rem .7rem 1rem;
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  border-radius: 7px 7px 0 0;
}
.popup-body {
  padding: .75rem 1rem;
  font-size: .8rem;
}
.popup-sec { margin-bottom: .7rem; }
.popup-sec:last-child { margin-bottom: 0; }
.popup-sec-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
  margin-bottom: .2rem;
}
.popup-ls { font-family: 'Roboto Condensed', sans-serif; font-size: .95rem; font-weight: 700; }
.popup-addr { color: #888; font-size: .75rem; line-height: 1.4; }
.popup-eh-yes { color: #5cd970; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.popup-eh-no  { color: #555; font-style: italic; }
.popup-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.popup-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  font-family: 'Roboto Condensed', sans-serif;
  text-decoration: none;
  letter-spacing: .03em;
  transition: background .15s;
}
.popup-btn-green { background: #289b38; color: #fff; }
.popup-btn-green:hover { background: #1e7a2a; color: #fff; }
.popup-btn-red   { background: var(--red); color: #fff; }
.popup-btn-red:hover { background: var(--red-dark); color: #fff; }

/* Highlight-Pulse für gefundenen Kreis */
@keyframes pulse-ring {
  0%   { stroke-width: 1px; stroke-opacity: 1; }
  100% { stroke-width: 5px; stroke-opacity: 0; }
}
