﻿/* --- START OF CORRECTED StickyHeader.css --- */

.sticky-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.sticky-header nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* This is the main rule we are changing */
a.nav-button {
    background: none;
    color: var(--color-primary); /* Initial button color */
    border: none;
    padding: 16px 20px;
    margin: 0 20px;
    cursor: pointer;
    font-size: 1.2em;
    font-family: var(--font-navigation);
    position: relative;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    text-decoration: none; /* This is important to remove the underline from links */
}

    /* Underline element */
    a.nav-button::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--color-hover);
        /* We ensure the transition is always ready to fire */
        transition: width 0.3s ease-out, left 0.3s ease-out, background-color 0.3s ease-out;
        z-index: 2;
        margin-bottom: 10px;
    }

    /* Background element */
    a.nav-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to top, rgba(180, 178, 220, 0.2), transparent);
        opacity: 0;
        /* We ensure the transition is always ready to fire */
        transition: opacity 0.3s ease, background 0.3s ease;
        z-index: -1;
    }

/* --- States --- */

/* Hover State */
a.nav-button:hover {
    color: var(--color-hover);
}

a.nav-button:hover::before {
    opacity: 1;
}

a.nav-button:hover::after {
    width: 40%;
    left: 30%;
}

/* Selected State */
/* Selected State */
a.nav-button.selected {
    color: var(--color-selected);
}

a.nav-button.selected::before {
    background: linear-gradient(to top, rgba(193, 137, 123, 0.3), transparent);
    opacity: 1;
    animation: fadeIn 0.25s ease-in-out;
}

a.nav-button.selected::after {
    /* Make the initial state match the hover state */
    width: 60%;
    left: 20%;
    background-color: var(--color-selected);
}

a.nav-button.selected:hover::after {
    width: 40%;
    left: 30%;
}

a.nav-button:active {
    transform: none;
    box-shadow: none;
}

/* --- END OF CORRECTED StickyHeader.css --- */