/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, rgba(11, 15, 25, 0.97), rgba(17, 24, 39, 0.95), rgba(20, 16, 35, 0.97));
    border-bottom: 1px solid rgba(79, 143, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    max-width: 100%;
    padding: 0 40px;
    position: relative;
}

.header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header__logo img {
    height: auto;
    width: 200px;
}

/* ===== MENU WRAPPER (nav + auth) ===== */
.header__menu {
    display: contents;
}

.header__nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header__nav a {
    padding: 8px 18px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
}

.header__nav a:hover,
.header__nav a.active {
    color: var(--primary);
    background: rgba(79, 143, 255, 0.08);
}

.header__nav a.active {
    font-weight: 600;
}

/* ===== AUTH BUTTONS ===== */
.header__auth {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    margin-right: 16px;
}

.header__auth-btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.header__auth-btn--login {
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: transparent;
}

.header__auth-btn--login:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.header__auth-btn--register {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--purple));
}

.header__auth-btn--register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 143, 255, 0.3);
}

/* ===== BURGER BUTTON ===== */
.header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 10;
}

.header__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

/* Burger -> X animation */
.header__burger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.header__burger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== HEADER SCROLLED STATE ===== */
.header {
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.header .container {
    transition: height 0.35s ease;
}

.header__logo img {
    transition: width 0.35s ease;
}

.header--scrolled {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: rgba(79, 143, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.header--scrolled .container {
    height: 60px;
}

.header--scrolled .header__logo img {
    width: 160px;
}

[data-theme="light"] .header--scrolled {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .header .container {
        height: 70px;
    }

    .header__logo img {
        width: 160px;
    }

    .header__burger {
        display: flex;
    }

    .header__menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(11, 15, 25, 0.98));
        border-bottom: 1px solid rgba(79, 143, 255, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        flex-direction: column;
        gap: 0;
        padding: 0;
        backdrop-filter: blur(16px);
    }

    .header__menu.open {
        display: flex;
    }

    .header__nav {
        position: static;
        transform: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 16px 20px;
    }

    .header__nav a {
        width: 100%;
        padding: 14px 16px;
        border-radius: 8px;
        font-size: 1rem;
    }

    .header__auth {
        width: 100%;
        padding: 16px 20px;
        border-top: 1px solid var(--border);
        gap: 10px;
    }

    .header__auth {
        margin-right: 0;
    }

    .theme-toggle {
        margin-left: auto;
        margin-right: 4px;
    }

    .header__auth-btn {
        flex: 1;
        text-align: center;
        padding: 12px 16px;
    }
}
