/* ============================================
   C++ АКАДЕМІЯ — ANIMATIONS CSS
   ============================================ */

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.6); }
}

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

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

@keyframes heroFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(1deg); }
  66%       { transform: translateY(5px) rotate(-1deg); }
}

@keyframes xpPop {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  30%  { opacity: 1; transform: translateY(-20px) scale(1.2); }
  70%  { opacity: 1; transform: translateY(-40px) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(0.8); }
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100px); }
}

@keyframes progressFill {
  from { width: 0; }
  to   { width: var(--target-width, 100%); }
}

@keyframes badgeUnlock {
  0%   { transform: scale(0) rotate(-180deg); }
  60%  { transform: scale(1.2) rotate(10deg); }
  80%  { transform: scale(0.95) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes streakPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(30px, -20px) scale(1.1); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-20px, 30px) scale(0.9); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(15px, 15px) scale(1.05); }
}

/* ---- ANIMATION UTILITY CLASSES ---- */
.animate-fadeIn     { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.5s ease forwards; }
.animate-scaleIn    { animation: scaleIn 0.4s ease forwards; }
.animate-float      { animation: float 3s ease-in-out infinite; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-glow       { animation: glow 2s ease-in-out infinite; }

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}
.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-children > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.50s; }
.stagger-children > *:nth-child(n+11){ animation-delay: 0.55s; }

/* ---- HOVER EFFECTS ---- */
.hover-lift {
  transition: var(--transition);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ---- XP POPUP ---- */
.xp-popup {
  position: fixed;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-orange);
  pointer-events: none;
  z-index: 9999;
  text-shadow: 0 2px 10px rgba(245,158,11,0.6);
  display: none;
}
.xp-popup.active {
  display: block;
  animation: xpPop 1.2s ease forwards;
}
