/* =========================================
   Trip Frogger — Animation System
   ========================================= */

/* ----- Keyframes ----- */
@keyframes tf-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tf-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tf-slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tf-slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tf-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ----- Utility Classes ----- */
.tf-animate-fade {
  animation: tf-fadeIn 0.3s ease both;
}

.tf-animate-up {
  animation: tf-fadeInUp 0.4s ease both;
}

.tf-animate-slide-right {
  animation: tf-slideInRight 0.3s ease both;
}

.tf-animate-slide-down {
  animation: tf-slideDown 0.3s ease both;
}

/* Staggered children — apply to parent container */
.tf-stagger-children > * {
  animation: tf-fadeInUp 0.4s ease both;
}
.tf-stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.tf-stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.tf-stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.tf-stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.tf-stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.tf-stagger-children > *:nth-child(6) { animation-delay: 250ms; }
.tf-stagger-children > *:nth-child(7) { animation-delay: 300ms; }
.tf-stagger-children > *:nth-child(8) { animation-delay: 350ms; }

/* ----- Card Hover Lift ----- */
.tf-card-hover {
  transition: transform var(--tf-transition-fast), box-shadow var(--tf-transition-fast);
}

.tf-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--tf-shadow-lg);
}

/* ----- Skeleton loading pulse ----- */
.tf-skeleton {
  background: linear-gradient(90deg, var(--tf-border) 25%, #f1f5f9 50%, var(--tf-border) 75%);
  background-size: 200% 100%;
  animation: tf-pulse 1.5s ease-in-out infinite;
  border-radius: var(--tf-radius-sm);
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .tf-animate-fade,
  .tf-animate-up,
  .tf-animate-slide-right,
  .tf-animate-slide-down,
  .tf-stagger-children > *,
  .tf-card-hover {
    animation: none !important;
    transition: none !important;
  }
}
