/* ═══════════════════════════════════════════════
   eAutoDeal — Design System
   ═══════════════════════════════════════════════ */

:root {
    --bg: #0a0e17;
    --surface: #131825;
    --surface2: #1a2035;
    --border: rgba(255,255,255,0.08);
    --text: #e8eaf0;
    --text-light: #8892a4;
    --text-muted: #5c6578;
    --accent: #3b82f6;
    --accent-glow: rgba(59,130,246,0.15);
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface2: #f0f2f5;
    --border: rgba(0,0,0,0.08);
    --text: #1a1a2e;
    --text-light: #555b6e;
    --text-muted: #9ca3af;
    --accent-glow: rgba(59,130,246,0.1);
    --shadow: 0 2px 16px rgba(0,0,0,0.08);
    --green: #16a34a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
    background: rgba(19,24,37,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 12px 20px;
    display: flex; align-items: center; gap: 20px;
}
.logo {
    font-size: 1.3rem; font-weight: 800;
    color: var(--accent) !important;
    text-decoration: none !important;
}
.nav-links {
    display: flex; gap: 16px; flex: 1;
}
.nav-links a {
    color: var(--text-light); font-size: .9rem; font-weight: 500;
    padding: 6px 10px; border-radius: var(--radius-sm);
    transition: all .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.nav-toggle {
    display: none; background: none; border: none; color: var(--text);
    font-size: 1.5rem; cursor: pointer;
}
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); padding: 12px; border-bottom: 1px solid var(--border); }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ── HERO ── */
.hero {
    text-align: center; padding: 60px 20px 40px;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(34,197,94,0.05));
}
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.hero p { color: var(--text-light); font-size: 1.15rem; max-width: 600px; margin: 0 auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .95rem; cursor: pointer;
    border: none; transition: all .15s;
    text-decoration: none !important;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #2563eb; text-decoration: none; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); text-decoration: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #16a34a; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── CARDS ── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-2px); }

/* ── DEAL CARD ── */
.deal-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all .2s; position: relative;
}
.deal-card:hover { border-color: rgba(59,130,246,0.4); transform: translateY(-3px); box-shadow: var(--shadow); }
.deal-card-body { padding: 44px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.deal-vehicle { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.deal-variant { color: var(--text-light); font-size: .85rem; }
.deal-rate { font-size: 1.8rem; font-weight: 800; color: var(--accent); margin: 12px 0 4px; }
.deal-rate small { font-size: .85rem; font-weight: 400; color: var(--text-light); }
.deal-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.deal-meta span {
    font-size: .8rem; color: var(--text-light);
    background: var(--surface2); padding: 3px 8px; border-radius: 4px;
}
.deal-score {
    position: absolute; top: 12px; right: 12px;
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .85rem; color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.deal-type-badge {
    position: absolute; top: 12px; left: 12px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 4px; letter-spacing: .5px;
}
.badge-privat { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-gewerbe { background: rgba(168,85,247,0.2); color: #c084fc; }
.deal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.deal-total { font-size: .85rem; color: var(--text-light); }

/* ── GRIDS ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── FILTER BAR ── */
.filter-bar {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 24px;
}
.filter-bar .form-row {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: end;
}
.filter-bar .form-group { flex: 1; min-width: 120px; }
.filter-bar label { display: block; font-size: .75rem; color: var(--text-light); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ── FORMS ── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .85rem; color: var(--text-light); margin-bottom: 4px; font-weight: 600; }
.form-input {
    width: 100%; padding: 10px 12px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: .95rem; transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
select.form-input { cursor: pointer; }

/* ── SECTIONS ── */
.section { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* ── STATS ── */
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-card .stat-label { font-size: .85rem; color: var(--text-light); margin-top: 4px; }

/* ── CALCULATOR ── */
.calc-container {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
}
.calc-result {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(34,197,94,0.05));
    border-radius: var(--radius); padding: 20px; margin-top: 16px;
}
.calc-result .result-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.calc-result .result-row:last-child { border-bottom: none; }
.calc-result .result-total {
    font-size: 1.3rem; font-weight: 700; color: var(--accent);
    padding-top: 12px; margin-top: 8px; border-top: 2px solid var(--accent);
}

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; font-size: .8rem; color: var(--text-light);
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: .5px;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.data-table tr:hover td { background: var(--surface2); }

/* ── ADMIN ── */
.admin-nav { display: flex; gap: 12px; margin-bottom: 24px; }
.admin-nav a {
    padding: 8px 16px; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-light);
    font-size: .9rem; font-weight: 500; border: 1px solid var(--border);
}
.admin-nav a.active, .admin-nav a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ── SPEC GRID ── */
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.spec-item { background: var(--surface2); padding: 10px 14px; border-radius: var(--radius-sm); }
.spec-item .spec-label { font-size: .75rem; color: var(--text-light); text-transform: uppercase; }
.spec-item .spec-value { font-size: 1rem; font-weight: 700; }
@media (max-width: 768px) { .spec-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── SUBSIDY CARD ── */
.subsidy-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
}
.subsidy-badge {
    display: inline-block; font-size: .7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
}
.subsidy-bund { background: rgba(59,130,246,0.2); color: #60a5fa; }
.subsidy-land { background: rgba(34,197,94,0.2); color: #4ade80; }
.subsidy-kommunal { background: rgba(245,158,11,0.2); color: #fbbf24; }

/* ── COMPARE BAR ── */
.compare-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 2px solid var(--accent);
    padding: 12px 20px; display: flex; align-items: center; gap: 12px;
    z-index: 99; transform: translateY(100%); transition: transform .2s;
}
.compare-bar.visible { transform: translateY(0); }

/* ── TOAST ── */
.toast {
    position: fixed; bottom: 80px; right: 20px;
    background: var(--surface); border: 1px solid var(--accent);
    border-radius: var(--radius); padding: 12px 20px;
    z-index: 200; animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 20px; cursor: pointer; color: var(--text-light);
    font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all .15s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── MISC ── */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.hidden { display: none; }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-light { color: var(--text-light); }
.font-bold { font-weight: 700; }

/* ── FOOTER ── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 20px 24px;
    margin-top: 64px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
.footer a:hover { color: var(--accent) !important; }
.disclaimer { color: var(--text-muted); }
.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-light); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.data-table td { font-size: .9rem; }

/* ── ADMIN ── */
.admin-nav { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-nav a { padding: 8px 16px; border-radius: var(--radius-sm); color: var(--text-light); text-decoration: none; font-size: .9rem; font-weight: 600; transition: all .15s; }
.admin-nav a:hover { background: var(--surface2); color: var(--text); }
.admin-nav a.active { background: var(--accent); color: #fff; }
.admin-inline-edit { background: var(--surface2); border-radius: var(--radius-sm); padding: 16px; margin-top: 8px; }

/* ── DEAL ACTIONS ── */
.deal-actions { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); }
.deal-actions .btn { font-size: .8rem; padding: 4px 8px; }
.compare-bar {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 20px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5); z-index: 100;
}
.compare-count { font-weight: 700; color: var(--text); }

.nav-toggle-theme {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 8px; cursor: pointer; font-size: 1rem; color: var(--text);
    transition: all .15s;
}
.nav-toggle-theme:hover { background: var(--surface2); }

