/* ============================================================
   ContentFlow: animations.css
   ============================================================ */

/* ============================================================
   Page transitions
   ============================================================ */

.page-section {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   Drawer slide-in
   ============================================================ */

.drawer {
  animation: slide-in-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.modal-box {
  animation: scale-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-overlay {
  animation: fade-overlay 0.2s ease;
}

@keyframes fade-overlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   Toast pop-up
   ============================================================ */

.toast {
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.dismissing {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

/* ============================================================
   Agent thinking pulse
   ============================================================ */

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

@keyframes thinking-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

/* Shimmer loading effect */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ============================================================
   Status transitions
   ============================================================ */

.badge,
.agent-status-badge {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   Card hover lift
   ============================================================ */

.pauta-card,
.article-row,
.run-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

/* ============================================================
   Score circle fill animation
   ============================================================ */

.seo-score-circle .fill {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.5s ease;
}

/* ============================================================
   Loading states
   ============================================================ */

.btn.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  left: 50%;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   Kanban card drag states (future)
   ============================================================ */

.pauta-card.dragging {
  opacity: 0.7;
  transform: rotate(2deg) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Number counter animation
   ============================================================ */

@keyframes count-up {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.metric-value {
  animation: count-up 0.5s ease;
}

/* ============================================================
   Glow pulse for running elements
   ============================================================ */

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 8px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(79, 156, 249, 0.1);
  }
}

.agent-card.running {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ============================================================
   Sidebar nav item active indicator
   ============================================================ */

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item {
  position: relative;
}
