/* ========================================
   HEADER STYLES - Tribe FantasyVenture
   Modern Glassmorphism Design
   ======================================== */

/* Header Container - Glassmorphism Effect */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    transition: all var(--transition-base);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Navbar Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

/* Logo Section - Left */
.header-logo {
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo img {
    height: 65px;
    width: auto;
    transition: all var(--transition-base);
}

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

/* Navigation Menu - Center */
.nav-menu {
    flex: 1;
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    display: inline-block;
    position: relative;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: transform var(--transition-base);
}

.nav-menu li a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.nav-menu li a:hover::before,
.nav-menu li a.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-menu li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Auth Buttons - Right */
.header-auth-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.user-welcome {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0 0.5rem;
    display: none;
}

.header-auth-buttons .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.btn-register {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.btn-dashboard {
    background: var(--gradient-accent);
    color: var(--bg-primary);
    border: none;
}

.btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-logout:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.nav-toggle:hover {
    background: var(--bg-secondary);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 0.25rem;
    }
    
    .nav-menu li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .header-auth-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        position: relative;
    }
    
    .nav-toggle {
        display: flex;
        order: 3;
    }
    
    .header-logo {
        order: 1;
    }
    
    .header-auth-buttons {
        order: 2;
        margin-left: auto;
    }
    
    .nav-menu {
        order: 4;
        width: 100%;
        flex-direction: column;
        background: var(--bg-primary);
        border-radius: var(--radius-lg);
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all var(--transition-base);
    }
    
    .nav-menu.active {
        max-height: 500px;
        opacity: 1;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu li a {
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .user-welcome {
        display: none !important;
    }
    
    .header-logo img {
        height: 40px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .user-welcome {
        display: inline-block;
    }
}

@media (min-width: 1025px) {
    .user-welcome {
        display: inline-block;
    }
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--gradient-primary);
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.preloader-door-left {
    left: 0;
}

.preloader-door-right {
    right: 0;
}

.preloader.hidden .preloader-door-left {
    transform: translateX(-100%);
}

.preloader.hidden .preloader-door-right {
    transform: translateX(100%);
}

.preloader-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.preloader-logo {
    width: 150px;
    height: 150px;
    animation: spinPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(99, 102, 241, 0.5));
}

@keyframes spinPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.9;
    }
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
