html {
    scroll-behavior: smooth;
}

:root {
    --nav-primary: #1a4354;
    --nav-accent: #4cabb8;
    --nav-hover-bg: #f4fbfc;
    --nav-font: 'Open Sans', 'Roboto', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   Header & Container Layout
   ========================================================================== */
.header {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(26, 67, 84, 0.06);
    z-index: 997;
    transition: all 0.3s ease;
}

.header .container-fluid {
    padding-left: clamp(15px, 4vw, 50px);
    padding-right: clamp(15px, 4vw, 50px);
}

.header .topbar {
    background: #1a4354;
    color: #ffffff;
    font-size: 0.82rem;
    padding: 6px 0;
    transition: all 0.3s ease;
}

.header .topbar a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.header .topbar a:hover {
    color: #4cabb8;
}

.header .branding {
    min-height: 70px;
    padding: 8px 0;
}

.vidwan-main-logo {
    height: 48px;
    max-height: 52px;
    width: auto;
    object-fit: contain;
    transition: height 0.2s ease;
}

.nav-right-wrap {
    gap: 10px;
}

/* ==========================================================================
   Desktop Navigation Menu (>= 1200px)
   ========================================================================== */
@media (min-width: 1200px) {

    .mobile-nav-backdrop,
    .mobile-nav-header,
    .mobile-nav-footer,
    .mobile-nav-toggle {
        display: none !important;
    }

    .navmenu {
        display: flex;
        align-items: center;
    }

    .nav-list {
        list-style: none;
        padding: 0;
        margin: 0 15px 0 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown-icon {
        font-size: 0.65rem;
        margin-left: 4px;
        transition: transform 0.2s ease;
    }

    .dropdown:hover .nav-dropdown-icon {
        transform: rotate(180deg);
    }

    .nav-link-style {
        color: #1a4354;
        font-weight: 700;
        font-size: 0.92rem;
        text-decoration: none;
        padding: 8px 14px;
        border-radius: 6px;
        transition: all 0.25s ease;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .nav-link-style:hover,
    .nav-link-style.active {
        color: #4cabb8 !important;
        background: #f4fbfc;
    }

    .dropdown-menu-custom {
        position: absolute;
        top: 100%;
        left: 0;
        background: #ffffff;
        min-width: 210px;
        box-shadow: 0 12px 30px rgba(26, 67, 84, 0.12);
        border: 1px solid #e1eff2;
        border-radius: 10px;
        padding: 8px 0;
        list-style: none;
        display: none;
        z-index: 999;
        margin-top: 5px;
        animation: navDropdownFade 0.25s ease forwards;
    }

    @keyframes navDropdownFade {
        from {
            opacity: 0;
            transform: translateY(6px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dropdown:hover .dropdown-menu-custom {
        display: block;
    }

    .dropdown-menu-custom li a {
        font-family: var(--nav-font);
        padding: 10px 18px;
        display: block;
        color: #1a4354;
        text-decoration: none;
        font-size: 0.88rem;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .dropdown-menu-custom li a:hover {
        background: #f4fbfc;
        color: #4cabb8;
        padding-left: 22px;
    }
}

/* Ministry Logo */
.ministry-logo {
    display: inline-flex;
    align-items: center;
    margin: 0 8px;
    height: 38px;
}

.ministry-logo img {
    height: 38px;
    max-height: 42px;
    width: auto;
    object-fit: contain;
}

/* Expert Login / Dashboard Button (Desktop) */
.e_login {
    font-family: var(--nav-font);
    background: #1a4354;
    color: #ffffff !important;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(26, 67, 84, 0.18);
    white-space: nowrap;
    border: 1px solid transparent;
}

.e_login:hover {
    background: #4cabb8;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 171, 184, 0.3);
}

.nav-action-icon {
    font-size: 0.9rem;
}

/* Mobile Hamburger Toggle Button */
.mobile-nav-toggle {
    width: 42px;
    height: 42px;
    background: #f4fbfc;
    border: 1px solid #d8ebef;
    border-radius: 10px;
    color: #1a4354;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(26, 67, 84, 0.08);
    padding: 0;
    margin-left: 6px;
    flex-shrink: 0;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus {
    background: #1a4354;
    color: #ffffff;
    border-color: #1a4354;
}

/* ==========================================================================
   Mobile & Tablet Drawer Menu (< 1200px)
   ========================================================================== */
@media (max-width: 1199px) {

    /* Mobile Backdrop Overlay */
    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10, 28, 36, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    body.mobile-nav-active .mobile-nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.mobile-nav-active {
        overflow: hidden;
    }

    /* Off-Canvas Navigation Drawer */
    .navmenu {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: #ffffff;
        z-index: 9999;
        box-shadow: -6px 0 25px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px;
    }

    body.mobile-nav-active .navmenu {
        right: 0 !important;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 14px;
        margin-bottom: 14px;
        border-bottom: 1px solid #eef3f5;
    }

    .mobile-nav-title {
        font-size: 1.1rem;
        font-weight: 800;
        color: #1a4354;
        letter-spacing: -0.3px;
    }

    .mobile-nav-close {
        width: 36px;
        height: 36px;
        background: #f4fbfc;
        border: 1px solid #d8ebef;
        border-radius: 8px;
        color: #1a4354;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
        transition: all 0.2s ease;
    }

    .mobile-nav-close:hover {
        background: #1a4354;
        color: #ffffff;
    }

    .nav-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .nav-link-style {
        color: #1a4354;
        font-weight: 600;
        font-size: 0.95rem;
        padding: 11px 14px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .nav-link-style:hover,
    .nav-link-style.active {
        background: #f4fbfc;
        color: #4cabb8 !important;
    }

    /* Mobile Accordion Dropdown */
    .dropdown-menu-custom {
        list-style: none;
        padding: 4px 0 4px 15px;
        margin: 4px 0 6px 10px;
        border-left: 2px solid #e1eff2;
        display: none;
    }

    .dropdown-menu-custom.dropdown-active,
    .dropdown.active .dropdown-menu-custom {
        display: block !important;
    }

    .dropdown-menu-custom li a {
        color: #55717d;
        font-size: 0.88rem;
        padding: 8px 12px;
        display: block;
        text-decoration: none;
        border-radius: 6px;
        font-weight: 500;
    }

    .dropdown-menu-custom li a:hover {
        color: #1a4354;
        background: #f4fbfc;
    }

    .nav-dropdown-icon {
        transition: transform 0.3s ease;
    }

    .dropdown.active .nav-dropdown-icon {
        transform: rotate(180deg);
        color: #4cabb8;
    }

    /* Mobile Drawer Footer */
    .mobile-nav-footer {
        margin-top: 20px;
        padding-top: 16px;
        border-top: 1px solid #eef3f5;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .mobile-nav-cta {
        background: linear-gradient(135deg, #1a4354, #2d6b7e);
        color: #ffffff !important;
        font-weight: 700;
        font-size: 0.9rem;
        padding: 12px 18px;
        border-radius: 8px;
        text-align: center;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(26, 67, 84, 0.2);
    }

    .mobile-nav-cta:hover {
        background: #4cabb8;
    }

    .mobile-nav-contact {
        display: flex;
        flex-direction: column;
        gap: 8px;
        font-size: 0.8rem;
        color: #64748b;
    }

    .mobile-nav-contact .contact-item {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-nav-contact .contact-item i {
        color: #4cabb8;
        font-size: 0.85rem;
    }

    .mobile-nav-contact .contact-item a {
        color: #64748b;
        text-decoration: none;
    }
}

/* Small screens adjustments (< 576px) */
@media (max-width: 575px) {
    .header .topbar {
        font-size: 0.72rem;
        padding: 4px 0;
    }

    .header .topbar .contact-info {
        justify-content: center;
        gap: 6px;
    }

    .vidwan-main-logo {
        height: 38px;
        max-height: 40px;
    }

    .ministry-logo {
        height: 30px;
        margin: 0 4px;
    }

    .ministry-logo img {
        height: 30px;
        max-height: 32px;
    }

    .mobile-nav-toggle {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
        border-radius: 8px;
    }
}

/* Extra small screens (< 400px) */
@media (max-width: 400px) {
    .ministry-logo img {
        max-width: 60px;
    }
}