/* assets/css/styles.css */

/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0f172a;       /* Deep Obsidian Slate */
    --panel-dark: #1e293b;   /* Sleek Dark Blue-Gray */
    --panel-glass: rgba(30, 41, 59, 0.7);
    --border-color: #334155;  /* High-contrast border */
    
    --primary: #4f46e5;       /* Electric Indigo */
    --primary-hover: #6366f1;
    --primary-glow: rgba(79, 70, 229, 0.3);
    
    --accent-teal: #10b981;   /* Emerald Teal for sold/profits */
    --accent-teal-glow: rgba(16, 185, 129, 0.2);
    
    --accent-coral: #f43f5e;  /* Coral Red for expenses */
    --accent-coral-glow: rgba(244, 63, 94, 0.2);
    
    --text-main: #f8fafc;     /* Clear readable white */
    --text-muted: #94a3b8;    /* Slate silver */
    --text-dark: #0f172a;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Navbar */
.navbar {
    background: var(--panel-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand span {
    background: linear-gradient(135deg, #818cf8, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.nav-link.active {
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius) var(--radius) 0 0;
}

.nav-divider {
    width: 1px;
    height: 1.5rem;
    background: var(--border-color);
    align-self: center;
    margin: 0 0.25rem;
}

/* Container */
.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex-grow: 1;
}

/* Cards & Glass Panels */
.card {
    background: var(--panel-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Dashboard Summary Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 130px;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up { color: var(--accent-teal); }
.trend-down { color: var(--accent-coral); }

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 25px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
    background: var(--accent-teal);
    color: var(--text-dark);
}

.btn-accent:hover {
    background: #34d399;
}

.btn-danger {
    background: var(--accent-coral);
    color: var(--text-main);
}

.btn-danger:hover {
    background: #fb7185;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

select.form-control option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Badges for status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-bought { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-inspecting { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-repairing { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-ready { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-sold { background: rgba(156, 163, 175, 0.15); color: #d1d5db; border: 1px solid rgba(156, 163, 175, 0.3); }

/* Grid Layouts */
.truck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.truck-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.truck-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.truck-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.truck-reg {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.truck-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.meta-value {
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

/* Table styling for ledger */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: left;
}

.ledger-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.ledger-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 0.9rem;
}

.ledger-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Photo and Video Gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.media-item-wrapper {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.media-item-wrapper img, .media-item-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.media-item-wrapper:hover img, .media-item-wrapper:hover video {
    transform: scale(1.05);
}

.media-overlay-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.media-item-wrapper:hover .media-overlay-actions {
    opacity: 1;
}

/* File Upload drag & drop zone */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.3);
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Inspection Checklist UI */
.inspection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.inspection-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .inspection-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .inspection-details {
        flex: 1;
    }
    
    .inspection-controls {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        min-width: 400px;
    }
}

.status-options {
    display: flex;
    gap: 0.5rem;
}

.status-btn {
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.status-btn.active-Good { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: #10b981; }
.status-btn.active-Fair { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: #f59e0b; }
.status-btn.active-Repair { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: #8b5cf6; }
.status-btn.active-Critical { background: rgba(244, 63, 94, 0.15); color: #fb7185; border-color: #f43f5e; }

/* Dashboard Chart Elements */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-teal));
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* Alert Notification Banner */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #34d399; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fbbf24; }
.alert-error { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.2); color: #fb7185; }

/* Timeline UI */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--primary);
    top: 4px;
}

.timeline-dot.completed {
    border-color: var(--accent-teal);
    background: var(--accent-teal);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

/* Footer Styling */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

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

footer a:hover {
    text-decoration: underline;
}

/* Search bar styling */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.filter-item {
    flex: 1 1 200px;
}
