/* ═══════════════════════════════════════════════════════════════
   KIIT Material — ANIMATION LAYER  (loaded last on every page)

   Pure CSS, so it can never get "stuck": every entrance uses
   `backwards` fill (not `forwards`/`both`), meaning the element
   returns to its normal, visible state once the animation ends —
   it never clobbers :hover transforms and never leaves content
   hidden if the file is slow to load. Fully off for users who
   prefer reduced motion.
   ═══════════════════════════════════════════════════════════════ */

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

  @keyframes kcFadeUp  { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes kcFadeIn  { from { opacity: 0; }                              to { opacity: 1; } }
  @keyframes kcZoomIn  { from { opacity: 0; transform: scale(.92); }       to { opacity: 1; transform: scale(1); } }
  @keyframes kcPulse   { 0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(244,63,94,0); } }
  @keyframes kcShimmer { to { background-position: 200% center; } }

  /* ── Entrance: content cards & panels fade up on first paint ──────────────
     `backwards` keeps them hidden only DURING their stagger delay; afterwards
     they use their normal styles, so hover lifts and the featured-plan scale
     keep working. */
  [class*="-card"]:not(.plan-card), .feed-post, .widget, .faq-item,
  .section-header, .company-card, .sgpa-result, .pdf-wrap {
    animation: kcFadeUp .55s cubic-bezier(.22,1,.36,1) backwards;
  }
  /* opacity-only for cards that carry a static transform (featured plan) */
  .plan-card { animation: kcFadeIn .55s ease backwards; }

  /* light stagger for the first items in a row/list */
  [class*="-card"]:nth-child(2), .feed-post:nth-child(2) { animation-delay: .06s; }
  [class*="-card"]:nth-child(3), .feed-post:nth-child(3) { animation-delay: .12s; }
  [class*="-card"]:nth-child(4), .feed-post:nth-child(4) { animation-delay: .18s; }
  [class*="-card"]:nth-child(5)                          { animation-delay: .24s; }
  [class*="-card"]:nth-child(6)                          { animation-delay: .30s; }

  /* ── Button shine sweep on hover ────────────────────────────────────────── */
  .btn-primary, .btn-white, .plan-btn-premium, .plan-btn-pro, .sgpa-result {
    position: relative; overflow: hidden;
  }
  .btn-primary::after, .btn-white::after, .plan-btn-premium::after, .plan-btn-pro::after {
    content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.4), transparent);
    transform: skewX(-22deg); transition: left .65s ease; pointer-events: none;
  }
  .btn-primary:hover::after, .btn-white:hover::after,
  .plan-btn-premium:hover::after, .plan-btn-pro:hover::after { left: 140%; }

  /* ── Notification bell dot: gentle pulse ────────────────────────────────── */
  .top-bar-notif-dot { animation: kcPulse 2.2s ease-out infinite; }

  /* ── Hover nudges on nav / filter items ─────────────────────────────────── */
  .sidebar-nav-item { transition: transform .2s ease, background .2s ease, color .2s ease; }
  .sidebar-nav-item:hover { transform: translateX(4px); }
  .filter-opt { transition: transform .15s ease, background .2s ease, color .2s ease; }
  .filter-opt:hover { transform: translateX(3px); }

  /* ── Logo icon reacts to hover ──────────────────────────────────────────── */
  .logo-icon, .sidebar-logo-icon { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
  .logo:hover .logo-icon, .sidebar-logo:hover .sidebar-logo-icon { transform: rotate(-8deg) scale(1.08); }

  /* ── Gradient text gets a slow shimmer ──────────────────────────────────── */
  .text-gradient { background-size: 200% auto; animation: kcShimmer 5s linear infinite; }

  /* ── Icon buttons / social links pop on hover ───────────────────────────── */
  .social-link, .top-bar-icon-btn { transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
  .social-link:hover { transform: translateY(-3px) scale(1.05); }
  .top-bar-icon-btn:hover { transform: translateY(-2px); }

  /* ── Stat numbers pop in ────────────────────────────────────────────────── */
  .stat-card-value, .stat-number, .sgpa-value { animation: kcZoomIn .5s ease backwards; }

  /* ── Toast icon pop ─────────────────────────────────────────────────────── */
  .toast-icon { animation: kcZoomIn .3s ease backwards; }
}
