/* --- Premium Dark Mode Design System --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette */
    --bg-dark: #0f172a;
    /* Deep Slate */
    --bg-card: rgba(30, 41, 59, 0.7);
    /* Glassy Panel */
    --primary: #3b82f6;
    /* Blue */
    --accent: #06b6d4;
    /* Cyan Neon */
    --accent-glow: rgba(6, 182, 212, 0.5);
    --secondary: #8b5cf6;
    /* Purple */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;

    /* Glass Effect */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(12px);

    /* Spacing */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */
.app-container {
    display: flex;
    flex: 1;
    height: 100%;
    padding: 20px;
    gap: 20px;
}

/* Sidebar / Nav */
.sidebar {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-right: var(--glass-border);
    border-radius: var(--radius-lg);
    /* Floating sidebar look */
    height: calc(100vh - 40px);
    z-index: 1000;
    /* Ensure it's above other elements */
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
}

.nav-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.2rem;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* Main Content area */
/* Main Content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow-y: auto;
    /* Enable scrolling */
    height: 100%;
    /* Take full height */
    padding-right: 10px;
    /* Space for scrollbar */
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    padding: 2px;
}

/* --- Hero Section (Car Display) --- */
.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr;
    /* Car | List | Panel */
    gap: 20px;
    flex: 1;
    min-height: 0;
    padding-bottom: 20px;
}

/* Responsive: Stack Layout on Tablets/Mobile */
@media (max-width: 1200px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        overflow-y: auto;
        padding-right: 5px;
        /* Prevent scrollbar overlap */
    }

    /* Fixed height for list in stack mode to prevent it taking too much vertical space */
    .car-list-vertical {
        height: 350px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 16px;
        padding: 10px;
    }

    /* Make Hero section maintain reasonable height */
    .car-display {
        min-height: 450px;
    }
}

.car-display {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--glass-shadow);
}

.car-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 60%);
    z-index: 0;
}

.active-car-img {
    width: 80%;
    max-width: 600px;
    z-index: 1;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    transition: transform 0.5s ease;
}

.active-car-img:hover {
    transform: scale(1.02);
}

.car-info-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
}

.car-name-large {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.car-plate-large {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 2px;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Mobile Arrows in Car Display */
.mobile-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: center;
}

.mobile-nav-btn:hover {
    background: var(--primary);
}

/* --- Vertical Car List (Center) --- */
.car-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
}

.timeline-car-item {
    min-height: 80px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    flex-shrink: 0;
}

#wizard-step-2:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.timeline-car-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.timeline-car-item.active {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

/* --- Booking Panel --- */
.booking-panel {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    max-height: 100%;
    /* Fix: Ensure this panel is always on top of other layers */
    position: relative;
    z-index: 1000;
}

.panel-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px min-content 1fr;
        gap: 15px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .car-display {
        min-height: 250px;
        max-height: 350px;
        flex-shrink: 0;
    }

    .car-list-vertical {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        min-height: 100px;
        max-height: 120px;
        flex-shrink: 0;
        padding-bottom: 5px;
    }

    .timeline-car-item {
        min-width: 200px;
        min-height: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-nav-btn {
        display: flex;
    }

    .booking-panel {
        max-height: none;
        flex: 1;
    }
}

/* Utilities */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.bg-available {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.bg-busy {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.hidden {
    display: none !important;
}

/* --- Multi-Select Tag Input --- */
.tag-input-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
    cursor: text;
}

.tag-input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.tag {
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-close {
    cursor: pointer;
    opacity: 0.7;
}

.tag-close:hover {
    opacity: 1;
}

.tag-input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    min-width: 100px;
    outline: none;
    padding: 5px;
    font-size: 0.95rem;
}

.suggestions-box {
    position: absolute;
    bottom: 100%;
    /* Drop UP to avoid keyboard covering it */
    top: auto;
    left: 0;
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 5px;
    /* Spacing above input */
    max-height: 180px;
    /* Slightly taller for better view */
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    /* Shadow upwards */
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.suggestion-item:hover {
    background: rgba(6, 182, 212, 0.2);
    color: white;
}

/* --- Centered Modal Overlay */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker bg instead of blur for performance */
    /* REMOVED BACKDROP-FILTER (Causes lag on some devices) */
    align-items: center;
    justify-content: center;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 360px;
    /* Fit calendar */
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Override Flatpickr Dark Theme for Clean Look */
.flatpickr-calendar {
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 auto !important;
}

/* --- Calendar Tooltip --- */
.calendar-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    pointer-events: none;
    /* Let mouse pass through */
    transform: translate(-50%, -110%);
    /* Center above cursor */
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    visibility: hidden;
}

.calendar-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -120%);
    visibility: visible;
}

.tooltip-header {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.tooltip-row {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* --- Weekly Dashboard Grid (Premium Redesign) --- */
.weekly-grid {
    display: flex !important;
    gap: 12px;
    /* height: 100%; removed */
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
    align-items: stretch;
    /* Ensure full height */
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Ensure columns have fixed width in flex container */
.weekly-grid>div {
    flex: 0 0 180px;
    /* Force width */
    width: 180px;
}

.day-column {
    background: rgba(15, 23, 42, 0.9);
    /* Opaque background instead of blur */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    /* CRITICAL for nested flex scroll */
    /* backdrop-filter: blur(10px); -- REMOVED FOR PERFORMANCE */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: background 0.3s;
}

.day-column:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(59, 130, 246, 0.2);
}

.day-header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.day-header.today {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.day-body {
    flex: 1;
    min-height: 0;
    /* CRITICAL for nested flex scroll */
    overflow-y: auto;
    padding: 10px 10px 80px 10px;
    /* Extra bottom padding for mobile menu overlap */
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
}

.trip-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    backdrop-filter: blur(5px);
}

.trip-card:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 0 10px rgba(59, 130, 246, 0.2);
    z-index: 10;
    border-left-width: 4px;
}

.trip-card.active {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.trip-card.future {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.trip-card.past {
    border-left-color: #64748b;
    opacity: 0.6;
    filter: grayscale(0.8);
}

.card-role {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    text-transform: uppercase;
}

.card-driver {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    margin-bottom: 4px;
}

.card-dest {
    font-size: 0.85rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.card-vehicle {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 -12px -12px -12px;
    padding: 8px 12px;
}

/* Premium Dashboard Enhancements */
.weekly-grid::-webkit-scrollbar {
    height: 8px;
}

.weekly-grid::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.weekly-grid::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}

.weekly-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

.daily-column {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 10px;
    min-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-header {
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: inherit;
    /* Matches column background for readability when sticky */
    backdrop-filter: blur(5px);
    border-radius: 12px 12px 0 0;
}

.day-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.day-date {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

.day-header.today .day-date {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.day-header.today .day-name {
    color: #60a5fa;
}

/* Enhanced Trip Card */
.trip-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

.trip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.trip-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

/* Hover glow for status */
.trip-card:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

/* Weekly Navigation Controls */
.week-nav {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.nav-icon-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-icon-btn:active {
    transform: scale(0.95);
}

.nav-text-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0 12px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-text-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Smart Layout Enhancements */

/* Enforce 7 Columns */
.weekly-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 8px;
    /* Slightly tighter gap */
    width: 100%;
}

/* Fluid Density for High Volume Days */
.day-body.density-high {
    gap: 6px;
    /* Tighter gap between cards */
}

/* Compact Card Style */
.trip-card.compact {
    padding: 6px 8px;
    min-height: auto;
}

.trip-card.compact .card-role {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.trip-card.compact .card-driver {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.trip-card.compact .card-dest {
    display: none;
    /* Hide destination in compact mode */
}

.trip-card.compact .card-vehicle {
    display: none;
    /* Hide extra vehicle info in compact mode */
}

/* Expanded Card Style */
.trip-card.expanded {
    padding: 16px;
    border-left-width: 4px;
}

.trip-card.expanded .card-driver {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.trip-card.expanded .card-dest {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* Driver Card Styles */
.driver-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.driver-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.driver-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.driver-info {
    flex: 1;
}

.driver-name {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.95rem;
}

.driver-meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* --- MOBILE OPTIMIZATIONS (Max Width 768px) --- */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
        padding-bottom: 80px;
        /* Space for Bottom Nav */
        flex-direction: column;
        gap: 10px;
    }

    /* Hide Desktop Sidebar */
    .sidebar {
        display: none !important;
    }

    /* Top Bar Adjustments */
    .top-bar {
        padding: 5px 10px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .user-profile #profile-name,
    .user-profile #profile-role {
        display: none;
    }

    /* Hide name on mobile to save space */

    /* Hero Grid Stack */
    .hero-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow-y: visible;
        /* Let page scroll */
    }

    /* Car Display */
    .car-display {
        min-height: 380px;
        /* Taller for mobile to fit everything */
        max-height: none;
        border-radius: 24px;
    }

    .car-name-large {
        font-size: 2.2rem;
    }

    .mobile-nav-btn {
        display: flex;
    }

    /* Show arrows */

    /* Hide Vertical List on Mobile Home (Too cluttered) 
       User can use arrows on Hero to switch */
    .car-list-vertical {
        display: none;
    }

    /* --- MOBILE BOTTOM NAV --- */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 5000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: 15px;
        /* Safe area for iOS home bar */
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #64748b;
        font-size: 0.7rem;
        gap: 4px;
        width: 60px;
    }

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

    .mobile-nav-item i {
        width: 24px;
        height: 24px;
    }

    /* --- BOOKING BOTTOM SHEET --- */
    .booking-panel {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 85dvh;
        /* Dynamic viewport height */
        height: auto;
        /* Allow shrinking */
        z-index: 6000;
        border-radius: 24px 24px 0 0;
        background: #1e293b;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateY(110%);
        padding: 20px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        /* iPhone X+ safe area */
        flex-direction: column;
        /* Ensure vertical stack */
    }

    .booking-panel.open {
        display: flex;
        transform: translateY(0);
    }

    /* Add a drag handle visual */
    .booking-panel::before {
        content: '';
        display: block;
        width: 50px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        margin: 0 auto 20px auto;
    }

    /* --- FLOATING ACTION BUTTON (FAB) --- */
    .mobile-fab {
        display: flex;
        position: fixed;
        bottom: 90px;
        /* Above nav tab */
        right: 20px;
        background: var(--accent);
        color: white;
        border: none;
        padding: 15px 25px;
        border-radius: 30px;
        font-weight: 600;
        font-size: 1rem;
        box-shadow: 0 10px 20px rgba(6, 182, 212, 0.4);
        z-index: 4999;
        align-items: center;
        gap: 8px;
        animation: pulse 2s infinite;
    }

    /* Copyright Adjustments */
    .copyright-footer {
        display: none;
        /* Hide on mobile to save space */
    }

    /* MODALS: Bottom Sheet Style */
    .modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        margin: 0;
        transform: translateY(0);
    }
}

/* Desktop Default Hides */
.mobile-bottom-nav,
.mobile-fab {
    display: none;
}

.copyright-footer {
    position: fixed;
    bottom: 5px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.65rem;
    pointer-events: none;
    text-align: right;
    z-index: 0;
}

/* Show Hero booking button only on mobile */
@media (max-width: 768px) {
    #hero-book-btn {
        display: inline-block !important;
        pointer-events: auto;
        z-index: 100;
        position: relative;
    }

    /* Boost FAB z-index and ensure visibility */
    .mobile-fab {
        z-index: 9999 !important;
        bottom: 85px !important;
        /* Adjust position */
    }
}

/* --- Desktop Schedule Card (Premium) --- */
.booking-card-item {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Optimize transition */
    position: relative;
    /* backdrop-filter: blur(8px); -- REMOVED FOR PERFORMANCE */
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    will-change: transform;
    /* Hint for compositor */
}

.booking-card-item:hover {
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border-left-width: 4px;
}

.booking-card-item.ongoing {
    border-left-color: #ef4444;
    /* Red for Busy */
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), rgba(30, 41, 59, 0.6));
}

.booking-card-item.future {
    border-left-color: #fbbf24;
    /* Yellow for Future */
}

/* Internal Elements */
.card-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    display: inline-block;
    background: rgba(6, 182, 212, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

.card-vehicle {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-top: 2px;
}

.card-driver {
    font-size: 0.8rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-driver::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
}

.card-purpose {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 4px;
    margin-top: 4px !important;
}

.card-info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.2);
}

.booking-card-item:hover .card-info-icon {
    color: var(--accent);
}

/* --- Completed/Returned Card Styling --- */
.booking-card-item.past {
    border-left-color: #64748b;
    /* Gray Border */
    background: rgba(30, 41, 59, 0.4);
    /* Dim background */
    opacity: 0.7;
    filter: grayscale(0.8);
    /* Desaturate colors */
}

/* Ensure text remains readable but dimmed */
.booking-card-item.past .card-time,
.booking-card-item.past .card-vehicle,
.booking-card-item.past .card-driver {
    color: #94a3b8;
    /* Force gray text */
}

.booking-card-item.past .card-info-icon {
    display: none;
    /* Hide icon for cleaner look on past items */
}

.booking-card-item.past:hover {
    transform: none;
    /* No lift effect */
    box-shadow: none;
    opacity: 1;
    /* Brighten slightly on hover to read */
    filter: grayscale(0);

    /* GENERAL UTILITIES */
    .desktop-only {
        display: none !important;
    }
}