/* Navbar styling */
.navbar {
    background-color: #2c2c3a;
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    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: 30px; /* 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: #a68ab7;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 8px 12px;
    font-size: 18px;
    border-radius: 6px;
    min-width: 44px;
    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: #fff;
    font-size: 22px;
    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: #a68ab7;
}

/* 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: #2c2c3a;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
    min-width: 275px;
    z-index: 1;
    transition: background-color 0.3s ease;
}

/* Individual dropdown links */
.dropdown-content li {
    display: block;
    padding: 10px 20px;
}

.dropdown-content li a {
    color: #fff;
    text-decoration: none;
    display: block;
    font-size: 16px;
    transition: color 0.3s ease;
}

.dropdown-content li a:hover {
    background-color: #696969;
}

/* 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;
    }
}
