/* Animations - Keyframes, Transitions, Motion */

/* Keyframe Animations */
@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes gentleRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes scroll {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 
      0 8px 20px rgba(37, 211, 102, 0.4),
      0 4px 10px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 
      0 8px 30px rgba(37, 211, 102, 0.6),
      0 4px 15px rgba(0, 0, 0, 0.4);
  }
}

@keyframes rotateBg {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes scrollDot {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(20px); }
  100% { transform: translateX(-50%) translateY(40px); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Hover Effects */
.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.3);
}

/* Button Animations */
.btn-text {
  position: relative;
  z-index: 2;
}

.neo-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.neo-button:hover::before {
  opacity: 0.1;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 209, 102, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* Floating Elements */
.floating-shape {
  position: absolute;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.floating-shape:nth-child(2) {
  animation-delay: -2s;
}

.floating-shape:nth-child(3) {
  animation-delay: -4s;
}

/* Stagger Animations */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animated-bg {
    animation: none;
  }
  
  .scroll-indicator {
    animation: none;
  }
  
  .floating-shape {
    animation: none;
  }
  
  .testimonial-track {
    /* Allow carousel transitions even in reduced motion - they're essential for functionality */
    transition: transform 0.2s ease !important;
  }
  
  .carousel-nav,
  .carousel-dot {
    /* Keep minimal transitions for accessibility */
    transition: color 0.2s ease, background-color 0.2s ease !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  
  .stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* Focus Animations */
.focus-ring {
  transition: all 0.2s ease;
}

.focus-ring:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.2);
}

/* Modal Animations */
.modal-enter {
  animation: scaleIn 0.3s ease;
}

.modal-exit {
  animation: scaleIn 0.3s ease reverse;
}

/* Carousel Specific Animations */
.testimonial-track {
  backface-visibility: hidden;
  perspective: 1000px;
}

.testimonial-slide {
  backface-visibility: hidden;
}

.carousel-nav:active {
  transform: translateY(0);
  box-shadow: 
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

.carousel-dot:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* Ensure proper stacking context */
.testimonial-carousel {
  isolation: isolate;
}

/* Fix potential overflow issues */
.testimonial-slide .neo-card {
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
}