/* Animations — Design System 2.0 keyframes library */

/* Fade up: content entrance */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in: simple opacity */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale in: modal/card entrance */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide up: bottom sheet / drawer */
@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Slide down: bottom sheet exit */
@keyframes slide-down-out {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Slide down: dropdown / menu */
@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content entrance (page transition) */
@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flash banner entrance */
@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flash countdown bar */
@keyframes flash-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Shake: form error feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

/* Pulse ring: notification / active state */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(200, 150, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(200, 150, 74, 0);
  }
}

/* Pulse dot: badge active indicator */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Skeleton shimmer: loading placeholder */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Spin: loading spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Count up helper — JS drives the value, CSS handles the visual transition */
.count-up {
  transition: all 0.6s var(--ease-out);
}

/* Staggered children: sequential entrance animation */
.stagger-children > * {
  animation: fade-up 0.4s var(--ease-out) both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }
.stagger-children > *:nth-child(7) { animation-delay: 360ms; }
.stagger-children > *:nth-child(8) { animation-delay: 420ms; }

/* Skeleton loading placeholder */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton--text {
  height: 1em;
  width: 60%;
  margin-bottom: var(--space-sm);
}

.skeleton--heading {
  height: 1.5em;
  width: 40%;
  margin-bottom: var(--space-md);
}

.skeleton--card {
  height: 120px;
  width: 100%;
}

.skeleton--circle {
  border-radius: 50%;
}

/* Utility: apply shake on error */
.animate-shake {
  animation: shake 0.5s var(--ease-spring);
}

/* Utility: apply pulse ring */
.animate-pulse-ring {
  animation: pulse-ring 2s ease infinite;
}

/* Utility: apply fade up */
.animate-fade-up {
  animation: fade-up 0.4s var(--ease-out) both;
}

/* Utility: apply scale in */
.animate-scale-in {
  animation: scale-in 0.3s var(--ease-spring) both;
}
