/* ============================================================
   Atlas — animations.css
   Keyframes, entry animations, loading effects
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  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 scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scaleOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.94); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Animation classes ───────────────────────────────────────── */
.animate-fade-in  { animation: fadeIn  0.4s var(--ease-out) both; }
.animate-slide-up { animation: slideUp 0.5s var(--ease-out) both; }
.animate-scale-in { animation: scaleIn 0.3s var(--ease-out) both; }
.animate-spin     { animation: spin    0.8s linear infinite; }
.animate-pulse    { animation: pulse   2s ease-in-out infinite; }
.animate-float    { animation: float   3s ease-in-out infinite; }

/* ── Stagger delays for list animations ──────────────────────── */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* ── Page transition wrapper ─────────────────────────────────── */
.page-enter {
  animation: slideUp 0.4s var(--ease-out) both;
}

/* ── Notification ping (live indicator) ─────────────────────── */
.ping-container {
  position: relative;
  display: inline-flex;
}

.ping-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.ping-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ── Hero background gradient animation ──────────────────────── */
.hero-gradient-animated {
  background: linear-gradient(-45deg,
    rgba(99,102,241,0.15),
    rgba(139,92,246,0.10),
    rgba(59,130,246,0.10),
    rgba(99,102,241,0.15)
  );
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

/* ── Progress bar fill animation ────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width 0.6s var(--ease-out);
}

/* ── Reduced motion override ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
