/* Common navigation styles */
.site-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh; /* Fallback for older browsers */
    height: 100svh; /* Small viewport height - fallback for browsers without dvh */
    height: 100dvh; /* Dynamic viewport height - adjusts to visible viewport on mobile */
    background-color: var(--nav-bg-color);
    color: var(--text-color);
    z-index: 1000;
    transform: translateX(-240px); /* Default hidden on mobile */
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-nav);
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
}

.nav-top {
    display: flex;
    flex-direction: column;
    height: auto;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    padding-top: 12px;
}

#nav-language-switcher {
    width: 100%;
    display: flex;
    justify-content: center;
}

.close-nav {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    left: 12px;
    top: 12px;
    position: absolute;
}

.close-nav:hover {
    background-color: var(--overlay-white-10);
}

/* Show menu by default on large screens */
@media (min-width: 1281px) {
    .site-nav {
        transform: translateX(0); /* Visible by default */
    }
    
    .main-container {
        padding-left: 240px !important; /* Make space for the menu */
    }
}

@media (min-width: 1281px) {
    .close-nav {
        display: none;
    }
}

.site-nav.open {
    transform: translateX(0);
}

.nav-logo {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid var(--grey4-color);
}

.nav-logo-link {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
}

.nav-logo-link:hover {
    text-decoration: none;
    color: var(--text-color);
}

.nav-logo-link svg {
    width: 100px;
    height: 100px;
}    

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    overflow-x: visible;
}

.nav-menu li {
    margin: 0;
    padding: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light-color);
    font-weight: 400;
    text-decoration: none;
    transition: background-color var(--transition-base), color var(--transition-base);
    border-left: 3px solid transparent;
}

.nav-menu a svg {
    margin-right: 10px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-menu a span {
    line-height: 24px;
}

.nav-menu a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--text-color);
    text-decoration: none;
}

.nav-menu a.active {
    background-color: var(--nav-active-bg);
    color: var(--text-color);
    border-left-color: var(--primary-button-color);
}


/* Profile button styling (matches language-switcher) */
.nav-profile-container {
    width: 100%;
}

.nav-profile-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--grey5-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-l);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
    text-decoration: none;
}

.nav-profile-button:hover {
    background: var(--grey6-color);
    border-color: var(--grey4-color);
    text-decoration: none;
}

.nav-profile-button svg {
    width: 20px;
    height: 20px;
}

.nav-profile-button span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Back to game button for content pages */
.back-to-game {
    padding: 16px 20px 0;
    flex-shrink: 0;
}

.back-to-game a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    background-color: var(--nav-button-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-s);
    text-align: center;
    transition: background-color var(--transition-slow);
}

.back-to-game a:hover {
    background-color: var(--nav-button-primary-hover);
    text-decoration: none;
}

/* Adjust main container when nav is open */
.main-container.nav-open {
    padding-left: 240px;
    transition: padding-left 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-container.nav-open {
        padding-left: 1rem;
    }
}
