/**
 * SimpleMoney Platform - Animations
 * CSS transitions and Lottie integration
 */

/* =================== KEYFRAME ANIMATIONS =================== */

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInTop {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  }
}

@keyframes coinIncrease {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.3) translateY(-30px);
    opacity: 0;
  }
}

@keyframes xpBarFill {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes levelUpPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes notificationSlide {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =================== ANIMATION CLASSES =================== */

.animate-slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.animate-slide-in-top {
  animation: slideInTop 0.5s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-bounce {
  animation: bounce 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-coin-increase {
  animation: coinIncrease 0.8s ease-out forwards;
}

.animate-level-up {
  animation: levelUpPulse 0.5s ease-out;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* =================== TRANSITION UTILITIES =================== */

.transition {
  transition: all var(--transition);
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.6s ease;
}

/* =================== HOVER EFFECTS =================== */

.hover-lift {
  transition: all var(--transition);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.hover-glow {
  transition: all var(--transition);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.hover-scale {
  transition: all var(--transition);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* =================== LOADING SPINNER =================== */

.spinner-custom {
  width: 40px;
  height: 40px;
  border: 4px solid var(--card-bg);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* =================== MODAL ANIMATIONS =================== */

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translateY(-50px);
  opacity: 0;
}

.modal.show .modal-dialog {
  transform: translateY(0);
  opacity: 1;
}

/* =================== TOAST ANIMATIONS =================== */

.toast {
  animation: notificationSlide 0.4s ease-out;
}

.toast.hide {
  animation: notificationSlide 0.4s ease-in reverse;
}

/* =================== BADGE ANIMATIONS =================== */

.badge {
  animation: slideInTop 0.3s ease-out;
}

/* =================== CARD ANIMATIONS =================== */

.card {
  animation: slideInLeft 0.5s ease-out;
}

.card:nth-child(2) {
  animation-delay: 0.1s;
}

.card:nth-child(3) {
  animation-delay: 0.2s;
}

.card:nth-child(4) {
  animation-delay: 0.3s;
}

.card:nth-child(5) {
  animation-delay: 0.4s;
}

/* =================== LOTTIE INTEGRATION =================== */

.lottie-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lottie-animation {
  animation: fadeIn 0.5s ease-out;
}

/* =================== REDUCE MOTION =================== */

@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;
  }
}