/* Universal Floating Header Navigation Module */

/* Floating Pill Navigation */
.floating-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(211, 255, 0, 0.3);
  border-radius: 33px;
  padding: var(--space-sm) var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  animation: floatIn 0.6s ease-out;
  max-width: 1200px;
  width: auto;
  min-width: 300px;
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.floating-nav:hover {
  transform: translateX(-50%) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(211, 255, 0, 0.4);
}

.floating-nav .logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-lime);
  text-decoration: none;
  margin-right: var(--space-md);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  line-height: 1;
}

.floating-nav .logo:hover {
  color: var(--text-primary);
  text-shadow: 0 0 70px rgba(211, 255, 0, 0.5);
}

.floating-nav .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.floating-nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  overflow: hidden;
  background: transparent !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Animated terracotta gradient underline */
.floating-nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(226, 114, 91, 0.8) 30%, 
    rgba(226, 114, 91, 1) 50%, 
    rgba(200, 90, 71, 1) 70%, 
    transparent 100%);
  transform: translateX(-100%);
  transition: transform 0s;
  box-shadow: 0 0 8px rgba(226, 114, 91, 0.6);
  
  /* Edge masking for realistic fade-out */
  mask: linear-gradient(90deg, 
    transparent 0%, 
    black 15%, 
    black 85%, 
    transparent 100%);
  -webkit-mask: linear-gradient(90deg, 
    transparent 0%, 
    black 15%, 
    black 85%, 
    transparent 100%);
}

.floating-nav .nav-links a:hover {
  color: var(--accent-lime);
}

.floating-nav .nav-links a:hover::after {
  animation: illumination-sweep-loop 1.5s linear infinite;
}

@keyframes illumination-sweep-loop {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(200%);
    opacity: 0;
  }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .floating-nav .nav-links a::after,
  .mobile-menu a::after {
    animation: none;
    transition: opacity 0.2s ease;
    /* Keep masking for consistent appearance */
    mask: linear-gradient(90deg, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask: linear-gradient(90deg, transparent 0%, black 20%, black 80%, transparent 100%);
  }
  
  .floating-nav .nav-links a:hover::after,
  .mobile-menu a:hover::after {
    animation: none;
    opacity: 1;
    transform: translateX(0);
  }
}

.floating-nav .nav-links a:focus {
  outline: 2px solid var(--accent-lime);
  outline-offset: 2px;
  background: transparent !important;
}

/* Mobile Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.hamburger:hover {
  transform: scale(1.1);
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--accent-lime);
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(211, 255, 0, 0.3);
  border-radius: 20px;
  padding: var(--space-lg);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mobile-menu a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xs) 0;
  transition: color 0.3s ease;
  font-size: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Mobile animated terracotta gradient underline */
.mobile-menu a::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(226, 114, 91, 0.8) 30%, 
    rgba(226, 114, 91, 1) 50%, 
    rgba(200, 90, 71, 1) 70%, 
    transparent 100%);
  transform: translateX(-100%);
  transition: transform 0s;
  box-shadow: 0 0 8px rgba(226, 114, 91, 0.6);
  
  /* Edge masking for realistic fade-out */
  mask: linear-gradient(90deg, 
    transparent 0%, 
    black 15%, 
    black 85%, 
    transparent 100%);
  -webkit-mask: linear-gradient(90deg, 
    transparent 0%, 
    black 15%, 
    black 85%, 
    transparent 100%);
}

.mobile-menu a:hover {
  color: var(--accent-lime);
}

.mobile-menu a:hover::after {
  animation: illumination-sweep-loop 1.5s linear infinite;
}

/* Responsive Design */
@media (max-width: 1280px) {
  .floating-nav {
    max-width: 95vw;
    margin: 0 2.5vw;
  }
}

@media (max-width: 768px) {
  .floating-nav {
    min-width: 280px;
    padding: var(--space-xs) var(--space-md);
    max-width: 90vw;
  }

  .mobile-menu {
    min-width: 250px;
  }

  .floating-nav .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .floating-nav .logo {
    font-size: 1.3rem;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .floating-nav {
    min-width: 250px;
    padding: var(--space-xs) var(--space-sm);
    max-width: 95vw;
  }

  .floating-nav .logo {
    font-size: 1.2rem;
  }
}
