/* =============================================
   ERTC Quiz - Animations
   ============================================= */

/* Fade In Up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Slide In Left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Slide In Right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Pulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* Bounce In */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

/* Scale In */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Animated Helpers ---- */
.animate-fade-up {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease both;
}

.animate-slide-left {
  animation: slideInLeft 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-slide-right {
  animation: slideInRight 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce-in {
  animation: bounceIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* ---- Scroll-triggered animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ---- Floating cards animation ---- */
.hero-floating-card.card-1 { animation: float 4s ease-in-out infinite; }
.hero-floating-card.card-2 { animation: float 3.5s ease-in-out infinite 0.5s; }

/* ---- Quiz transition ---- */
.quiz-question-wrap {
  animation: fadeInUp 0.4s ease;
}

.quiz-question-out {
  animation: slideInLeft 0.3s ease reverse;
}

/* ---- Decorative SVG animation ---- */
.svg-deco {
  animation: rotate 20s linear infinite;
}

.svg-deco-slow {
  animation: rotate 40s linear infinite reverse;
}

/* ---- Gradient shimmer text ---- */
.shimmer-text {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ---- Page load animation ---- */
.page-load-animate > * {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-load-animate > *:nth-child(1) { animation-delay: 0.1s; }
.page-load-animate > *:nth-child(2) { animation-delay: 0.2s; }
.page-load-animate > *:nth-child(3) { animation-delay: 0.3s; }
.page-load-animate > *:nth-child(4) { animation-delay: 0.4s; }
.page-load-animate > *:nth-child(5) { animation-delay: 0.5s; }

/* ---- Hover lift ---- */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(91,79,233,0.15); }

/* ---- Loading spinner ---- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
  margin: 0 auto;
}

/* ---- SVG Decorations ---- */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  pointer-events: none;
}

.deco-dot-grid {
  position: absolute;
  opacity: 0.05;
  pointer-events: none;
}
