/* Navigation Styles - Mobile-First Architecture */

/* ============================
   MOBILE NAVIGATION DRAWER
   ============================ */

/* Mobile-first drawer menu - base styles are for mobile */
.nav-list {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 90vw);
  padding: calc(var(--spacing-16) + var(--spacing-4)) var(--spacing-6) var(--spacing-6);
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-5);
  transform: translateX(110%);
  transition: transform var(--transition-slower);
  z-index: var(--z-modal); /* Above backdrop and page content */
  will-change: transform; /* Performance optimization */
}

.nav-list.active {
  transform: translateX(0);
}

/* Navigation Links */
.nav-link {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: var(--spacing-3) 0;
  position: relative;
  transition: color var(--transition-fast);
  pointer-events: auto; /* Explicitly allow clicks */
  cursor: pointer; /* Visual feedback */
  z-index: 1; /* Ensure links are above any pseudo-elements */
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #FF6B35 0%, #FF8C5A 100%);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 28px;
}

/* Desktop CTA (hidden on mobile) */
.nav-cta {
  display: none;
}

/* Mobile CTA inside drawer */
.mobile-cta-container {
  margin-top: var(--spacing-2);
}

.mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%);
  color: var(--color-white);
  box-shadow: 0 10px 26px rgba(255, 107, 53, 0.25);
  transition: filter var(--transition-fast);
  pointer-events: auto; /* Ensure CTA button is clickable */
  cursor: pointer;
}

.mobile-cta:hover {
  filter: brightness(1.03);
}

/* ============================
   MOBILE MENU BUTTON
   ============================ */

.mobile-menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(15, 23, 42, 0.5);
}

.mobile-menu-btn:focus {
  outline: 2px solid rgba(255, 107, 53, 0.75);
  outline-offset: 2px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.92);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================
   NAV BACKDROP
   ============================ */

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px); /* Safari support */
  opacity: 0;
  pointer-events: none; /* Don't capture clicks when inactive */
  transition: opacity var(--transition-slower);
  z-index: var(--z-modal-backdrop); /* Just below nav-list */
  will-change: opacity; /* Performance optimization */
}

.nav-backdrop.active {
  opacity: 1;
  pointer-events: auto; /* Capture clicks when active to close menu */
  /* Nav-list is at z-index: 1000, so clicks on it will still work */
}

/* ============================
   DESKTOP NAVIGATION
   ============================ */

@media (min-width: 900px) {
  .nav-list {
    position: static;
    height: auto;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-6);
  }

  .nav-link {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-2) 0;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--color-accent);
  }

  .nav-link::after {
    bottom: 0;
  }

  .mobile-menu-btn {
    display: none;
  }

  .nav-cta {
    display: inline-flex;
  }

  .mobile-cta-container {
    display: none;
  }

  .nav-backdrop {
    display: none;
  }
}
