/* ═══════════════════════════════════════════════════════════════
   Jus d'orange SaaS — Animations & Micro-interactions
   ═══════════════════════════════════════════════════════════════ */

/* ─── Keyframes ──────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes orangePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,109,26,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255,109,26,0); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes progressIndeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ─── Card / stat entrance & emphasis ────────────────────────── */
.stat-card.animate { animation: orangePulse 2s ease infinite; }
.stat-value { animation: countUp 0.4s var(--ease-spring); }

/* ─── Scheduler active indicator ─────────────────────────────── */
.scheduler-active-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
.scheduler-active-dot.paused  { background: var(--yellow); animation: none; }
.scheduler-active-dot.stopped { background: var(--red);    animation: none; }

/* ─── SSE / progress bar ─────────────────────────────────────── */
.sse-progress-bar {
  height: 3px;
  background: var(--bg-surface3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.sse-progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: 2px;
  transition: width var(--transition-base);
}
.sse-progress-bar.indeterminate .sse-progress-fill {
  width: 40%;
  animation: progressIndeterminate 1.5s ease infinite;
}

/* ─── Table row entrance (subtle stagger) ────────────────────── */
.table tbody tr { animation: fadeIn 0.2s ease both; }
.table tbody tr:nth-child(1) { animation-delay: 0ms; }
.table tbody tr:nth-child(2) { animation-delay: 25ms; }
.table tbody tr:nth-child(3) { animation-delay: 50ms; }
.table tbody tr:nth-child(4) { animation-delay: 75ms; }
.table tbody tr:nth-child(5) { animation-delay: 100ms; }

/* ─── Login card ─────────────────────────────────────────────── */
.login-card { animation: fadeInUp 0.4s var(--ease-spring); }

/* ─── Notification badge pulse ───────────────────────────────── */
.nav-badge { animation: pulse 3s ease infinite; }

/* ─── Respect reduced-motion preference ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .stat-card.animate,
  .scheduler-active-dot,
  .nav-badge,
  .sse-progress-bar.indeterminate .sse-progress-fill,
  .table tbody tr,
  .stat-value,
  .login-card { animation: none !important; }
}
