/* ============================================================
   ANIMATIONS — Hub Alcance Contabilidade
   Micro-interactions and motion design
   ============================================================ */

/* --- Fade & Slide Up (staggered page load) --- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeSlideUp 0.4s var(--ease-out) both;
}

.animate-in:nth-child(1) { animation-delay: 0.04s; }
.animate-in:nth-child(2) { animation-delay: 0.08s; }
.animate-in:nth-child(3) { animation-delay: 0.12s; }
.animate-in:nth-child(4) { animation-delay: 0.16s; }
.animate-in:nth-child(5) { animation-delay: 0.20s; }
.animate-in:nth-child(6) { animation-delay: 0.24s; }
.animate-in:nth-child(7) { animation-delay: 0.28s; }
.animate-in:nth-child(8) { animation-delay: 0.32s; }

/* --- Status Pulse --- */
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Skeleton Loading --- */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-surface-hover) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.hub-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* --- Glow Pulse (for active automation) --- */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 8px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 20px var(--accent-glow);
  }
}

.glow-active {
  animation: glowPulse 2s ease-in-out infinite;
}

/* --- Subtle scale on click --- */
.press-effect:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* --- Page transition --- */
.page-enter {
  animation: fadeSlideUp 0.35s var(--ease-out) both;
}
