/**
 * Navigation Micro-interactions - Moon Memory Website
 * Subtle interactive effects for better UX
 */

/* Ripple Effect on Links */
nav a {
  position: relative;
  overflow: hidden;
}

nav a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

nav a:active::before {
  width: 200px;
  height: 200px;
}

/* Glow Effect on Hover */
nav a:hover {
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Smooth Color Transition */
nav a {
  background: linear-gradient(90deg, #C9CDD2, #D4AF37, #C9CDD2);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background-position 0.5s ease;
}

nav a:hover {
  background-position: 100% center;
}

/* Focus States for Accessibility */
nav a:focus-visible {
  outline: 2px solid #D4AF37;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Button Hover Effects */
.header-cta,
button {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-cta:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.header-cta:active,
button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Magnetic Effect for Buttons */
@media (hover: hover) {
  .header-cta {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  }
}

/* Loading State */
.nav-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.nav-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #D4AF37;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Menu Items Animation */
#mobileMenu nav a {
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileMenu.active nav a {
  opacity: 1;
  transform: translateX(0);
}

#mobileMenu.active nav a:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.active nav a:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.active nav a:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.active nav a:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.active nav a:nth-child(5) { transition-delay: 0.25s; }
#mobileMenu.active nav a:nth-child(6) { transition-delay: 0.3s; }

/* Hover Lift Effect */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* Shine Effect */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.shine-effect:hover::before {
  left: 100%;
}

/* Pulse Effect for Active Link */
@keyframes pulse-active {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

nav a.active {
  animation: pulse-active 2s ease-in-out infinite;
}

/* Scale on Active */
nav a:active {
  transform: scale(0.95);
}

/* Smooth Background Transition */
button,
.header-cta {
  background-size: 200% auto;
  transition: background-position 0.5s ease, transform 0.3s ease;
}

button:hover,
.header-cta:hover {
  background-position: right center;
}

/* Icon Rotation on Hover */
nav a svg,
button svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover svg,
button:hover svg {
  transform: rotate(15deg) scale(1.1);
}

/* Underline Growth Animation */
.underline-grow {
  position: relative;
}

.underline-grow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #D4AF37;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.underline-grow:hover::after {
  width: 100%;
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
