/* Navbar styling */
.navbar {
    background-color: #ff157d;
    color: var(--brand-surface-text);
    padding: clamp(0.5rem, 1.5vh, 0.8rem) clamp(1rem, 3vw, 2rem);
    box-shadow: 0 clamp(2px, 0.5vw, 6px) clamp(4px, 1vw, 12px) rgba(0, 0, 0, 0.2);
    margin-bottom: clamp(1.5rem, 5vw, 2rem);
    transition: background-color 0.3s ease;
}

/* Navbar links */
.nav-links {
    list-style-type: none;
    display: flex;
    justify-content: center; /* Center all the navigation items */
    gap: clamp(1.5rem, 3vw, 2.5rem); /* Space between links */
    align-items: center; /* Vertically center links */
}

.nav-links li {
    display: inline-block;
}

/* Ensure the theme toggle button is visible inside the nav links */
.nav-links .theme-toggle {
    color: #1e1e2e;
    background: #ff157d;
    border: 1px solid rgba(0,0,0,0.15);
    padding: clamp(0.4rem, 1vh, 0.7rem) clamp(0.7rem, 1.5vw, 1rem);
    font-size: clamp(1rem, 2vw, 1.3rem);
    border-radius: clamp(0.3rem, 0.5vw, 0.5rem);
    min-width: clamp(40px, 6vw, 50px);
    text-align: center;
}
.nav-links .theme-toggle:hover {
    filter: brightness(0.95);
}
.theme-toggle-item {
    display: inline-block;
}

/* Retro theme variant to keep the toggle readable */
body.retro-theme .nav-links .theme-toggle {
    background: #ff6f61;
    color: #333344;
    border-color: rgba(0,0,0,0.05);
}

/* General link styles */
.nav-links a {
    text-decoration: none;
    color: var(--brand-surface-text);
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    font-weight: bold;
    transition: color 0.3s ease;
    text-align: center; /* Keep text center-aligned */
    display: block; /* Full block for better layout control */
}

.nav-links a:hover {
    color: var(--brand-surface-contrast);
}

/* Retro theme color override for nav links */
body.retro-theme .nav-links a:hover {
    color: #f4a460; /* replace #a68ab7 light purple */
}

/* Retro theme nav link text */
body.retro-theme .nav-links a {
    color: #333344;
}

/* Dropdown styling */
.nav-links .dropdown {
    position: relative;
    display: inline-block;
    text-align: center; /* Center the dropdown title */
}

/* Dropdown content */
.dropdown-content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* Horizontally center the dropdown */
    background-color: #ff157d;
    box-shadow: 0 clamp(4px, 1vw, 12px) clamp(8px, 2vw, 20px) rgba(0, 0, 0, 0.3);
    padding: clamp(0.5rem, 1vh, 0.8rem) 0;
    min-width: clamp(200px, 40vw, 350px);
    z-index: 1;
    transition: background-color 0.3s ease;
}

/* Individual dropdown links */
.dropdown-content li {
    display: block;
    padding: clamp(0.5rem, 1vh, 0.8rem) clamp(1rem, 2vw, 1.5rem);
}

.dropdown-content li a {
    color: var(--brand-surface-text);
    text-decoration: none;
    display: block;
    font-size: 16px;
    transition: color 0.3s ease;
}

.dropdown-content li a:hover {
    background-color: rgba(42, 6, 24, 0.16);
    color: var(--brand-surface-contrast);
}

/* Retro theme dropdown content */
body.retro-theme .dropdown-content {
    background-color: #d4a574;
}

body.retro-theme .dropdown-content li a {
    color: #333344;
}

body.retro-theme .dropdown-content li a:hover {
    background-color: #c9955f;
    color: #fff;
}

/* Show the dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile responsive for smaller screens */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        align-items: center; /* Center the items vertically */
        gap: 15px;
    }

    /* Dropdown content for mobile */
    .dropdown-content {
        left: 0;
        right: 0;
        transform: none; /* No need to center horizontally */
        width: 100%; /* Full width on small screens */
        position: relative; /* Relative to avoid navbar flow disruption */
    }

    /* Ensure dropdown works on mobile */
    .dropdown:hover .dropdown-content {
        display: block;
    }
}
