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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.9);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

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

/* ─── PAGE TRANSITION ────────────────────────────────────────────────────── */
.page-enter {
  animation: fadeIn 0.28s ease forwards;
}

/* ─── NAV ITEM HOVER ─────────────────────────────────────────────────────── */
.nav-item {
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(184,95,61,0.06);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
  border-radius: inherit;
}

.nav-item:hover::before {
  transform: scaleX(1);
}

/* ─── COUNTER ANIMATION ──────────────────────────────────────────────────── */
.stat-value {
  transition: color 0.4s ease;
  animation: countUp 0.5s ease;
}

/* ─── PANEL HOVER ────────────────────────────────────────────────────────── */
.panel {
  transition: box-shadow var(--transition), transform var(--transition);
}

/* ─── BUTTON RIPPLE ──────────────────────────────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.btn:active::after {
  opacity: 1;
}

/* ─── TIMELINE DOT PULSE ─────────────────────────────────────────────────── */
.timeline-item:first-child .timeline-dot {
  animation: pulse 2s ease-in-out infinite;
}

/* ─── LOADING SHIMMER ────────────────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg,
    rgba(64,50,38,0.05) 25%,
    rgba(64,50,38,0.1) 50%,
    rgba(64,50,38,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

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

/* ─── SLIDE-IN FOR LISTS ─────────────────────────────────────────────────── */
.reply-item, .timeline-item {
  animation: slideIn 0.22s ease both;
}

.reply-item:nth-child(1) { animation-delay: 0.02s; }
.reply-item:nth-child(2) { animation-delay: 0.05s; }
.reply-item:nth-child(3) { animation-delay: 0.08s; }
.reply-item:nth-child(4) { animation-delay: 0.11s; }
.reply-item:nth-child(5) { animation-delay: 0.14s; }

/* ─── HOVER LIFT ─────────────────────────────────────────────────────────── */
.stat-card, .action-btn {
  will-change: transform;
}

/* ─── FOCUS RING ─────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
