/* ========================= */
/* Futuristic Navigation — Mobile Optimized */
/* ========================= */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: rgba(10, 10, 20, 0.55);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.4s ease;
  font-family: 'Inter', sans-serif;
  overflow: visible; /* ✅ FIX: allow menu to open fully */
}

/* Clean Professional Logo */
nav .logo {
  font-size: clamp(1.2em, 4vw, 1.5em);
  font-weight: 800;
  color: #e5e5e5;
  text-transform: uppercase;
  letter-spacing: 3px;   /* increased spacing for clean separation */
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;              /* spacing between letters */
  text-decoration: none; /* remove underline */
  margin-left: 6px;

  transition: transform 0.3s ease, color 0.3s ease, letter-spacing 0.3s ease;
}

nav .logo:hover {
  color: #0ff;
  transform: scale(1.05);
  letter-spacing: 4px;  /* subtle expansion on hover */
}


/* Links Container */
nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0 6px;
  position: relative;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: clamp(0.85em, 2vw, 1em);
  padding: 6px 8px;
  border-radius: 10px;
  position: relative;
  transition: all 0.3s ease;
}

/* Hover Underline */
nav ul li a::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ff, #0ff55a, #0ff);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.4s ease;
}
nav ul li a:hover::before {
  width: 100%;
}

/* Glow Pulse */
nav ul li a::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
nav ul li a:hover::after {
  opacity: 1;
  transform: scale(1.03);
}

/* Dropdown */
nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  min-width: 150px;
  z-index: 9999;
}
nav ul li:hover ul {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
nav ul li ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9em;
}
nav ul li ul li a:hover {
  background-color: rgba(0, 255, 255, 0.1);
  color: #0ff;
}

/* ========================= */
/* Mobile Responsive Nav */
/* ========================= */

/* Show toggle only on mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
}

/* Base toggle styling */
.nav-toggle {
  display: none;
  width: 32px;
  height: 28px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10001;
  padding: 0;
  margin-right: 18px;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #0ff;
  border-radius: 4px;
  transition: 0.4s ease;
}

/* Animation – Hamburger to X */
.nav-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Nav Styling */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100vh;
  width: 70%;
  max-width: 320px;
  background: #000;
  padding: 80px 24px;
  transition: 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10000;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav a {
  color: #0ff;
  font-size: 20px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: 0.3s;
}

.mobile-nav a:hover {
  color: #fff;
}

/* ========================= */
/* 🔧 Fix: Keep Toggle Button Above Nav Overlay */
/* ========================= */
@media (max-width: 768px) {

  .nav-toggle {
    position: fixed;        /* stays visible even when menu opens */
    top: 6px;
    bottom: 16px;
    right: 18px;
    z-index: 200000;        /* 🔥 higher than nav overlay */
    background: rgba(0, 0, 0, 0.55);
    border-radius: 6px;
    padding: 6px;
    display: flex;
  }

  .nav-toggle span {
    background: #0ff;
  }

  /* Ensure the menu never overlaps the toggle */
  .nav-links.active {
    z-index: 150000;        /* 🔥 slightly lower than toggle */
  }
}

/* Hamburger Animation */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================= */
/* Mobile Layout Fix */
/* ========================= */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px;
  }

  .nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .nav-toggle {
    display: flex;
  }

  /* ✅ FIXED FULLSCREEN OVERLAY MENU */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;  /* ✅ Full width */
    height: 100vh; /* ✅ Full height */
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 99999; /* ✅ Appear above everything */
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
  }

  nav ul {
    flex-direction: column;
    gap: 18px;
    width: 100%;
  }

  nav ul li a {
    font-size: 1.3em;
    padding: 10px 16px;
    text-align: center;
    width: 80%;
    border-radius: 8px;
  }

  nav .logo {
    font-size: 1.2em;
    margin-left: 0;
  }
}

/* ========================= */
/* Ultra-Small Screen Fix (<=400px) */
/* ========================= */
@media (max-width: 400px) {
  nav {
    padding: 5px 8px;
  }
  nav .logo {
    font-size: 1em;
  }
  nav ul li a {
    font-size: 1.1em;
    padding: 10px 12px;
    width: 90%;
  }
}
