/* =====================================================================
   My-Womo.Rocks Adventures — Design System v2
   Inspired by AdventureLog · Sidebar layout · Modern dark nav
   ===================================================================== */

/* ── Variables ────────────────────────────────────────────────────── */
:root {
    --primary:          #1abc9c;
    --primary-dark:     #16a085;
    --primary-light:    #d1fae5;
    --primary-50:       #f0fdf9;

    --sidebar-bg:       #1a2332;
    --sidebar-border:   rgba(255,255,255,.06);
    --sidebar-hover:    rgba(255,255,255,.07);
    --sidebar-active-bg:rgba(26,188,156,.15);
    --sidebar-active-text: #1abc9c;
    --sidebar-text:     #94a3b8;
    --sidebar-text-hover:#e2e8f0;
    --sidebar-width:    240px;

    --topbar-height:    62px;

    --bg-body:          #f0f4f8;
    --bg-card:          #ffffff;
    --bg-subtle:        #f8fafc;

    --text-main:        #1e293b;
    --text-secondary:   #475569;
    --text-muted:       #94a3b8;

    --border:           #e2e8f0;
    --border-strong:    #cbd5e1;

    --shadow-xs: 0 1px 2px 0 rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
    --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.05);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition: .18s cubic-bezier(.4,0,.2,1);
    --transition-slow: .3s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ── App Shell (Sidebar + Content) ───────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-slow);
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    text-decoration: none;
    min-height: var(--topbar-height);
}

.sidebar-logo-icon {
    width: 34px; height: 34px;
    
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -.01em;
}
.sidebar-logo-sub {
    font-size: 0.68rem;
    color: var(--sidebar-text);
    font-weight: 400;
}

/* Nav sections */
.sidebar-section {
    padding: 0.75rem 0.625rem 0.5rem;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0.5rem 0.5rem 0.35rem;
}

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    margin-bottom: 2px;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: .7;
    display: flex; align-items: center; justify-content: center;
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
    opacity: 1;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.625rem 0.625rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.625rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* User chip in sidebar footer */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,.04);
    border: 1px solid var(--sidebar-border);
}

.sidebar-user-avatar {
    width: 30px; height: 30px;
    border-radius: var(--radius-full);
    background: var(--sidebar-active-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sidebar-text-hover);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── App Main ─────────────────────────────────────────────────────── */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
    flex-shrink: 0;
}

.topbar-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.topbar-hamburger:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
}

.topbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Main Content ─────────────────────────────────────────────────── */
.app-content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Page Header ──────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -.02em;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--bg-subtle, #f8fafc);
    display: block;
}

.card-body {
    padding: 1rem 1.125rem 1.125rem;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.card-cover-placeholder {
    height: 180px;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* ── Stat Cards ───────────────────────────────────────────────────── */
/* Fluides Raster: die Spaltenzahl passt sich der verfügbaren Breite an, jede Kachel ist
   mindestens so breit, dass Zahl und Label einzeilig hineinpassen — nichts wird umgebrochen.
   `min(100%, 16rem)` verhindert horizontalen Überlauf, wenn der Viewport schmaler als die
   Mindestbreite ist. Gemeinsam genutzt von Dashboard, Statistiken, Budget, öffentlichem Dashboard. */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: clamp(0.9rem, 0.55rem + 1.1vw, 1.375rem);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 0.3rem + 1vw, 1rem);
    min-width: 0;
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-icon {
    width: clamp(38px, 30px + 2vw, 48px);
    height: clamp(38px, 30px + 2vw, 48px);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(1.05rem, 0.85rem + 0.7vw, 1.375rem);
    flex-shrink: 0;
}

.stat-icon.green  { background: #d1fae5; }
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.rose   { background: #ffe4e6; }
.stat-icon.sky    { background: #e0f2fe; }

.stat-content { min-width: 0; overflow: hidden; }

.stat-number {
    font-size: clamp(1.2rem, 0.95rem + 1.25vw, 1.625rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.05;
    letter-spacing: -.02em;
    white-space: nowrap;            /* Zahlen nie umbrechen */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Geldbeträge haben mehr Zeichen (Tausenderpunkte + „ €") → etwas kleiner skaliert */
.stat-number--money {
    font-size: clamp(0.95rem, 0.7rem + 1vw, 1.3rem);
}

.stat-label {
    font-size: clamp(0.66rem, 0.6rem + 0.25vw, 0.75rem);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;            /* Label einzeilig, kein Wortumbruch */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Section Heading ──────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
}

.section-link {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
}

.section-link:hover { color: var(--primary-dark); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    letter-spacing: -.01em;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26,188,156,.3);
}

.btn-primary:active { transform: scale(.98); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background var(--transition);
}

.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 0.4375rem;
    border-radius: var(--radius-sm);
    width: 32px; height: 32px;
    justify-content: center;
}

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-primary { background: rgba(26,188,156,.12); color: #0d9488; }
.badge-gray    { background: #f1f5f9; color: #64748b; }
.badge-public  { background: #dcfce7; color: #16a34a; }
.badge-private { background: #fee2e2; color: #dc2626; }
.badge-blue    { background: #dbeafe; color: #2563eb; }
.badge-amber   { background: #fef3c7; color: #d97706; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-control {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-main);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,188,156,.14);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Filter bar */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

/* ── Tables ───────────────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.table th {
    background: var(--bg-subtle);
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.table td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-secondary);
}

.table td:first-child { color: var(--text-main); font-weight: 500; }

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-subtle); }

/* ── Alerts / Flash ───────────────────────────────────────────────── */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    border: 1px solid transparent;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ── Rating Stars ─────────────────────────────────────────────────── */
.rating-stars { color: #f59e0b; font-size: 0.875rem; letter-spacing: 1px; }
.rating-stars .empty { color: #d1d5db; }

/* ── Titelbild-Hero mit Blur-Fill (Ansichtsmodus) ─────────────────── */
/* Das Titelbild wird komplett gezeigt (object-fit:contain); der freie Rand wird von
   einer unscharfen, vergrößerten Kopie desselben Bildes gefüllt. Genutzt auf
   adventures/show.php und collections/show.php. */
.cover-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    height: clamp(240px, 40vh, 420px);
    background: #0b1220;              /* Fallback hinter dem Blur, falls Bild fehlt/lädt */
}
.cover-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(30px) brightness(0.72) saturate(1.15);
    transform: scale(1.18);          /* überdeckt die durch den Blur ausgefransten Kanten */
    pointer-events: none;
}
.cover-hero__img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;             /* komplettes Titelbild sichtbar */
}
.cover-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}
@media (max-width: 640px) {
    .cover-hero { height: clamp(200px, 46vw, 300px); }
}

/* ── Map ──────────────────────────────────────────────────────────── */
#map, .map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}
/* Leaflet vergibt intern hohe z-indizes (Panes 400, Controls/Ecken 1000). Ohne eigenen
   Stacking-Context konkurrieren die direkt mit App-Chrome (Topbar z-index 100, Sidebar 200,
   Sidebar-Overlay 150) und verdecken die Navigation — vor allem auf kleinen Screens mit
   Off-Canvas-Sidebar. Leaflet setzt am Container immer position:relative, daher genügt hier
   ein niedriger z-index: alle Karten-Interna bleiben darunter gekapselt.
   Das Karten-Vollbild (.map-container.map-expanded, höhere Spezifität) überschreibt das gezielt. */
.leaflet-container {
    z-index: 1;
}
.map-expand-btn {
    position: absolute;
    top: .5rem; right: .5rem;
    z-index: 1000;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow-xs);
}
.map-expand-btn:hover { background: var(--bg-subtle); }
.map-container.map-expanded,
.leaflet-container.map-expanded {
    position: fixed !important;
    inset: 1rem;
    z-index: 9997;
    width: auto !important;
    height: auto !important;
    box-shadow: var(--shadow-lg);
}
body.map-expand-lock { overflow: hidden; }

/* Hinweis "Strg + Scrollen zum Zoomen" — blendet kurz ein, wenn ohne Strg über der Karte gescrollt wird */
.map-scroll-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 998;
    text-align: center;
    padding: 1rem;
}
.map-scroll-hint.show { opacity: 1; }

/* ── Länder-Accordion (/countries) ───────────────────────────────── */
.country-expand-btn {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform .2s ease;
}
details[data-country-code][open] > summary .country-expand-btn { transform: rotate(180deg); }

/* ── Checklists ───────────────────────────────────────────────────── */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checklist-item.checked label {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ── Upload Zone ──────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.upload-zone p { color: var(--text-muted); font-size: 0.8125rem; margin-top: 0.5rem; }

/* ── Photo Grid ───────────────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.625rem;
}

.photo-thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-thumb .actions {
    position: absolute;
    top: 0; right: 0;
    display: none;
    gap: 0.25rem;
    padding: 0.375rem;
    background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, transparent 100%);
    width: 100%;
}

.photo-thumb:hover .actions { display: flex; }

/* ── Empty States ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.375rem; }
.empty-state-text  { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ── Mobile Overlay ───────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 150;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.open { display: block; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Panel (content sections inside pages) ───────────────────────── */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.panel-body { padding: 1.375rem; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9375rem 1.375rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
}

.panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 94vw;
    max-height: 92vh;
    border-radius: var(--radius);
    box-shadow: 0 25px 60px rgba(0,0,0,.6);
    animation: fadeIn .2s ease;
}
.lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,.12);
    transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }

/* Photo gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-subtle);
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}
.gallery-item:hover img { transform: scale(1.05); }

/* Schnellvorschau-Modal (Reiseplan-Einträge in Sammlungen) */
.preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.preview-modal.open { display: flex; }
.preview-modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: fadeIn .15s ease;
}
.preview-modal-close {
    position: absolute;
    top: .75rem; right: .75rem;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 1;
}
.preview-modal-close:hover { background: var(--border-strong); }
.preview-modal-content { padding: 1.5rem; }

/* ── Utility ──────────────────────────────────────────────────────── */
.text-primary   { color: var(--primary); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }

/* ── Animations ───────────────────────────────────────────────────── */
.fade-in {
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Leaflet Fixes ────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; box-shadow: var(--shadow-md) !important; }
.leaflet-popup-tip-container   { margin-top: -1px; }

/* ── Auth Layout ──────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 1.5rem;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

/* ── Public Layout ────────────────────────────────────────────────── */
/* Bewusst einfach gehalten (Wrap statt Scroll-Trick) — eine frühere Fassung mit
   `flex:1 1 auto` + `overflow-x:auto` + `min-width:0` auf dem <nav> wurde in freier Wildbahn
   als unsichtbar gemeldet (vermutlich ein Flexbox-Randfall in manchen Browsern, bei dem ein
   wachsender Flex-Child mit overflow ungewollt auf Breite 0 kollabiert). Diese Fassung
   verzichtet komplett auf flex-grow/min-width/overflow auf dem Nav und lässt die Kopfzeile
   bei Platzmangel stattdessen einfach zweizeilig umbrechen — kein Trick, der schiefgehen kann. */
.public-navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: .5rem;
    column-gap: 1.5rem;
    padding: .75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.public-navbar-logo {
    display: flex;
    align-items: center;
    gap: .625rem;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: auto;
}
.public-navbar-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .375rem 1.25rem;
}
.public-navbar-links a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
    color: #475569;
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
}
.public-navbar-links a:hover { color: #1abc9c; }

@media (max-width: 768px) {
    .public-navbar {
        padding: .75rem 1rem;
    }
    .public-navbar-logo div:last-child {
        display: none;
    }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-hamburger { display: flex; }

    .app-content { padding: 1rem; }

    .page-title { font-size: 1.125rem; }
    /* .stat-card / .stat-number skalieren jetzt fluide per clamp() — keine festen Overrides mehr nötig */
}

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
    .filter-bar { padding: 0.75rem; }
}

/* ── Geo-Autocomplete (Ortssuche) ─────────────────────────────────── */
.geo-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
}

.geo-suggestion {
    padding: .55rem .75rem;
    font-size: .8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.geo-suggestion:last-child { border-bottom: none; }

.geo-suggestion:hover {
    background: var(--primary-50);
    color: var(--text-main);
}

/* ── Command-Palette (Strg/Cmd+K) ─────────────────────────────────── */
.cmd-palette-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 500;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.cmd-palette-overlay.open { display: flex; }

.cmd-palette {
    width: min(560px, 92vw);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.cmd-palette-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}

.cmd-palette-results {
    max-height: 360px;
    overflow-y: auto;
    padding: .5rem;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
}

.cmd-palette-item.active { background: var(--primary-50); }

.cmd-palette-item-icon { flex-shrink: 0; }
.cmd-palette-item-title { flex: 1; font-size: .875rem; font-weight: 500; }
.cmd-palette-item-meta { font-size: .75rem; color: var(--text-muted); }

.cmd-palette-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
}

/* ── Markdown-Rendering (Reisebeschreibungen) ─────────────────────── */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-weight: 700;
    margin: 1em 0 .5em;
    line-height: 1.3;
}
.markdown-body h1 { font-size: 1.3em; }
.markdown-body h2 { font-size: 1.15em; }
.markdown-body h3 { font-size: 1.05em; }
.markdown-body p { margin: 0 0 .75em; }
.markdown-body ul, .markdown-body ol { margin: 0 0 .75em; padding-left: 1.5em; }
.markdown-body li { margin-bottom: .25em; }
.markdown-body a { color: var(--primary); text-decoration: underline; }
.markdown-body code {
    background: var(--bg-subtle);
    padding: .1em .35em;
    border-radius: 4px;
    font-size: .875em;
}
.markdown-body pre {
    background: var(--bg-subtle);
    padding: .75em 1em;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote {
    border-left: 3px solid var(--primary);
    margin: 0 0 .75em;
    padding-left: 1em;
    color: var(--text-muted);
}
.markdown-body img { max-width: 100%; border-radius: var(--radius-sm); }

.cmd-palette-hint {
    padding: .5rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: .72rem;
    color: var(--text-muted);
}
