/* ============================================================
   QUIZZING SOCIETY — ANIMATIONS
   Premium keyframes, scroll effects, micro-interactions
   ============================================================ */

/* ── Gradient Shift ── */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Glow Pulse ── */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(14,143,224,0.15); }
  50%      { box-shadow: 0 0 40px rgba(14,143,224,0.35), 0 0 80px rgba(14,143,224,0.1); }
}

/* ── Shimmer (loading skeleton) ── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Slide Ins ── */
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-down {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scale Bounce ── */
@keyframes scale-bounce {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

/* ── Spin Slow ── */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Blob morph ── */
@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%      { border-radius: 50% 60% 30% 60% / 30% 50% 70% 60%; }
  75%      { border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%; }
}

/* ── Ticker scroll ── */
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Border glow rotate ── */
@keyframes border-glow-rotate {
  0%   { --angle: 0deg; }
  100% { --angle: 360deg; }
}

/* ── Confetti fall ── */
@keyframes confetti-fall {
  0%   { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Pulse ring ── */
@keyframes pulse-ring-effect {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Typewriter cursor blink ── */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Page loader ── */
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

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

@keyframes loader-fill {
  to { width: 100%; }
}

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

/* ── Number count up ── */
@keyframes count-tick {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Wiggle ── */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-3deg); }
  75%      { transform: rotate(3deg); }
}

/* ── Decorative floating shapes ── */
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floating-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: float-gentle 8s ease-in-out infinite;
}

.floating-shapes .shape:nth-child(1) {
  width: 300px; height: 300px;
  background: var(--brand-bright);
  top: -50px; right: -80px;
  animation-duration: 10s;
}

.floating-shapes .shape:nth-child(2) {
  width: 200px; height: 200px;
  background: var(--brand-cyan);
  bottom: -40px; left: -60px;
  animation-duration: 12s;
  animation-delay: -3s;
}

.floating-shapes .shape:nth-child(3) {
  width: 150px; height: 150px;
  background: var(--brand-sky);
  top: 40%; left: 60%;
  animation-duration: 9s;
  animation-delay: -5s;
}

/* ── Animated gradient background ── */
.animated-gradient-bg {
  background: linear-gradient(-45deg, var(--brand-deep), var(--brand-bright), var(--brand-cyan), var(--brand-sky));
  background-size: 400% 400%;
  animation: gradient-shift 8s ease infinite;
}

/* ── Utility: animate on scroll visible ── */
[data-scroll] {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-scroll="fade-up"] {
  transform: translateY(40px);
}

[data-scroll="fade-down"] {
  transform: translateY(-40px);
}

[data-scroll="fade-left"] {
  transform: translateX(-40px);
}

[data-scroll="fade-right"] {
  transform: translateX(40px);
}

[data-scroll="scale-up"] {
  transform: scale(0.9);
}

[data-scroll].is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* ── Stagger children ── */
.stagger-child {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.stagger-child.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Dynamic Hover Elevate ── */
.hover-elevate {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-elevate:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.15);
  border-color: var(--brand-sky) !important;
  z-index: 10;
}

/* ── Staggered Entrance Animation ── */
.stagger-enter {
  animation: slide-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.stagger-enter:nth-child(1) { animation-delay: 0.05s; }
.stagger-enter:nth-child(2) { animation-delay: 0.10s; }
.stagger-enter:nth-child(3) { animation-delay: 0.15s; }
.stagger-enter:nth-child(4) { animation-delay: 0.20s; }
.stagger-enter:nth-child(5) { animation-delay: 0.25s; }
.stagger-enter:nth-child(n+6) { animation-delay: 0.30s; }
