/* Header CSS */

.header {
    background: rgba(11, 12, 21, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-index-sticky);
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

html[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.header__nav {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__brand {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 10px rgba(5, 217, 232, 0.3);
}

html[data-theme="light"] .header__brand {
    background: linear-gradient(to right, #101010, var(--color-secondary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.header__menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
}

.header__menu-link {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: var(--font-size-sm);
    letter-spacing: 1px;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-fast);
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
    box-shadow: 0 0 8px var(--color-primary);
}

.header__menu-link:hover,
.header__menu-link--active {
    color: var(--color-text);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.header__menu-link:hover::after,
.header__menu-link--active::after {
    width: 100%;
}

html[data-theme="light"] .header__menu-link {
    color: var(--color-text-muted);
}

html[data-theme="light"] .header__menu-link:hover,
html[data-theme="light"] .header__menu-link--active {
    color: var(--color-primary-dark);
    text-shadow: none;
}

/* Controls Container */
.header__controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: var(--spacing-md);
}

/* Toggle Buttons */
.header__theme-toggle,
.header__animation-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.header__animation-toggle {
    display: none;
}

.header__theme-toggle:hover,
.header__animation-toggle:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 0 10px rgba(5, 217, 232, 0.2);
    color: var(--color-secondary);
}

.theme-icon,
.animation-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Hide/Show icons based on theme */
html[data-theme="dark"] .theme-icon--dark { display: none; }
html[data-theme="light"] .theme-icon--light { display: none; }

/* Hide/Show icons based on animation state */
.arcade-paused .animation-icon--pause { display: none; }
html:not(.arcade-paused) .animation-icon--play { display: none; }

/* Mobile Menu Toggle */
.header__mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2000;
}

.header__mobile-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    margin: 6px 0;
    transition: all var(--transition-base);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .header__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--color-bg-alt);
        flex-direction: column;
        padding: 6rem 2rem;
        transition: right var(--transition-base);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--color-border);
    }

    .header__menu--open {
        right: 0;
    }

    .header__mobile-toggle {
        display: block;
        margin-left: var(--spacing-md);
    }

    /* Hamburger Animation */
    .header__mobile-toggle--open .header__mobile-toggle-icon:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .header__mobile-toggle--open .header__mobile-toggle-icon:nth-child(2) {
        opacity: 0;
    }

    .header__mobile-toggle--open .header__mobile-toggle-icon:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}
