/* ==========================================================================
   ISAAC Summit — Animations
   Scroll-triggered, micro-interactions, and page transitions
   ========================================================================== */

/* ---------- Scroll-triggered Animations ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate].animated {
  opacity: 1;
  transform: translateY(0);
}
[data-animate="fade-left"] {
  transform: translateX(-30px);
}
[data-animate="fade-left"].animated {
  transform: translateX(0);
}
[data-animate="fade-right"] {
  transform: translateX(30px);
}
[data-animate="fade-right"].animated {
  transform: translateX(0);
}
[data-animate="scale-in"] {
  transform: scale(0.9);
}
[data-animate="scale-in"].animated {
  transform: scale(1);
}
[data-animate="fade-up"].animated {
  transform: translateY(0);
}

/* Stagger delays for children */
[data-animate-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate-stagger].animated > *:nth-child(1) { transition-delay: 0.05s; }
[data-animate-stagger].animated > *:nth-child(2) { transition-delay: 0.1s; }
[data-animate-stagger].animated > *:nth-child(3) { transition-delay: 0.15s; }
[data-animate-stagger].animated > *:nth-child(4) { transition-delay: 0.2s; }
[data-animate-stagger].animated > *:nth-child(5) { transition-delay: 0.25s; }
[data-animate-stagger].animated > *:nth-child(6) { transition-delay: 0.3s; }
[data-animate-stagger].animated > *:nth-child(7) { transition-delay: 0.35s; }
[data-animate-stagger].animated > *:nth-child(8) { transition-delay: 0.4s; }
[data-animate-stagger].animated > *:nth-child(9) { transition-delay: 0.45s; }
[data-animate-stagger].animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 0.5;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes checkmark {
  0%   { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ---------- Utility Animation Classes ---------- */
.animate-fade-in     { animation: fadeIn 0.5s ease forwards; }
.animate-fade-up     { animation: fadeInUp 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.animate-fade-down   { animation: fadeInDown 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.animate-fade-left   { animation: fadeInLeft 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.animate-fade-right  { animation: fadeInRight 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.animate-scale-in    { animation: scaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.animate-pulse       { animation: pulse 2s infinite; }
.animate-float       { animation: float 3s ease-in-out infinite; }
.animate-bounce-in   { animation: bounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.animate-spin        { animation: spin 1s linear infinite; }

/* ---------- Loading Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--light-gray) 25%, var(--mid-gray) 50%, var(--light-gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}

/* ---------- Countdown Timer Animations ---------- */
.countdown-flip {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.countdown-flip.ticking {
  transform: scale(1.15);
}

/* ---------- Button Ripple Effect ---------- */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  animation: ripple 0.6s linear forwards;
  pointer-events: none;
}

/* ---------- Progress Bar Animation ---------- */
.progress-bar-animated {
  animation: none;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Page Transition ---------- */
.page-enter {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Counter Animation ---------- */
.counter-animate {
  animation: countUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Hover Lift ---------- */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(11,61,145,0.12);
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-animate-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .skeleton { animation: none; }
}
