/**
 * assets/css/animations.css
 * Micro-animaciones y transiciones de la UI.
 * Respeta prefers-reduced-motion.
 */

/* ── Fade In ──────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Clases de animación ──────────────────────────────────────────────────── */
.animate-fade-in       { animation: fadeIn       200ms ease forwards; }
.animate-fade-in-left  { animation: fadeInLeft   200ms ease forwards; }
.animate-fade-in-scale { animation: fadeInScale  200ms ease forwards; }

/* ── Stagger (children) ───────────────────────────────────────────────────── */
.stagger-children > *:nth-child(1)  { animation-delay: 0ms;   }
.stagger-children > *:nth-child(2)  { animation-delay: 50ms;  }
.stagger-children > *:nth-child(3)  { animation-delay: 100ms; }
.stagger-children > *:nth-child(4)  { animation-delay: 150ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 200ms; }

/* ── Pulse (notificaciones) ───────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-pulse { animation: pulse 2s ease-in-out infinite; }

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

.animate-spin {
  animation: spin 0.7s linear infinite;
}

/* ── Hover lift en cards ──────────────────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.hover-lift:hover {
  transform:  translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ── Accent glow ──────────────────────────────────────────────────────────── */
.accent-glow-hover {
  transition: box-shadow var(--transition-fast);
}
.accent-glow-hover:hover {
  box-shadow: var(--shadow-accent);
}

/* ── KPI counter animado ──────────────────────────────────────────────────── */
.kpi-value-animated {
  transition: all var(--transition-slow);
}

/* ── Sidebar item hover ───────────────────────────────────────────────────── */
.nav-item-icon {
  transition: transform var(--transition-fast);
}
.nav-item:hover .nav-item-icon {
  transform: scale(1.1);
}

/* ── Respetar prefers-reduced-motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
    scroll-behavior:      auto   !important;
  }
}
