/* ==========================================================================
   CONVERTMASTER PRO — ANIMATION SYSTEM (animation.css)
   Micro-interactions, Keyframes, Hardware-accelerated transitions
   ========================================================================== */

/* Keyframe Definitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translate3d(-30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translate3d(30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.92, 0.92, 1);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  33% {
    transform: translate3d(12px, -18px, 0) rotate(2deg);
  }
  66% {
    transform: translate3d(-10px, -8px, 0) rotate(-2deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  33% {
    transform: translate3d(-14px, 16px, 0) rotate(-3deg);
  }
  66% {
    transform: translate3d(12px, 8px, 0) rotate(1.5deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25), 0 0 30px rgba(59, 130, 246, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5), 0 0 50px rgba(59, 130, 246, 0.25);
  }
}

@keyframes electricPulse {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(0, 242, 254, 0.95)) drop-shadow(0 0 24px rgba(79, 172, 254, 0.6));
  }
}

@keyframes lightningArc {
  0%, 100% {
    opacity: 0.7;
    stroke-dashoffset: 0;
  }
  50% {
    opacity: 1;
    stroke-dashoffset: 12;
  }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes swapSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes rippleAnimation {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

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

@keyframes marqueeScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes badgeBreathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes cardShine {
  0% {
    left: -100%;
    opacity: 0;
  }
  50% {
    opacity: 0.15;
  }
  100% {
    left: 200%;
    opacity: 0;
  }
}

/* Reusable Animation Classes */
.animate-fade-in {
  animation: fadeIn var(--transition-normal) ease-out forwards;
}

.animate-fade-up {
  animation: fadeUp var(--transition-smooth) ease-out forwards;
}

.animate-fade-left {
  animation: fadeLeft var(--transition-smooth) ease-out forwards;
}

.animate-fade-right {
  animation: fadeRight var(--transition-smooth) ease-out forwards;
}

.animate-zoom-in {
  animation: zoomIn var(--transition-normal) ease-out forwards;
}

.animate-float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}

.animate-float-reverse {
  animation: floatReverse 10s ease-in-out infinite;
}

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

.animate-electric {
  animation: electricPulse 2.5s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spinSlow 20s linear infinite;
}

/* Stagger Helpers */
.stagger-1 { animation-delay: 60ms; }
.stagger-2 { animation-delay: 120ms; }
.stagger-3 { animation-delay: 180ms; }
.stagger-4 { animation-delay: 240ms; }
.stagger-5 { animation-delay: 300ms; }

/* Scroll-Driven Reveal Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Micro-interactions: Buttons, Cards, Inputs */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleAnimation 600ms linear;
  pointer-events: none;
}

/* Card Lift and Hover Shine */
.card-lift {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-normal);
  will-change: transform, box-shadow;
}

.card-lift:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: var(--shadow-hover);
  border-color: var(--card-border-hover);
}

.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 100%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  transform: rotate(30deg);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.card-shine:hover::after {
  animation: cardShine 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Icon Rotation Micro-interaction */
.icon-rotate-hover {
  transition: transform var(--transition-bounce);
}

.icon-rotate-hover:hover {
  transform: rotate(12deg) scale(1.1);
}

.icon-swap-active {
  animation: swapSpin 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Number Counter Animation */
.counter-val {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 200ms ease;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
