/* ==========================================================================
   Animations (13/11/2026) — pour tout le monde depuis le 13/11/2026 (essai valide sur le compte Benjamin).
   Regle : uniquement opacite / deplacement / taille (dessines par la carte graphique), moins de 0,25 s.
   ========================================================================== */

/* pendant le passage clair / sombre : aucune transition element par element (c'est la page entiere qui fond) */
html.anim-sans * { transition: none !important; }

/* ---------- 1. Au passage de la souris ---------- */
body.tv2 table tbody tr, body.tv2 table tbody tr > td { transition: background-color .14s ease; }

.ml-item { overflow: clip; transition: background-color .12s ease; }
.ml-item > * { transition: translate .16s cubic-bezier(.2, .8, .2, 1); }
.ml-item:hover > * { translate: 3px 0; }

.acc-stat { transition: translate .16s cubic-bezier(.2, .8, .2, 1), background-color .15s ease; }
.acc-stat:hover { translate: 0 -2px; }
.acc-tache > * { transition: translate .16s cubic-bezier(.2, .8, .2, 1); }
.acc-tache:hover > * { translate: 3px 0; }
body.tv2 .stat-card:hover { box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .35); }

/* ---------- 2. Ce qui s'ouvre : leger zoom ---------- */
@keyframes animMenu { from { opacity: 0; scale: .96; } to { opacity: 1; scale: 1; } }
body.tv2 .dropdown-menu.show { animation: animMenu .14s ease-out; }
body.tv2 #notif-panel { animation: animMenu .16s ease-out; transform-origin: top right; }
body.tv2 .modal.fade .modal-dialog { transform: scale(.96); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
body.tv2 .modal.show .modal-dialog { transform: none; }

/* ---------- 3. Listes : arrivee en cascade, seulement a l'ouverture de la page ---------- */
@keyframes animEntree { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(-n+14) { animation: animEntree .22s ease-out both; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(2) { animation-delay: 18ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(3) { animation-delay: 36ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(4) { animation-delay: 54ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(5) { animation-delay: 72ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(6) { animation-delay: 90ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(7) { animation-delay: 108ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(8) { animation-delay: 126ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(9) { animation-delay: 144ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(10) { animation-delay: 162ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(11) { animation-delay: 180ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(12) { animation-delay: 198ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(13) { animation-delay: 216ms; }
html.anim-entree :is(.ml-item, .tache-item, .acc-tache):nth-child(14) { animation-delay: 234ms; }

/* notifications : elles glissent depuis la droite a l'ouverture de la cloche */
@keyframes animGlisse { from { opacity: 0; translate: 14px 0; } to { opacity: 1; translate: 0 0; } }
#notif-list .notif-item:nth-child(-n+8) { animation: animGlisse .2s ease-out both; }
#notif-list .notif-item:nth-child(2) { animation-delay: 25ms; }
#notif-list .notif-item:nth-child(3) { animation-delay: 50ms; }
#notif-list .notif-item:nth-child(4) { animation-delay: 75ms; }
#notif-list .notif-item:nth-child(5) { animation-delay: 100ms; }
#notif-list .notif-item:nth-child(6) { animation-delay: 125ms; }
#notif-list .notif-item:nth-child(7) { animation-delay: 150ms; }
#notif-list .notif-item:nth-child(8) { animation-delay: 175ms; }

/* ---------- 4. Petits details ---------- */
@keyframes animRebond { 0% { scale: 1; } 40% { scale: 1.35; } 100% { scale: 1; } }
.anim-rebond { animation: animRebond .32s cubic-bezier(.3, 1.6, .5, 1); }

/* la barre bleue de l'onglet actif glisse depuis l'onglet precedent */
@keyframes animBarre { from { translate: 0 var(--anim-de, 0px); } to { translate: 0 0; } }
body.tv2 .app-btn.active.anim-glisse::after { animation: animBarre .28s cubic-bezier(.2, .8, .2, 1); }

@media (prefers-reduced-motion: reduce) {
  .ml-item > *, .acc-stat, .acc-tache > * { transition: none; translate: none !important; }
  body.tv2 .dropdown-menu.show, body.tv2 #notif-panel, #notif-list .notif-item, .anim-rebond,
  html.anim-entree :is(.ml-item, .tache-item, .acc-tache), body.tv2 .app-btn.active.anim-glisse::after { animation: none !important; }
  body.tv2 .modal.fade .modal-dialog { transform: none; transition: none; }
}
