/* =========================================
   header.css
   Fixed header, navigation, mega menu,
   search box, mobile nav drawer, and
   header/hero overlap fixes.
   Depends on: global.css
========================================= */

/* =========================================
   FIXED HEADER — BASE STATE (transparent)
========================================= */
.header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border-bottom: 1px solid transparent;
}

/* =========================================
   GLASSMORPHISM STATE (on scroll)
========================================= */
.header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
}

/* =========================================
   INTERNAL PAGES — always glassmorphism
   (no hero section to underlay)
========================================= */
body:not(:has(.hero-wrap)) .header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08) !important;
}

/* =========================================
   HEADER CONTAINER
========================================= */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1300px) {
    .header-container { padding: 16px 20px; }
}

/* =========================================
   LOGO
========================================= */
.logo a {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: #0f172a;
}

/* =========================================
   AUTH BUTTONS (Login / Signup)
========================================= */
.auth {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* =========================================
   DESKTOP NAVIGATION
========================================= */
.nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.2s ease;
    position: relative;
    padding: 5px 0;
}

.header.scrolled .nav-link { color: #0f172a; }
.nav-link:hover             { color: #0066ff; }

/* Animated underline */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: 0; left: 0;
    background-color: #0066ff;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after { width: 100%; }

/* Active link state */
.nav-link-active           { color: #0066ff !important; }
.nav-link-active::after    { width: 100% !important; }

/* "For Employers" accent */
.nav-link-employers        { color: #0066ff !important; }
.nav-link-employers:hover  { color: #0052cc !important; }

/* =========================================
   DYNAMIC TEXT COLORS OVER DARK HERO
========================================= */
body:has(.hero-wrap) .header:not(.scrolled) .logo-text,
body:has(.hero-wrap) .header:not(.scrolled) .nav-link,
body:has(.hero-wrap) .header:not(.scrolled) .user-name,
body:has(.hero-wrap) .header:not(.scrolled) .mobile-menu-btn {
    color: #ffffff !important;
    transition: color 0.3s ease;
}

body:has(.hero-wrap) .header:not(.scrolled) .nav-link:hover {
    color: #F7B731 !important;
}

body:has(.hero-wrap) .header:not(.scrolled) .nav-link i {
    color: #ffffff !important;
}

body:has(.hero-wrap) .header:not(.scrolled) .nav-link-employers {
    color: #ffffff !important;
}

/* Login / Logout outline buttons over dark hero */
body:has(.hero-wrap) .header:not(.scrolled) .btn-outline {
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    background: transparent !important;
}

body:has(.hero-wrap) .header:not(.scrolled) .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffffff !important;
}

/* =========================================
   PREMIUM SEARCH BOX
========================================= */
.premium-search {
    position: relative;
    display: flex;
    align-items: center;
}

.premium-search form {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}

.premium-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.95rem;
    z-index: 2;
    pointer-events: none;
}

.premium-search input {
    padding: 10px 16px 10px 42px !important;
    width: 280px;
    border-radius: 30px;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-size: 0.9rem;
    color: #0f172a;
}

.premium-search input:focus {
    width: 340px;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15), 0 10px 15px -3px rgba(0,0,0,0.1);
}

.premium-search input:focus + i { color: #3b82f6; }

/* Search box over dark hero */
body:has(.hero-wrap) .header:not(.scrolled) .premium-search input {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body:has(.hero-wrap) .header:not(.scrolled) .premium-search input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body:has(.hero-wrap) .header:not(.scrolled) .premium-search i {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* =========================================
   MEGA MENU DROPDOWN
========================================= */
.has-mega-menu {
    position: relative;
    padding: 25px 0; /* hover bridge */
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: -20px;
    width: 480px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 50px -10px rgba(15, 23, 42, 0.15);
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    z-index: 1001;
}

.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Left tab rail */
.mega-menu-left {
    width: 35%;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 15px 0;
}

.mega-tab {
    padding: 12px 20px;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.mega-tab:hover,
.mega-tab.active {
    background: #eff6ff;
    color: #0066ff;
    border-left: 3px solid #0066ff;
}

/* Right content area */
.mega-menu-right {
    width: 65%;
    padding: 20px;
    max-height: 350px;
    overflow-y: auto;
}

.mega-menu-right::-webkit-scrollbar       { width: 5px; }
.mega-menu-right::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.mega-content          { display: none; flex-direction: column; gap: 14px; }
.mega-content.active   { display: flex; }

.mega-link {
    color: #334155;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.2s;
    display: block;
}

.mega-link:hover { color: #0066ff; transform: translateX(5px); }

.mega-link-featured { color: #0066ff !important; font-weight: 600 !important; }
.mega-link-featured i { margin-right: 6px; }

.mega-empty { color: #94a3b8; font-size: 0.85rem; padding: 5px 0; margin: 0; font-style: italic; }

/* =========================================
   MOBILE MENU BUTTON
========================================= */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #0f172a;
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}

/* =========================================
   MOBILE NAV DRAWER
========================================= */
.mobile-nav-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.mobile-nav-overlay.active { opacity: 1; visibility: visible; }

.mobile-nav-menu {
    position: fixed;
    top: 0; right: -300px;
    width: 280px; height: 100vh;
    background: #ffffff;
    z-index: 2001;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.mobile-nav-menu.active { right: 0; }

.mobile-nav-close {
    align-self: flex-end;
    background: #f1f5f9;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    margin-bottom: 30px;
    transition: 0.2s;
}

.mobile-nav-close:hover { background: #fee2e2; color: #dc2626; }

.mobile-nav-links { display: flex; flex-direction: column; gap: 20px; }

.mobile-nav-links a {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav-links a i        { color: #3b82f6; width: 20px; text-align: center; }
.mobile-nav-active           { color: #0066ff !important; }

/* =========================================
   DASHBOARD PAGES — sidebar shifts header
========================================= */
body:has(.sidebar) .header {
    margin-left: 260px;
    width: calc(100% - 260px);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
========================================= */
@media (max-width: 950px) {
    .hide-on-mobile    { display: none !important; }
    .mobile-menu-btn   { display: block; }
    .header-container  { padding: 15px 20px; }
}

@media (max-width: 768px) {
    .header-container  { flex-wrap: wrap; gap: 15px; padding: 15px 20px; }

    /* Remove sidebar offset on mobile */
    body:has(.sidebar) .header {
        margin-left: 0;
        width: 100%;
    }
}