/* GG Call — movimento: transições e animações de entrada (carregado por último).
   Tudo aqui é desligado por "prefers-reduced-motion" na regra global de styles.css. */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- controles: resposta ao toque */
.btn, .icon-btn, .round-btn, .rail-btn, .nav-row, .member, .reaction, .tab, .settings-tab, .menu-item, .emoji-btn, .role-item, .switcher-item, .source, .radio-card {
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease, opacity 0.14s ease, border-radius 0.18s ease;
}
.btn:active:not(:disabled), .round-btn:active, .reaction:active { transform: scale(0.96); }
.icon-btn:active:not(:disabled) { transform: scale(0.9); }
.icon-btn .icon, .round-btn .icon { transition: transform 0.18s var(--ease-spring); }
.icon-btn:hover .icon { transform: scale(1.08); }
.round-btn:hover { transform: translateY(-2px); }
.round-btn:hover .icon { transform: scale(1.1); }
.round-btn.hangup:hover .icon { transform: rotate(-12deg) scale(1.1); }
.user-panel .icon-btn[aria-label^='Configurações']:hover .icon { transform: rotate(60deg); }

/* ---------- barra de servidores */
.rail-btn { transition: border-radius 0.22s var(--ease-out), background-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.rail-btn:active { transform: translateY(1px) scale(0.96); }
.rail-pill { transition: height 0.2s var(--ease-spring); }
.rail.booting .rail-item { animation: rail-in 0.28s var(--ease-out) backwards; }
@keyframes rail-in { from { opacity: 0; transform: scale(0.6); } }
@keyframes badge-pop { from { transform: scale(0); } }
@keyframes badge-pop { from { transform: scale(0); } }

/* ---------- barra de canais */
.nav-row.unread .nav-name { transition: color 0.2s ease; }
.voice-user.fresh { animation: slide-in-left 0.22s var(--ease-out); }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-10px); } }
.voice-user .avatar, .tile { transition: box-shadow 0.12s ease, border-color 0.12s ease; }
.voice-panel:not([hidden]) { animation: rise 0.24s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.category-toggle .icon { transition: transform 0.18s ease; }

/* ---------- troca de tela */
/* Só na navegação (classe posta por navigate()); redesenhos da mesma tela não reanimam. */
.content > .primary.entering > * { animation: view-in 0.2s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.side-panel.entering { animation: side-in 0.22s var(--ease-out); }
@keyframes side-in { from { opacity: 0; transform: translateX(16px); } }
.auth-card { animation: auth-in 0.42s var(--ease-out); }
@keyframes auth-in { from { opacity: 0; transform: translateY(-28px) scale(1.04); } }

/* ---------- mensagens */
.msg.fresh { animation: msg-in 0.24s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }
.msg-tools { animation: tools-in 0.12s ease-out; }
@keyframes tools-in { from { opacity: 0; transform: translateY(4px); } }
.reaction:hover { transform: translateY(-1px); }
.attach-image img { transition: filter 0.15s ease, transform 0.25s var(--ease-out); }
.attach-image:hover img { filter: brightness(1.08); }
.reply-bar:not([hidden]), .pending-files:not([hidden]) { animation: rise 0.18s var(--ease-out); }
.composer-row { transition: box-shadow 0.15s ease, background-color 0.15s ease; }
.composer-row .send .icon { transition: transform 0.2s var(--ease-spring); }
.composer-row .send:hover .icon { transform: translateX(2px) rotate(-8deg) scale(1.1); }
.typing:not(:empty) { animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } }
.day-divider.new { animation: fade-in 0.4s ease; }

/* ---------- flutuantes */
.modal-backdrop { animation: fade-in 0.14s ease-out; }
.modal { animation: modal-in 0.22s var(--ease-spring); }
@keyframes modal-in { from { opacity: 0; transform: scale(0.88); } }
.modal-backdrop.closing { animation: fade-out 0.11s ease-in forwards; pointer-events: none; }
.modal-backdrop.closing .modal { animation: modal-out 0.11s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: scale(0.94); } }
.menu { animation: pop-in 0.12s var(--ease-out); transform-origin: top left; }
.user-card { animation: pop-in 0.16s var(--ease-out); transform-origin: top right; }
.picker { animation: pop-in 0.16s var(--ease-out); transform-origin: bottom right; }
.autocomplete:not([hidden]) { animation: rise 0.14s var(--ease-out); }
.stream-preview { animation: pop-in 0.14s var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); } }
.toast { animation: toast-in 0.3s var(--ease-spring); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
.toast.leaving { animation: toast-out 0.18s ease-in forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.settings-pane > * { animation: view-in 0.2s var(--ease-out) backwards; }
.banner:not([hidden]) { animation: rise 0.2s var(--ease-out); }

/* ---------- chamada */
.tile.fresh { animation: tile-in 0.26s var(--ease-out); }
.tile { transition: box-shadow 0.12s ease, border-color 0.12s ease, transform 0.18s var(--ease-out); }
@keyframes tile-in { from { opacity: 0; transform: scale(0.92); } }
.tile.speaking { box-shadow: 0 0 0 1px var(--green), 0 0 18px rgba(59, 165, 92, 0.35); }
.tile.user:not(.speaking) .avatar { transition: transform 0.2s var(--ease-out); }
.tile.user.speaking .avatar { animation: speak 1.1s ease-in-out infinite; }
@keyframes speak { 50% { transform: scale(1.05); } }
.content > .primary.entering .call-controls { animation: rise 0.28s var(--ease-out); }
.live-tag { animation: live 2s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 4px rgba(237, 66, 69, 0.22); } }
.live-tag.muted { animation: none; }
.voice-where strong .icon { animation: fade-in 0.4s ease; }
.voice-where.connecting strong .icon { animation: pulse 1s ease-in-out infinite; }

/* ---------- estados */
.status-dot { transition: background-color 0.25s ease; }
.meter span { transition: width 0.06s linear, background-color 0.12s ease; }
.pending-bar i { transition: width 0.2s ease; }
.spinner-wrap, .empty-state { animation: fade-in 0.25s ease; }
.source { transition: border-color 0.14s ease, transform 0.14s var(--ease-out); }
.source:hover { transform: translateY(-2px); }
.search-result { transition: border-color 0.14s ease, transform 0.14s var(--ease-out); }
.search-result:hover { transform: translateX(-2px); }
.accent-dot { transition: transform 0.16s var(--ease-spring), border-color 0.14s ease; }
.accent-dot:hover { transform: scale(1.15); }
