:root {
    --text-primary: #212529;
    --primary-color: #1872f9;
    --primary-soft: rgba(24, 114, 249, 0.08);
    --border-color: #e5e7eb;
    --navbar-bg: #ffffff;
    --topbar-bg: #f8f9fa;
    --header-height-mobile: 70px;
    --menu-speed: 0.2s;
    --shadow-sm: 0 8px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
    --blur-amount: 12px;
    --scroll-offset: -70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f7fa;
    color: var(--text-primary);
    padding-top: 135px;
    transition: padding-top 0.2s;
}

/* ----- HEADER – FIXED, SLIDES UP ON SCROLL (DESKTOP) ----- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--navbar-bg);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s;
    will-change: transform;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 992px) {
    .site-header.header-scrolled {
        transform: translateY(var(--scroll-offset));
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 991.98px) {
    .site-header {
        transition: none !important;
        transform: none !important;
    }
    body { padding-top: var(--header-height-mobile); }
}

/* ----- TOP BAR (DESKTOP ONLY) – ENHANCED ACTIVE STATE ----- */
.top-bar {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.7rem;
    padding: 0.5rem 0;
}
.top-bar a {
    color: var(--text-primary) !important;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.top-bar a:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-soft);
    transform: translateY(-1px);
}
/* ✅ ACTIVE STATE – NOW MATCHES MAIN NAV STYLE (blue bg + underline) */
.top-bar a.active {
    color: var(--primary-color) !important;
    background-color: var(--primary-soft) !important;
    font-weight: 600;
    position: relative;
}
.top-bar a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ----- NAVBAR ----- */
.navbar {
    background-color: var(--navbar-bg);
    padding: 2.5rem 1rem;
    height: var(--header-height-mobile);
}
.navbar-brand-container { display: flex; align-items: center; gap: 10px; }
.navbar-brand { margin: 0 !important; padding: 0; }
.navbar-brand img { max-height: 50px; width: auto; }
.brand-text { font-size: 0.5rem; font-weight: 700; line-height: 1; }

/* ----- STATIC HAMBURGER (NO X) ----- */
.navbar-toggler {
    border: none; padding: 0.25rem; width: 30px; height: 30px;
    background: transparent; margin-left: auto;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.navbar-toggler span {
    display: block; height: 2px; width: 100%;
    background-color: var(--text-primary); margin: 3px 0;
    transition: none;
}

/* ----- NAV LINKS (MAIN) ----- */
.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500; padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem; position: relative; white-space: nowrap;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
    border-radius: 6px;
}
.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-soft);
    transform: translateY(-1px);
}
.nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--primary-soft);
}
.nav-link.active::after {
    content: ''; position: absolute; bottom: 0; left: 0.75rem; right: 0.75rem;
    height: 2px; background: var(--primary-color);
}

/* Rotating caret */
.dropdown-toggle::after {
    transition: transform 0.25s ease;
}
.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ----- DROPDOWN MENU (DESKTOP) ----- */
.dropdown-menu {
    border: none; box-shadow: var(--shadow-lg); background: var(--navbar-bg);
    border-radius: 12px; padding: 0.5rem 0;
    margin-top: 0rem;
}
.dropdown-item {
    padding: 0.5rem 1rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 0.6rem;
    transition: background-color 0.2s, transform 0.2s, padding-left 0.2s;
    border-radius: 8px; margin: 0rem 0.5rem; width: auto;
}
.dropdown-item i {
    font-size: 0.8rem; color: var(--primary-color);
    width: 1.2rem; text-align: center;
    transition: transform 0.2s;
}
.dropdown-item:hover i {
    transform: scale(1.15);
}
.dropdown-item:hover {
    background-color: var(--primary-soft);
    transform: translateX(6px);
    padding-left: 1.4rem;
}
/* ✅ ACTIVE STATE FOR DROPDOWN ITEMS */
.dropdown-item.active {
    background-color: var(--primary-soft);
    color: var(--primary-color) !important;
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
    transform: translateX(6px);
    padding-left: 1.4rem;
}
.dropdown-item.active i {
    color: var(--primary-color);
    transform: scale(1.15);
}

/* Desktop hover */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block; opacity: 1; visibility: visible;
        transform: translateY(0); pointer-events: auto;
    }
    .dropdown-menu {
        display: block; opacity: 0; visibility: hidden;
        transform: translateY(-50px); transition: all 0.25s ease;
        pointer-events: none;
    }
}

/* ===== MOBILE STYLES – 2‑COL GRID, CENTERED SOCIAL, NO OVERLAP ===== */
@media (max-width: 991.98px) {
    .top-bar { display: none !important; }

    .navbar-collapse {
        position: fixed; top: 0; right: -100%; bottom: 0;
        width: 320px; max-width: 90%;
        padding: 4rem 1.5rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: -8px 0 30px rgba(0,0,0,0.12);
        transition: right var(--menu-speed) cubic-bezier(0.23, 1, 0.32, 1);
        will-change: right; z-index: 1070;
        overflow-y: auto; height: 100vh;
        display: block !important;
        border-left: 1px solid rgba(255,255,255,0.3);
        border-radius: 16px 0 0 16px;
    }
    .navbar-collapse.show { right: 0; }

    .navbar-backdrop {
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: radial-gradient(circle at 20% 30%, rgba(0,20,40,0.3), rgba(0,0,0,0.55));
        backdrop-filter: blur(var(--blur-amount)) brightness(0.8);
        -webkit-backdrop-filter: blur(var(--blur-amount)) brightness(0.8);
        z-index: 1065; display: none; height: 100vh;
        transition: opacity 0.25s ease;
    }
    .navbar-backdrop.show { display: block; }

    .no-scroll, html.no-scroll { overflow: hidden; height: 100%; touch-action: none; }

    .menu-close-btn {
        position: absolute; top: 20px; right: 22px;
        background: rgba(0,0,0,0.04); border: none;
        font-size: 1.6rem; line-height: 1; color: var(--text-primary);
        cursor: pointer; z-index: 1080;
        width: 42px; height: 42px; display: flex;
        align-items: center; justify-content: center;
        border-radius: 50%; transition: all 0.2s;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255,255,255,0.5);
    }
    .menu-close-btn:hover {
        background-color: var(--primary-soft);
        transform: scale(1.1);
        color: var(--primary-color);
        border-color: var(--primary-color);
    }

    /* 2‑column grid for top links */
    .mobile-top-bar {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.2rem;
        margin-bottom: 1.2rem;
    }
    .mobile-top-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-bottom: 1.5rem;
    }
    .mobile-top-links a {
        display: flex;
        align-items: center;
        padding: 0.65rem 0.8rem;
        background-color: rgba(0,0,0,0.02);
        border-radius: 14px;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        color: var(--text-primary);
        text-decoration: none;
        font-weight: 450;
    }
    .mobile-top-links a i {
        margin-right: 0.7rem;
        color: var(--primary-color);
        font-size: 1.1rem;
        width: 1.3rem;
        text-align: center;
    }
    .mobile-top-links a:hover {
        background-color: var(--primary-soft);
        border-color: rgba(24,114,249,0.3);
        transform: translateX(5px);
    }
    /* ✅ ACTIVE STATE FOR MOBILE TOP LINKS */
    .mobile-top-links a.active {
        background-color: var(--primary-soft);
        border-color: var(--primary-color);
        color: var(--primary-color) !important;
        font-weight: 600;
    }
    .mobile-top-links a.active i {
        color: var(--primary-color);
        transform: scale(1.1);
    }

    /* Social icons – CENTERED */
    .mobile-top-bar .social-icons {
        margin-top: 0.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1.4rem;
        width: 100%;
    }
    .mobile-top-bar .social-icons a {
        color: var(--text-primary);
        font-size: 1.2rem;
        transition: transform 0.2s, color 0.2s;
    }
    .mobile-top-bar .social-icons a:hover {
        color: var(--primary-color);
        transform: translateY(-3px);
    }

    .mobile-top-bar .login-btn {
        margin-top: 1.8rem !important;
        border-radius: 30px;
        padding: 0.6rem;
        font-weight: 500;
        transition: all 0.2s;
    }
    .mobile-top-bar .login-btn:hover {
        background-color: var(--primary-color);
        color: white !important;
        border-color: var(--primary-color);
    }

    .navbar-nav { margin-top: 1rem; width: 100%; }
    .nav-item { width: 100%; }
    .nav-link {
        padding: 0.75rem 0.5rem !important;
        justify-content: flex-start;
    }

    .dropdown-menu {
        position: static !important; transform: none !important;
        border: none; background: transparent; box-shadow: none;
        margin-left: 0.5rem; width: 100%;
        max-height: 0; padding: 0; overflow: hidden;
        display: block !important;
        transition: max-height 0.4s cubic-bezier(0.23, 1, 0.32, 1), padding 0.2s;
        border-radius: 0;
    }
    .dropdown-menu.show {
        max-height: 600px;
        padding: 0.5rem 0;
    }
    /* Mobile dropdown active state */
    .dropdown-item.active {
        background-color: var(--primary-soft);
        border-left: 4px solid var(--primary-color);
    }
}

/* ----- ACCESSIBILITY ----- */
.navbar-toggler:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.menu-close-btn:focus-visible,
.mobile-top-links a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ----- ANIMATIONS ----- */
.bi-animate { transition: transform 0.2s; }
a:hover .bi-animate { transform: translateY(-2px); }

/* ===== FOOTER – CLEAN BLUE GRADIENT ===== */
footer {
    background: linear-gradient(145deg, #0d6efd, #0a58ca) !important;
    color: white !important;
    padding-top: 4rem;
    margin-top: 3rem;
    position: relative;
}
footer h3, footer h5, footer h6 {
    color: white !important;
    font-weight: 600;
}
footer .small, footer p, footer li {
    color: rgba(255, 255, 255, 0.9) !important;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 0.6rem;
}
.footer-links a {
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    font-size: 0.9rem;
}
.footer-links a:hover {
    color: white !important;
    transform: translateX(6px);
}
/* ✅ ACTIVE STATE FOR FOOTER LINKS */
.footer-links a.active {
    color: white !important;
    font-weight: 600;
    border-bottom: 2px solid white;
    padding-bottom: 2px;
}
footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: white;
    transition: all 0.2s;
    margin-right: 0.25rem;
}
footer .social-icons a:hover {
    background: white;
    color: #0d6efd !important;
    transform: translateY(-4px);
}
.footer-bottom {
    background: rgba(0, 0, 0, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.75rem 0;
    margin-top: 3rem;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(24, 114, 249, 0.3);
}

.back-to-top:hover {
    background: #0a58ca;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(24, 114, 249, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile adjustment */
@media (max-width: 576px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}