/* Styles for the main header/top bar component */

header {
    background: var(--background-color); /* should be background color, a stylistic choice */
    padding: 1rem 0;
    position: fixed;
    top: 0;
    z-index: 2;
    left: 0;
    right: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    /* margin-right: auto; is removed to allow center content to be centered */
}

/* Wrapper for centered desktop nav items */
.desktop-nav-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* New style for text-based navigation links */
.nav-link {
    background: none;
    border: none;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--primary-color);
}

/* Wrapper for header controls like theme toggle and burger */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* A bit tighter for icon buttons */
}

/* Theme toggle button styles */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 2rem;
    height: 2rem;
    overflow: hidden;
}

.theme-toggle:hover {
    opacity: 0.8;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Default state (which is dark mode in the CSS) */
.theme-toggle .icon-sun {
    opacity: 0;
    transform: translateY(-15px);
}
.theme-toggle .icon-moon {
    opacity: 1;
    transform: translateY(0);
}

/* When in light mode, flip the icons */
[data-theme='light'] .theme-toggle .icon-sun {
    opacity: 1;
    transform: translateY(0);
}
[data-theme='light'] .theme-toggle .icon-moon {
    opacity: 0;
    transform: translateY(15px);
}

/* Burger menu toggle icon - now always visible */
.burger-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 1rem;
    height: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000; /* Above header content */
}

.burger-toggle span {
    width: 1rem;
    height: 0.25rem;
    background: var(--text-color);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

/* Responsive styles for the top bar */
@media (max-width: 768px) {
    .desktop-nav-center {
        display: none; /* Hide the center links on mobile */
    }
}