/* ===== CSS-Variablen ===== */
:root {
  --blau:       #2563EB;
  --blau-hell:  #EFF6FF;
  --blau-rand:  #BFDBFE;
  --gruen:      #16A34A;
  --orange:     #EA580C;
  --lila:       #7C3AED;
  --grau:       #6B7280;
  --grau-hell:  #F9FAFB;
  --grau-rand:  #E5E7EB;
  --text:       #111827;
  --text-leise: #6B7280;
  --weiss:      #ffffff;
  --radius:     12px;
  --radius-sm:  8px;
  --schatten:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --schatten-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --nav-hoehe:  56px;
  --bottom-nav: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--grau-hell);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav);
}
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== Top-Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--weiss);
  border-bottom: 1px solid var(--grau-rand);
  height: var(--nav-hoehe);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: var(--schatten);
}
.navbar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blau);
  flex: 1;
}
.navbar-logo span { color: var(--text); }
.navbar-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--grau);
  display: flex;
  align-items: center;
}
.navbar-btn:hover { background: var(--grau-hell); color: var(--text); }
.navbar-search {
  flex: 1;
  max-width: 300px;
  position: relative;
}
.navbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--grau-rand);
  border-radius: 20px;
  font-size: .875rem;
  background: var(--grau-hell);
  outline: none;
  transition: border-color .15s;
}
.navbar-search input:focus {
  border-color: var(--blau);
  background: var(--weiss);
}
.navbar-search .suche-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grau);
  pointer-events: none;
}

/* ===== Bottom Navigation (Mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--weiss);
  border-top: 1px solid var(--grau-rand);
  height: var(--bottom-nav);
  display: flex;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -1px 3px rgba(0,0,0,.06);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--grau);
  text-decoration: none;
  font-size: .65rem;
  font-weight: 500;
  border-radius: 0;
  transition: color .15s;
}
.bottom-nav-item.aktiv { color: var(--blau); }
.bottom-nav-item:hover { color: var(--blau); text-decoration: none; }
.bottom-nav-item .nav-icon { font-size: 1.4rem; line-height: 1; }
.bottom-nav-neu {
  flex: 1.2;
}
.bottom-nav-neu .nav-icon {
  background: var(--blau);
  color: var(--weiss);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}

/* ===== Desktop-Navigation ===== */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .navbar-logo { font-size: 1.375rem; }
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .desktop-nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--grau);
    font-size: .875rem;
    font-weight: 500;
    transition: all .15s;
  }
  .desktop-nav-link:hover { background: var(--grau-hell); color: var(--text); text-decoration: none; }
  .desktop-nav-link.aktiv { background: var(--blau-hell); color: var(--blau); }
  .btn-neu-desktop {
    background: var(--blau);
    color: var(--weiss) !important;
    padding: 8px 18px !important;
  }
  .btn-neu-desktop:hover { background: #1D4ED8; }
}
@media (max-width: 767px) {
  .desktop-nav { display: none; }
}

/* ===== Layout & Container ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
@media (min-width: 768px) {
  .container { padding: 24px 20px; }
}

/* ===== Karten / Cards ===== */
.card {
  background: var(--weiss);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }

/* ===== Eintrag-Zeile (Listenansicht) ===== */
.eintrag-gruppe { margin-bottom: 24px; }
.eintrag-gruppe-titel {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-leise);
  padding: 0 4px;
  margin-bottom: 8px;
}
.eintrag-liste { display: flex; flex-direction: column; gap: 2px; }
.eintrag-zeile {
  background: var(--weiss);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--grau-rand);
  transition: box-shadow .15s, border-color .15s;
}
.eintrag-zeile:hover {
  box-shadow: var(--schatten-md);
  border-color: var(--blau-rand);
  text-decoration: none;
  color: var(--text);
}
.eintrag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.eintrag-info { flex: 1; min-width: 0; }
.eintrag-name {
  font-weight: 600;
  font-size: .9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eintrag-meta {
  font-size: .8125rem;
  color: var(--text-leise);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.eintrag-rechts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.eintrag-bewertung { font-size: .8125rem; color: #F59E0B; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .6875rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-vielleicht { background: #F3F4F6; color: #374151; }
.badge-geplant    { background: #FEF3C7; color: #92400E; }
.badge-gefahren   { background: #DCFCE7; color: #166534; }
.badge-default    { background: var(--grau-hell); color: var(--grau); }
.badge-blau       { background: var(--blau-hell); color: var(--blau); }

/* ===== Filter-Leiste ===== */
.filter-leiste {
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--schatten);
}
.filter-zeile {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--grau-rand);
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  background: var(--weiss);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--blau); }

/* ===== Formular ===== */
.form-gruppe { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-label .pflicht { color: var(--blau); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--grau-rand);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  background: var(--weiss);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blau);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hilfe {
  font-size: .8125rem;
  color: var(--text-leise);
  margin-top: 4px;
}
.form-zeile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== GPS-Button ===== */
.gps-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blau);
  color: var(--weiss);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background .15s;
}
.gps-btn:hover { background: #1D4ED8; }
.gps-btn:active { background: #1E40AF; }
.gps-btn.laden { opacity: .7; cursor: wait; }

/* ===== Sterne-Auswahl ===== */
.sterne-gruppe { display: flex; gap: 4px; }
.stern-label {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--grau-rand);
  transition: color .1s;
  padding: 2px;
}
.stern-input { display: none; }
.stern-input:checked ~ .stern-label,
.stern-label:hover,
.stern-label:hover ~ .stern-label { color: #F59E0B; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blau); color: var(--weiss); }
.btn-primary:hover { background: #1D4ED8; color: var(--weiss); }
.btn-secondary {
  background: var(--weiss);
  color: var(--text);
  border: 1px solid var(--grau-rand);
}
.btn-secondary:hover { background: var(--grau-hell); }
.btn-danger { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FECACA; }
.btn-sm { padding: 6px 14px; font-size: .8125rem; }
.btn-gruen { background: #DCFCE7; color: #166534; }
.btn-gruen:hover { background: #BBF7D0; }

/* ===== Detail-Ansicht ===== */
.detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--grau-rand);
}
.detail-titel {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-leise);
  font-size: .875rem;
}
.detail-body { padding: 20px; }
.detail-feld { margin-bottom: 14px; }
.detail-feld-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-leise);
  margin-bottom: 3px;
}
.detail-feld-wert { font-size: .9375rem; color: var(--text); }

/* ===== Mini-Karte ===== */
#mini-karte {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--grau-rand);
  margin-bottom: 16px;
}
#haupt-karte {
  width: 100%;
  height: calc(100vh - var(--nav-hoehe) - var(--bottom-nav) - 120px);
  min-height: 400px;
}
@media (min-width: 768px) {
  #haupt-karte { height: calc(100vh - var(--nav-hoehe) - 60px); }
}

/* ===== Flash-Nachrichten ===== */
.flash-container {
  position: fixed;
  top: calc(var(--nav-hoehe) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(400px, 90vw);
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--schatten-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: flash-ein .2s ease;
}
.flash-erfolg { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.flash-fehler { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
@keyframes flash-ein {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Leer-Zustand ===== */
.leer-zustand {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-leise);
}
.leer-zustand-icon { font-size: 3rem; margin-bottom: 12px; }
.leer-zustand h3 { font-size: 1.125rem; color: var(--text); margin-bottom: 8px; }

/* ===== Trennlinie ===== */
.trenner { border: none; border-top: 1px solid var(--grau-rand); margin: 20px 0; }

/* ===== Tag-Cloud ===== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--blau-hell);
  color: var(--blau);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 500;
}

/* ===== Überschrift + Aktions-Leiste ===== */
.seite-kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.seite-titel {
  font-size: 1.125rem;
  font-weight: 700;
  flex: 1;
}
.anzahl-badge {
  background: var(--blau-hell);
  color: var(--blau);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 600;
}

/* ===== Modal (Lösch-Bestätigung) ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal-overlay.offen { display: flex; }
.modal {
  background: var(--weiss);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { margin-bottom: 10px; }
.modal p { color: var(--text-leise); font-size: .9375rem; margin-bottom: 20px; }
.modal-btn-zeile { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Karte-Ansicht Toggle ===== */
.ansicht-toggle {
  display: flex;
  background: var(--grau-hell);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.ansicht-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--grau);
  transition: all .15s;
}
.ansicht-btn.aktiv {
  background: var(--weiss);
  color: var(--blau);
  box-shadow: var(--schatten);
}

/* ===== Offline-Banner ===== */
.offline-banner {
  display: none;
  background: #FEF3C7;
  color: #92400E;
  text-align: center;
  padding: 8px;
  font-size: .875rem;
  font-weight: 500;
}
body.offline .offline-banner { display: block; }

/* ===== Utility ===== */
.versteckt { display: none !important; }
.text-leise { color: var(--text-leise); }
.text-sm { font-size: .875rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.flex-end { justify-content: flex-end; }
