/* --- 1. THEME VARIABLES (The Engine) --- */
:root {
    --primary-color: #0d6efd;
    --p-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #555555;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --card-bg: #fdfdfd;
    --category-bg: rgba(0,0,0,0.03);
    --glass-border: rgba(0,0,0,0.1);
    --shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* All sections will automatically switch when this class is active */
html.dark-mode {
    --p-bg: #121212;
    --text-main: #f8f9fa;
    --text-muted: #cccccc;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --card-bg: rgba(20, 20, 20, 0.4); /* Glass Effect for dark cards */
    --category-bg: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.1);
    --shadow: 0 20px 50px rgba(0,0,0,0.6);
}

/* --- 2. GLOBAL RESET --- */
body { 
    font-family: sans-serif; 
    background-color: var(--p-bg); 
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease; 
    margin: 0;
}

h1, h2, h5, .display-3 { color: var(--text-main); transition: color 0.3s ease; }
.text-dark { color: var(--text-main) !important; }
.bg-light { background-color: var(--category-bg) !important; transition: background 0.3s ease; }

/* --- 3. REUSABLE GLASS COMPONENTS --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}




/* --- 4. NAVIGATION & THEME CONTROLS --- */

/* Default Light Mode: Pure White & Black Text */
:root {
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-text: #000000;
    --nav-border: rgba(0, 0, 0, 0.1);
    --dropdown-bg: #ffffff;
    --item-hover: #f8f9fa;
}

/* Dark Mode Override */
html.dark-mode {
    --nav-bg: rgba(0, 0, 0, 0.6);
    --nav-text: #ffffff;
    --nav-border: rgba(255, 255, 255, 0.1);
    --dropdown-bg: rgba(20, 20, 20, 0.98);
    --item-hover: rgba(255, 255, 255, 0.05);
}

.glass-navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--nav-border);
    transition: background 0.3s ease, color 0.3s ease;
}

.navbar-brand, .nav-link {
    color: var(--nav-text) !important;
}

/* Arrow (Caret) Side Alignment Fix */
.dropdown-toggle::after {
    margin-left: auto; /* Pushes arrow to the right in flex containers */
    display: inline-block;
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 991px) {
    /* Prevent Logo and Toggler from breaking into 2 lines */
    .glass-navbar .container-fluid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
    }

    /* Fixed the "Pushing" nonsense: This ensures the menu stays inside the navbar area */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 10px;
        right: 10px;
        background: var(--dropdown-bg);
        margin-top: 5px;
        padding: 20px;
        border-radius: 15px;
        border: 1px solid var(--nav-border);
        box-shadow: 0 15px 35px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    .nav-link {
        padding: 12px 10px !important;
        border-bottom: 1px solid var(--nav-border);
    }

    .nav-actions {
        margin-top: 15px;
        justify-content: space-between;
    }
}

/* Underline Animation */
.navbar-nav .nav-link {
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: 0; left: 50%;
    background-color: var(--primary-color);
    transition: 0.3s;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Glass Dropdowns */
.glass-dropdown {
    background: var(--dropdown-bg) !important;
    backdrop-filter: blur(15px);
    border: 1px solid var(--nav-border) !important;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.glass-dropdown .dropdown-item {
    color: var(--nav-text) !important;
}

.glass-dropdown .dropdown-item:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
}

/* Toggler Icon Visibility */
.navbar-toggler { border-color: var(--nav-border); }
html:not(.dark-mode) .navbar-toggler-icon { filter: brightness(0); }
html.dark-mode .navbar-toggler-icon { filter: invert(1); }

/* --- CHEVRON (DROPDOWN ARROW) ALIGNMENT --- */

/* Force the arrow to the right of the flex container */
.dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

/* Move the chevron to the far right side */
.dropdown-toggle::after {
    margin-left: 15px !important; /* Space between text and arrow */
    vertical-align: middle;
    border-top: 0.35em solid; /* Ensures the arrow size is consistent */
    border-right: 0.35em solid transparent;
    border-left: 0.35em solid transparent;
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 991px) {
    /* Ensure the menu doesn't push the logo down */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 5%;
        right: 5%;
        background: var(--dropdown-bg);
        margin-top: 10px;
        padding: 20px;
        border-radius: 15px;
        border: 1px solid var(--nav-border);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 9999;
    }

    /* Make sure the text spans full width so chevron hits the right edge */
    .navbar-nav {
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%; /* Force link to take full width of mobile drawer */
    }
}

/* --- THEME COLORS (Refined) --- */
:root {
    --nav-bg: rgba(255, 255, 255, 0.98);
    --nav-text: #000000;
    --nav-border: rgba(0, 0, 0, 0.1);
    --dropdown-bg: #ffffff;
}

html.dark-mode {
    --nav-bg: rgba(0, 0, 0, 0.7);
    --nav-text: #ffffff;
    --nav-border: rgba(255, 255, 255, 0.1);
    --dropdown-bg: rgba(25, 25, 25, 0.98);
}

.glass-navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--nav-border);
}

.nav-link, .navbar-brand {
    color: var(--nav-text) !important;
}








/* --- 5. HERO SECTION --- */
.hero-section {
    position: relative;
    height: 100vh;
    background: url('assets/hero-car.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 1;
}
.hero-content { z-index: 2; position: relative; color: #fff; }

/* --- 6. CATEGORIES (Car Icons) --- */
.category-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100px; height: 100px; text-align: center;
    background: var(--category-bg); 
    border-radius: 50%; padding: 15px;
    cursor: pointer; transition: all 0.2s ease;
}
.category-item:hover { background: rgba(128,128,128,0.1); transform: scale(1.05); }
.category-item img { 
    width: 50px; margin-bottom: 8px; 
    filter: grayscale(1); 
    transition: filter 0.3s ease;
}
.category-item p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* Invert icons in dark mode */
html.dark-mode .category-item img { filter: invert(1) grayscale(1); }

/* --- 7. CAR CARDS --- */
.car-card { 
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.car-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.car-img-container img { height: 200px; object-fit: cover; }

/* --- 8. FOOTER --- */
.glass-footer {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}
.border-white-10 { border-color: rgba(255,255,255,0.1) !important; }






/* --- RECENT NEWS & ARTICLES --- */

.recent-news {
    background-color: var(--p-bg);
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow) !important;
}

.article-img-wrapper {
    overflow: hidden;
}

.article-img-wrapper img {
    transition: transform 0.5s ease;
    object-fit: cover;
    width: 100%;
}

.article-card:hover .article-img-wrapper img {
    transform: scale(1.1);
}

.x-small {
    font-size: 0.75rem;
}

/* Featured card specific adjustment for mobile */
@media (max-width: 767px) {
    .featured-card .row.g-0 {
        flex-direction: column;
    }
    .featured-card .article-img-wrapper {
        height: 250px !important;
    }
    .featured-card .card-body {
        padding: 2rem !important;
    }
}

/* Grid adjustment to ensure clean row on desktop */
@media (min-width: 992px) {
    .featured-card {
        min-height: 400px;
    }
}





/* --- NEWSLETTER STYLING --- */
.newsletter-section {
    background-color: var(--p-bg);
    transition: background-color 0.3s ease;
}

.newsletter-form {
    background-color: var(--card-bg);
    border-color: var(--glass-border) !important;
}

.newsletter-form input {
    color: var(--text-main);
}

.newsletter-form input:focus {
    box-shadow: none;
    outline: none;
}

/* --- FOOTER STYLING --- */
.main-footer {
    background-color: #1a1a1a; /* Dark footer as per reference image */
    color: #ffffff;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
}

.contact-icon-box {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.text-secondary {
    color: #888 !important;
}

@media (max-width: 991px) {
    .newsletter-form {
        border-radius: 12px;
        flex-direction: column;
        padding: 10px;
    }
    .newsletter-form button {
        border-radius: 8px !important;
        width: 100%;
        margin-top: 10px;
    }
    .main-footer {
        text-align: center;
    }
    .contact-list li {
        justify-content: center;
    }
}






        /* --- BREADCRUMB STYLING --- */

.page-breadcrumb {
    position: relative;
    padding: 120px 0; /* Slightly increased for better impact */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; 
    min-height: 350px; /* Increased from your 300px for a more premium feel */
    display: flex;
    align-items: center;
}

/* Darker overlay with higher opacity */
.breadcrumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker gradient: 85% opacity on left, 70% on right */
    background: linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

/* Theme Integration */
.page-breadcrumb .breadcrumb-item a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.page-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* Custom Separator */
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "|";
    color: rgba(255, 255, 255, 0.6); /* Increased opacity for visibility */
    padding: 0 15px;
}

/* Dark Mode Specific: Almost Pitch Black Overlay */
html.dark-mode .breadcrumb-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
}

@media (max-width: 768px) {
    .page-breadcrumb {
        padding: 80px 0;
        min-height: 250px;
        background-attachment: scroll; /* Fixed background can be glitchy on mobile */
    }
    .page-breadcrumb h1 {
        font-size: 2.2rem;
    }
}