/* Enhanced Navigation Layout */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem; /* Reduced from 2rem */
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: var(--color-50);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0.75rem; /* Reduced horizontal padding */
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  text-align: center;
}

/* Hover effect for desktop */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-300);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-links a:hover::after {
  width: 80%;
}

.nav-links a:hover {
  color: var(--color-300);
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation Styles */
@media (max-width: 767px) {
  .burger {
    display: block;
    cursor: pointer;
    z-index: 100;
    position: fixed;
    right: 1rem;
    top: 1rem;
  }

  .burger div {
    width: 22px;
    height: 2px;
    background-color: white;
    margin: 4px 0;
    transition: all 0.25s ease;
    border-radius: 2px;
  }

  /* Burger Animation */
  .burger.toggle .line1 {
    transform: rotate(-45deg) translate(-4px, 5px);
  }

  .burger.toggle .line2 {
    opacity: 0;
  }

  .burger.toggle .line3 {
    transform: rotate(45deg) translate(-4px, -5px);
  }

  /* Mobile Menu Container */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #6226b1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Reduced padding */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    gap: 0.75rem; /* Reduced gap for mobile */
    transform: translateX(-100%);
  }

  /* Active State */
  .nav-links.active {
    transform: translateX(0);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  /* Menu Items */
  .nav-links li {
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    text-align: center;
    margin: 0.25rem 0; /* Added small vertical margin */
  }

  .nav-links.active li {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
  }

  /* Menu Links */
  .nav-links a {
    display: block;
    padding: 0.75rem; /* Reduced padding */
    font-size: 1.1rem; /* Slightly reduced font size */
    text-align: center;
    width: 100%;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02); /* Reduced scale effect */
  }

  .nav-links a::after {
    display: none;
  }

  /* Prevent body scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

  /* Mobile Menu Background Overlay */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 98;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile Auth Buttons */
  .mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 280px; /* Slightly reduced max-width */
    gap: 0.5rem; /* Reduced gap */
    margin-top: 1.5rem; /* Reduced margin */
  }

  .mobile-auth-buttons button {
    width: 100%;
    padding: 0.75rem; /* Reduced padding */
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
  }
}

/* Animation for menu items */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Large screens */
@media (min-width: 768px) {
  .nav-links {
    position: relative;
    width: auto;
    height: auto;
    background: none;
    flex-direction: row;
    padding: 0;
    transform: none;
    box-shadow: none;
    gap: 0.5rem; /* Reduced gap for desktop */
  }

  .nav-links li {
    opacity: 1;
    transform: none;
  }

  .nav-links a {
    padding: 0.5rem 0.75rem; /* Consistent padding */
  }
}