/* Auto Link Malawi - CarGurus Style Design */

/* Import fonts - Montserrat as primary font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* Preload fonts for better performance */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/montserrat/v25/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Hw5aXpsog.woff2') format('woff2');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-weight: 400;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    transition: font-family 0.3s ease;
}

/* Apply Montserrat when font is loaded */
.font-loaded {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Apply Montserrat font to all text elements when loaded */
.font-loaded h1, .font-loaded h2, .font-loaded h3, .font-loaded h4, .font-loaded h5, .font-loaded h6,
.font-loaded p, .font-loaded span, .font-loaded div, .font-loaded a, .font-loaded button, .font-loaded input, .font-loaded select, .font-loaded textarea,
.font-loaded label, .font-loaded li, .font-loaded ul, .font-loaded ol, .font-loaded table, .font-loaded th, .font-loaded td {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Specific font weights for Montserrat */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

h4, h5, h6 {
    font-weight: 500;
    letter-spacing: -0.005em;
}

button, .btn {
    font-weight: 500;
    letter-spacing: 0.01em;
}

input, select, textarea {
    font-weight: 400;
    letter-spacing: 0.005em;
}

/* Override any existing font-family declarations */
* {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Font Awesome icons styling */
.fas, .far, .fab, .fa {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'Font Awesome 6 Brands' !important;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure icons are not blocked */
i[class*="fa-"], i[class*="fas"], i[class*="far"], i[class*="fab"] {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Specific icon styling */
.fa-search, .fa-times, .fa-sync-alt, .fa-filter, .fa-chevron-down, .fa-heart, .fa-times-circle, .fa-spinner {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

/* Spinner animation */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Vehicle Detail Modal */
.vehicle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.vehicle-modal.show {
    display: flex;
}

.vehicle-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.vehicle-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.vehicle-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.vehicle-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* Vehicle Gallery */
.vehicle-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.main-vehicle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
}

.image-nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: all 0.2s;
}

.image-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.image-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #007bff;
}

/* Vehicle Info */
.vehicle-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.vehicle-basic-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.vehicle-basic-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9rem;
}

.vehicle-price-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-weight: 500;
    color: #666;
}

.vehicle-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff;
}

.total-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

/* Specifications */
.vehicle-specs h4,
.vehicle-features h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.spec-label {
    font-weight: 500;
    color: #666;
}

.spec-value {
    font-weight: 600;
    color: #333;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.feature-item.available {
    background: #d4edda;
    color: #155724;
}

.feature-item.unavailable {
    background: #f8d7da;
    color: #721c24;
}

/* Modal Footer */
.vehicle-modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.inquiry-btn,
.favorite-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.inquiry-btn {
    background: #007bff;
    color: white;
}

.inquiry-btn:hover {
    background: #0056b3;
}

.favorite-btn {
    background: #6c757d;
    color: white;
}

.favorite-btn:hover {
    background: #5a6268;
}

.favorite-btn.favorited {
    background: #dc3545;
}

.favorite-btn.favorited:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vehicle-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .vehicle-modal-header {
        padding: 15px 20px;
    }
    
    .vehicle-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Styles */
.pagination-controls {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover:not(.disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e1e5e9;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    letter-spacing: -0.02em;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 3rem;
    align-items: center;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.75rem;
    transition: color 0.3s ease;
    z-index: 101;
    border-radius: 4px;
}

.mobile-menu-toggle:hover {
    color: #ff6b6b;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #1a202c;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Currency Switcher Styles */
.currency-switcher {
    display: flex;
    align-items: center;
}

.currency-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    min-width: 80px;
    justify-content: center;
}

.currency-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.currency-btn:active {
    transform: translateY(1px);
}

.currency-btn i {
    font-size: 12px;
    opacity: 0.7;
}

.currency-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.currency-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* WhatsApp Button Styles - Floating */
.whatsapp-contact {
    display: flex;
    align-items: center;
}

.whatsapp-btn {
    background: #25d366;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.whatsapp-btn:hover {
    background: #1da851;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

/* Mobile adjustments for floating WhatsApp */
@media (max-width: 768px) {
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 20px;
        right: 20px;
    }
}

.auth-buttons {
    display: inline-block;
}

.auth-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.auth-icon:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.auth-icon.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.user-info, .admin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar, .admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-avatar {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.admin-avatar {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.dashboard-btn, .admin-dashboard-btn {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-dashboard-btn {
    background: #dc2626;
}

.dashboard-btn:hover, .admin-dashboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logout-btn, .admin-logout-btn {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-logout-btn {
    background: #6b7280;
}

.logout-btn:hover, .admin-logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Layout */
.main-layout {
    display: flex;
    width: 100%;
    padding: 0 20px;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-section {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.filter-title .arrow {
    transition: transform 0.2s;
}

.filter-title.collapsed .arrow {
    transform: rotate(-90deg);
}

.filter-content {
    display: block;
    max-height: 400px;
    overflow-y: auto;
}

.filter-content.collapsed {
    display: none;
}

/* Special styling for make filter with many options */
#makeFilter .filter-content {
    max-height: 600px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 8px;
}

#makeFilter .filter-option {
    margin-bottom: 8px;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

#makeFilter .filter-option:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.filter-option input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.filter-option label {
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
}

.price-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.year-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.year-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Filter Actions */
.filter-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apply-filters-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.apply-filters-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.apply-filters-btn:active {
    transform: translateY(0);
}

.apply-filters-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.apply-filters-btn:disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

.clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
}

.clear-filters-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.clear-filters-btn:active {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e1e5e9;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-container {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 300px;
}

.search-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
    color: #333;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.search-btn:hover {
    color: #007bff;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 4px;
}

.clear-search-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

.refresh-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: #e9ecef;
    color: #007bff;
    border-color: #007bff;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.clear-all {
    color: #007bff;
    text-decoration: none;
    font-size: 0.875rem;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: #666;
}

/* Car Grid */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.car-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.car-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.car-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.car-card:hover .car-image {
    transform: scale(1.05);
}


.car-content {
    padding: 16px;
}

.car-title {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 8px;
    line-height: 1.3;
}

.car-title a {
    color: inherit;
    text-decoration: none;
}

.car-title a:hover {
    color: #007bff;
}

.car-specs {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: #666;
}

.car-price-section {
    margin-bottom: 12px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.price-row:last-child {
    margin-bottom: 0;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.price-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.base-price {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.total-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
}

.car-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 12px;
}

.sold-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.sold-badge i {
    font-size: 0.875rem;
}

.car-link {
    display: block;
    background: #000;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    width: 100%;
}

.car-link:hover {
    background: #333;
}

/* Request Invoice Button Styles */
.request-invoice-btn {
    display: block;
    background: #007bff;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    width: 100%;
    margin-top: 8px;
}

.request-invoice-btn:hover {
    background: #0056b3;
}

.request-invoice-btn.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.request-invoice-btn.disabled:hover {
    background: #6c757d;
}

.sold-card {
    opacity: 0.6;
    position: relative;
    cursor: not-allowed;
    pointer-events: none;
}

.sold-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 2;
    pointer-events: none;
}

.sold-card .car-image {
    filter: grayscale(100%);
}

.sold-card .car-title {
    color: #6b7280 !important;
    cursor: not-allowed;
}

.sold-card .car-title a {
    color: #6b7280 !important;
    text-decoration: none;
    cursor: not-allowed;
    pointer-events: none;
}

.sold-card .car-title a:hover {
    color: #6b7280 !important;
    text-decoration: none;
}

.sold-title {
    color: #6b7280 !important;
    cursor: not-allowed;
}

.sold-link {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.sold-link:hover {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none;
}

.sold-link.disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none;
}

/* Pagination */
.pagination-controls {
    text-align: center;
    margin-top: 40px;
    padding: 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pagination button {
    background: white;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination button:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e1e5e9;
}

.pagination button.ellipsis {
    background: none;
    border: none;
    cursor: default;
    color: #999;
}

.pagination button.ellipsis:hover {
    background: none;
    transform: none;
}

.pagination-info {
    color: #666;
    font-size: 0.875rem;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Loader Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.page-loader.show {
    opacity: 1;
    visibility: visible;
}

.page-loader-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.page-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.page-loader-text {
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.page-loader-subtext {
    color: #666;
    font-size: 0.875rem;
    margin: 8px 0 0 0;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
    border: 1px solid #f5c6cb;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        padding: 0 16px;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 24px;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        height: auto;
        padding: 1rem 2rem;
    }

    /* Mobile header improvements */
    .logo-image {
        height: 70px;
        width: auto;
    }

    .header-actions {
        gap: 8px;
    }

    .header {
        height: auto;
    }

    /* Show mobile menu toggle on tablets and mobile */
    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        z-index: 102;
    }

    /* Position header-container relatively for mobile menu */
    .header-container {
        position: relative;
    }

    /* Ensure header has proper positioning */
    .header {
        position: relative;
        z-index: 100;
    }

    /* Hide regular nav menu on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        border-radius: 0 0 20px 20px;
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        z-index: 100;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu .nav-link {
        color: #2c3e50;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .nav-menu .nav-link:hover {
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
    }

    /* Mobile header authentication fixes */
    .user-info, .admin-info {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        text-align: center;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        min-width: 200px;
    }

    .user-avatar, .admin-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .dashboard-btn, .admin-dashboard-btn {
        padding: 0.5rem 0.75rem;
        font-size: 12px;
        border-radius: 8px;
    }

    .logout-btn, .admin-logout-btn {
        padding: 0.5rem 0.75rem;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .nav-menu {
        gap: 16px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .search-container {
        min-width: auto;
        width: 100%;
    }
}

@media (min-width: 1400px) {
    .main-layout {
        padding: 0 40px;
    }
    
    .header-content {
        padding: 0 40px;
    }
}

@media (max-width: 480px) {
    .cars-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .car-content {
        padding: 12px;
    }

    /* Mobile header fixes for very small screens */
    .header-container {
        padding: 0.75rem 1rem;
        gap: 12px;
    }

    .logo-image {
        height: 65px; /* Slightly smaller on very small screens but still larger than desktop */
    }

    .user-info, .admin-info {
        min-width: 160px;
        padding: 0.75rem;
    }

    .user-avatar, .admin-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .dashboard-btn, .admin-dashboard-btn, .logout-btn, .admin-logout-btn {
        padding: 0.375rem 0.625rem;
        font-size: 11px;
    }

    /* Ensure mobile menu is visible on very small screens */
    .mobile-menu-toggle {
        font-size: 2rem;
        padding: 1rem;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .pagination button {
        padding: 6px 10px;
        min-width: 36px;
        font-size: 0.875rem;
    }
}

/* Footer Styles */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 5rem 0 3rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-section {
    text-align: center;
}

.footer-section h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links .footer-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ffffff;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
}

.footer-links .footer-link:hover {
    background: #ffffff;
    color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}


.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #ff6b6b;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.5rem;
    }
    
    .footer-section p {
        font-size: 0.9rem;
    }
    
    .footer-links .footer-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
