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

:root {
    --bg:           #0f1117;
    --bg2:          #1a1d27;
    --bg3:          #22263a;
    --border:       #2e3250;
    --text:         #e2e6f0;
    --text-muted:   #7a80a0;
    --primary:      #4A90E2;
    --gruen:        #7ED321;
    --rot:          #E05252;
    --orange:       #F5A623;
    --radius:       10px;
    --shadow:       0 4px 20px rgba(0,0,0,0.4);
    --transition:   0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Container ─────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Navigation ────────────────────────────────────────────────────── */
nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.nav-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text);
    text-decoration: none;
}

/* ── Hero / Suchbereich ────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 48px 0 32px;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ── Filter Leiste ─────────────────────────────────────────────────── */
.filter-leiste {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

select,
input[type="text"],
input[type="number"] {
    background: var(--bg2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
    cursor: pointer;
}

select:hover,
select:focus,
input:focus {
    border-color: var(--primary);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 9px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--text);
}

/* ── Karte ─────────────────────────────────────────────────────────── */
#karte {
    width: 100%;
    height: 380px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 28px;
    z-index: 1;
}

.karten-marker {
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ── Tankstellen Liste ─────────────────────────────────────────────── */
.liste-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.liste-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.liste-header span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

#tankstellen-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Tankstellen Karte ─────────────────────────────────────────────── */
.tank-karte {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color var(--transition), transform var(--transition);
    cursor: pointer;
}

.tank-karte:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.tank-karte:hover {
    box-shadow: var(--shadow);
}

.tank-marke {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.tank-details {
    flex: 1;
    min-width: 0;
}

.tank-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tank-adresse {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

.tank-entfernung {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 3px;
}

.tank-preise {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.tank-preis-item {
    text-align: center;
}

.tank-preis-item .sorte {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tank-preis-item .wert {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.wert.guenstig { color: var(--gruen); }
.wert.teuer    { color: var(--rot);   }
.wert.mittel   { color: var(--text);  }

.tank-verlauf-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color var(--transition);
}

.tank-verlauf-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ── Lade Zustand ──────────────────────────────────────────────────── */
.lade-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.lade-spinner::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: drehen 0.8s linear infinite;
}

@keyframes drehen {
    to { transform: rotate(360deg); }
}

/* ── Kein Ergebnis ─────────────────────────────────────────────────── */
.kein-ergebnis {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.kein-ergebnis .icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ── Durchschnitt Banner ───────────────────────────────────────────── */
.durchschnitt-banner {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.durchschnitt-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.durchschnitt-item .label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.durchschnitt-item .wert {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ── Verlauf Seite ─────────────────────────────────────────────────── */
.zurueck-btn {
    display: inline-block;
    margin: 24px 0 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.zurueck-btn:hover {
    color: var(--text);
    text-decoration: none;
}

.station-header {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.station-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.station-adresse {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.aktuelle-preise {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.preis-badge {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    min-width: 90px;
}

.preis-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.preis-wert {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}

.preis-aktualisiert {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Zeitraum Buttons ──────────────────────────────────────────────── */
.zeitraum-auswahl {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.zeitraum-btn {
    background: var(--bg2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.zeitraum-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.zeitraum-btn.aktiv {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ── Sorten Checkboxen ─────────────────────────────────────────────── */
.sorten-auswahl {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sorten-auswahl label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.sorten-auswahl input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    font-weight: 600;
}

.e10-farbe    { color: #4A90E2; }
.e5-farbe     { color: #7ED321; }
.diesel-farbe { color: #F5A623; }

/* ── Chart Bereich ─────────────────────────────────────────────────── */
.chart-bereich {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    min-height: 300px;
}

.chart-lade {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

#preis-chart {
    max-height: 320px;
}

/* ── Statistik ─────────────────────────────────────────────────────── */
.statistik-bereich {
    margin-bottom: 28px;
}

.statistik-bereich h2,
.bestzeit-bereich h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.statistik-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.statistik-karte {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.statistik-karte h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-zeile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.stat-zeile:last-child {
    border-bottom: none;
}

.stat-zeile span {
    color: var(--text-muted);
}

.gruen { color: var(--gruen); }
.rot   { color: var(--rot);   }

/* ── Beste Tankzeit ────────────────────────────────────────────────── */
.bestzeit-bereich {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.bestzeit-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

#bestzeit-chart {
    max-height: 200px;
    margin-bottom: 16px;
}

.bestzeit-tipp {
    background: rgba(126, 211, 33, 0.08);
    border: 1px solid rgba(126, 211, 33, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--gruen);
}

.bestzeit-tipp strong {
    font-weight: 700;
}

/* ── Footer ────────────────────────────────────────────────────────── */
footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--text);
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .tank-karte {
        flex-wrap: wrap;
    }

    .tank-preise {
        gap: 8px;
    }

    .aktuelle-preise {
        gap: 10px;
    }

    .preis-badge {
        min-width: 75px;
        padding: 10px 14px;
    }

    .preis-wert {
        font-size: 1.1rem;
    }

    .statistik-grid {
        grid-template-columns: 1fr;
    }

    #karte {
        height: 260px;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .filter-leiste {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-leiste select,
    .filter-leiste button {
        width: 100%;
    }

    .durchschnitt-banner {
        gap: 14px;
    }
}

/* ── Nav Aktiv Link ────────────────────────────────────────────────── */
.nav-links a.aktiv {
    color: var(--text);
    font-weight: 600;
}

/* ── Mobil Menü Button ─────────────────────────────────────────────── */
.mobil-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobil-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Burger → X Animation */
.mobil-menu-btn.offen span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobil-menu-btn.offen span:nth-child(2) {
    opacity: 0;
}
.mobil-menu-btn.offen span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobil Menü Dropdown ───────────────────────────────────────────── */
.mobil-menu {
    display: none;
    flex-direction: column;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 8px 0;
}

.mobil-menu a {
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color var(--transition), background var(--transition);
}

.mobil-menu a:hover {
    color: var(--text);
    background: var(--bg3);
    text-decoration: none;
}

.mobil-menu.offen {
    display: flex;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-sub {
    font-size: 0.78rem;
    opacity: 0.6;
}

/* ── Responsive Nav ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobil-menu-btn {
        display: flex;
    }
}

