/* ── Page transitions ───────────────────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.page-enter  { animation: pageIn  0.22s ease forwards; }
.page-leave  { animation: pageOut 0.18s ease forwards; }

/* ── Entrance stagger for lists ─────────────────────────────────── */
@keyframes itemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger-item {
  opacity: 0;
  animation: itemIn 0.2s ease forwards;
}
.stagger-item:nth-child(1)  { animation-delay: 0.02s; }
.stagger-item:nth-child(2)  { animation-delay: 0.05s; }
.stagger-item:nth-child(3)  { animation-delay: 0.08s; }
.stagger-item:nth-child(4)  { animation-delay: 0.11s; }
.stagger-item:nth-child(5)  { animation-delay: 0.14s; }
.stagger-item:nth-child(6)  { animation-delay: 0.17s; }
.stagger-item:nth-child(7)  { animation-delay: 0.20s; }
.stagger-item:nth-child(8)  { animation-delay: 0.23s; }
.stagger-item:nth-child(9)  { animation-delay: 0.26s; }
.stagger-item:nth-child(10) { animation-delay: 0.29s; }

/* ── Spinner ────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-lg {
  width: 28px; height: 28px;
  border-width: 3px;
}

/* ── Pulse ring (running jobs) ──────────────────────────────────── */
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 1; }
  70%  { transform: scale(1.6);  opacity: 0; }
  100% { transform: scale(1.6);  opacity: 0; }
}
.pulse-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: var(--color-blue);
  border-radius: 50%;
  animation: pulseRing 1.4s ease-out infinite;
}

/* ── Progress bar fill ──────────────────────────────────────────── */
@keyframes progressFill {
  from { width: 0%; }
}
.progress-fill { animation: progressFill 0.6s ease; }

/* ── Toast slide ────────────────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
.toast         { animation: toastIn  0.25s cubic-bezier(0.16,1,0.3,1) forwards; }
.toast.leaving { animation: toastOut 0.2s ease forwards; }

/* ── Modal scale ────────────────────────────────────────────────── */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-box     { animation: modalIn   0.2s cubic-bezier(0.16,1,0.3,1) forwards; }
.modal-overlay { animation: overlayIn 0.2s ease forwards; }

/* ── Upload drag pulse ──────────────────────────────────────────── */
@keyframes dropPulse {
  0%, 100% { border-color: var(--color-blue); box-shadow: 0 0 0 0   rgba(59,130,246,0.3); }
  50%       { border-color: var(--color-blue); box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}
.drop-zone.drag-over { animation: dropPulse 1s ease infinite; }

/* ── Skeleton shimmer ───────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 400px 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 4px;
}

/* ── Upload progress bar ────────────────────────────────────────── */
@keyframes uploadProgress {
  0%   { width: 5%;   }
  30%  { width: 40%;  }
  60%  { width: 70%;  }
  80%  { width: 85%;  }
  100% { width: 100%; }
}
.upload-progress-bar { animation: uploadProgress 3s cubic-bezier(0.4,0,0.2,1) forwards; }

/* ── Badge fade in ──────────────────────────────────────────────── */
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.badge-new { animation: badgeIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards; }
