:root {
    --off-white: #F8FAFC;
    --pure-white: #FFFFFF;
    --slate-dark: #0F172A;
    --hyper-blue: #2563EB;
    --muted-text: #64748B;
    --border-light: #E2E8F0;
    --success-green: #10B981;
    --warning-amber: #F59E0B;
    --danger-red: #EF4444;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--off-white);
    color: var(--slate-dark);
    line-height: 1.6;
}

.bg-dark-slate { background-color: var(--slate-dark) !important; }

.text-muted { color: var(--muted-text) !important; }

.text-primary { color: var(--hyper-blue) !important; }

.btn-primary {
    background-color: var(--hyper-blue);
    border-color: var(--hyper-blue);
    transition: all 0.2s ease-in-out;
}
.btn-primary:hover {
    background-color: #1D4ED8;
    border-color: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-outline-primary {
    color: var(--hyper-blue);
    border-color: var(--hyper-blue);
    transition: all 0.2s ease-in-out;
}
.btn-outline-primary:hover {
    background-color: var(--hyper-blue);
    border-color: var(--hyper-blue);
    transform: translateY(-1px);
}

/* Car Cards */
.car-card {
    background: var(--pure-white);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
    height: 100%;
}
.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgb(0 0 0 / 0.1);
}
.car-card .card-img-top {
    height: 220px;
    object-fit: cover;
    background: var(--off-white);
}
.car-card .card-body { padding: 1.25rem; }
.car-card .card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}
.car-card .price-tag {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hyper-blue);
}
.car-card .spec-item {
    font-size: 0.8rem;
    color: var(--muted-text);
}
.car-card .spec-item i { width: 16px; }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--slate-dark) 0%, #1e293b 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 540px;
}
.hero-search-card {
    background: var(--pure-white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Search Filters */
.filter-section {
    background: var(--pure-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}
.filter-section .filter-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    margin-bottom: 0.75rem;
}

/* Car Detail Gallery */
.main-image-container {
    border-radius: 8px;
    overflow: hidden;
    background: var(--off-white);
    margin-bottom: 0.75rem;
}
.main-image-container img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}
.thumbnail-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.thumbnail-list .thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}
.thumbnail-list .thumb:hover { opacity: 0.85; }
.thumbnail-list .thumb.active {
    opacity: 1;
    border-color: var(--hyper-blue);
}
.thumbnail-list .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spec Sheet */
.spec-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}
.spec-item {
    background: var(--pure-white);
    padding: 1rem 1.25rem;
}
.spec-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    margin-bottom: 0.25rem;
}
.spec-item .value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Contact Form Card */
.contact-card {
    background: var(--pure-white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    position: sticky;
    top: 100px;
}

/* Form Floating Labels */
.form-floating > .form-control:focus {
    border-color: var(--hyper-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-floating > .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Pagination */
.pagination .page-link {
    color: var(--slate-dark);
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 2px;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out;
}
.pagination .page-link:hover {
    background: var(--off-white);
    color: var(--hyper-blue);
}
.pagination .page-item.active .page-link {
    background: var(--hyper-blue);
    color: var(--pure-white);
    font-weight: 600;
}
.pagination .page-item.disabled .page-link {
    color: var(--muted-text);
    background: transparent;
}

/* Badges */
.badge-available { background: #D1FAE5; color: #065F46; }
.badge-sold { background: #F3F4F6; color: #4B5563; }
.badge-featured { background: #DBEAFE; color: #1E40AF; }
.badge-unread { background: #FEF3C7; color: #92400E; }
.badge-read { background: #DBEAFE; color: #1E40AF; }
.badge-replied { background: #D1FAE5; color: #065F46; }

/* View Toggle */
.view-toggle .btn {
    border: 1px solid var(--border-light);
    color: var(--muted-text);
    padding: 0.4rem 0.75rem;
    transition: all 0.2s ease-in-out;
}
.view-toggle .btn.active {
    background: var(--hyper-blue);
    border-color: var(--hyper-blue);
    color: var(--pure-white);
}

/* Loading Spinner */
.spinner-overlay {
    display: none;
    text-align: center;
    padding: 3rem 0;
}
.spinner-overlay.active { display: block; }

/* List View */
.car-list-item {
    background: var(--pure-white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}
.car-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgb(0 0 0 / 0.1);
}
.car-list-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Alerts */
.alert-modern {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}
#formAlert { display: none; }
#formAlert.show { display: block; }

/* Navbar */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.7);
    transition: color 0.2s ease-in-out;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--pure-white);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 1.75rem; }
    .hero-section { padding: 3rem 0 2.5rem; }
    .main-image-container img { height: 260px; }
    .spec-sheet { grid-template-columns: 1fr 1fr; }
}
