/* ============================================
   MODERN HEADER & DROPDOWN STYLES
   ============================================ */

:root {
    --hdr-primary: #6366f1;
    --hdr-secondary: #8b5cf6;
    --hdr-accent: #06b6d4;
    --hdr-dark: #0f172a;
    --hdr-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
}

/* Header container */
#header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Top-level nav links */
#header .main-na > ul > li > a,
#header .custom-nav > ul > li > a {
    position: relative;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.5px;
    color: #1e293b !important;
    padding: 32px 18px !important;
    transition: all 0.3s ease;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Dropdown caret indicator */
#header .main-na > ul > li.dropdown > a::before,
#header .custom-nav > ul > li.dropdown > a::before {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    margin-left: 6px;
    order: 2;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
}

#header .main-na > ul > li.dropdown:hover > a::before,
#header .custom-nav > ul > li.dropdown:hover > a::before {
    transform: rotate(180deg);
    color: var(--hdr-primary);
}

/* Active state — current page */
#header .main-na > ul > li.active > a,
#header .custom-nav > ul > li.active > a {
    color: var(--hdr-primary) !important;
}

#header .main-na > ul > li.active > a::after,
#header .custom-nav > ul > li.active > a::after {
    width: 28px !important;
}

/* Hover animated underline */
#header .main-na > ul > li > a::after,
#header .custom-nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--hdr-gradient);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#header .main-na > ul > li:hover > a::after,
#header .custom-nav > ul > li:hover > a::after {
    width: 28px;
}

#header .main-na > ul > li:hover > a,
#header .custom-nav > ul > li:hover > a {
    color: var(--hdr-primary) !important;
}

/* ============================================
   DROPDOWN MENU — MODERN GLASS CARD
   ============================================ */
#header .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 18px;
    box-shadow:
        0 25px 60px rgba(15, 23, 42, 0.15),
        0 10px 30px rgba(99, 102, 241, 0.1),
        0 0 0 1px rgba(99, 102, 241, 0.05);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.96);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#header .dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Decorative top arrow */
#header .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 30px;
    width: 16px;
    height: 16px;
    background: white;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    border-left: 1px solid rgba(99, 102, 241, 0.1);
    transform: rotate(45deg);
    border-radius: 3px 0 0 0;
}

/* Top gradient strip */
#header .dropdown-menu::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 3px;
    background: var(--hdr-gradient);
    border-radius: 3px;
    opacity: 0.5;
}

/* Dropdown items */
#header .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
    border: none !important;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

#header .dropdown:hover .dropdown-menu li {
    opacity: 1;
    transform: translateX(0);
}

#header .dropdown-menu li:nth-child(1) { transition-delay: 0.05s; }
#header .dropdown-menu li:nth-child(2) { transition-delay: 0.08s; }
#header .dropdown-menu li:nth-child(3) { transition-delay: 0.11s; }
#header .dropdown-menu li:nth-child(4) { transition-delay: 0.14s; }
#header .dropdown-menu li:nth-child(5) { transition-delay: 0.17s; }
#header .dropdown-menu li:nth-child(6) { transition-delay: 0.20s; }
#header .dropdown-menu li:nth-child(7) { transition-delay: 0.23s; }
#header .dropdown-menu li:nth-child(8) { transition-delay: 0.26s; }
#header .dropdown-menu li:nth-child(9) { transition-delay: 0.29s; }
#header .dropdown-menu li:nth-child(10) { transition-delay: 0.32s; }

#header .dropdown-menu li a {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 16px !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    color: #334155 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 10px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* Icon dot before each item */
#header .dropdown-menu li a::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

#header .dropdown-menu li a:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
    color: var(--hdr-primary) !important;
    transform: translateX(4px);
}

#header .dropdown-menu li a:hover::before {
    background: var(--hdr-gradient);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
    transform: scale(1.3);
}

/* Right arrow on hover */
#header .dropdown-menu li a::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
    color: var(--hdr-primary);
}

#header .dropdown-menu li a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Active/hover indicator on parent when dropdown open */
#header .dropdown:hover > a {
    color: var(--hdr-primary) !important;
}

/* Logo refinement */
#header #logo img {
    transition: transform 0.3s ease;
}
#header #logo:hover img {
    transform: scale(1.05);
}

/* Mobile responsive */
@media (max-width: 991px) {
    #header .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        background: rgba(99, 102, 241, 0.04) !important;
        margin: 0;
        padding: 8px;
    }
    #header .dropdown-menu::before,
    #header .dropdown-menu::after { display: none; }
    #header .dropdown-menu li { opacity: 1; transform: none; }
    #header .main-na > ul > li > a,
    #header .custom-nav > ul > li > a {
        padding: 16px 18px !important;
    }
}
