/* Advanced Animation Library */

/* Entrance Animations */
@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Continuous Animations */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.8);
  }
}

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

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

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

/* Hover Effect Animations */
@keyframes hoverLift {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes morphBorder {
  0%, 100% {
    border-radius: 12px;
  }
  50% {
    border-radius: 24px;
  }
}

/* Text Animations */
@keyframes typewriter {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

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

/* Utility Animation Classes */
.animate-slide-left {
  animation: slideInFromLeft 0.8s var(--ease-back) forwards;
}

.animate-slide-right {
  animation: slideInFromRight 0.8s var(--ease-back) forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.6s var(--ease-elastic) forwards;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-float {
  animation: floatingElement 3s ease-in-out infinite;
}

.animate-rotate-glow {
  animation: rotateGlow 8s linear infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.animate-gradient {
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
}

/* Hover Animation Classes */
.hover-lift {
  transition: all 0.3s var(--ease-smooth);
}

.hover-lift:hover {
  animation: hoverLift 0.3s var(--ease-smooth) forwards;
}

.hover-morph {
  transition: all 0.4s var(--ease-elastic);
}

.hover-morph:hover {
  animation: morphBorder 0.6s var(--ease-elastic);
}

/* Stagger Animation Delays */
.animate-stagger-1 { animation-delay: 0.1s; }
.animate-stagger-2 { animation-delay: 0.2s; }
.animate-stagger-3 { animation-delay: 0.3s; }
.animate-stagger-4 { animation-delay: 0.4s; }
.animate-stagger-5 { animation-delay: 0.5s; }

/* Intersection Observer Triggered Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s var(--ease-back);
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Performance Optimized Animations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-float,
  .animate-pulse-glow,
  .animate-rotate-glow {
    animation: none !important;
  }
}