/* DEXRabbit Animation Library
 * Коллекция анимаций для улучшения UX
 * Version: 1.0.0
 * Performance optimized with GPU acceleration
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

/* Slide animations */
@keyframes slideIn {
  from {
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideOut {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    visibility: hidden;
    transform: translate3d(0, 100%, 0);
  }
}

/* Scale animations */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes zoomOut {
  from {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
  50% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  to {
    opacity: 0;
  }
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
  0% {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 140, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(124, 140, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 140, 255, 0);
  }
}

/* Bounce animation */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40% {
    transform: translate3d(0, -30px, 0);
  }
  60% {
    transform: translate3d(0, -15px, 0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  100% {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

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

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

/* Shake animation for errors */
@keyframes shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}

/* Loading animations */
@keyframes loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes loadingDots {
  0%,
  80%,
  100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}

/* Rabbit hop animation */
@keyframes rabbitHop {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-10px) rotate(-5deg);
  }
  50% {
    transform: translateY(-20px) rotate(0deg);
  }
  75% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* PLEX coin spin */
@keyframes coinSpin {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

/* Gradient animation for premium badges */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* Base animation class */
.animate {
  animation-duration: 0.6s;
  animation-fill-mode: both;
}

.animate.fast {
  animation-duration: 0.3s;
}

.animate.slow {
  animation-duration: 1s;
}

.animate.infinite {
  animation-iteration-count: infinite;
}

/* Fade animations */
.animate-fadeIn {
  animation-name: fadeIn;
}

.animate-fadeInUp {
  animation-name: fadeInUp;
}

.animate-fadeInDown {
  animation-name: fadeInDown;
}

.animate-fadeInLeft {
  animation-name: fadeInLeft;
}

.animate-fadeInRight {
  animation-name: fadeInRight;
}

/* Zoom animations */
.animate-zoomIn {
  animation-name: zoomIn;
}

.animate-zoomOut {
  animation-name: zoomOut;
}

/* Bounce animations */
.animate-bounce {
  animation-name: bounce;
  animation-duration: 1s;
}

.animate-bounceIn {
  animation-name: bounceIn;
  animation-duration: 0.75s;
}

/* Pulse animation */
.animate-pulse {
  animation-name: pulse;
  animation-duration: 1s;
  animation-iteration-count: infinite;
}

.animate-pulseGlow {
  animation-name: pulseGlow;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

/* Rotate animations */
.animate-rotate {
  animation-name: rotate;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.animate-rotateIn {
  animation-name: rotateIn;
}

/* Shake animation */
.animate-shake {
  animation-name: shake;
  animation-duration: 0.82s;
}

/* Loading spinner */
.animate-loading {
  animation: loading 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Rabbit hop */
.animate-rabbitHop {
  animation: rabbitHop 2s ease-in-out infinite;
}

/* Coin spin */
.animate-coinSpin {
  animation: coinSpin 3s linear infinite;
}

/* Gradient shift */
.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Elements hidden until scroll */
.scroll-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

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

/* Parallax effect */
.parallax {
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(124, 140, 255, 0.2);
}

/* Button hover grow */
.hover-grow {
  transition: transform 0.3s ease;
}

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

/* Image hover zoom */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform 0.3s ease;
}

.hover-zoom:hover img {
  transform: scale(1.1);
}

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

/* GPU acceleration for smooth animations */
.animate,
.parallax,
.hover-lift,
.hover-grow,
.hover-zoom img {
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate,
  .parallax,
  .hover-lift,
  .hover-grow,
  .hover-zoom img {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

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

.animation-delay-1 {
  animation-delay: 0.1s;
}

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

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

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

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

/* Disable animations on mobile for performance */
@media (max-width: 768px) {
  .mobile-no-animate {
    animation: none !important;
    transition: none !important;
  }
}
