/* ============================================
   Mohassen Fuel Optimization - Complete Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg: #1A1A1A;
    --card: #2A2A2A;
    --card-alt: #333;
    --accent-red: #8B0000;
    --gold: #FFD700;
    --green: #00C853;
    --red: #FF3D00;
    --white: #FFFFFF;
    --text: #FFFFFF;
    --text-muted: #999;
    --text-dim: #666;
    --border: #444;
    --radius: 12px;
    --radius-lg: 16px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

input, select, textarea, button {
    font-family: var(--font);
    font-size: 16px;
}

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

/* --- Screen Container Pattern --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.screen-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 56px;
    width: 100%;
}

.screen-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.2s;
}

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

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--card-alt);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
    width: calc(100% - 32px);
}

.toast {
    background: var(--card-alt);
    color: var(--white);
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    border-left: 4px solid var(--gold);
}

.toast.success {
    border-left-color: var(--green);
}

.toast.error {
    border-left-color: var(--red);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #111;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    min-width: 56px;
    min-height: 44px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--gold);
}

.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

.nav-admin.hidden {
    display: none;
}

/* --- Card Base --- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

/* --- Button Styles --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    min-height: 44px;
    padding: 12px 24px;
    font-size: 16px;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-gold {
    background: var(--gold);
    color: #000;
}

.btn-red {
    background: var(--accent-red);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    min-height: 52px;
    font-size: 17px;
    border-radius: 12px;
}

.btn-sm {
    min-height: 36px;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    min-width: 44px;
    min-height: 44px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    min-height: 44px;
}

/* --- Input Styles --- */
.input-group {
    margin-bottom: 14px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--card-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-group textarea {
    height: auto;
    padding: 12px 16px;
    resize: vertical;
    min-height: 80px;
}

.input-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--gold);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-dim);
}

.input-row {
    display: flex;
    gap: 12px;
}

.flex-1 {
    flex: 1;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrap input {
    padding-left: 42px;
}

/* --- Autocomplete Dropdown --- */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #3a3a3a;
    min-height: 44px;
    display: flex;
    align-items: center;
}

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

.autocomplete-item:active {
    background: var(--card-alt);
}

/* --- Hidden Utility --- */
.hidden {
    display: none !important;
}

/* ==========================================
   AUTH SCREEN
   ========================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.auth-logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.auth-tab.active {
    background: var(--card-alt);
    color: var(--white);
}

.auth-form.hidden {
    display: none;
}

/* ==========================================
   HOME SCREEN
   ========================================== */
.welcome-card {
    background: linear-gradient(135deg, var(--accent-red), #4a0000);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 700;
}

.welcome-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.stat-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    flex: 1;
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.action-btn {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 8px;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 44px;
    font-size: 13px;
    font-weight: 500;
}

.action-btn:active {
    border-color: var(--gold);
}

.action-icon {
    font-size: 28px;
}

.tip-carousel {
    margin-bottom: 16px;
}

.tip-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-left: 4px solid var(--gold);
}

.tip-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tip-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Install Banner */
.install-banner {
    background: var(--card);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-banner.hidden {
    display: none;
}

.install-banner p {
    flex: 1;
    font-size: 14px;
}

/* ==========================================
   SMART SEARCH DROPDOWNS
   ========================================== */
.sd-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.sd-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sd-item:hover, .sd-item:active {
    background: var(--card-alt);
}

.sd-item small {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================
   TRIP PLANNER SCREEN
   ========================================== */
.plan-map {
    width: 100%;
    height: 250px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    background: #222;
}

.plan-form {
    margin-bottom: 16px;
}

/* Fuel Toggle */
.fuel-toggle {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 4px;
    height: 48px;
}

.fuel-pill {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
}

.fuel-pill.active {
    background: var(--gold);
    color: #000;
}

/* Plan Results */
.plan-results {
    animation: slideUp 0.4s ease;
}

.plan-results.hidden {
    display: none;
}

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

.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-icon {
    font-size: 22px;
}

.result-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.result-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.result-meta {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.result-route {
    border-left: 4px solid var(--green);
}

.result-departure {
    border-left: 4px solid #FF9800;
}

.result-savings {
    border: 1px solid var(--gold);
}

/* Traffic Bar */
.traffic-bar-wrap {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.traffic-bar {
    flex: 1;
    height: 8px;
    background: var(--card-alt);
    border-radius: 4px;
    overflow: hidden;
}

.traffic-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    background: var(--green);
}

.traffic-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Savings Grid */
.savings-grid {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.savings-item {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    background: var(--bg);
    border-radius: 10px;
}

.savings-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.savings-value {
    font-size: 18px;
    font-weight: 700;
}

.savings-value.gold { color: var(--gold); }
.savings-value.green { color: var(--green); }
.savings-value.red { color: var(--red); }

.savings-highlight {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.savings-extended {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.savings-ext-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
}

.savings-ext-item .gold {
    color: var(--gold);
    font-weight: 600;
}

/* Eco Checklist */
.result-eco {
    border-left: 4px solid var(--green);
}

.eco-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.eco-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--card-alt);
    border-radius: 4px;
    overflow: hidden;
}

.eco-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.eco-progress-text {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.eco-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eco-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    min-height: 44px;
    line-height: 1.4;
}

.eco-item input[type="checkbox"] {
    display: none;
}

.eco-checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 1px;
}

.eco-item input:checked + .eco-checkmark {
    background: var(--green);
    border-color: var(--green);
}

.eco-item input:checked + .eco-checkmark::after {
    content: '\2713';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.eco-item input:checked ~ span:last-child {
    color: var(--white);
}

/* API Checklist Items (ck-item/ck-box) */
.ck-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.4;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,200,83,0.1);
}

.ck-box {
    -webkit-tap-highlight-color: rgba(0,200,83,0.2);
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1px;
}

.ck-box.checked {
    background: var(--green);
    border-color: var(--green);
}

.ck-box.checked::after {
    content: '\2713';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

/* Research Note */
.research-note {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px dashed var(--border);
}

.research-note p {
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    font-style: italic;
}

/* Feedback Section */
.feedback-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
}

.feedback-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.star {
    font-size: 36px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star.active {
    color: var(--gold);
}

.would-use {
    margin-bottom: 14px;
}

.would-use p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.would-use-btns {
    display: flex;
    gap: 8px;
}

.would-btn {
    flex: 1;
    background: var(--card-alt);
    border: 2px solid var(--border);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.would-btn.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

/* ==========================================
   HISTORY SCREEN
   ========================================== */
.chart-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.chart-container h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.chart-container canvas {
    width: 100% !important;
    height: 250px !important; max-height: 35vh;
}

.trip-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trip-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    border: 1px solid transparent;
}

.trip-card:active {
    border-color: var(--gold);
}

.trip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.trip-route {
    font-size: 15px;
    font-weight: 600;
}

.trip-date {
    font-size: 12px;
    color: var(--text-dim);
}

.trip-card-body {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.trip-savings-badge {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================
   SETTINGS SCREEN
   ========================================== */
.settings-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

.about-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.5;
}

.about-copy {
    margin-top: 8px;
    font-size: 12px !important;
    color: var(--text-dim) !important;
}

/* ==========================================
   ADMIN SCREEN
   ========================================== */
.admin-section {
    margin-top: 8px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    background: var(--card);
}

.admin-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table thead {
    background: var(--card-alt);
}

.admin-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 14px;
    border-top: 1px solid #3a3a3a;
    color: var(--text-muted);
}

.admin-table tr:active {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================
   TRIP DETAIL SCREEN
   ========================================== */
.detail-info {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #3a3a3a;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-muted);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
}

.detail-value.gold { color: var(--gold); }
.detail-value.green { color: var(--green); }
.detail-value.red { color: var(--red); }

.highlight-row {
    background: rgba(255, 215, 0, 0.05);
}

/* ==========================================
   UTILITY COLORS
   ========================================== */
.gold { color: var(--gold) !important; }
.green { color: var(--green) !important; }
.red { color: var(--red) !important; }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 375px) {
    .stat-value {
        font-size: 18px;
    }

    .savings-value {
        font-size: 15px;
    }

    .star {
        font-size: 30px;
    }

    .screen-content {
        padding: 12px;
    }
}

@media (min-width: 481px) {
    .screen-content {
        padding: 24px;
    }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--card-alt);
    border-radius: 3px;
}

/* --- Button Loading State (Gap 4) --- */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* --- Arabic Subtitle Styles (Gap 5) --- */
.auth-subtitle-ar {
    font-size: 16px;
    color: var(--gold);
    margin-top: 4px;
    direction: rtl;
    font-weight: 600;
}

.title-ar {
    font-size: 14px;
    color: var(--gold);
    font-weight: 500;
    direction: rtl;
    display: inline-block;
    margin-left: 8px;
}

.welcome-ar {
    font-size: 16px;
    color: var(--gold);
    direction: rtl;
    display: block;
    margin-bottom: 2px;
}

/* --- Share Buttons (Gap 3) --- */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.share-buttons.hidden {
    display: none;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    flex: 1;
}

.share-buttons .btn-outline {
    flex: 1;
}

/* --- Custom Vehicle Fields (Gap 6) --- */
.custom-vehicle-fields {
    margin-bottom: 14px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.custom-vehicle-fields.hidden {
    display: none;
}

/* --- Research Badge (Gap 7) --- */
.research-badge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.5;
}

.research-badge.hidden {
    display: none;
}

.badge-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* --- Quick Estimate Screen (Gap 10) --- */
.quick-estimate-link {
    text-align: center;
    margin-top: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px;
    min-height: 44px;
}

.btn-link:active {
    opacity: 0.7;
}

.quick-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.quick-cta-card {
    background: var(--card);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-top: 12px;
}

.quick-cta-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* --- Trip Cost Calculator Grid --- */
.cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.cost-item {
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    text-align: center;
}
.cost-item.highlight {
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.2);
}
.cost-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.cost-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.cost-value.gold {
    color: #FFD700;
}

/* --- Fuel Price Badges --- */
.price-badge {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
}

/* Leaflet overrides for dark theme */
.leaflet-control-attribution {
    background: rgba(26, 26, 26, 0.8) !important;
    color: var(--text-dim) !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: var(--text-muted) !important;
}

/* ==========================================
   TOP MENU BUTTON (More/Hamburger)
   ========================================== */
.top-menu-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 50;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.top-menu-btn:active {
    background: var(--card-alt);
}

/* ==========================================
   MORE MENU OVERLAY
   ========================================== */
.more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    transition: opacity 0.3s;
}

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

.more-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background: #1e1e1e;
    padding: 0;
    animation: slideInRight 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.more-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.more-menu-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.more-menu-items {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    min-height: 52px;
    text-align: left;
    transition: background 0.2s;
}

.more-menu-item:active {
    background: var(--card-alt);
}

.more-menu-item span:first-child {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.more-menu-logout {
    color: var(--red);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.nav-admin-menu.hidden {
    display: none;
}

/* ==========================================
   ONBOARDING SCREENS
   ========================================== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
}

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

.onboarding-container {
    max-width: 400px;
    width: 100%;
    padding: 24px;
    text-align: center;
}

.onboarding-slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.onboarding-slide.active {
    display: block;
}

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

.onboarding-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.onboarding-slide h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}

.onboarding-slide p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 4px;
}

.onboarding-ar {
    font-size: 18px !important;
    color: var(--gold) !important;
    direction: rtl;
    font-weight: 600;
    margin-top: 8px !important;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 32px 0 24px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--card-alt);
    transition: background 0.3s;
}

.onboarding-dot.active {
    background: var(--gold);
}

/* ==========================================
   WEATHER CARD
   ========================================== */
.weather-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 4px solid #42A5F5;
}

.weather-card.hidden {
    display: none;
}

.weather-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.weather-temp {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.weather-condition {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.weather-impact {
    font-size: 12px;
    margin-left: auto;
    text-align: right;
    line-height: 1.3;
}

/* ==========================================
   SAVED ROUTES
   ========================================== */
.saved-routes-section {
    margin-bottom: 16px;
}

.saved-routes-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.saved-routes-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.saved-route-chip {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    transition: border-color 0.2s, background 0.2s;
    white-space: nowrap;
}

.saved-route-chip:active {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

.save-route-wrap {
    margin-top: 8px;
}

.save-route-form {
    margin-top: 8px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.save-route-form.hidden {
    display: none;
}

/* ==========================================
   LEADERBOARD
   ========================================== */
.leaderboard-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.leaderboard-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #3a3a3a;
    min-height: 44px;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-me {
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
    padding: 10px 8px;
    margin: 0 -8px;
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-gold {
    background: var(--gold);
    color: #000;
}

.rank-silver {
    background: #C0C0C0;
    color: #000;
}

.rank-bronze {
    background: #CD7F32;
    color: #000;
}

.rank-default {
    background: var(--card-alt);
    color: var(--text-muted);
}

.leaderboard-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.leaderboard-saved {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    white-space: nowrap;
}

.leaderboard-trips {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.leaderboard-full {
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* ==========================================
   FUEL LOG SCREEN
   ========================================== */
.fuel-add-form {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.fuel-add-form.hidden {
    display: none;
}

.fuel-log-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.fuel-log-entry {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.fuel-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.fuel-entry-date {
    font-size: 14px;
    font-weight: 600;
}

.fuel-entry-delete {
    background: none;
    border: none;
    color: var(--red);
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
}

.fuel-entry-delete:active {
    background: rgba(255, 61, 0, 0.1);
}

.fuel-entry-body {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.fuel-type-badge {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================
   COMPARE CARS
   ========================================== */
.compare-form {
    margin-bottom: 16px;
}

.compare-results.hidden {
    display: none;
}

.compare-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.compare-card {
    flex: 1;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.compare-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-stat {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #3a3a3a;
    color: var(--text-muted);
}

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

.compare-stat span:last-child {
    font-weight: 600;
    color: var(--text);
}

.compare-diff-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--gold);
    text-align: center;
}

.compare-winner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.compare-winner-icon {
    font-size: 24px;
}

.compare-winner-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
}

/* ==========================================
   EXPORT BUTTONS
   ========================================== */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.export-buttons .btn {
    flex: 1;
}

/* ==========================================
   DEMO BUTTON
   ========================================== */
.btn-demo {
    margin-bottom: 16px;
    font-size: 14px;
}

/* ==========================================
   RESPONSIVE ADDITIONS
   ========================================== */
/* ==========================================
   SEARCHABLE DROPDOWN
   ========================================== */
.searchable-select {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--card-alt);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.search-input:focus {
    border-color: var(--gold);
}

.search-input::placeholder {
    color: #666;
}

.search-dropdown {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.search-dropdown.hidden {
    display: none;
}

.search-option {
    padding: 12px 16px;
    color: #ddd;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.search-option:hover, .search-option:active {
    background: rgba(255,215,0,0.1);
    color: var(--gold);
}

.search-option:last-child {
    border-bottom: none;
}

/* ==========================================
   GPS BUTTON
   ========================================== */
.gps-btn {
    float: right;
    background: rgba(255,215,0,0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-top: -2px;
    min-height: 44px;
}

.gps-btn:active {
    background: rgba(255,215,0,0.3);
}

/* ==========================================
   AI CHAT
   ========================================== */
.chat-bubble {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 500;
    transition: transform 0.2s;
}

.chat-bubble:active {
    transform: scale(0.9);
}

.chat-bubble-icon {
    font-size: 24px;
}

.chat-panel {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 450px;
    max-height: 60vh;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 501;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    overflow: hidden;
}

.chat-panel.hidden {
    display: none;
}

.chat-header {
    padding: 14px 16px;
    background: #8B0000;
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-msg.ai {
    background: #2a2a2a;
    color: #ddd;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: #8B0000;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.loading {
    color: #888;
    font-style: italic;
}

.chat-input-row {
    display: flex;
    padding: 10px;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chat-input-row input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    background: #333;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    outline: none;
}

.chat-input-row input:focus {
    border-color: var(--gold);
}

.chat-send-btn {
    height: 40px;
    padding: 0 16px;
    background: #8B0000;
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    min-width: 60px;
}

/* ==========================================
   POPULAR ROUTES / RECENT SEARCHES
   ========================================== */
.popular-routes {
    margin-bottom: 16px;
}
.popular-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}
.popular-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.route-chip {
    padding: 8px 14px;
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 20px;
    color: #FFD700;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}
.route-chip:active {
    background: rgba(255,215,0,0.2);
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #888;
}
.empty-state.hidden {
    display: none;
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.empty-state h3 {
    color: #ccc;
    margin-bottom: 8px;
}
.empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}

@media (max-width: 375px) {
    .weather-card {
        flex-wrap: wrap;
        gap: 8px;
    }

    .weather-impact {
        margin-left: 0;
        width: 100%;
        text-align: left;
    }

    .compare-cards {
        flex-direction: column;
    }

    .leaderboard-saved {
        font-size: 12px;
    }

    .more-menu {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================
   RTL MODE (Arabic)
   ========================================== */
.rtl-mode {
    direction: rtl;
    text-align: right;
}
.rtl-mode .input-group label {
    text-align: right;
}
.rtl-mode .bottom-nav,
.rtl-mode .nav-bar {
    direction: ltr;
}
.rtl-mode .result-header {
    flex-direction: row-reverse;
}
.rtl-mode .popular-chips {
    direction: rtl;
}
.rtl-mode .savings-grid {
    direction: rtl;
}
.rtl-mode .search-input {
    text-align: right;
}
.rtl-mode .search-option {
    text-align: right;
}
.rtl-mode .more-menu {
    right: auto;
    left: 0;
    animation: slideInLeft 0.3s ease;
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
.rtl-mode .top-menu-btn {
    right: auto;
    left: 12px;
}
.rtl-mode .gps-btn {
    float: left;
}
.rtl-mode .tip-card {
    border-left: none;
    border-right: 4px solid var(--gold);
}
.rtl-mode .result-route {
    border-left: none;
    border-right: 4px solid var(--green);
}
.rtl-mode .result-departure {
    border-left: none;
    border-right: 4px solid #FF9800;
}
.rtl-mode .result-eco {
    border-left: none;
    border-right: 4px solid var(--green);
}
.rtl-mode .weather-card {
    border-left: none;
    border-right: 4px solid #42A5F5;
}
.rtl-mode .toast {
    border-left: none;
    border-right: 4px solid var(--gold);
}
.rtl-mode .toast.success {
    border-right-color: var(--green);
}
.rtl-mode .toast.error {
    border-right-color: var(--red);
}
.rtl-mode .detail-row {
    flex-direction: row-reverse;
}
.rtl-mode .trip-card-header {
    flex-direction: row-reverse;
}
.rtl-mode .more-menu-item {
    text-align: right;
    flex-direction: row-reverse;
}
.rtl-mode .input-group select {
    background-position: left 16px center;
    padding-right: 16px;
    padding-left: 40px;
}

/* ==========================================
   LANGUAGE TOGGLE BUTTON
   ========================================== */
.lang-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 600;
    background: rgba(255,215,0,0.15);
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    min-width: 44px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lang-btn:active {
    background: rgba(255,215,0,0.3);
}
.rtl-mode .lang-btn {
    left: auto;
    right: 12px;
}

/* ==========================================
   LIGHT MODE
   ========================================== */
.light-mode {
    --bg: #f5f5f5;
    --text-muted: #595959;
    --text-dim: #767676;
    --card: #ffffff;
    --card-alt: #f0f0f0;
    --text: #333333;
    --text-muted: #666666;
    --text-dim: #999999;
    --border: #ddd;
}
.light-mode {
    background: var(--bg);
    color: var(--text);
}
.light-mode .card,
.light-mode .result-card {
    background: var(--card);
    border-color: #ddd;
}
.light-mode .search-input {
    background: #f0f0f0;
    color: #333;
    border-color: #ccc;
}
.light-mode .search-dropdown {
    background: #fff;
    border-color: #ddd;
}
.light-mode .search-option {
    color: #333;
    border-color: #eee;
}
.light-mode .search-option:hover,
.light-mode .search-option:active {
    background: rgba(139,0,0,0.05);
}
.light-mode .bottom-nav {
    background: #fff;
    border-top: 1px solid #eee;
}
.light-mode .nav-item {
    color: #999;
}
.light-mode .nav-item.active {
    color: #8B0000;
}
.light-mode select {
    background-color: #f0f0f0;
    color: #333;
}
.light-mode .input-group input,
.light-mode .input-group select,
.light-mode .input-group textarea {
    background: #f0f0f0;
    color: #333;
    border-color: #ccc;
}
.light-mode .stat-card,
.light-mode .settings-card,
.light-mode .leaderboard-card,
.light-mode .compare-card {
    background: var(--card);
}
.light-mode .top-menu-btn {
    background: #fff;
    border-color: #ddd;
    color: #333;
}
.light-mode .more-menu {
    background: #fff;
}
.light-mode .more-menu-item {
    color: #333;
}
.light-mode .more-menu-item:active {
    background: #f5f5f5;
}
.light-mode .more-menu-header {
    border-bottom-color: #eee;
}
.light-mode .trip-card {
    background: #fff;
}
.light-mode .fuel-add-form {
    background: #fff;
    border-color: #ddd;
}
.light-mode .fuel-log-entry {
    background: #fff;
}
.light-mode .toast {
    background: #fff;
    color: #333;
}
.light-mode .chat-panel {
    background: #fff;
    border-color: #ddd;
}
.light-mode .chat-msg.ai {
    background: #f0f0f0;
    color: #333;
}
.light-mode .chat-input-row input {
    background: #f0f0f0;
    color: #333;
    border-color: #ddd;
}
.light-mode .welcome-card {
    color: #fff;
}
.light-mode .action-btn {
    background: #fff;
    border-color: #ddd;
    color: #333;
}
.light-mode .loading-overlay {
    background: rgba(255,255,255,0.7);
}
.light-mode .detail-info {
    background: #fff;
}
.light-mode .detail-row {
    border-bottom-color: #eee;
}
.light-mode .leaderboard-row {
    border-bottom-color: #eee;
}
.light-mode .admin-table thead {
    background: #f5f5f5;
}
.light-mode .admin-table td {
    border-top-color: #eee;
}
.light-mode .chart-container {
    background: #fff;
}

/* ==========================================
   MIC BUTTON (VOICE INPUT)
   ========================================== */
.mic-btn {
    position: absolute;
    right: 8px;
    bottom: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rtl-mode .mic-btn {
    right: auto;
    left: 8px;
}

/* ==========================================
   SKELETON LOADING
   ========================================== */
.skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    min-height: 20px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card { height: 80px; margin-bottom: 12px; border-radius: 12px; }
.skeleton-text { height: 16px; width: 60%; margin-bottom: 8px; }
.skeleton-text.short { width: 40%; }

/* Collapsible sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}
.collapsible-header::after {
    content: '\25B2';
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s;
}
.collapsible-header.collapsed::after {
    transform: rotate(180deg);
}
.collapsible-body {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.collapsible-body.collapsed {
    max-height: 0;
}
