/* ═══════════════════════════════════════════════════════════════
   LOTUS ACADEMY — Animations
   Smooth · Fast · 180–220ms · Premium micro-interactions
   ═══════════════════════════════════════════════════════════════ */

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes fadeIn {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
  0%   { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpFade {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  0%   { opacity: 0; transform: translateY(36px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pageIn {
  0%   { opacity: 0; transform: translateY(18px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeScale {
  0%   { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes scaleBounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes countUp {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes progressFill {
  0%   { width: 0; opacity: 0.6; }
  100% { opacity: 1; }
}

/* ── Lotus Glow Pulse ────────────────────────────────────────── */
@keyframes lotusPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.35), 0 0 20px rgba(109, 40, 217, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 50px rgba(109, 40, 217, 0.35);
  }
}

@keyframes lotusGlow {
  0%, 100% {
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
  }
  50% {
    text-shadow: 0 0 28px rgba(167, 139, 250, 0.8), 0 0 50px rgba(109, 40, 217, 0.45);
  }
}

/* ── Toast Animations ────────────────────────────────────────── */
@keyframes toastIn {
  0%   { opacity: 0; transform: translateX(100%) scale(0.92); }
  60%  { opacity: 1; transform: translateX(-4%) scale(1.01); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(110%) scale(0.92); }
}

/* ── Modal Animations ────────────────────────────────────────── */
@keyframes modalOverlayIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes modalContentIn {
  0%   { opacity: 0; transform: scale(0.94) translateY(28px); }
  60%  { opacity: 1; transform: scale(1.01) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalOverlayOut {
  from { opacity: 1; backdrop-filter: blur(8px); }
  to   { opacity: 0; backdrop-filter: blur(0px); }
}

@keyframes modalContentOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.94) translateY(18px); }
}

/* ── Pulse (notification badge) ─────────────────────────────── */
@keyframes pulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70%  { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ── Shake ───────────────────────────────────────────────────── */
@keyframes shake {
  10%, 90%       { transform: translate3d(-1px, 0, 0); }
  20%, 80%       { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70%  { transform: translate3d(-4px, 0, 0); }
  40%, 60%       { transform: translate3d(4px, 0, 0); }
}

/* ══════════════════════════════════════════════════════════════
   COMPONENT ANIMATION RULES
   ══════════════════════════════════════════════════════════════ */

/* Page entrance */
.page-enter {
  animation: pageIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Utility classes */
.animate-fade  { animation: fadeIn 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slide { animation: slideInRight 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-down  { animation: slideDown 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.slide-up      { animation: slideUp 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.fade-scale    { animation: fadeScale 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.float-animation { animation: floatUp 4s ease-in-out infinite; }
.count-up      { animation: countUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse         { animation: pulse 2s infinite cubic-bezier(0.66, 0, 0, 1); }
.glow-pulse    { animation: lotusPulse 3s ease-in-out infinite; }

/* Stagger children */
.stagger > * {
  animation: fadeIn 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(10px);
}
.stagger > *:nth-child(1)  { animation-delay: 0.04s; }
.stagger > *:nth-child(2)  { animation-delay: 0.08s; }
.stagger > *:nth-child(3)  { animation-delay: 0.12s; }
.stagger > *:nth-child(4)  { animation-delay: 0.16s; }
.stagger > *:nth-child(5)  { animation-delay: 0.20s; }
.stagger > *:nth-child(6)  { animation-delay: 0.24s; }
.stagger > *:nth-child(7)  { animation-delay: 0.28s; }
.stagger > *:nth-child(8)  { animation-delay: 0.32s; }

/* ── Stat Card Entrance ──────────────────────────────────────── */
.stat-card {
  animation: slideUp 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }
.stat-card:nth-child(5) { animation-delay: 0.20s; }
.stat-card:nth-child(6) { animation-delay: 0.24s; }

/* ── Card Hover ──────────────────────────────────────────────── */
.card {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(167, 139, 250, 0.25);
}

/* ── Button Interactions ─────────────────────────────────────── */
.btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
}

/* ── Nav Item Hover ──────────────────────────────────────────── */
.nav-item {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-item.active {
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.25),
    0 4px 20px rgba(109, 40, 217, 0.25);
}

/* ── Sidebar Logo Hover ──────────────────────────────────────── */
.sidebar-header .logo {
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* ── Progress Bar Fill ───────────────────────────────────────── */
.progress-bar .fill {
  animation: progressFill 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Table Row Stagger ───────────────────────────────────────── */
.data-table tbody tr {
  animation: fadeIn 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(4px);
}
.data-table tbody tr:nth-child(1)  { animation-delay: 0.025s; }
.data-table tbody tr:nth-child(2)  { animation-delay: 0.050s; }
.data-table tbody tr:nth-child(3)  { animation-delay: 0.075s; }
.data-table tbody tr:nth-child(4)  { animation-delay: 0.100s; }
.data-table tbody tr:nth-child(5)  { animation-delay: 0.125s; }
.data-table tbody tr:nth-child(6)  { animation-delay: 0.150s; }
.data-table tbody tr:nth-child(7)  { animation-delay: 0.175s; }
.data-table tbody tr:nth-child(8)  { animation-delay: 0.200s; }
.data-table tbody tr:nth-child(9)  { animation-delay: 0.225s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.250s; }

/* ── Tab Hover ───────────────────────────────────────────────── */
.tab-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-btn:hover {
  transform: translateY(-1px);
}
.tab-btn.active {
  font-weight: 700;
}

/* ── Notification Badge Pulse ────────────────────────────────── */
.topbar .notifications-btn .badge {
  animation: pulse 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* ── Skeleton Shimmer ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    110deg,
    var(--bg-card) 25%,
    rgba(139, 92, 246, 0.08) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ── Role Card Hover (Login) ─────────────────────────────────── */
.role-card {
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.role-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(167, 139, 250, 0.35);
}
.role-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3), 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: scale(1.02);
}
