/* =====================================================
   app-effects.css — interatividade para as telas internas
   (dashboard, treinos, ranking, indicação, admin, auth)
   Contraparte mais discreta do effects.css da landing —
   aqui o foco é feedback de uso, não impacto visual puro.
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ───────────────────────── Ripple nos botões ───────────────────────── */
.btn { position: relative; overflow: hidden; }
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: btn-ripple-anim 0.6s ease-out;
  pointer-events: none;
}
.btn-outline .btn-ripple,
.btn-ghost .btn-ripple { background: rgba(255,138,0,0.25); }
@keyframes btn-ripple-anim {
  to { transform: scale(2.4); opacity: 0; }
}

/* ───────────────────────── Reveal on scroll ───────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ───────────────────────── Cards interativos ───────────────────────── */
.card.stat-card,
.plano-card,
.conquista-card,
.admin-stat-cards .stat-card {
  transition: transform 0.2s cubic-bezier(.16,1,.3,1), border-color 0.2s, box-shadow 0.2s;
}
.card.stat-card:hover,
.plano-card:hover,
.conquista-card:hover,
.admin-stat-cards .stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,138,0,.28);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}

/* ───────────────────────── Número em destaque (count-up) ───────────────────────── */
.count-pop { animation: count-pop 0.4s cubic-bezier(.34,1.56,.64,1); }
@keyframes count-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ───────────────────────── Tabs com pill deslizante ───────────────────────── */
.tab-indicator {
  position: absolute;
  top: 0.3rem; bottom: 0.3rem; left: 0;
  background: var(--color-primary);
  border-radius: 6px;
  z-index: 0;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), width 0.3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

/* Modo gooey (opt-in via initTabsIndicator(el, {gooey:true})) — porte do
   GooeyNav do React Bits: blur+contrast funde a pill com as partículas que
   estouram na troca de aba, sem borrar o texto (que fica fora do wrapper).
   O truque só é estável com BRANCO PURO sobre fundo preto — qualquer canal
   de cor que não esteja já no extremo (0 ou 255) estoura pro lado errado sob
   contrast() alto e a cor sai distorcida (testado: laranja virou amarelo). */
.tab-indicator-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: blur(6px) contrast(28) blur(0);
  mix-blend-mode: lighten;
}
.tab-indicator-wrap::before {
  content: '';
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: #000;
}
.tab-indicator-wrap .tab-indicator { background: #fff; border-radius: 999px; }
.tabs-gooey .tab.active { color: #111; text-shadow: none; }
.tab-particle {
  position: absolute;
  top: 50%;
  border-radius: 50%;
  background: #fff;
  animation: tab-particle-fly var(--time, 550ms) cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes tab-particle-fly {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); }
}

/* ───────────────────────── Sidebar admin — indicador ativo ───────────────────────── */
.sidebar-nav a {
  position: relative;
  transition: background-color 0.2s, color 0.2s, padding-left 0.2s;
}
.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: -0.9rem; top: 50%;
  width: 3px; height: 0;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height 0.2s cubic-bezier(.4,0,.2,1);
}
.sidebar-nav a.active::before { height: 60%; }
.sidebar-nav a:hover:not(.active) { padding-left: 0.95rem; }

/* ───────────────────────── Kanban CRM — feedback de arraste ───────────────────────── */
.kanban-card {
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.kanban-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.96) rotate(-1.5deg);
}
.kanban-col-body {
  transition: background-color 0.15s ease;
}
.kanban-col-body.drag-over {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

/* ───────────────────────── Modal — abertura suave ───────────────────────── */
.modal-overlay {
  animation: modal-fade-in 0.2s ease;
}
.modal-box {
  animation: modal-scale-in 0.25s cubic-bezier(.16,1,.3,1);
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ───────────────────────── Toggle switch — leve pop ao mudar ───────────────────────── */
.switch .slider::before { transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), background-color 0.15s; }

/* ───────────────────────── Check-in — celebração ───────────────────────── */
.btn-checkin.success-burst { animation: checkin-burst 0.5s ease; }
@keyframes checkin-burst {
  0%   { box-shadow: 0 0 0 0 rgba(255,138,0,.55); }
  100% { box-shadow: 0 0 0 26px rgba(255,138,0,0); }
}
.dash-xp-fill.leveled-up { animation: xp-flash 0.6s ease; }
@keyframes xp-flash {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.6); }
}

/* ───────────────────────── Auth cards — entrada suave ───────────────────────── */
.auth-card {
  animation: auth-card-in 0.5s cubic-bezier(.16,1,.3,1);
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ───────────────────────── Wizard de matrícula — troca de etapa ───────────────────────── */
.step-section.step-enter {
  animation: step-fade-in 0.35s cubic-bezier(.16,1,.3,1);
}
@keyframes step-fade-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.step-item { transition: color 0.2s; }
.step-item .step-num { transition: background-color 0.2s, color 0.2s, transform 0.2s; }
.step-item.active .step-num { transform: scale(1.08); }

/* ───────────────────────── Botões com spinner inline ───────────────────────── */
.btn .spinner-sm {
  width: 14px; height: 14px; border-width: 2px;
}

/* ───────────────────────── Foco acessível e consistente ───────────────────────── */
/* Inputs já têm ring de foco no global.css — outline só onde não há ring */
.btn:focus-visible,
.tab:focus-visible,
.topnav-links a:focus-visible,
.sidebar-nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
