/* Header - newdesign.html style */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

/* Fallback: ensure content clears fixed navbar even if JS fails */
body { padding-top: 72px; }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: none;
    gap: 2rem;
}
/* Ensure UL reset and spacing */
.navbar .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

/* Normalize list items */
.navbar .nav-links > .nav-item { 
    position: relative; 
    list-style: none; 
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 8px 16px; /* match prototype spacing */
    border-radius: 8px;
    white-space: nowrap;
}

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

/* Active state highlight similar to prototype */
.nav-link.active { color: #00ff96; background: rgba(0, 255, 150, 0.1); }

.nav-buttons {
    display: none;
    gap: 0.75rem;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 72px; /* fallback; JS will override to exact navbar height */
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 40;
}

.mobile-menu.open {
    transform: translateY(0);
}

.mobile-nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.mobile-nav a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-glass);
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

/* Responsive */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
    }
    
    .nav-buttons {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: none;
    }
}

/* Credits Badge */
.credits-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
    text-decoration: none;
    transition: all 0.3s ease;
}

.credits-badge:hover {
    background: rgba(16, 185, 129, 0.15);
    transform: translateY(-1px);
}

/* User Avatar */
.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-xl);
}

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

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 0.5rem 0;
}

/* Dropdown (Generic for Navbar) */
.dropdown {
    position: relative;
}

.dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    /* near-black neutral background like prototype */
    background: #0a0a0a;
    border: none;
    border-radius: 12px;
    min-width: 220px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1100;
}

.dropdown .dropdown-right {
    right: 0;
    left: auto;
}

.nav-item.dropdown:hover > .dropdown-menu,
.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown .dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.dropdown .dropdown-item:hover,
.dropdown .dropdown-item.active {
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* Language selector adjustments */
.language-selector .language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
}

.language-menu .language-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-item .current-indicator {
    margin-left: auto;
    color: var(--accent-success);
}
