/* ═══════════════════════════════════════════════════════
   EV Atlas — Premium Design System
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables / Design Tokens ── */
:root {
    /* Colors - Electric Blue Theme */
    --primary-h: 220;
    --primary-s: 100%;
    --primary: hsl(var(--primary-h), var(--primary-s), 55%);
    --primary-light: hsl(var(--primary-h), var(--primary-s), 65%);
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 42%);
    --primary-glow: hsl(var(--primary-h), var(--primary-s), 55%, 0.3);

    --accent-h: 160;
    --accent: hsl(var(--accent-h), 84%, 50%);
    --accent-light: hsl(var(--accent-h), 84%, 65%);

    --warning: hsl(38, 92%, 55%);
    --danger: hsl(0, 78%, 58%);
    --success: hsl(142, 71%, 45%);

    /* Dark Theme (Default) */
    --bg-primary: hsl(222, 47%, 6%);
    --bg-secondary: hsl(222, 40%, 9%);
    --bg-tertiary: hsl(222, 35%, 12%);
    --bg-card: hsl(222, 35%, 10%);
    --bg-card-hover: hsl(222, 35%, 13%);
    --bg-glass: hsla(222, 40%, 12%, 0.7);
    --bg-glass-strong: hsla(222, 40%, 15%, 0.85);

    --text-primary: hsl(220, 20%, 95%);
    --text-secondary: hsl(220, 15%, 65%);
    --text-tertiary: hsl(220, 10%, 45%);
    --text-inverse: hsl(222, 47%, 6%);

    --border: hsla(220, 30%, 25%, 0.5);
    --border-hover: hsla(220, 30%, 35%, 0.6);
    --border-active: var(--primary);

    --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.3);
    --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.4);
    --shadow-lg: 0 8px 32px hsla(0, 0%, 0%, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --container-max: 1320px;
    --header-height: 64px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: hsl(220, 20%, 97%);
    --bg-secondary: hsl(220, 18%, 94%);
    --bg-tertiary: hsl(220, 15%, 90%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-card-hover: hsl(220, 20%, 97%);
    --bg-glass: hsla(0, 0%, 100%, 0.75);
    --bg-glass-strong: hsla(0, 0%, 100%, 0.9);

    --text-primary: hsl(222, 47%, 11%);
    --text-secondary: hsl(220, 15%, 40%);
    --text-tertiary: hsl(220, 10%, 60%);
    --text-inverse: hsl(0, 0%, 100%);

    --border: hsla(220, 20%, 80%, 0.6);
    --border-hover: hsla(220, 20%, 70%, 0.6);

    --shadow-sm: 0 1px 2px hsla(0, 0%, 0%, 0.05);
    --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.08);
    --shadow-lg: 0 8px 32px hsla(0, 0%, 0%, 0.12);
    --shadow-glow: 0 0 20px hsla(var(--primary-h), 100%, 55%, 0.15);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

img { max-width: 100%; height: auto; }

button, input, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ── Header / Nav ── */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    transition: background var(--transition-base);
}

#main-nav {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    letter-spacing: 0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--primary);
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ── Language Selector ── */
.lang-selector {
    position: relative;
}

.lang-btn {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
    overflow: hidden;
    z-index: 1001;
}

.lang-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    text-align: left;
}

.lang-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--primary);
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.1);
}

/* ── Hero Section ── */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    overflow: hidden;
    background: var(--bg-primary);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, hsla(var(--primary-h), 100%, 45%, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 20% 60%, hsla(var(--accent-h), 84%, 50%, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 80% 70%, hsla(280, 80%, 50%, 0.05) 0%, transparent 60%);
    z-index: 0;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
}

.hero-title-line {
    display: block;
}

.hero-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent), hsl(280, 80%, 65%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    font-weight: 400;
}

/* Search */
.hero-search-container {
    max-width: 560px;
    margin: 0 auto var(--space-xl);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 48px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-input:focus ~ .search-icon,
.search-wrapper:focus-within .search-icon {
    color: var(--primary);
}

.search-kbd {
    position: absolute;
    right: var(--space-md);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    pointer-events: none;
}

.search-input:focus ~ .search-kbd {
    display: none;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* ── Filters Section ── */
.filters-section {
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) 0;
}

.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
    min-width: 140px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-select, .filter-input {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:hover, .filter-input:hover {
    border-color: var(--border-hover);
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-reset-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-reset-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 2px;
    border: 1px solid var(--border);
}

.view-btn {
    padding: var(--space-xs) var(--space-sm);
    border-radius: calc(var(--radius-md) - 2px);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.view-btn.active {
    background: var(--primary);
    color: white;
}

/* ── Pages ── */
.page {
    display: none;
    padding: var(--space-xl) 0 var(--space-3xl);
    min-height: 60vh;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ── Vehicle Grid ── */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.vehicles-grid.list-view {
    grid-template-columns: 1fr;
}

/* ── Vehicle Card ── */
.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.vehicle-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.vehicle-card:hover .card-glow {
    opacity: 1;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.card-brand-info {
    display: flex;
    flex-direction: column;
}

.card-make {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-model {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-year-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    white-space: nowrap;
}

.card-variant {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-sm);
}

/* Card visual - gradient placeholder */
.card-visual {
    margin: 0 var(--space-lg);
    height: 140px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-visual-bg {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    opacity: 0.06;
}

.card-vehicle-img {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 110px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25));
}

.vehicle-card:hover .card-vehicle-img {
    transform: scale(1.08) translateY(-2px);
}

.card-visual-icon {
    position: relative;
    z-index: 1;
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detail Modal Hero Image */
.detail-hero-img {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius-lg);
}

.detail-hero-img img {
    max-width: 80%;
    max-height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.2));
}

/* Card Stats */
.card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    margin: var(--space-md) var(--space-lg) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-stat {
    background: var(--bg-card);
    padding: var(--space-sm) var(--space-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-stat:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.card-stat:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.card-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.card-stat-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* Card Footer */
.card-footer {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.card-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.1);
    color: var(--primary-light);
}

.card-compare-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.card-compare-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.08);
}

.card-compare-btn.added {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* NCAP Badge */
.card-ncap-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning);
}

.ncap-star {
    font-size: 0.7rem;
}

.ncap-star.filled {
    color: var(--warning);
}

.ncap-star.empty {
    color: var(--text-tertiary);
    opacity: 0.3;
}

/* ── List View Card ── */
.vehicles-grid.list-view .vehicle-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-lg);
}

.vehicles-grid.list-view .card-header {
    padding: var(--space-md) var(--space-lg);
}

.vehicles-grid.list-view .card-visual {
    width: 120px;
    height: 70px;
    margin: var(--space-sm) 0 var(--space-sm) var(--space-lg);
}

.vehicles-grid.list-view .card-vehicle-img {
    max-height: 55px;
    max-width: 100px;
}

.vehicles-grid.list-view .card-stats {
    margin: 0;
    grid-template-columns: repeat(3, 1fr);
}

.vehicles-grid.list-view .card-variant,
.vehicles-grid.list-view .card-footer {
    display: none;
}

/* ── Load More ── */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
}

.btn-load-more {
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: hsla(0, 0%, 0%, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    overflow-y: auto;
}

.modal-overlay.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.35s var(--transition-spring);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.modal-body {
    padding: var(--space-xl);
}

/* Modal Detail */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.detail-title-group h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.detail-make {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}

.detail-meta {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.detail-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.detail-badge.primary {
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.12);
    color: var(--primary-light);
}

/* Detail Sections */
.detail-section {
    margin-bottom: var(--space-xl);
}

.detail-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.detail-section-title svg {
    color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.detail-item {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-item-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.detail-item-value.highlight {
    color: var(--primary);
}

/* Range Bar visualization */
.range-bar-container {
    margin-top: var(--space-sm);
}

.range-bar-bg {
    height: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.range-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 1s var(--transition-spring);
}

.range-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* NCAP Detail */
.ncap-detail {
    background: linear-gradient(135deg, hsla(38, 92%, 55%, 0.08), hsla(38, 92%, 55%, 0.03));
    border: 1px solid hsla(38, 92%, 55%, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.ncap-stars-large {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.ncap-star-large {
    font-size: 1.8rem;
}

.ncap-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-md);
}

.ncap-category {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ncap-category-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ncap-category-bar-bg {
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ncap-category-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease;
}

.ncap-category-value {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ── Compare Page ── */
.compare-header, .stats-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.compare-header h2, .stats-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.compare-subtitle, .stats-subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-sm);
}

.compare-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.compare-slot {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    min-height: 200px;
    transition: all var(--transition-base);
    position: relative;
}

.compare-slot.empty:hover {
    border-color: var(--primary);
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.03);
}

.compare-slot.filled {
    border-style: solid;
    border-color: var(--border);
    background: var(--bg-card);
}

.compare-slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    gap: var(--space-md);
    color: var(--text-tertiary);
    height: 100%;
}

.compare-slot-placeholder svg {
    opacity: 0.4;
}

.compare-search {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: center;
}

.compare-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.compare-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: var(--shadow-lg);
}

.compare-dropdown.visible {
    display: block;
}

.compare-dropdown-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border);
}

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

.compare-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.compare-dropdown-item .dropdown-make {
    font-weight: 600;
    color: var(--primary);
}

.compare-slot-vehicle {
    padding: var(--space-lg);
}

.compare-slot-vehicle h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.compare-slot-vehicle .compare-make {
    font-size: 0.72rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.compare-remove-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.compare-remove-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Compare Table */
.compare-table-container {
    overflow-x: auto;
    margin-top: var(--space-xl);
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.compare-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
}

.compare-table td {
    background: var(--bg-card);
    font-family: var(--font-mono);
    font-weight: 500;
}

.compare-table tr:last-child td {
    border-bottom: none;
}

.compare-table td.best {
    color: var(--accent);
    font-weight: 700;
}

.compare-table .category-row td,
.compare-table .category-row th {
    background: hsla(var(--primary-h), var(--primary-s), 55%, 0.06);
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

/* ── Stats Page ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

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

.stat-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.stat-card-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.stat-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Bar chart */
.stat-bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stat-bar-label {
    width: 80px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.stat-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.stat-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    padding-left: var(--space-sm);
    transition: width 1s ease;
    min-width: fit-content;
}

.stat-bar-fill span {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-slow);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Footer ── */
#main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--space-xl) 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

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

    .hero {
        min-height: 60vh;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

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

    .compare-slots {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        margin: var(--space-md);
        border-radius: var(--radius-lg);
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ncap-categories {
        grid-template-columns: 1fr;
    }

    /* Mobile nav */
    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        background: var(--bg-glass-strong);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border);
        padding: var(--space-sm);
        justify-content: center;
        z-index: 1000;
    }

    #main-footer {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        gap: var(--space-md);
    }

    .hero-stat-value {
        font-size: 1.5rem;
    }

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

/* ═══════════════════════════════════════════════════════
   Favorites Heart Button
   ═══════════════════════════════════════════════════════ */
.card-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-fav-btn:hover { color: #ef4444; border-color: #ef444460; transform: scale(1.15); }
.card-fav-btn.active { color: #ef4444; background: #ef444420; border-color: #ef444460; }
.card-fav-btn.active:hover { transform: scale(1.2); }

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.card-fav-btn.active svg { animation: heartPop 0.4s ease; }

.vehicle-card { position: relative; }

/* Nav Badge */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   Favorites Page
   ═══════════════════════════════════════════════════════ */
.favorites-header {
    text-align: center;
    padding: 48px 0 32px;
}
.favorites-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.favorites-subtitle { color: var(--text-secondary); margin-top: 8px; }
.btn-clear-favorites {
    margin-top: 16px;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #ef444440;
    background: #ef444415;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-clear-favorites:hover { background: #ef444430; }
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════
   Cost Calculator (Modal Section)
   ═══════════════════════════════════════════════════════ */
.cost-calculator {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cost-market-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cost-market-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.cost-market-btn:hover { border-color: var(--primary); color: var(--primary); }
.cost-market-btn.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.cost-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cost-slider-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.cost-km-value {
    color: var(--primary-light);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
.cost-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}
.cost-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    cursor: pointer;
    box-shadow: 0 2px 8px var(--primary-glow);
    transition: transform 0.2s;
}
.cost-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.cost-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.cost-result-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}
.cost-result-card.ev { border-color: #3b82f640; }
.cost-result-card.gas { border-color: #f5920040; }
.cost-result-card.savings { border-color: #10b98140; background: #10b98110; }
.cost-result-icon { font-size: 1.5rem; margin-bottom: 4px; }
.cost-result-title { color: var(--text-tertiary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.cost-result-monthly { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin-top: 8px; font-family: 'JetBrains Mono', monospace; }
.cost-result-yearly { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.cost-result-perkm { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 4px; }
.savings-value { color: #10b981 !important; }
.savings-value.negative { color: #ef4444 !important; }

@media (max-width: 600px) {
    .cost-results { grid-template-columns: 1fr; }
    .cost-market-selector { gap: 4px; }
    .cost-market-btn { padding: 6px 10px; font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════
   Charging Map Page
   ═══════════════════════════════════════════════════════ */
.charging-header {
    text-align: center;
    padding: 48px 0 24px;
}
.charging-header h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.charging-subtitle { color: var(--text-secondary); margin-top: 8px; }
.charging-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}
.charging-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}
.charging-filter-group label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.btn-locate {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-locate:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }
.charging-map-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    height: 500px;
}
#charging-map {
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    min-height: 400px;
    z-index: 1;
}
.charging-info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}
.charging-info-hint {
    color: var(--text-tertiary);
    text-align: center;
    padding: 40px 16px;
    font-size: 0.9rem;
}
.charging-station-detail h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.charging-station-addr {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
}
.charging-station-connectors {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}
.charging-station-power {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.charging-station-status {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    display: inline-block;
}
.charging-attribution {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 16px;
}
.charging-attribution a { color: var(--primary-light); }
.charging-pin { background: none !important; border: none !important; }
.user-location-pin { font-size: 24px; line-height: 1; }

/* Leaflet dark theme override */
.leaflet-control-attribution { background: var(--bg-glass) !important; color: var(--text-tertiary) !important; }
.leaflet-control-attribution a { color: var(--primary-light) !important; }
.leaflet-control-zoom a { background: var(--bg-card) !important; color: var(--text-primary) !important; border-color: var(--border-subtle) !important; }

@media (max-width: 768px) {
    .charging-map-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    #charging-map { min-height: 350px; }
    .charging-controls { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════
   Price Badge & Filter
   ═══════════════════════════════════════════════════════ */
.card-price-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    z-index: 5;
}

.filter-price-range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-price-range .filter-input {
    width: 90px;
    flex: 1;
}
.filter-price-dash {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Modal Price */
.detail-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #05966915, #10b98115);
    border: 1px solid #10b98130;
    border-radius: 10px;
}
.detail-price-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #10b981;
    min-width: 42px;
}
.detail-price-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* Charging City Dropdown */
#charging-country {
    max-width: 220px;
    font-size: 0.8rem;
}
#charging-country optgroup {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    padding: 4px 0;
}
#charging-country option {
    font-weight: 400;
    font-size: 0.8rem;
    padding: 2px 8px;
}

/* Charging Network Tags */
.charging-networks-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
}
.charging-network-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.charging-network-tag b {
    color: var(--accent);
    margin-left: 3px;
}

/* AC vs DC type badges */
.charging-type-bar {
    display: flex;
    gap: 8px;
    padding: 6px 12px;
}
.charging-type-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.charging-type-badge.dc {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.charging-type-badge.ac {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.charging-type-badge b {
    margin-left: 4px;
}

/* Navigation buttons */
.charging-nav-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.nav-btn.apple-maps {
    background: linear-gradient(135deg, #333 0%, #111 100%);
    color: #fff;
    border: 1px solid #444;
}
.nav-btn.apple-maps:hover {
    background: linear-gradient(135deg, #444 0%, #222 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.nav-btn.google-maps {
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: #fff;
    border: 1px solid #5a95f5;
}
.nav-btn.google-maps:hover {
    background: linear-gradient(135deg, #5a95f5 0%, #4285f4 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66,133,244,0.4);
}

/* Station Reviews */
.reviews-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.reviews-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.avg-rating { font-size: 0.75rem; color: var(--text-dim); }
.add-review-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.star-selector { display: flex; gap: 2px; }
.review-input {
    flex: 1; min-width: 120px; padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--card); color: var(--text);
    font-size: 0.75rem; outline: none;
}
.review-input:focus { border-color: var(--accent); }
.review-submit-btn {
    padding: 6px 14px; border-radius: 8px; border: none;
    background: var(--accent); color: #fff; font-size: 0.75rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.review-submit-btn:hover { filter: brightness(1.15); }
.station-review-item {
    padding: 6px 0; border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}
.review-header { display: flex; align-items: center; gap: 6px; }
.review-stars { letter-spacing: 1px; }
.review-date { color: var(--text-dim); font-size: 0.65rem; }
.review-delete {
    margin-left: auto; background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 0.7rem; padding: 2px 4px; border-radius: 4px;
}
.review-delete:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.review-text { margin: 4px 0 0; color: var(--text); line-height: 1.4; }

/* Trip Planner */
.trip-planner-card {
    background: var(--card); border-radius: 16px; padding: 24px;
    border: 1px solid var(--border);
}
.trip-planner-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.trip-planner-desc { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 16px; }
.trip-planner-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.trip-field { display: flex; flex-direction: column; gap: 4px; }
.trip-field label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }
.trip-select, .trip-input {
    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 0.85rem;
}
.trip-select:focus, .trip-input:focus { border-color: var(--accent); outline: none; }
.trip-calc-btn {
    padding: 12px 24px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #06b6d4, #3b82f6); color: #fff;
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s; align-self: end;
}
.trip-calc-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(6,182,212,0.4); }
.trip-result { margin-top: 16px; }
.trip-result-card {
    border-radius: 14px; padding: 20px;
    border: 1px solid var(--border);
}
.trip-success { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.3); }
.trip-warning { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.3); }
.trip-vehicle-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.trip-stats { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.trip-stat { text-align: center; }
.trip-stat-value { display: block; font-size: 1.5rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--accent); }
.trip-stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }
.trip-verdict { padding: 12px; border-radius: 10px; font-size: 0.9rem; }
.trip-ok { background: rgba(16,185,129,0.1); }
.trip-stop { background: rgba(245,158,11,0.1); }
.trip-bar { height: 8px; background: var(--border); border-radius: 8px; margin-top: 8px; overflow: hidden; }
.trip-bar-fill { height: 100%; border-radius: 8px; transition: width 0.6s ease; }
.trip-tip { font-size: 0.8rem; color: var(--text-dim); margin-top: 8px; }
.trip-error { color: #ef4444; font-size: 0.85rem; }

/* Tools Page */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
    background: var(--card); border-radius: 16px; padding: 24px;
    border: 1px solid var(--border);
}
.tool-card h3 { font-size: 1.2rem; margin-bottom: 4px; }
.tool-desc { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 16px; }
.tool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .tool-form { grid-template-columns: 1fr; } }
.tool-field { display: flex; flex-direction: column; gap: 4px; }
.tool-field label { font-size: 0.7rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }

/* EV vs Gas */
.evg-compare { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.evg-col { text-align: center; padding: 16px 20px; border-radius: 14px; min-width: 140px; }
.evg-gas { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }
.evg-ev { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.evg-icon { font-size: 2rem; margin-bottom: 4px; }
.evg-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-dim); }
.evg-amount { font-size: 1.6rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; margin: 4px 0; }
.evg-gas .evg-amount { color: #ef4444; }
.evg-ev .evg-amount { color: #10b981; }
.evg-sub { font-size: 0.7rem; color: var(--text-dim); }
.evg-vs { font-size: 1.2rem; font-weight: 800; color: var(--text-dim); }
.evg-savings { text-align: center; padding: 16px; background: rgba(16,185,129,0.06); border-radius: 12px; margin: 12px 0; }
.evg-save-amount { font-size: 1.4rem; font-weight: 800; color: #10b981; }
.evg-save-monthly { font-size: 0.85rem; color: var(--text-dim); }
.evg-save-co2 { font-size: 0.85rem; color: #06b6d4; margin-top: 4px; }
.evg-save-pct { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
.evg-timeline { margin-top: 12px; }
.evg-timeline h4 { font-size: 0.85rem; margin-bottom: 8px; }
.evg-years { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.evg-year { text-align: center; padding: 10px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.evg-year-num { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-dim); }
.evg-year-val { display: block; font-size: 1.1rem; font-weight: 800; color: #10b981; font-family: 'JetBrains Mono', monospace; }

/* Battery Health */
.bh-table-wrap { overflow-x: auto; margin: 12px 0; }
.bh-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.bh-table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); font-size: 0.7rem; text-transform: uppercase; color: var(--text-dim); }
.bh-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.bh-warranty { margin-top: 12px; padding: 10px; border-radius: 8px; background: rgba(245,158,11,0.08); font-size: 0.85rem; }

/* Dark Mode Improvements */
[data-theme="dark"] {
    --bg: #0f1117;
    --card: #1a1d27;
    --border: #2a2d3a;
    --text: #e8eaed;
    --text-dim: #8b8fa3;
}
[data-theme="dark"] .tool-card { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
[data-theme="dark"] .evg-gas { background: rgba(239,68,68,0.12); }
[data-theme="dark"] .evg-ev { background: rgba(16,185,129,0.12); }
[data-theme="dark"] .bh-table tr:hover { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .trip-planner-card { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
[data-theme="dark"] .section-title { 
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Section Title */
.section-title {
    font-size: 1.8rem; font-weight: 800; text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
