/**
 * Chuyển động toàn app (2026-11-02), lấy ý từ Animate UI (animate-ui.com) nhưng viết lại bằng CSS thuần:
 * Animate UI cần React + Tailwind + Motion, app này không dùng React nên không cài thư viện.
 * Chỉ đổi transform / opacity (không làm trình duyệt tính lại bố cục). Máy bật "giảm chuyển động": tắt hết.
 * Gạch dưới tab trượt: js/motion.js. Ảnh lớn trượt khi bấm ‹ ›: js/case_viewer.js (.tl-zin-l / .tl-zin-r).
 */
@media (prefers-reduced-motion: no-preference) {
  /* 1. gạch dưới tab trượt sang tab vừa chọn */
  .mo-inked { position: relative; }
  .mo-inked > button.active { border-bottom-color: transparent !important; }
  .mo-ink { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; border-radius: 2px; background: #0d9488; pointer-events: none;
    transition: transform .32s cubic-bezier(.22,1,.36,1), width .32s cubic-bezier(.22,1,.36,1); }

  /* 2. hộp thoại bật ra nhẹ (.p1-modal đã có p1in ở page1.css) */
  .td-modal { animation: moPop .2s cubic-bezier(.22,1,.36,1); }
  .td-modal-bg.tdc-pop-bg .td-modal { animation: none; }
  .tca-view { animation: moFade .18s ease; }

  /* 3. nút lún nhẹ khi bấm */
  .p1-btn, .p1-btn2, .td-btn, .p1-x, .tca-x { transition: transform .12s ease, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
  .p1-btn:active:not(:disabled), .p1-btn2:active:not(:disabled), .td-btn:active:not(:disabled), .p1-x:active, .tca-x:active { transform: scale(.95); }

  /* 4. danh sách hiện lần lượt từng ô (chỉ 12 ô đầu, phần sau hiện cùng lúc) */
  .tl-grid > *, .zl-bots > *, .tl-cards > *, .mo-stagger > * { animation: moUp .34s cubic-bezier(.22,1,.36,1) backwards; }
  .tl-grid > :nth-child(2), .zl-bots > :nth-child(2), .tl-cards > :nth-child(2), .mo-stagger > :nth-child(2) { animation-delay: .03s; }
  .tl-grid > :nth-child(3), .zl-bots > :nth-child(3), .tl-cards > :nth-child(3), .mo-stagger > :nth-child(3) { animation-delay: .06s; }
  .tl-grid > :nth-child(4), .zl-bots > :nth-child(4), .tl-cards > :nth-child(4), .mo-stagger > :nth-child(4) { animation-delay: .09s; }
  .tl-grid > :nth-child(5), .tl-cards > :nth-child(5), .mo-stagger > :nth-child(5) { animation-delay: .12s; }
  .tl-grid > :nth-child(6), .tl-cards > :nth-child(6), .mo-stagger > :nth-child(6) { animation-delay: .15s; }
  .tl-grid > :nth-child(7), .tl-cards > :nth-child(7), .mo-stagger > :nth-child(7) { animation-delay: .18s; }
  .tl-grid > :nth-child(8), .tl-cards > :nth-child(8), .mo-stagger > :nth-child(8) { animation-delay: .21s; }
  .tl-grid > :nth-child(9), .mo-stagger > :nth-child(9) { animation-delay: .24s; }
  .tl-grid > :nth-child(10), .mo-stagger > :nth-child(10) { animation-delay: .27s; }
  .tl-grid > :nth-child(11), .mo-stagger > :nth-child(11) { animation-delay: .3s; }
  .tl-grid > :nth-child(n+12), .mo-stagger > :nth-child(n+12) { animation-delay: .33s; }

  /* 5. chữ "Đang tải…" có vệt sáng chạy qua */
  .tl-wait, .tl-recstat:not(.bad) {
    background: linear-gradient(90deg, #0f766e 0%, #0f766e 40%, #7dd3c8 50%, #0f766e 60%, #0f766e 100%) 0 0 / 250% 100%;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: moShine 1.6s linear infinite;
  }

  /* 6. ảnh lớn trượt vào khi bấm ‹ › (js/case_viewer.js) */
  .tl-zin-r { animation: moInR .26s cubic-bezier(.22,1,.36,1); }
  .tl-zin-l { animation: moInL .26s cubic-bezier(.22,1,.36,1); }
}
@keyframes moPop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes moFade { from { opacity: 0; } }
@keyframes moUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes moShine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes moInR { from { opacity: .2; transform: translateX(60px); } }
@keyframes moInL { from { opacity: .2; transform: translateX(-60px); } }
