/* Modern Header - Isolated Styles */

/* Base Header Container */
#modern-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    /* Ensure it stays on top */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    background-color: transparent;
    padding: 0;
}

/* Header Inner Content */
.header-row {
    height: 90px;
    /* Default height */
    transition: height 0.3s ease;
}

/* Container override if needed */
.header-content {
    background: transparent;
}

/* Logo */
.header-logo img {
    height: 60px;
    width: auto;
    transition: filter 0.3s ease, height 0.3s ease;
    filter: brightness(0) invert(1);
    /* White logo initially */
}

/* Navigation Links */
.header-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.header-nav li {
    margin-left: 30px;
}

.header-nav a {
    text-decoration: none;
    color: #ffffff;
    /* White text initially */
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 4px;
    font-family: 'Poppins', sans-serif;
    transition: color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.header-nav a:hover {
    color: #ffffff;
    opacity: 0.8;
}

/* SCROLLED STATE (and Inner Pages) */
#modern-header.scrolled,
#modern-header.header-solid {
    background-color: #ffffff;
    /* White background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#modern-header.scrolled .header-row,
#modern-header.header-solid .header-row {
    height: 70px;
    /* Specific reduced height */
}

#modern-header.scrolled .header-logo img,
#modern-header.header-solid .header-logo img {
    filter: none;
    /* Restore original color */
    height: 50px;
    /* Smaller logo */
}

#modern-header.scrolled .header-nav a,
#modern-header.header-solid .header-nav a {
    text-shadow: none;
    color: #333333;
    /* Dark text */
}

#modern-header.scrolled .header-nav a:hover,
#modern-header.header-solid .header-nav a:hover {
    color: #004b8d;
    /* Primary Color hover */
    border-bottom-color: #00b5e2;
    /* Secondary color underline */
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
}

#modern-header.scrolled .mobile-toggle,
#modern-header.header-solid .mobile-toggle {
    color: #333333;
}

/* Media Query for Mobile */
@media (max-width: 991px) {
    .header-content {
        padding: 0 20px;
    }
}

@media (max-width: 1200px) {

    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl {
        max-width: 1140px;
    }
}

/* --- TOP BAR STYLES --- */
.header-top-bar {
    height: 35px;
    background-color: transparent;
    /* Or a slight dark overlay if preferred */
    display: flex;
    /* Flexbox for layout */
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    /* Subtle divider */
    transition: opacity 0.3s ease, height 0.3s ease;
    font-size: 12px;
    font-weight: 500;
}

.header-top-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    /* Align to right */
    width: 100%;
}

.header-top-bar li {
    margin-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
}

.header-top-bar a {
    text-decoration: none;
    text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 4px;
    color: #ffffff;
    opacity: 0.9;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-top-bar a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Top Bar Scrolled State */
#modern-header.scrolled .header-top-bar,
#modern-header.header-solid .header-top-bar {
    height: 35px;
    /* Keep visible or set to 0 to hide on scroll */
    background: #f8f9fa;
    /* Light grey background when solid */
    border-bottom: 1px solid #e9ecef;
}

#modern-header.scrolled .header-top-bar a,
#modern-header.header-solid .header-top-bar a {
    text-shadow: none;
    color: #555555;
    /* Dark text */
}

/* --- MEGA MENU / DROPDOWN STYLES --- */
.header-nav li {
    position: relative;
    /* Context for absolute dropdown */
}

/* Default Dropdown */
.header-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    /* Generous width */
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 20px 0;
    border-top: 3px solid #004b8d;
    /* Primary color highlight */
    z-index: 1000;
    display: block;
    /* Override bootstrap display:none, manage with opacity/visibility */
}

/* Desktop Dropdown Show on class (for Click action) */
.header-nav li.show-dropdown>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-nav .dropdown-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

.header-nav .dropdown-menu a {
    display: block;
    padding: 10px 25px;
    color: #555555 !important;
    text-transform: none;
    text-shadow: none;
    /* Sentence case for readability */
    font-weight: 500;
    font-size: 14px;
    border-bottom: none;
    transition: all 0.2s ease;
}

.header-nav .dropdown-menu a:hover {
    background-color: #f4f4f4;
    color: #004b8d !important;
    padding-left: 30px;
    /* Slight slide effect */
}

/* Multi-level Dropdown Support (Desktop Fly-out) */
@media (min-width: 992px) {
    .header-nav .dropdown-menu li {
        position: relative;
    }

    .header-nav .dropdown-menu .dropdown-menu {
        top: -20px;
        /* Align with parent item padding */
        right: 100%;
        left: auto;
        /* Fly left instead of right */
        margin-top: 0;
        border-top: none;
        border-right: 3px solid #004b8d;
        /* Sidebar highlight on the right since it's flying left */
        border-left: none;
    }

    /* Chevron left for items with submenus in horizontal mode (flying left) */
    .header-nav .dropdown-menu li.has-children>a::before {
        content: "\f053";
        /* fa-chevron-left */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 10px;
        float: left;
        margin-right: 8px;
        opacity: 0.5;
    }
}

/* Group Headers inside Dropdown (Optional) */
.dropdown-header {
    padding: 10px 25px;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hide mobile-only elements on desktop */
@media (min-width: 992px) {

    .mobile-submenu-header,
    .mobile-nav-header,
    .mobile-nav-close {
        display: none !important;
    }
}

/* Mobile adjustments (Tablet included) */
@media (max-width: 991px) {
    .header-top-bar {
        display: none;
        /* Hide top bar on mobile */
    }

    .mobile-toggle {
        display: block;
    }

    /* Off-Canvas Sidebar Translation (Fullscreen) */
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen */
        width: 100%;
        /* Full Width */
        height: 100vh;
        background: #ffffff;
        z-index: 10001;
        padding: 0;
        overflow-y: auto;
        /* Fixed: Changed from hidden to auto to allow scrolling */
        transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
        display: block !important;
        visibility: visible;
        display: flex;
        flex-direction: column;
    }

    /* Change Chevron Down to Right in Mobile Menu */
    .header-nav .fa-chevron-down {
        transform: rotate(-90deg);
        display: inline-block;
    }

    /* Scrollable Area for Main Menu */
    .header-nav>ul {
        flex: 1;
        overflow-y: auto;
        padding-top: 0;
    }

    .header-nav.active {
        right: 0;
        /* Slide in */
    }

    /* Mobile Nav List */
    .header-nav ul {
        flex-direction: column;
        padding-top: 20px;
    }

    .header-nav li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }

    .header-nav a {
        padding: 20px 25px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        color: #333333 !important;
        font-size: 16px;
        font-weight: 500;
    }

    /* Mobile Dropdowns (Drill Down Panels) */
    .header-nav .dropdown-menu {
        position: fixed;
        /* Fixed coverage */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #ffffff;
        z-index: 10001;
        /* Above main menu */
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateX(100%);
        /* Start hidden right */
        transition: transform 0.3s ease;
        padding: 0;
        overflow-y: auto;
        box-shadow: none;
        border: none;
    }

    .header-nav .dropdown-menu.active-panel {
        transform: translateX(0);
        /* Slide in */
    }

    .header-nav .dropdown-menu a {
        padding: 20px 25px;
        font-size: 15px;
        color: #555 !important;
        border-bottom: 1px solid #f9f9f9;
    }

    /* Submenu Header (Back Button) */
    .mobile-submenu-header {
        display: flex;
        align-items: center;
        padding: 20px;
        background: #f8f9fa;
        border-bottom: 1px solid #eee;
        font-weight: 600;
        color: #333;
        cursor: pointer;
    }

    .mobile-submenu-header i {
        margin-right: 15px;
        font-size: 14px;
        color: #004b8d;
    }

    /* Mobile Header Layout (Logo + Close) */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #eee;
        background: #fff;
    }

    .mobile-nav-close {
        font-size: 24px;
        color: #333;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .mobile-nav-close:hover {
        background: #f0f0f0;
    }

    /* Mobile Top Bar Links Integration */
    .mobile-top-bar-links {
        list-style: none;
        padding: 20px 0;
        margin: 0;
        background: #f8f9fa;
        border-top: 5px solid #004b8d;
    }

    .mobile-top-bar-links li {
        border-bottom: 1px solid #eee;
    }

    .mobile-top-bar-links a {
        padding: 15px 25px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #004b8d !important;
        text-transform: uppercase;
        display: block;
    }
}

/* Backdrop */
.mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-backdrop.active {
    opacity: 1;
    visibility: visible;
}