/**
 * Header Component Styles
 * Two-row responsive header with mobile hamburger menu
 */

/* === NEW TWO-ROW HEADER === */
.site-header {
    display: flex;
    flex-direction: column;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1000;
}

/* === TOP ROW: Logo, Search, User === */
.header-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1.25rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 150px;
    width: auto;
    filter: drop-shadow(0 0 20px var(--neon-blue-glow));
}

.header-search {
    position: relative;
    max-width: 520px;
    width: 100%;
    justify-self: center;
}

.search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.header-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 6px;
    color: var(--neon-teal);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-location:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: rgba(0, 217, 255, 0.5);
    box-shadow: 0 0 15px var(--neon-teal-glow);
    text-shadow: none;
    color: var(--neon-teal);
}

.header-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fafafa;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #09090b;
}

.user-name {
    font-weight: 600;
}

.impersonation-warning {
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #f59e0b;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.impersonation-warning:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
}

.auth-link {
    padding: 0.625rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    white-space: nowrap;
}

.auth-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    text-shadow: none;
    color: var(--text-primary);
}

/* === BOTTOM ROW: Navigation + Location === */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.header-nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    text-shadow: none;
}

.nav-link.active {
    color: var(--neon-blue);
}

.nav-link.backstage {
    color: var(--neon-pink);
}

/* Nav Dropdown Styles */
.nav-dropdown {
    display: none;
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-dropdown-icon {
    font-size: 0.625rem;
    transition: transform 0.15s ease;
}

.nav-dropdown.open .nav-dropdown-icon {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 180px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu .nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-dropdown-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-dropdown-menu .nav-link.active {
    color: var(--neon-blue);
}

/* === MOBILE HAMBURGER (Fixed, Pink) === */
.mobile-hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    background: rgba(255, 59, 154, 0.95);
    border: 1px solid rgba(255, 59, 154, 0.5);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 20px var(--neon-pink-glow);
    transition: all 0.2s;
}

.mobile-hamburger:hover {
    background: rgba(255, 59, 154, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 30px var(--neon-pink-glow);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-hamburger.open .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translateY(7px);
}

.mobile-hamburger.open .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.open .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translateY(-7px);
}

/* === MOBILE MENU OVERLAY === */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
}

.mobile-menu-overlay.open {
    display: flex;
    flex-direction: column;
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-section-title {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fafafa;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.mobile-menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    text-shadow: none;
}

.mobile-menu-link.active {
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.3);
    color: var(--neon-blue);
}

.mobile-menu-user-info {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.mobile-menu-user-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.mobile-menu-user-email {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fafafa;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.mobile-menu-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    text-shadow: none;
}

.mobile-menu-button.danger {
    color: #ef4444;
}

.mobile-menu-button.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.mobile-menu-user {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: auto;
}

.mobile-menu-user-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-user-link {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.2s;
}

.mobile-menu-user-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    text-shadow: none;
}

.mobile-menu-user-link.danger {
    color: #ef4444;
}

.mobile-menu-user-link.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* User Dropdown (Desktop/Tablet) */
.user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10001;
}

.header-user.open .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.user-info-name {
    font-weight: 600;
    color: #fafafa;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-info-email {
    color: #71717a;
    font-size: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #a1a1aa;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fafafa;
    text-shadow: none;
}

.menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.menu-item.verify-warning {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.08));
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #FFD700;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.menu-item.verify-warning:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.15));
    border-color: rgba(255, 215, 0, 0.6);
    color: #FFE44D;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.menu-item.verify-warning strong {
    font-size: 0.875rem;
}

.menu-item.verify-warning small {
    font-size: 0.75rem;
    color: #b8b8c8;
    font-weight: normal;
}

/* === RESPONSIVE: 641px - 767px (Smaller logo + compact nav) === */
@media (max-width: 767px) and (min-width: 641px) {
    .header-logo img {
        height: 75px; /* 50% of original 150px */
    }
    
    .header-top {
        gap: 1rem;
        padding: 0.625rem 1rem;
    }
    
    .header-nav {
        padding: 0.375rem 1rem;
        gap: 1rem;
    }
    
    .header-nav-links {
        gap: 1.25rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    .header-location {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* === RESPONSIVE: Below 640px (Hamburger menu, stacked layout) === */
@media (max-width: 640px) {
    /* Header becomes vertical stack */
    .site-header {
        flex-direction: column;
    }
    
    .header-top {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.75rem;
        padding: 1rem 1.25rem 0.5rem;
    }
    
    .header-logo img {
        height: 150px; /* Back to original size */
    }
    
    .header-search {
        max-width: 100%;
        width: 100%;
    }
    
    /* Hide user menu from header */
    .header-user {
        display: none;
    }
    
    /* Second row: Location only */
    .header-nav {
        padding: 0.75rem 1.25rem;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .header-nav-links {
        display: none;
    }
    
    .header-location {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
    
    /* Show hamburger */
    .mobile-hamburger {
        display: flex !important;
    }
}

/* Hide hamburger on desktop/tablet */
@media (min-width: 641px) {
    .mobile-hamburger {
        display: none !important;
    }
}
