/* Navigation Menu */
/* Navigation Menu Base Styles */
.nav-menu {
    position: fixed;
    top: 0;
    left: -300px; /* Use left positioning instead of transform */
    width: 300px;
    height: 100%;
    background: var(--color-surface);
    padding-top: var(--header-height);
    z-index: var(--z-nav); /* Ensure this is between overlay and hamburger */
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin;
    scrollbar-color: #ff8c00 #2a2a2a;
}

.nav-scroll-wrapper {
    padding-bottom: 30px; /* Add padding at the bottom */
}

.nav-menu.active {
    left: 0;
}

/* Custom scrollbar styling */
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.nav-menu::-webkit-scrollbar-thumb {
    background-color: #ff8c00;
    border-radius: 3px;
}

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: var(--z-overlay);
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
}

/* Navigation sections */
.nav-section {
    padding: 15px;  /* Reduced from 20px */
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 10px;  /* Reduced from default */
}

.nav-section h3 {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 10px;  /* Reduced from 15px */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation links */
.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;  /* Reduced from 10px */
}

.nav-links li {    margin-bottom: 0;  /* Removed margin */
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 8px 15px;  /* Reduced top/bottom padding from 10px */
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    background: linear-gradient(145deg, #2a2a2a, #333);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: none;
    pointer-events: none;
}

.nav-links a:hover::before {
    animation: slideRight 1s ease-in-out;
}

@keyframes slideRight {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.nav-links a:hover {
    transform: translateX(5px);
    border-left-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.15);
}

/* Updated specific navigation colors with glow effects */
.nav-links li a[href="/"] { 
    border-left-color: #4CAF50; 
}
.nav-links li a[href="/"]:hover { 
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.3);
}

.nav-links li a[href="/"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(76, 175, 80, 0.2),
        transparent
    );
}

.nav-links li a[href*="discord"] { 
    border-left-color: #99AAE9; 
    background: linear-gradient(145deg, #2a2a2a, #1a2a4a);
}
.nav-links li a[href*="discord"]:hover { 
    box-shadow: 0 2px 12px rgba(153, 170, 233, 0.6);
    border-left-color: #B8C5F2;
    color: #fff;
    text-shadow: 0 0 8px rgba(153, 170, 233, 0.4);
}

.nav-links li a[href*="discord"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(153, 170, 233, 0.2),
        transparent
    );
}

.nav-links li a[href*="discord"] i {
    color: #99AAE9;
    transition: color 0.3s ease;
}

.nav-links li a[href*="discord"]:hover i {
    color: #B8C5F2;
}

/* Updated store link colors */
.nav-links li a[href*="store"] { 
    border-left-color: #FFD700; /* Changed to gold */
    background: linear-gradient(145deg, #2a2a2a, #332b15); /* Slightly warmer background */
}
.nav-links li a[href*="store"]:hover { 
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.8); /* Increased glow opacity */
    border-left-color: #FFF000; /* Brighter yellow on hover */
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8); /* Increased text glow */
}

.nav-links li a[href*="store"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.4), /* Increased gradient opacity */
        transparent
    );
}

.nav-links li a[href*="store"] i {
    color: #FFD700; /* Changed icon to gold */
    transition: color 0.3s ease;
}

.nav-links li a[href*="store"]:hover i {
    color: #FFF000; /* Brighter yellow on hover */
}

.nav-links li a[href*="rustimages"] { 
    border-left-color: #E91E63;
    background: linear-gradient(145deg, #2a2a2a, #333);
}
.nav-links li a[href*="rustimages"]:hover { 
    box-shadow: 0 2px 12px rgba(233, 30, 99, 0.3);
}

.nav-links li a[href*="rustimages"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(233, 30, 99, 0.2),
        transparent
    );
}

.nav-links li a[href*="contact"] { 
    border-left-color: #2196F3; 
}
.nav-links li a[href*="contact"]:hover { 
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.3);
}

.nav-links li a[href*="contact"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(33, 150, 243, 0.2),
        transparent
    );
}

/* Specific navigation colors */
.nav-links li a[href="/"] { border-left-color: #4CAF50; }
.nav-links li a[href*="discord"] { 
    border-left-color: #99AAE9; 
    background: linear-gradient(145deg, #2a2a2a, #1a2a4a);
}
.nav-links li a[href*="changelog"] { 
    border-left-color: #1b98ff;  /* Changed to match admin changelog green */
    background: linear-gradient(145deg, #2a2a2a, #333);  /* Kept gray background */
}
.nav-links li a[href*="store"] { 
    border-left-color: #FFD700; /* Updated to match new gold color */
    background: linear-gradient(145deg, #2a2a2a, #332b15);
}
.nav-links li a[href*="rustimages"] { 
    border-left-color: #E91E63;
    background: linear-gradient(145deg, #2a2a2a, #333); /* Updated to match home background */
}
.nav-links li a[href*="contact"] { border-left-color: #2196F3; }

/* Add specific color for changelog link */
.nav-links a[href="/changelog"] {
    color: #fff;
    border-left-color: #64B5F6;  /* Changed to match admin changelog green */
    background: linear-gradient(145deg, #2a2a2a, #333);  /* Kept gray background */
    transition: all 0.3s ease;
}

.nav-links a[href="/changelog"]:hover {
    transform: translateX(5px);
    border-left-color: #1e87ff;  /* Changed to match admin changelog green */
    background: linear-gradient(145deg, #2a2a2a, #333);  /* Kept gray background */
    text-shadow: 0 0 8px rgba(33, 150, 243, 0.6);  /* Changed to blue glow */
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);  /* Changed to blue shadow */
}

.nav-links a[href="/changelog"]::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(33, 150, 243, 0.2),
        transparent
    );
}

.nav-links a[href="/changelog"] i {
    color: #fff;  /* Changed from #2196F3 to white */
    transition: all 0.3s ease;
}

.nav-links a[href="/changelog"]:hover i {
    color: #fff;  /* Changed from #64B5F6 to stay white */
    text-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
}

/* Admin section */
.admin-section {
    background: var(--color-surface-variant);
    padding: 15px;  /* Reduced from 20px */
    margin-top: 10px;  /* Reduced from 20px */
}

.admin-section .nav-links a {
    background: rgba(255, 140, 0, 0.1);
    margin-bottom: 5px;  /* Reduced from 8px */
}

.admin-section .nav-links a::before {
    display: none;
}

/* Admin navigation colors */
.admin-section .nav-links li a[href*="changelog"] { 
    border-left-color: #2196F3;
    background: linear-gradient(145deg, #2a2a2a, #1a2a4a);
}
.admin-section .nav-links li a[href*="pterodactyl"] { 
    border-left-color: #2196F3;
    background: linear-gradient(145deg, #2a2a2a, #1a2a4a);
}
.admin-section .nav-links li a[href*="panel.underworldrust.com"] { 
    border-left-color: #2196F3;
    background: linear-gradient(145deg, #2a2a2a, #1a2a4a);
}
.admin-section .nav-links li a[href*="rustimages"] { 
    border-left-color: #E91E63;
    background: linear-gradient(145deg, #2a2a2a, #3a1515);
}
.admin-section .nav-links li a.logout-link { 
    border-left-color: #F44336;
    background: linear-gradient(145deg, #2a2a2a, #3a1a1a);
}

.admin-section .nav-links a:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.2);
}

/* Admin section hover effects */
.admin-section .nav-links li a[href*="changelog"]:hover { 
    background: linear-gradient(145deg, #1a2a4a, #2a3a5a);
    border-left-color: #64B5F6;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.admin-section .nav-links li a[href*="pterodactyl"]:hover,
.admin-section .nav-links li a[href*="panel.underworldrust.com"]:hover { 
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.3);
}

.admin-section .nav-links li a[href*="rustimages"]:hover { 
    box-shadow: 0 2px 12px rgba(233, 30, 99, 0.3);
}

.admin-section .nav-links li a.logout-link:hover { 
    box-shadow: 0 2px 12px rgba(244, 67, 54, 0.3);
}

/* Navigation links hover effects */
.nav-links li a[href*="changelog"]:hover { 
    box-shadow: 0 2px 12px rgba(33, 150, 243, 0.3);
    border-left-color: #64B5F6;
}

/* Body class for when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Ensure hamburger visibility */
.hamburger {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    z-index: 1001 !important;
}

/* Force visibility for nav elements */
.nav-menu,
.hamburger,
.nav-overlay {
    display: block !important;
    visibility: visible !important;
}

/* Ensure pointer events work correctly */
.nav-menu, .hamburger {
    pointer-events: auto !important;
}

.nav-overlay {
    pointer-events: none;
}

.nav-overlay.active {
    pointer-events: auto;
}

/* Fallback styles for older browsers */
@supports not (transform: translateX(-100%)) {
    .nav-menu {
        left: -300px;
    }
    .nav-menu.active {
        left: 0;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .nav-menu {
        -webkit-transform: translateX(-100%);
    }
    .nav-menu.active {
        -webkit-transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-menu {
        width: 280px;
        height: calc(100vh - 60px); /* Adjust based on header height */
        max-height: calc(100vh - 60px);
        top: 60px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        width: 260px;
        height: calc(100vh - 50px); /* Adjust for smaller header on mobile */
        max-height: calc(100vh - 50px);
        top: 50px;
    }
}
