/* PayFlow Pro - Advanced Animations & Micro-Interactions */
/* Premium UI/UX Animations for Enhanced User Experience */

/* ==========================================
   ENTRANCE ANIMATIONS
   ========================================== */

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

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

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-100px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInFromBottom {
  0% {
    opacity: 0;
    transform: translateY(100px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  0% {
    opacity: 0;
    transform: rotate(-200deg) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes flipInX {
  0% {
    opacity: 0;
    transform: perspective(400px) rotateX(90deg);
  }
  40% {
    transform: perspective(400px) rotateX(-20deg);
  }
  60% {
    transform: perspective(400px) rotateX(10deg);
  }
  80% {
    transform: perspective(400px) rotateX(-5deg);
  }
  100% {
    opacity: 1;
    transform: perspective(400px) rotateX(0deg);
  }
}

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

/* ==========================================
   HOVER ANIMATIONS
   ========================================== */

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

@keyframes hoverScale {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

@keyframes hoverRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(5deg);
  }
}

@keyframes hoverPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    transform: scale(1);
  }
}

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

/* ==========================================
   INTERACTIVE FEEDBACK ANIMATIONS
   ========================================== */

@keyframes buttonPress {
  0% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(0.98) translateY(1px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@keyframes inputFocus {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    border-color: rgba(255, 255, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 1);
  }
}

@keyframes successCheckmark {
  0% {
    stroke-dasharray: 0 100;
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dasharray: 100 0;
    stroke-dashoffset: 0;
  }
}

@keyframes errorShake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

/* ==========================================
   LOADING & PROGRESS ANIMATIONS
   ========================================== */

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

@keyframes spinnerPulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes dotsLoading {
  0%, 20% {
    color: rgba(255, 215, 0, 0);
  }
  50% {
    color: rgba(255, 215, 0, 1);
  }
  100% {
    color: rgba(255, 215, 0, 0);
  }
}

@keyframes progressBar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

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

/* ==========================================
   ATTENTION-GRABBING ANIMATIONS
   ========================================== */

@keyframes wiggle {
  0%, 7% {
    transform: rotateZ(0);
  }
  15% {
    transform: rotateZ(-15deg);
  }
  20% {
    transform: rotateZ(10deg);
  }
  25% {
    transform: rotateZ(-10deg);
  }
  30% {
    transform: rotateZ(6deg);
  }
  35% {
    transform: rotateZ(-4deg);
  }
  40%, 100% {
    transform: rotateZ(0);
  }
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(1);
  }
}

@keyframes neon {
  0%, 100% {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #FFD700, 0 0 20px #FFD700;
  }
  50% {
    text-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 8px #FFD700, 0 0 12px #FFD700;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  }
}

/* ==========================================
   FLOATING & BACKGROUND ANIMATIONS
   ========================================== */

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

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

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

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

/* ==========================================
   ADVANCED TRANSITIONS
   ========================================== */

@keyframes morphShape {
  0% {
    border-radius: 50% 20% 80% 30%;
  }
  25% {
    border-radius: 30% 80% 20% 70%;
  }
  50% {
    border-radius: 70% 30% 50% 80%;
  }
  75% {
    border-radius: 80% 50% 30% 20%;
  }
  100% {
    border-radius: 50% 20% 80% 30%;
  }
}

@keyframes liquidDrop {
  0% {
    transform: scale(1) rotate(0deg);
    border-radius: 50%;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    border-radius: 30% 70% 60% 40%;
  }
  100% {
    transform: scale(1) rotate(360deg);
    border-radius: 50%;
  }
}

/* ==========================================
   UTILITY ANIMATION CLASSES
   ========================================== */

/* Entrance Animations */
.animate-slide-in-left {
  animation: slideInFromLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-slide-in-right {
  animation: slideInFromRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-slide-in-top {
  animation: slideInFromTop 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-slide-in-bottom {
  animation: slideInFromBottom 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-zoom-in {
  animation: zoomIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-rotate-in {
  animation: rotateIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-flip-in {
  animation: flipInX 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* Hover Effects */
.hover-bounce:hover {
  animation: hoverBounce 0.6s ease-in-out;
}

.hover-scale:hover {
  animation: hoverScale 0.3s ease-out forwards;
}

.hover-rotate:hover {
  animation: hoverRotate 0.3s ease-out forwards;
}

.hover-pulse:hover {
  animation: hoverPulse 1.5s infinite;
}

.hover-shine {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
}

.hover-shine:hover {
  animation: hoverShine 0.6s ease-out;
}

/* Interactive Feedback */
.animate-button-press:active {
  animation: buttonPress 0.15s ease-out;
}

.animate-input-focus:focus {
  animation: inputFocus 0.3s ease-out forwards;
}

.animate-success {
  animation: successCheckmark 0.6s ease-out forwards;
}

.animate-error {
  animation: errorShake 0.6s ease-in-out;
}

/* Loading States */
.animate-spinner {
  animation: spinnerRotate 1s linear infinite;
}

.animate-spinner-pulse {
  animation: spinnerPulse 1s ease-in-out infinite;
}

.animate-dots-loading::after {
  content: '...';
  animation: dotsLoading 1.5s infinite;
}

.animate-progress {
  animation: progressBar 2s ease-out forwards;
}

.animate-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.02) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
}

/* Attention Grabbers */
.animate-wiggle {
  animation: wiggle 1s ease-in-out;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-neon {
  animation: neon 2s ease-in-out infinite;
}

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

/* Floating Effects */
.animate-floating {
  animation: floating 3s ease-in-out infinite;
}

.animate-floating-reverse {
  animation: floatingReverse 3s ease-in-out infinite;
}

.animate-particle-float {
  animation: particleFloat 10s linear infinite;
}

.animate-gradient-shift {
  background: linear-gradient(-45deg, #FFD700, #E8742A, #D4856F, #FFD700);
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
}

/* Advanced Morphing */
.animate-morph {
  animation: morphShape 6s ease-in-out infinite;
}

.animate-liquid {
  animation: liquidDrop 4s ease-in-out infinite;
}

/* ==========================================
   STAGGERED ANIMATION DELAYS
   ========================================== */

.stagger-delay-1 { animation-delay: 0.1s; }
.stagger-delay-2 { animation-delay: 0.2s; }
.stagger-delay-3 { animation-delay: 0.3s; }
.stagger-delay-4 { animation-delay: 0.4s; }
.stagger-delay-5 { animation-delay: 0.5s; }
.stagger-delay-6 { animation-delay: 0.6s; }
.stagger-delay-7 { animation-delay: 0.7s; }
.stagger-delay-8 { animation-delay: 0.8s; }
.stagger-delay-9 { animation-delay: 0.9s; }
.stagger-delay-10 { animation-delay: 1.0s; }

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* GPU Acceleration for Smooth Animations */
.gpu-accelerated {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-slide-in-top,
  .animate-slide-in-bottom,
  .animate-zoom-in,
  .animate-rotate-in,
  .animate-flip-in,
  .animate-bounce-in,
  .hover-bounce:hover,
  .hover-scale:hover,
  .hover-rotate:hover,
  .hover-pulse:hover,
  .animate-floating,
  .animate-floating-reverse,
  .animate-gradient-shift,
  .animate-morph,
  .animate-liquid {
    animation: none !important;
    transform: none !important;
  }
  
  .hover-shine:hover {
    animation: none !important;
  }
}

/* ==========================================
   SCROLL-TRIGGERED ANIMATIONS
   ========================================== */

.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================
   INTERACTIVE PARTICLE EFFECTS
   ========================================== */

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 215, 0, 0.6);
  border-radius: 50%;
  animation: particleFloat 15s linear infinite;
}

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