/* ==========================================
   HEADER - MODERN DARK THEME
   Professional, clean, and responsive
   ========================================== */

:root {
    --header-bg-solid: #0a0f0d;
    --header-bg-transparent: rgba(10, 15, 13, 0.6);
    --header-border: rgba(255, 255, 255, 0.1);
    --nav-text: #ffffff;
    --nav-text-hover: #ffffff;
    --primary: #b5f433;
    --primary-hover: #c8ff4d;
    --primary-dark: #268226;
    --text-black: #000000;
    --border-light: rgba(255, 255, 255, 0.15);
    --bg-white-subtle: rgba(255, 255, 255, 0.06);
    --bg-white-hover: rgba(255, 255, 255, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    font-family: "Poppins", sans-serif;
}

/* ==========================================
   BASE HEADER STYLES
   ========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--header-bg-solid);
    border-bottom: 1px solid var(--header-border);
    transition: var(--transition-smooth);
}

/* At top - transparent with blur effect */
.site-header.is-top {
    background: var(--header-bg-transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: transparent;
}

/* When scrolled - solid dark background with shadow */
.site-header.is-scrolled {
    background: var(--header-bg-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: var(--header-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}


/* ==========================================
   HEADER CONTAINER & LAYOUT
   ========================================== */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 20px;
    position: relative;
}

/* ==========================================
   BRAND / LOGO
   ========================================== */
.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    position: relative;
    z-index: 1001;
    transition: var(--transition-smooth);
}

.brand-mark {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.brand:hover .brand-mark {
    transform: scale(1.05);
}

.brand-title {
    height: 12px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.brand:hover .brand-title {
    opacity: 1;
}

/* ==========================================
   NAVIGATION - DESKTOP
   ========================================== */
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Compact nav link styling */
.nav-link,
.nav-link--btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 50px;
    transition: var(--transition-smooth);
    background: var(--bg-white-subtle);
    border: 1px solid var(--border-light);
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link--btn:hover {
    color: var(--nav-text);
    background: var(--bg-white-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Active/Current page styling */
.nav-link.is-current {
    color: var(--text-black);
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.nav-link.is-current:hover {
    color: var(--text-black);
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ==========================================
   DROPDOWN CARET
   ========================================== */
.caret {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-top: -3px;
}

.has-mega.open .caret {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* ==========================================
   MEGA DROPDOWN (Resources & Technology)
   ========================================== */
.has-mega {
    position: relative;
}

.has-mega .nav-link--btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.has-mega .mega {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 520px;
    background: rgba(10, 15, 13, 0.98);
    border: 1px solid var(--header-border);
    border-radius: 20px;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    z-index: 1002;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    will-change: opacity, transform;
    pointer-events: none;
}

/* Hover area above dropdown */
.has-mega .mega::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

/* Dropdown arrow pointer */
.has-mega .mega::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(10, 15, 13, 0.98);
    border-left: 1px solid var(--header-border);
    border-top: 1px solid var(--header-border);
}

.has-mega.open .mega {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.has-mega .mega-panel {
    background: transparent;
}

.has-mega .mega-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Dropdown items */
.has-mega .dd-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.25s ease;
}

.has-mega .dd-item:hover {
    background: rgba(181, 244, 51, 0.1);
    transform: translateX(4px);
}

/* Dropdown icon container */
.has-mega .dd-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white-subtle);
    border: 1px solid var(--header-border);
    border-radius: 12px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.has-mega .dd-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1) opacity(0.8);
    transition: all 0.25s ease;
}

.has-mega .dd-item:hover .dd-icon {
    background: var(--primary);
    border-color: var(--primary);
}

.has-mega .dd-item:hover .dd-icon img {
    filter: brightness(0) invert(0);
}

.has-mega .dd-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--nav-text);
    transition: color 0.25s ease;
}

.has-mega .dd-item:hover .dd-label {
    color: var(--primary);
}

/* Colored icon backgrounds for visual distinction */
.has-mega .dd-item:nth-child(1) .dd-icon { 
    background: rgba(181, 244, 51, 0.15); 
    border-color: rgba(181, 244, 51, 0.3); 
}
.has-mega .dd-item:nth-child(2) .dd-icon { 
    background: rgba(59, 130, 246, 0.15); 
    border-color: rgba(59, 130, 246, 0.3); 
}
.has-mega .dd-item:nth-child(3) .dd-icon { 
    background: rgba(168, 85, 247, 0.15); 
    border-color: rgba(168, 85, 247, 0.3); 
}
.has-mega .dd-item:nth-child(4) .dd-icon { 
    background: rgba(249, 115, 22, 0.15); 
    border-color: rgba(249, 115, 22, 0.3); 
}
.has-mega .dd-item:nth-child(5) .dd-icon { 
    background: rgba(236, 72, 153, 0.15); 
    border-color: rgba(236, 72, 153, 0.3); 
}
.has-mega .dd-item:nth-child(6) .dd-icon { 
    background: rgba(34, 197, 94, 0.15); 
    border-color: rgba(34, 197, 94, 0.3); 
}
.has-mega .dd-item:nth-child(7) .dd-icon { 
    background: rgba(234, 179, 8, 0.15); 
    border-color: rgba(234, 179, 8, 0.3); 
}
.has-mega .dd-item:nth-child(8) .dd-icon { 
    background: rgba(239, 68, 68, 0.15); 
    border-color: rgba(239, 68, 68, 0.3); 
}

/* Active dropdown item */
.has-mega .dd-item.is-active {
    background: rgba(181, 244, 51, 0.15);
}

.has-mega .dd-item.is-active .dd-icon {
    background: var(--primary);
    border-color: var(--primary);
}

.has-mega .dd-item.is-active .dd-icon img {
    filter: brightness(0) invert(0);
}

.has-mega .dd-item.is-active .dd-label {
    color: var(--primary);
}

/* ==========================================
   CTA BUTTONS (Compact Design)
   ========================================== */
.cta-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    position: relative;
    z-index: 10;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    background: transparent;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn-outline:hover {
    color: var(--nav-text);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-fill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    color: var(--text-black);
    text-decoration: none;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50px;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn-fill:hover {
    color: var(--text-black);
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Form submit button within header */
.cta-group form {
    display: inline;
    margin: 0;
    padding: 0;
}

.cta-group button[type="submit"].btn-fill {
    cursor: pointer;
}

/* ==========================================
   MOBILE TOGGLE BUTTON
   ========================================== */
.menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: var(--bg-white-subtle);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1201;
    transition: var(--transition-smooth);
    padding: 0;
}

.menu-toggle:hover {
    background: var(--bg-white-hover);
}

.menu-toggle .bar {
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.menu-toggle .bar:nth-child(1) {
    transform: translateY(-7px);
}

.menu-toggle .bar:nth-child(2) {
    transform: translateY(0);
}

.menu-toggle .bar:nth-child(3) {
    transform: translateY(7px);
}

/* Hamburger to X animation */
.menu-toggle.is-open .bar:nth-child(1) {
    transform: rotate(45deg);
}

.menu-toggle.is-open .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.is-open .bar:nth-child(3) {
    transform: rotate(-45deg);
}

/* ==========================================
   MOBILE NAVIGATION DRAWER
   ========================================== */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 15, 13, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 100px 24px 40px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    overflow-y: auto;
    border-left: 1px solid var(--header-border);
    display: flex;
    flex-direction: column;
}

.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 14px;
    background: var(--bg-white-subtle);
    border: 1px solid var(--header-border);
    transition: var(--transition-smooth);
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.mobile-nav-link:hover {
    background: var(--bg-white-hover);
    color: var(--nav-text);
}

.mobile-nav-link.is-current {
    background: rgba(181, 244, 51, 0.2);
    color: var(--primary);
    border-color: rgba(181, 244, 51, 0.4);
}

/* Mobile dropdown */
.mobile-has-dropdown {
    position: relative;
}

.mobile-dropdown-btn {
    background: var(--bg-white-subtle);
    border: 1px solid var(--header-border);
    color: var(--nav-text);
}

.mobile-caret {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-top: -4px;
}

.mobile-has-dropdown.open .mobile-caret {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.mobile-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.mobile-has-dropdown.open .mobile-dropdown-menu {
    max-height: 500px;
    padding: 8px 0 0 16px;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.mobile-dropdown-menu li a:hover {
    background: rgba(181, 244, 51, 0.15);
    color: var(--primary);
    padding-left: 24px;
}

/* Mobile CTA buttons */
.mobile-cta-group {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--header-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-btn-outline,
.mobile-btn-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 14px;
    text-decoration: none;
    transition: var(--transition-smooth);
    width: 100%;
    cursor: pointer;
    border: 1px solid transparent;
}

.mobile-btn-outline {
    color: var(--nav-text);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
}

.mobile-btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--nav-text);
}

.mobile-btn-fill {
    color: var(--text-black);
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-btn-fill:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--text-black);
}

/* Mobile form buttons */
.mobile-cta-group form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.mobile-cta-group button[type="submit"] {
    border: none;
}

/* ==========================================
   MOBILE OVERLAY
   ========================================== */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 9997;
    pointer-events: none;
}

.nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

/* Staggered animation for mobile drawer items */
.mobile-nav-drawer.is-open .mobile-nav-list li {
    animation: slideDown 0.4s ease forwards;
    opacity: 0;
}

.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(1) { animation-delay: 0.05s; }
.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(2) { animation-delay: 0.1s; }
.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(3) { animation-delay: 0.15s; }
.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(4) { animation-delay: 0.2s; }
.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(5) { animation-delay: 0.25s; }
.mobile-nav-drawer.is-open .mobile-nav-list li:nth-child(6) { animation-delay: 0.3s; }

.mobile-nav-drawer.is-open .mobile-cta-group {
    animation: slideDown 0.4s ease 0.3s forwards;
    opacity: 0;
}

/* ==========================================
   ACCESSIBILITY - FOCUS STATES
   ========================================== */
.nav-link:focus-visible,
.nav-link--btn:focus-visible,
.btn-outline:focus-visible,
.btn-fill:focus-visible,
.dd-item:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-dropdown-btn:focus-visible,
.mobile-btn-outline:focus-visible,
.mobile-btn-fill:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Hide desktop nav and show mobile toggle on smaller screens */
@media (max-width: 1100px) {
    .header-bar {
        height: 70px;
    }

    .menu-toggle {
        display: flex;
        order: 3;
    }

    .nav-wrap,
    .cta-group {
        display: none;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }

    .brand-mark {
        height: 42px;
    }

    .brand-title {
        height: 10px;
    }

    .mobile-nav-drawer {
        padding: 90px 20px 30px;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
    }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1100px) {
    .mobile-nav-drawer {
        max-width: 450px;
    }
}

/* ==========================================
   SMOOTH SCROLLING
   ========================================== */
html {
    scroll-behavior: smooth;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
