/* ============================================
   Shopify Learn - Animations Stylesheet
   Premium Animation Effects
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Blob Float Animation */
@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(20px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-10px, 20px) scale(0.95);
  }
  75% {
    transform: translate(30px, 10px) scale(1.02);
  }
}

/* Glowing Pulse Animation */
@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    box-shadow: 0 0 20px rgba(124, 255, 59, 0.3),
                0 0 40px rgba(124, 255, 59, 0.2),
                0 0 60px rgba(124, 255, 59, 0.1);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 30px rgba(124, 255, 59, 0.4),
                0 0 60px rgba(124, 255, 59, 0.3),
                0 0 90px rgba(124, 255, 59, 0.2);
  }
}

/* Ring Rotation Animation */
@keyframes ringRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Scroll Bounce Animation */
@keyframes scrollBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Scroll Wheel Animation */
@keyframes scrollWheel {
  0%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.3;
    transform: translateY(6px);
  }
}

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

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade Up Animation */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade Down Animation */
@keyframes fadeDown {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade Left Animation */
@keyframes fadeLeft {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade Right Animation */
@keyframes fadeRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateY(0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-30px);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translateY(-15px);
  }
  90% {
    transform: translateY(-4px);
  }
}

/* Ripple Animation */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Card Tilt */
@keyframes cardTilt {
  0%, 100% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
  }
  75% {
    transform: perspective(1000px) rotateX(-2deg) rotateY(2deg);
  }
}

/* Slide In from Left */
@keyframes slideInLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide In from Right */
@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Counter Grow Animation */
@keyframes counterGrow {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Progress Fill Animation */
@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* Base Animation Properties */
.anim-fade-up,
.anim-fade-down,
.anim-fade-left,
.anim-fade-right,
.anim-scale,
.anim-zoom {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade-up {
  transform: translateY(30px);
}

.anim-fade-down {
  transform: translateY(-30px);
}

.anim-fade-left {
  transform: translateX(-30px);
}

.anim-fade-right {
  transform: translateX(30px);
}

.anim-scale,
.anim-zoom {
  transform: scale(0.95);
}

/* Animated State */
.anim-fade-up.animated,
.anim-fade-down.animated,
.anim-fade-left.animated,
.anim-fade-right.animated,
.anim-scale.animated,
.anim-zoom.animated {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Floating Animations */
.anim-float {
  animation: float 6s ease-in-out infinite;
}

.anim-float.delay-1 {
  animation-delay: 1s;
}

.anim-float.delay-2 {
  animation-delay: 2s;
}

.anim-float.delay-3 {
  animation-delay: 3s;
}

/* Animation Delays */
.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

/* Transition Timing Variants */
.anim-fast {
  transition-duration: 0.3s;
}

.anim-medium {
  transition-duration: 0.6s;
}

.anim-slow {
  transition-duration: 0.9s;
}

/* ============================================
   Hover Animations
   ============================================ */

/* Hover Glow Effect */
.hover-glow {
  position: relative;
  overflow: hidden;
}

.hover-glow::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(124, 255, 59, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hover-glow:hover::after {
  opacity: 1;
}

/* Hover Lift Effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Hover Scale Effect */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Magnetic Button Effect */
.magnetic {
  position: relative;
  transition: transform 0.3s ease;
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* ============================================
   Text Animations
   ============================================ */

/* Gradient Text Animation */
.gradient-text-animated {
  background: linear-gradient(90deg, #7CFF3B, #32D74B, #7CFF3B);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

/* Text Reveal Animation */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: fadeUp 0.6s ease forwards;
}

/* ============================================
   Loading Animations
   ============================================ */

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(124, 255, 59, 0.2);
  border-top-color: #7CFF3B;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ============================================
   Special Effects
   ============================================ */

/* Neon Glow Border */
.neon-border {
  position: relative;
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #7CFF3B, #32D74B, #7CFF3B);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(8px);
}

.neon-border:hover::before {
  opacity: 1;
}

/* Glass Effect on Hover */
.glass-hover {
  transition: all 0.3s ease;
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Morphing Background */
.morph-bg {
  animation: blobFloat 15s ease-in-out infinite alternate;
}

/* ============================================
   Scroll-based Animations
   ============================================ */

/* Sections animate in view */
.section .section-header {
  transition-delay: 0s;
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* ============================================
   Particle Animation Classes
   ============================================ */

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #7CFF3B;
  border-radius: 50%;
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.particle:nth-child(1) { animation-delay: 0s; top: 10%; left: 20%; }
.particle:nth-child(2) { animation-delay: 1s; top: 30%; left: 80%; }
.particle:nth-child(3) { animation-delay: 2s; top: 50%; left: 60%; }
.particle:nth-child(4) { animation-delay: 3s; top: 70%; left: 30%; }
.particle:nth-child(5) { animation-delay: 4s; top: 20%; left: 50%; }
.particle:nth-child(6) { animation-delay: 5s; top: 80%; left: 70%; }
.particle:nth-child(7) { animation-delay: 6s; top: 40%; left: 40%; }
.particle:nth-child(8) { animation-delay: 7s; top: 60%; left: 90%; }

/* ============================================
   Performance Optimizations
   ============================================ */

/* Use will-change sparingly for elements that will animate */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .anim-float {
    animation: none;
  }

  .glow-ring {
    animation: none;
  }

  .cursor-glow {
    display: none;
  }
}

/* GPU Acceleration */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================
   Modal/Overlay Animations
   ============================================ */

.modal-enter {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
}

.modal-enter-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-exit {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-exit-active {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Overlay Fade */
.overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
}

/* ============================================
   Navigation Animations
   ============================================ */

/* Menu Slide Animation */
.menu-slide-down {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.menu-slide-down.active {
  transform: translateY(0);
}

/* Link Hover Underline */
.nav-link-animated {
  position: relative;
}

.nav-link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7CFF3B, #32D74B);
  transition: width 0.3s ease;
}

.nav-link-animated:hover::after {
  width: 100%;
}
