@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-solid: #1e293b;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-main);
}

/* Layout - App Shell */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-light);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.sidebar .logo {
    margin-bottom: 40px;
}

.logo i {
    color: var(--primary);
    font-size: 28px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px 48px;
    max-width: calc(100vw - 280px);
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 10px 20px;
    width: 400px;
    gap: 12px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

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

.notification-bell {
    position: relative;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.notification-bell:hover {
    color: var(--text-main);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* Grid Layouts */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon.blue { color: var(--primary); background: rgba(59, 130, 246, 0.1); }
.kpi-icon.green { color: var(--success); background: var(--success-bg); }
.kpi-icon.purple { color: #a855f7; background: rgba(168, 85, 247, 0.1); }
.kpi-icon.orange { color: var(--warning); background: var(--warning-bg); }

.kpi-value {
    font-size: 32px;
    font-weight: 700;
}

.trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }


/* Dashboard Charts & Tables Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.chart-container, .list-container {
    padding: 24px;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
}

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

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active, .status-available { background: var(--success-bg); color: var(--success); }
.status-active::before, .status-available::before { background: var(--success); }

.status-pending, .status-reserved { background: var(--warning-bg); color: var(--warning); }
.status-pending::before, .status-reserved::before { background: var(--warning); }

.status-maintenance { background: var(--danger-bg); color: var(--danger); }
.status-maintenance::before { background: var(--danger); }


/* Customer / Public Website Styles */
.public-header {
    padding: 20px 48px;
    background: var(--bg-darker);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.public-header .logo i { font-size: 32px; }
.public-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
.public-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.public-nav a:hover { color: var(--primary); }

.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, #1e293b 0%, var(--bg-darker) 70%);
    z-index: -1;
}

.hero-car {
    position: absolute;
    right: -5%;
    bottom: 15%;
    width: 60%;
    object-fit: contain;
    filter: drop-shadow(0 30px 60px rgba(0,0,0,0.8));
    transform: perspective(1000px) rotateY(-15deg);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-car:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

.hero-content {
    width: 100%;
    max-width: 1400px;
    padding: 0 48px;
    z-index: 2;
}

.hero-title {
    font-size: 80px;
    line-height: 1.1;
    margin-bottom: 24px;
    max-width: 650px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 48px;
    max-width: 500px;
}

.search-widget {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 900px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.search-field {
    flex: 1;
    padding: 0 24px;
    border-right: 1px solid var(--border-light);
}

.search-field:last-of-type {
    border-right: none;
}

.search-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-weight: 600;
}

.search-field input, .search-field select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    outline: none;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    padding-right: 24px;
    text-overflow: ellipsis;
}
.search-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.search-field select option {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 10px;
}

.search-btn {
    padding: 20px 40px;
    border-radius: 100px;
    font-size: 18px;
}

/* Vehicles Section (Public & Admin) */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 48px;
}

.section-title {
    font-size: 40px;
    margin-bottom: 40px;
    text-align: center;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.vehicle-card {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.vehicle-image-container {
    height: 220px;
    width: 100%;
    background: radial-gradient(circle at center, #334155 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.vehicle-image-container img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.5));
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.vehicle-card:hover .vehicle-image-container img {
    transform: scale(1.1);
}

.vehicle-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vehicle-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-light);
    color: white;
    z-index: 2;
}

.vehicle-name {
    font-size: 24px;
    margin-bottom: 4px;
}

.vehicle-type {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.vehicle-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 14px;
    flex: 1;
}

.vehicle-features span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vehicle-features i { color: var(--primary); }

.vehicle-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.vehicle-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.vehicle-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

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

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    padding: 40px;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-main);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

/* Modal specific layout */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.modal-header h2 { margin-bottom: 8px; }
.modal-header p { color: var(--text-muted); margin-bottom: 24px; }

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-strong);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: var(--transition);
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Hide sections for SPA feel */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.tab-content.active {
    display: block;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */

/* Tablets and below */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 56px;
    }
    
    .hero-car {
        width: 80%;
        right: -10%;
        bottom: 15%;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    /* Admin & Dashboard Layout */
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        z-index: 100;
    }
    
    .sidebar .logo {
        margin-bottom: 0;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-darker);
        padding: 16px;
        border-bottom: 1px solid var(--border-light);
        flex-direction: column;
    }
    
    .nav-links.mobile-show {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        max-width: 100%;
    }
    
    .top-header {
        flex-direction: column-reverse;
        gap: 20px;
        align-items: stretch;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .user-profile {
        justify-content: flex-end;
    }
    
    /* Public Website */
    .public-header {
        padding: 12px 16px;
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .public-header .logo {
        font-size: 16px;
        margin: 0;
    }
    
    .public-header .logo i {
        font-size: 20px;
    }
    
    .public-nav {
        display: flex !important;
        width: auto;
        flex-direction: row;
        gap: 12px;
        padding-top: 0;
        margin-top: 0;
        border-top: none;
        align-items: center;
        background: transparent;
        position: static;
    }
    
    .public-nav a {
        font-size: 12px;
        padding: 0;
    }
    
    .public-nav .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .public-header .mobile-menu-btn {
        display: none !important;
    }
    
    .hero-section {
        height: auto;
        min-height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        padding-bottom: 40px;
    }
    
    .hero-content {
        padding: 0 16px;
        z-index: 2;
    }
    
    .hero-title {
        font-size: 40px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .hero-car {
        position: relative;
        width: 100%;
        max-width: 400px;
        right: auto;
        bottom: auto;
        margin: 20px auto 0;
        opacity: 1;
        display: block;
    }
    
    .search-widget {
        flex-direction: column;
        padding: 24px;
        border-radius: 20px;
        gap: 16px;
        background: var(--surface-solid);
        border: 2px solid var(--border-strong);
        box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    }
    
    .search-field {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 0 0 16px 0;
    }
    
    .search-field:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .search-btn {
        width: 100%;
        margin-top: 8px;
    }
    
    .section-container {
        padding: 40px 16px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    /* Tables - Squeeze to fit single view without scrolling */
    .list-container {
        overflow-x: hidden;
        padding: 12px;
    }
    
    table {
        min-width: 0 !important;
        width: 100%;
        font-size: 10px; /* Extremely small text to fit */
    }
    
    th {
        font-size: 9px;
        padding: 8px 2px !important;
    }
    
    td {
        padding: 8px 2px !important;
        word-break: break-word; /* Allow break if absolutely needed, but prefer small font */
    }
    
    /* Status badges */
    .status-badge {
        padding: 4px 6px;
        font-size: 9px;
        gap: 4px;
    }
    .status-badge::before {
        width: 4px; height: 4px;
    }
    
    /* Action buttons in table */
    td .btn {
        padding: 4px 8px !important;
        font-size: 9px !important;
        gap: 4px;
    }
    td i {
        font-size: 10px !important;
    }
    
    /* Flex wrappers in td for actions */
    td > div[style*="display: flex"] {
        gap: 4px !important;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    /* Specific overrides for Customer KYC and long texts */
    td div {
        font-size: 10px !important;
    }
    td span {
        font-size: 9px !important;
    }
    
    /* Modal */
    .modal-content {
        padding: 24px;
        margin: 16px;
    }
    
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* Grid */
    .vehicles-grid {
        gap: 20px;
    }
}
