/* ===== Motion & Micro-interactions ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,.35); }
  50% { box-shadow: 0 0 0 12px rgba(108,92,231,0); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.anim-fade-up { animation: fadeUp .7s ease both; }
.anim-fade-in { animation: fadeIn .6s ease both; }
.anim-scale-in { animation: scaleIn .55s ease both; }
.anim-float { animation: floatY 4s ease-in-out infinite; }
.anim-delay-1 { animation-delay: .1s; }
.anim-delay-2 { animation-delay: .2s; }
.anim-delay-3 { animation-delay: .3s; }
.anim-delay-4 { animation-delay: .4s; }
.anim-delay-5 { animation-delay: .5s; }

/* Hero animated gradient */
.hero, .hero-motion {
  background-size: 200% 200% !important;
  animation: gradientShift 12s ease infinite;
}

/* Cards hover lift */
.course-card, .stat-card, .card, .quick-link {
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease !important;
}
.course-card:hover, .stat-card:hover, .quick-link:hover {
  transform: translateY(-6px) scale(1.015) !important;
}
.course-card img, .course-card .ph {
  transition: transform .5s ease !important;
}
.course-card:hover img, .course-card:hover .ph {
  transform: scale(1.06);
}

/* Buttons */
.btn-primary, .btn-p, .btn-gold, .btn-auth, a.btn-p {
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease !important;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover, .btn-p:hover, .btn-gold:hover, .btn-auth:hover, a.btn-p:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
}
.btn-primary:active, .btn-p:active {
  transform: scale(.97);
}

/* Pulse CTA */
.btn-pulse { animation: pulseGlow 2.2s infinite; }

/* Stagger children */
.stagger > * { opacity: 0; animation: fadeUp .55s ease both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .19s; }
.stagger > *:nth-child(4) { animation-delay: .26s; }
.stagger > *:nth-child(5) { animation-delay: .33s; }
.stagger > *:nth-child(6) { animation-delay: .4s; }
.stagger > *:nth-child(7) { animation-delay: .47s; }
.stagger > *:nth-child(8) { animation-delay: .54s; }
.stagger > *:nth-child(9) { animation-delay: .61s; }
.stagger > *:nth-child(10) { animation-delay: .68s; }
.stagger > *:nth-child(11) { animation-delay: .75s; }
.stagger > *:nth-child(12) { animation-delay: .82s; }

/* Nav underline motion */
.nav-l { position: relative; }
.nav-l::after {
  content: '';
  position: absolute;
  right: 0; bottom: -4px;
  width: 0; height: 2px;
  background: linear-gradient(90deg,#6c5ce7,#a29bfe);
  transition: width .25s ease;
}
.nav-l:hover::after, .nav-l.active::after { width: 100%; }

/* Page enter */
.page-enter { animation: fadeUp .45s ease both; }

/* Sidebar links */
.sidebar a, .offcanvas-sidebar a {
  transition: background .2s ease, transform .2s ease, padding .2s ease !important;
}
.sidebar a:hover, .offcanvas-sidebar a:hover {
  transform: translateX(-4px);
}

/* Badge pop */
.badge-on {
  animation: scaleIn .5s ease both, bounceSoft 2.5s ease-in-out 1s infinite;
}

/* Accordion smooth */
.accordion-button { transition: background .25s ease, color .25s ease !important; }
.accordion-collapse { transition: height .35s ease !important; }

/* Loading shimmer optional */
.shimmer {
  background: linear-gradient(90deg, #efeaff 25%, #fff 50%, #efeaff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
