:root {
    --bg-main: #0c1017;
    --bg-surface: #141b26;
    --bg-elevated: #1c2638;
    --bg-input: #172238;
    --bg-hover: rgba(56, 189, 248, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.3);
    
    --accent-cyan: #38bdf8;
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #f43f5e;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-input: #e2e8f0;
    --bg-hover: rgba(2, 132, 199, 0.05);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(2, 132, 199, 0.3);

    --accent-cyan: #0284c7;
    --accent-indigo: #4f46e5;
    --accent-teal: #0d9488;
    --accent-emerald: #059669;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.05);
}

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

body, html {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header & Navbar */
header {
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}
.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24, #ea2027);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* National Fuel Price Summary Cards */
.avg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.avg-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
}
.avg-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
.avg-price {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--text-main);
    margin: 6px 0;
}
.avg-diff {
    font-size: 0.82rem;
    font-weight: 700;
}
.avg-diff.down { color: var(--accent-emerald); }
.avg-diff.up { color: var(--accent-rose); }

/* Control Panel */
.control-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
}

/* Fuel Tabs */
.fuel-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}
.fuel-tab {
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.fuel-tab:hover, .fuel-tab.active {
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

/* Search Filters Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
select, input[type="text"] {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}
select:focus {
    border-color: var(--accent-cyan);
}

.btn-gps {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent-teal), #0d9488);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
    transition: var(--transition);
}
.btn-gps:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(45, 212, 191, 0.4);
}

/* Stations Grid */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.station-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.station-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
}

.station-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.brand-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
    display: inline-block;
}
.station-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 6px;
}

.price-box {
    margin: 1rem 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.price-val {
    font-size: 2.2rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}
.price-unit {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

.station-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.facility-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 1.2rem;
}
.fac-pill {
    padding: 3px 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.station-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.dist-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-amber);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-nav {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-nav:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Empty / Loading State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    text-align: center;
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
}
