/* ========================================
   HEADER — Utility Bar, Navigation, Search
   Shared across all pages
   ======================================== */

/* ========== TOP UTILITY BAR ========== */
.top-utility-bar {
    background-color: #0b2e4f;
    color: #ffffff;
    padding: 8px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.utility-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.utility-text {
    color: #ffffff;
    font-weight: 400;
}

.help-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.help-link:hover {
    color: #64b5f6;
    border-bottom: 1px solid #64b5f6;
}

.utility-bar-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.utility-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.utility-link:hover {
    color: #64b5f6;
}

.language-select {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: auto;
}

.language-select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #64b5f6;
}

.language-select:focus {
    outline: 2px solid #64b5f6;
    outline-offset: 1px;
}

.language-select option {
    background-color: #0b2e4f;
    color: #ffffff;
    padding: 8px;
}

/* RTL Support — Header */
[dir="rtl"] .utility-bar-left,
[dir="rtl"] .utility-bar-right {
    direction: rtl;
}

[dir="rtl"] .nav-menu-links {
    direction: rtl;
}

[dir="rtl"] .mega-dropdown-inner {
    direction: rtl;
    text-align: right;
}

/* ========== MAIN NAVIGATION HEADER ========== */
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 60px;
    background: rgba(14, 13, 13, 0.45);
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.main-header.scrolled {
    position: fixed;
    background: rgba(26, 25, 25, 0.45);
    backdrop-filter: blur(6px);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 2;
}

/* Logo Section */
.nav-logo-section {
    flex-shrink: 0;
}

.logo {
    font-size: 10px;
    font-weight: 300;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.logo img {
    max-width: 70px;
    height: auto;
}

.logo:hover {
    color: #64b5f6;
}

/* Center Navigation Menu */
.nav-menu-links {
    display: flex;
    list-style: none;
    gap: 35px;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.nav-menu-links li {
    margin: 0;
    padding: 0;
}

.nav-menu-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-menu-links a:hover {
    color: #64b5f6;
}

/* ========== MEGA DROPDOWN ========== */
.has-mega-dropdown {
    position: relative;
}

.mega-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.mega-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.has-mega-dropdown:hover .mega-arrow,
.has-mega-dropdown.open .mega-arrow {
    transform: rotate(180deg);
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 580px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border-radius: 0 0 6px 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 200;
    border-top: 3px solid var(--dark-blue);
}

.has-mega-dropdown:hover .mega-dropdown,
.has-mega-dropdown.open .mega-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mega-dropdown-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 28px 0;
}

.mega-col {
    padding: 0 28px;
    border-right: 1px solid #eee;
}

.mega-col:last-child {
    border-right: none;
}

.mega-col-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--dark-blue);
    display: inline-block;
}

.mega-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-links li {
    margin-bottom: 6px;
}

.mega-links a {
    color: #444 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 6px 0;
    display: block;
    transition: color 0.2s ease, padding-left 0.2s ease;
    white-space: nowrap;
}

.mega-links a:hover {
    color: var(--dark-blue) !important;
    padding-left: 6px;
}

/* ========== SIMPLE DROPDOWN (Latest menu) ========== */
.has-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.has-dropdown:hover .mega-arrow,
.has-dropdown.open .mega-arrow {
    transform: rotate(180deg);
}

.sub-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 200px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border-radius: 0 0 6px 6px;
    border-top: 3px solid var(--dark-blue);
    list-style: none;
    margin: 0;
    padding: 12px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}

.has-dropdown:hover .sub-dropdown,
.has-dropdown.open .sub-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.sub-dropdown li {
    margin: 0;
    padding: 0;
}

.sub-dropdown a {
    display: block;
    padding: 8px 24px;
    color: #444 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    transition: color 0.2s ease, padding-left 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.sub-dropdown a:hover {
    color: var(--dark-blue) !important;
    background: #f5f5f5;
    padding-left: 30px;
}

/* Wide variant for What We Do dropdown */
.mega-dropdown-wide {
    min-width: 720px;
}

.mega-col-programs {
    flex: 1.4;
}

.mega-links-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 20px;
}

.mega-link-icon {
    width: 18px;
    font-size: 13px;
    color: var(--dark-blue);
    margin-right: 4px;
    text-align: center;
}

/* Right Section: Search + Donate */
.nav-right-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.search-icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon-btn:hover {
    color: #64b5f6;
}

/* Donate Button */
.donate-btn {
    background-color: #0066cc;
    border: none;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
}

.donate-btn:hover {
    background-color: #0052a3;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Close Button — hidden on desktop */
.mobile-menu-close {
    display: none !important;
}

/* ========== SEARCH OVERLAY ========== */
.search-overlay {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(11, 46, 79, 0.95);
    padding: 20px 60px;
    z-index: 101;
    backdrop-filter: blur(10px);
    animation: searchSlideDown 0.3s ease;
}

.search-overlay.active {
    display: block;
}

@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-form {
    display: flex;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    outline: none;
    transition: background 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.25);
}

.search-submit-btn {
    background: #0066cc;
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-submit-btn:hover {
    background: #0052a3;
}

.search-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.3s ease;
}

.search-close-btn:hover {
    color: #64b5f6;
}

/* SEARCH RESULTS */
.search-results {
    padding: 16px 0 10px;
    max-height: 400px;
    overflow-y: auto;
}
.search-results-count {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
}
.search-results-count strong {
    color: #fff;
}
.search-no-results {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    padding: 10px 0;
}
.search-no-results strong {
    color: #fff;
}
.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.search-result-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}
.search-result-link:hover {
    background: rgba(255,255,255,0.1);
}
.search-result-title {
    font-size: 15px;
    font-weight: 500;
}
.search-result-page {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.08);
    padding: 3px 10px;
    border-radius: 20px;
}

/* ========================================
   HEADER RESPONSIVE — 1024px (Tablet)
   ======================================== */
@media (max-width: 1024px) {
    .main-header {
        padding: 15px 30px;
    }

    .nav-menu-links {
        gap: 16px;
    }

    .nav-menu-links a {
        font-size: 13px;
    }

    .logo img {
        max-width: 100px;
    }

    .mega-dropdown {
        min-width: 440px;
        left: 0;
        transform: translateX(0) translateY(10px);
    }

    .has-mega-dropdown:hover .mega-dropdown,
    .has-mega-dropdown.open .mega-dropdown {
        transform: translateX(0) translateY(0);
    }

    .mega-dropdown-wide {
        min-width: 540px;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }

    .has-mega-dropdown:hover .mega-dropdown-wide,
    .has-mega-dropdown.open .mega-dropdown-wide {
        transform: translateX(-50%) translateY(0);
    }

    .mega-dropdown-inner {
        padding: 20px 0;
    }

    .mega-col {
        padding: 0 18px;
    }

    .mega-col-title {
        font-size: 11px;
        letter-spacing: 0.8px;
    }

    .mega-links a {
        font-size: 13px !important;
    }

    .mega-links-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .top-utility-bar {
        padding: 8px 30px;
    }

    .search-overlay {
        padding: 15px 30px;
    }
}

/* ========================================
   HEADER RESPONSIVE — 768px (Mobile)
   ======================================== */
@media (max-width: 768px) {
    .top-utility-bar {
        padding: 8px 15px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .utility-bar-left {
        width: 100%;
        flex-direction: column;
        gap: 4px;
    }

    .utility-text {
        font-size: 12px;
    }

    .utility-bar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .utility-link {
        font-size: 12px;
    }

    /* Main Header - Mobile */
    .main-header {
        padding: 12px 15px;
    }

    .main-header.scrolled {
        position: fixed;
    }

    .main-nav {
        gap: 12px;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 16px;
    }

    .logo img {
        max-width: 55px;
    }

    /* Hide nav menu on mobile, show hamburger */
    .nav-menu-links {
        display: none;
        width: 100%;
    }

    .nav-menu-links.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(180deg, #072038 0%, #0b2e4f 40%, #0e3a63 100%);
        padding: 0;
        gap: 0;
        z-index: 98;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 0;
    }

    /* Mobile close button */
    .nav-menu-links.open .mobile-menu-close {
        display: flex !important;
        justify-content: flex-end;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 0;
        background: #072038;
        z-index: 10;
    }

    .mobile-close-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s, border-color 0.2s;
        font-family: inherit;
    }

    .mobile-close-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: #fff;
    }

    .mobile-close-btn i {
        font-size: 16px;
    }

    .nav-menu-links.open > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .nav-menu-links.open > li > a,
    .nav-menu-links.open > li > .mega-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 16px;
        font-weight: 500;
        padding: 16px 24px;
        color: #ffffff;
        border-bottom: none;
        letter-spacing: 0.2px;
    }

    .nav-menu-links.open > li > a:hover,
    .nav-menu-links.open > li > .mega-trigger:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Mega Dropdown - Mobile: smooth accordion */
    .has-mega-dropdown {
        position: static;
    }

    .mega-dropdown {
        position: static;
        transform: none !important;
        min-width: 100% !important;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .has-mega-dropdown:hover .mega-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        max-height: 0;
        transform: none !important;
    }

    .has-mega-dropdown.open .mega-dropdown {
        max-height: 800px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none !important;
    }

    .mega-dropdown-inner {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.15);
    }

    .mega-col {
        padding: 14px 24px 14px 36px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mega-col:last-child {
        border-bottom: none;
    }

    .mega-col-title {
        color: rgba(255, 255, 255, 0.5);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        border-bottom: none;
        margin-bottom: 8px;
        padding-bottom: 0;
        display: block;
    }

    .mega-links li {
        margin-bottom: 0;
    }

    .mega-links a {
        color: rgba(255, 255, 255, 0.85) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        padding: 8px 0 8px 12px !important;
        border-bottom: none !important;
        border-left: 2px solid transparent;
        white-space: normal !important;
        transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    }

    .mega-links a:hover {
        color: #ffffff !important;
        border-left-color: #64b5f6;
        background: rgba(255, 255, 255, 0.04);
        padding-left: 16px !important;
    }

    .mega-links-2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .mega-link-icon {
        color: #64b5f6;
        width: 20px;
    }

    .mega-arrow {
        color: rgba(255, 255, 255, 0.5);
        font-size: 12px;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .has-mega-dropdown.open > .mega-trigger .mega-arrow {
        color: #64b5f6;
    }

    /* Simple dropdown (Latest) - Mobile */
    .has-dropdown {
        position: static;
    }

    .sub-dropdown {
        position: static;
        transform: none !important;
        min-width: 100% !important;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        padding: 0;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .has-dropdown:hover .sub-dropdown {
        max-height: 0;
        transform: none !important;
    }

    .has-dropdown.open .sub-dropdown {
        max-height: 400px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none !important;
        padding: 4px 0;
        background: rgba(0, 0, 0, 0.15);
    }

    .sub-dropdown a {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 10px 24px 10px 36px !important;
    }

    .sub-dropdown a:hover {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.04);
        padding-left: 42px !important;
    }

    .has-dropdown.open > .dropdown-trigger .mega-arrow {
        color: #64b5f6;
    }

    .hamburger-btn {
        display: flex;
    }

    .nav-right-section {
        gap: 14px;
    }

    .donate-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .search-icon-btn {
        font-size: 16px;
        padding: 6px;
    }

    /* Search overlay mobile */
    .search-overlay {
        padding: 15px 15px;
    }

    .search-input {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ========================================
   HEADER RESPONSIVE — 480px (Small Mobile)
   ======================================== */
@media (max-width: 480px) {
    .top-utility-bar {
        padding: 6px 10px;
        gap: 4px;
    }

    .utility-text {
        font-size: 11px;
    }

    .utility-bar-right {
        gap: 8px;
    }

    .utility-link {
        font-size: 11px;
    }

    .language-select {
        font-size: 12px;
    }

    .main-header {
        padding: 10px 12px;
    }

    .logo img {
        max-width: 48px;
    }

    .search-icon-btn {
        font-size: 15px;
        padding: 4px 6px;
    }

    .nav-right-section {
        gap: 12px;
    }

    .donate-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .search-icon-btn {
        padding: 4px;
    }

    .hamburger-btn {
        width: 22px;
        height: 16px;
    }

    .nav-menu-links.open {
        padding-top: 0;
    }

    .nav-menu-links.open > li > a,
    .nav-menu-links.open > li > .mega-trigger {
        font-size: 15px;
        padding: 14px 18px;
    }

    .mega-col {
        padding: 12px 18px 12px 28px;
    }

    .mega-col-title {
        font-size: 10px;
    }

    .mega-links a {
        font-size: 13px !important;
        padding: 7px 0 7px 10px !important;
    }
}
