/* ==========================================================================
   PREMIUM GLASSMORPHISM NAVBAR STYLES (STICKY & RESPONSIVE)
   ========================================================================== */

/* Sticky & Glassmorphism Base Container */
.nav_container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 18px 30px;
  background: transparent; /* Transparent at the top */
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 99999;
  transition: padding 0.4s ease, 
              background-color 0.4s ease, 
              backdrop-filter 0.4s ease, 
              box-shadow 0.4s ease, 
              border-color 0.4s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0);
  box-sizing: border-box;
}

/* Glassmorphism state after scrolling down */
.nav_container.scrolled {
  padding: 12px 30px;
  background-color: rgba(255, 255, 255, 0.72) !important; /* White glass */
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* ==========================================================================
   LOGO HOVER MOTIONS
   ========================================================================== */
.logo {
  cursor: pointer;
}

.logo img {
  width: 42px !important;
  height: 42px !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.logo .title {
  font-size: 20px !important;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
              color 0.4s ease !important;
}

/* Logo hover effects */
.logo:hover img {
  transform: scale(1.08) rotate(6deg);
}

.logo:hover .title {
  transform: translateX(3px);
}

/* ==========================================================================
   DESKTOP MENU HOVER & ACTIVE INDICATORS
   ========================================================================== */
nav ul {
  position: relative; /* Anchor for absolute active indicator */
  display: flex;
  gap: 28px;
  align-items: center;
}

nav a {
  position: relative;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
  padding: 6px 0;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: var(--primary) !important;
}

/* Hover underline animation on links (inactive) */
nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Hide static active underline pseudo-elements to avoid double indicator lines */
nav a.active::after {
  display: none !important;
}

/* Single Active Navigation Underline Indicator */
.nav-active-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  background-color: var(--primary);
  width: 0;
  pointer-events: none;
  transform-origin: left center;
  z-index: 1;
}

/* ==========================================================================
   DARK MODE COMPATIBILITY
   ========================================================================== */
body.dark .nav_container.scrolled {
  background-color: rgba(14, 14, 26, 0.72) !important; /* Dark glass */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15) !important;
}

body.dark nav a {
  color: #e4e4e7;
}

body.dark .logo .title {
  color: #f4f4f5 !important;
}

body.dark .hamburger div {
  background: #f4f4f5 !important;
}

/* ==========================================================================
   MOBILE INTERFACE (<768px)
   ========================================================================== */
@media (max-width: 767px) {
  .nav_container {
    padding: 16px 20px;
  }
  
  .nav_container.scrolled {
    padding: 12px 20px;
  }

  /* Full Screen Slide-Down Menu Overlay */
  nav ul {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98); /* Light backdrop */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transform: translateY(-100%); /* Start hidden above top */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 99998;
    margin: 0;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  }

  nav ul.active {
    transform: translateY(0); /* Slide down into view */
  }

  nav a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
  }

  /* Dark mode full-screen overlay adjustment */
  body.dark nav ul {
    background-color: rgba(14, 14, 26, 0.98);
  }

  /* Hamburger Menu Trigger Button spacing */
  .hamburger {
    display: flex !important;
    z-index: 99999;
  }

  /* Hide the active indicator on mobile, standardizing layout details */
  .nav-active-indicator {
    display: none !important;
  }
}

/* Scroll lock when mobile menu is active */
body.nav-menu-open {
  overflow: hidden !important;
  height: 100vh !important;
}
