/* ============================================================================
   نبغة — طبقة حركة لوحة الطالب (app dashboard motion layer).
   ADDITIVE ONLY: لا يعيد تعريف أي token؛ يستخدم متغيّرات styles.css القائمة.
   كل الحركة transform/opacity (60fps) ومحاطة بـ prefers-reduced-motion.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* ---- staggered, flash-free view entrance (added by nabgha-motion.js) ---- */
  .ds-anim-in { animation: nb-in .42s cubic-bezier(0,0,.2,1) both; }
  @keyframes nb-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* ---- micro-interactions layered onto existing components ---- */
  .card.click { transition: transform .18s cubic-bezier(0,0,.2,1), box-shadow .22s, border-color .22s; }
  .card.click:hover { transform: translateY(-3px); }
  .card.click:active { transform: scale(.985); }
  .btn { transition: transform .12s cubic-bezier(0,0,.2,1), filter .2s, box-shadow .2s; }
  .btn:active { transform: translateY(0) scale(.97); }
  .nav-link { transition: background .2s, color .2s, transform .12s; }
  .nav-link:active { transform: scale(.99); }
  .pill { transition: transform .15s ease, box-shadow .2s; }
  .pill:hover { transform: translateY(-1px); }
  .lesson { transition: background .18s, transform .12s; }
  .lesson:hover { transform: translateX(-2px); }

  /* animated active-nav indicator */
  .nav-link.active::after {
    content: ""; position: absolute; inset-inline-start: 6px; top: 50%;
    width: 4px; height: 0; border-radius: 999px; background: var(--grad, linear-gradient(120deg,#2b4cc8,#7a2fb0));
    transform: translateY(-50%); animation: nb-navdot .35s cubic-bezier(.34,1.56,.64,1) forwards;
  }
  @keyframes nb-navdot { to { height: 56%; } }

  /* topbar stat pills — gentle pop when values refresh */
  .pill.points, .pill.streak { animation: nb-pop .4s cubic-bezier(.34,1.56,.64,1); }
  @keyframes nb-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
}

/* ---- skeleton shimmer loader (used by loading()) ---- */
.sk { position: relative; overflow: hidden; background: var(--mist, #e9edf6); border-radius: 12px; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: nb-shimmer 1.4s infinite;
}
:root[data-theme="dark"] .sk, html.dark .sk { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .sk::after, html.dark .sk::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09), transparent);
}
@keyframes nb-shimmer { 100% { transform: translateX(100%); } }

.sk-load { padding: 4px 0; }
.sk-load .sk + .sk { margin-top: 14px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.sk-card { border-radius: 16px; }

@media (prefers-reduced-motion: reduce) {
  .ds-anim-in { animation: none; }
  .sk::after { animation: none; }
  .nav-link.active::after { animation: none; height: 56%; }
  .pill.points, .pill.streak { animation: none; }
}
