/* ========== MODERN HEADER & NAVBAR STYLES ========== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --nav-bg: #0d1120;
    --nav-bg-glass: rgba(13, 17, 32, 0.95);
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-hover: #d97706;
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    --dropdown-bg: #151b2e;
    --border-color: rgba(255, 255, 255, 0.08);
}

/* Base Reset for Header Component */
header, header * {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

header {
    background: var(--nav-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* Header Container */
header .navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    max-width: 1440px;
    margin: 0 auto;
    gap: 15px;
}

/* Brand Logo */
header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

header .logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

header .logo img {
    height: 46px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

header .logo a:hover img {
    transform: scale(1.06);
}

header .logo .brand-name {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search Container */
header .search-container {
    position: relative;
    flex: 1;
    max-width: 360px;
    margin: 0 15px;
}

header .search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

header .search-input {
    width: 100%;
    padding: 9px 40px 9px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 13.5px;
    outline: none;
    transition: all 0.3s ease;
}

header .search-input::placeholder {
    color: var(--text-muted);
}

header .search-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

header .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gold);
    color: #0f172a;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

header .search-btn:hover {
    background: var(--gold-light);
    transform: translateY(-50%) scale(1.05);
}

/* Live Search Results Popup */
#searchResults {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1100;
    display: none;
    padding: 8px 0;
}

#searchResults p {
    margin: 0;
}

#searchResults a {
    display: block;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

#searchResults a:hover {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold-light);
}

#searchResults .text-danger {
    padding: 12px 16px;
    color: #ef4444;
    font-size: 13px;
    text-align: center;
}

/* Navigation Links */
header nav {
    display: flex;
    align-items: center;
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

header nav ul li {
    position: relative;
}

header nav ul li a {
    text-decoration: none !important;
    color: #d1d5db !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 8px;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap;
}

header nav ul li a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}

header nav ul > li > a:hover {
    color: var(--gold-light) !important;
}

header nav ul li a i {
    font-size: 15px;
    transition: transform 0.2s ease, color 0.2s ease;
    color: var(--text-muted);
}

header nav ul li a:hover i {
    color: var(--gold-light);
}

/* Action Icons & Badges */
.nav-action-btn {
    position: relative;
    padding: 8px 10px !important;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--gold);
    color: #0f172a;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* User Account Button */
.login-btn {
    background: linear-gradient(135deg, var(--gold), #d97706) !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    padding: 7px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold)) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

/* Dropdown Menus */
header .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--dropdown-bg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-width: 220px;
    display: none;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(10px);
    padding: 8px 0;
    list-style: none;
}

header .dropdown-menu li {
    display: block;
    width: 100%;
}

header .dropdown-menu a {
    padding: 10px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    color: #e2e8f0 !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
}

header .dropdown-menu a:hover {
    background: rgba(245, 158, 11, 0.12) !important;
    color: var(--gold-light) !important;
    padding-left: 22px !important;
}

/* Multi-level Dropdown flyouts */
header nav ul li:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

header .dropdown-sub {
    position: relative;
}

header .dropdown-sub > .dropdown-menu {
    top: -8px;
    left: 100%;
    margin-left: 4px;
}

header .dropdown-menu li:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Arrow Indicators */
header .dropdown > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    margin-left: 4px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

header .dropdown:hover > a::after {
    transform: rotate(180deg);
    color: var(--gold-light);
}

header .dropdown-sub > a::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    margin-left: auto;
    opacity: 0.6;
}

/* Mobile Toggle Icon */
.menu-toggle {
    display: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gold-light);
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
}

.menu-toggle:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #ffffff;
}

/* Mobile Responsiveness */
@media screen and (max-width: 992px) {
    header .navigation {
        padding: 10px 18px;
    }

    header .search-container {
        max-width: 220px;
        margin: 0 10px;
    }

    .menu-toggle {
        display: block;
    }

    header nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 70px);
        background: var(--nav-bg);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--border-color);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding: 20px 15px;
        align-items: flex-start;
    }

    header nav.show {
        right: 0;
    }

    header nav ul {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 8px;
    }

    header nav ul li a {
        padding: 12px 16px !important;
        border-radius: 10px;
        font-size: 15px !important;
        background: rgba(255, 255, 255, 0.03);
    }

    header .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        padding-left: 15px;
        margin-top: 5px;
    }

    header nav ul li.active > .dropdown-menu,
    header .dropdown-sub.active > .dropdown-menu {
        display: block;
    }

    header .dropdown-sub > .dropdown-menu {
        margin-left: 0;
    }

    header .dropdown-sub > a::after {
        content: '\f107';
    }
}

@media screen and (max-width: 576px) {
    header .brand-name {
        display: none;
    }
    
    header .search-container {
        max-width: 160px;
    }
}
