/* WhatsApp do sistema: camada de movimento e acabamento.
   Regra desta folha: so cor, sombra, transform, opacity, filter e fundo.
   Nada de overflow/position/display nas bolhas — elas carregam anexos,
   previas de documento e audio por dentro, e qualquer mudanca de caixa ali
   esconde conteudo. */

@keyframes wa-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wa-entra-lado { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes wa-aurora { 0% { background-position: 0% 0%, 100% 100%, 0 0; } 50% { background-position: 30% 20%, 70% 80%, 0 0; } 100% { background-position: 0% 0%, 100% 100%, 0 0; } }
@keyframes wa-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .55), 0 0 10px rgba(255, 90, 31, .5); } 60% { box-shadow: 0 0 0 6px rgba(255, 90, 31, 0), 0 0 10px rgba(255, 90, 31, .5); } }
@keyframes wa-sinal { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .7; } }
@keyframes wa-brilho { 0%, 65% { background-position: -160% 0; } 100% { background-position: 260% 0; } }
@keyframes wa-respira { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes wa-voa { 0% { transform: translate(0, 0) rotate(0); } 45% { transform: translate(6px, -6px) rotate(-8deg); opacity: 0; } 55% { transform: translate(-6px, 6px); opacity: 0; } 100% { transform: translate(0, 0); opacity: 1; } }

/* ---------- moldura ---------- */
.central .central-lista, .central .central-chat {
  transition: box-shadow .4s, border-color .4s;
}
.central .central-chat:focus-within { border-color: rgba(255, 90, 31, .22); box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 90, 31, .06); }

/* rolagem fina e discreta */
.central .central-lista, .central .central-mensagens, .central .central-ficha-corpo { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.central ::-webkit-scrollbar { width: 6px; height: 6px; }
.central ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 6px; }
.central ::-webkit-scrollbar-thumb:hover { background: rgba(255, 90, 31, .45); }
.central ::-webkit-scrollbar-track { background: transparent; }

/* ---------- filtros e barra ---------- */
.central .central-abas button { transition: color .2s, background .25s, transform .2s, box-shadow .25s; }
.central .central-abas button:hover { transform: translateY(-1px); }
.central .central-abas button:active { transform: scale(.96); }
.central .central-nova {
  background-image: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%), linear-gradient(180deg, #ff8247, #ff5a1f 60%, #ef4a12) !important;
  background-size: 220% 100%, 100% 100% !important;
  animation: wa-brilho 5.5s ease-in-out infinite;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s !important;
}
.central .central-nova:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px #ff5a1f !important; }
.central .central-nova:active { transform: scale(.96); }
.central .central-nova svg { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.central .central-nova:hover svg { transform: rotate(90deg); }
.central .central-lupa { transition: border-color .2s, box-shadow .25s, background .2s, transform .2s; }
.central .central-lupa:hover { transform: translateY(-1px); }
.central .central-lupa:focus-within { border-color: rgba(255, 90, 31, .5); box-shadow: 0 0 0 4px rgba(255, 90, 31, .12); }

/* ---------- lista de conversas ---------- */
.central .central-item {
  transition: background .25s, border-color .25s, transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s !important;
}
.central .central-item:hover { transform: translateX(3px); background: linear-gradient(90deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)) !important; border-color: rgba(255, 255, 255, .06); }
.central .central-item:active { transform: translateX(3px) scale(.985); }
.central .central-item.ativo { box-shadow: 0 12px 28px -18px rgba(255, 90, 31, .7), inset 0 1px 0 rgba(255, 255, 255, .04); }
.central .central-item .central-avatar { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s; }
.central .central-item:hover .central-avatar { transform: scale(1.07); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .8); }
.central .central-item.ativo .central-avatar { box-shadow: 0 0 0 2px rgba(255, 90, 31, .55), 0 0 18px -4px rgba(255, 90, 31, .7); }
.central .central-naolidas { animation: wa-pulso 2.4s ease-in-out infinite; }
.central .central-item.ativo .central-naolidas { animation: none; }

/* ---------- cabecalho da conversa ---------- */
.central .central-cabeca .central-avatar { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 2px rgba(63, 207, 142, .35), 0 8px 20px -10px rgba(0, 0, 0, .8); }
.central .central-cabeca .central-avatar:hover { transform: scale(1.06) rotate(-3deg); }
.central .central-acoes button { transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s, border-color .2s, box-shadow .2s, color .2s !important; }
.central .central-acoes button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .9); }
.central .central-acoes button:active { transform: scale(.95); }

/* faixa "Sem responsavel": sinal respirando e Assumir com brilho */
.central .central-faixa { transition: background .3s, border-color .3s; }
.central .central-faixa.livre { background: linear-gradient(90deg, rgba(245, 185, 71, .09), rgba(255, 255, 255, .015) 55%) !important; border-color: rgba(245, 185, 71, .18) !important; }
.central .central-faixa .fx-sinal, .central .central-faixa.livre::before { animation: wa-sinal 1.8s ease-in-out infinite; }
.central .fx-assumir {
  background-image: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%), linear-gradient(180deg, #ffd27a, #f5b947) !important;
  background-size: 220% 100%, 100% 100% !important; animation: wa-brilho 4s ease-in-out infinite;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s !important;
}
.central .fx-assumir:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px #f5b947 !important; }
.central .fx-assumir:active { transform: scale(.95); }

/* ---------- area das mensagens: fundo vivo, bem lento ---------- */
.central .central-mensagens {
  background-image:
    radial-gradient(600px 380px at 15% 10%, rgba(255, 90, 31, .055), transparent 70%),
    radial-gradient(520px 420px at 90% 90%, rgba(80, 140, 255, .035), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px) !important;
  background-size: 140% 140%, 140% 140%, 18px 18px !important;
  animation: wa-aurora 26s ease-in-out infinite;
}

/* bolha recebida: vidro escuro, borda fina, leve elevacao ao passar */
.central .bolha.dele {
  background: linear-gradient(180deg, rgba(34, 42, 55, .96), rgba(26, 33, 44, .96)) !important;
  border: 1px solid rgba(255, 255, 255, .07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 24px -18px rgba(0, 0, 0, .9) !important;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s;
}
.central .bolha.dele:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .12) !important; }
.central .bolha-linha:last-child .bolha.dele { animation: wa-entra .35s cubic-bezier(.2, .8, .2, 1) both; }
.central .bolha .bolha-texto a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 2px; transition: text-decoration-color .2s; }
.central .bolha .bolha-texto a:hover { text-decoration-color: currentColor; }
.central .bolha-avatar { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.central .bolha-linha:hover .bolha-avatar { transform: scale(1.08); }

/* ---------- escrever ---------- */
.central .central-campo { transition: border-color .25s, box-shadow .3s, background .25s, transform .25s !important; }
.central .central-campo:focus-within {
  background: rgba(255, 255, 255, .05) !important;
  box-shadow: 0 0 0 4px rgba(255, 90, 31, .1), 0 14px 30px -20px rgba(255, 90, 31, .6) !important;
}
.central .central-icone { transition: color .2s, background .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1) !important; }
.central .central-icone:hover { color: #ffb38a !important; background: rgba(255, 90, 31, .1) !important; transform: scale(1.08); }
.central #anexar:hover .clipe { transform: rotate(-15deg); transform-origin: center; }
.central .central-icone svg, .central .central-icone .clipe { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.central #emojis:hover svg { transform: rotate(12deg) scale(1.05); }

/* enviar: apagado sem texto, acende quando tem o que mandar */
.central .central-enviar { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, filter .25s, opacity .25s !important; }
.central .central-escrever:has(textarea:placeholder-shown) .central-enviar { filter: saturate(.4) brightness(.8); opacity: .7; box-shadow: none !important; }
.central .central-escrever:not(:has(textarea:placeholder-shown)) .central-enviar { box-shadow: 0 0 0 4px rgba(255, 90, 31, .14), 0 12px 26px -10px #ff5a1f !important; }
.central .central-enviar:hover { transform: translateY(-2px) scale(1.04); }
.central .central-enviar:hover svg { animation: wa-voa .6s ease; }
.central .central-enviar:active { transform: scale(.92); }


@media (prefers-reduced-motion: reduce) {
  .central *, .central .central-mensagens { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   WhatsApp: responder citando, editar, apagar, menu da mensagem
   ========================================================================== */
.central-mensagens .bolha { position: relative; transition: background .3s ease; }
/* a setinha do menu: aparece ao passar o mouse, no canto de cima */
.bolha-menu-botao {
  position: absolute; top: 4px; right: 4px; z-index: 2; display: grid; place-items: center;
  width: 24px; height: 24px; padding: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: color-mix(in srgb, currentColor 0%, rgba(0, 0, 0, .35)) !important; color: #fff !important;
  box-shadow: none !important; opacity: 0; cursor: pointer; transition: opacity .15s ease;
}
.bolha-menu-botao svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bolha:hover > .bolha-menu-botao, .bolha-menu-botao:focus-visible { opacity: 1; }
@media (hover: none) { .bolha-menu-botao { display: none; } }

.bolha-menu {
  position: fixed; z-index: 3000; width: 210px; padding: 6px; border-radius: 14px;
  background: #1b212b; border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .65); animation: zap-menu .16s cubic-bezier(.2, .8, .2, 1);
}
@keyframes zap-menu { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.bolha-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px !important;
  border: 0 !important; border-radius: 9px !important; background: transparent !important; box-shadow: none !important;
  color: #e9edf3 !important; font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.bolha-menu button:hover { background: rgba(255, 255, 255, .07) !important; }
.bolha-menu button svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.bolha-menu button.perigo { color: #ff8a8d !important; }

/* a citacao dentro da bolha */
.bolha-citacao {
  display: grid; gap: 1px; width: 100%; margin: 0 0 6px; padding: 6px 10px 7px 12px !important; text-align: left; cursor: pointer;
  border: 0 !important; border-left: 4px solid #34d399 !important; border-radius: 8px !important;
  background: rgba(0, 0, 0, .22) !important; box-shadow: none !important; color: inherit !important; font: inherit;
}
.bolha-citacao.minha { border-left-color: #ff7a3d !important; }
.bolha-citacao b { font-size: 12px; font-weight: 700; color: #34d399; }
.bolha-citacao.minha b { color: #ff9a6b; }
.bolha-citacao span { font-size: 12.5px; opacity: .78; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bolha.destacada { animation: zap-destaque 1.4s ease; }
@keyframes zap-destaque { 0%, 40% { box-shadow: 0 0 0 3px rgba(255, 122, 61, .55); } 100% { box-shadow: none; } }

/* apagada */
.bolha.apagada .bolha-texto { display: flex; align-items: center; gap: 6px; font-style: italic; opacity: .6; }
.bolha.apagada .bolha-texto svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* a barra "Respondendo a..." / "Editando mensagem" em cima da caixa */
.resposta-barra {
  display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 8px 8px 8px 0; border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); border-bottom: 0;
  animation: zap-barra .18s cubic-bezier(.2, .8, .2, 1);
}
.resposta-barra[hidden] { display: none; }
@keyframes zap-barra { from { opacity: 0; transform: translateY(6px); } }
.resposta-barra-cor { align-self: stretch; width: 4px; border-radius: 0 3px 3px 0; background: #34d399; }
.resposta-barra.editar .resposta-barra-cor { background: #ff7a3d; }
.resposta-barra > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.resposta-barra b { font-size: 12px; color: #34d399; }
.resposta-barra.editar b { color: #ff9a6b; }
.resposta-barra span { font-size: 12.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resposta-barra button { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important; color: inherit !important; opacity: .7; cursor: pointer; }
.resposta-barra button:hover { opacity: 1; background: rgba(255, 255, 255, .08) !important; }
.resposta-barra button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.central-escrever.editando .central-enviar { background: linear-gradient(135deg, #ff9a5c, #ff5a1f) !important; }

/* "Enviar como arquivo" na previa do anexo */
.anexo-como-arquivo { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 12px; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); grid-column: 1 / -1; }
.anexo-como-arquivo input { width: 18px; height: 18px; accent-color: #ff5a1f; flex: none; }
.anexo-como-arquivo span { display: grid; gap: 1px; }
.anexo-como-arquivo b { font-size: 13px; }
.anexo-como-arquivo small { font-size: 11.5px; opacity: .65; }
/* os tracinhos do WhatsApp no rodape da bolha */
.bolha-rodape .tique { display: inline-flex; vertical-align: -2px; margin-left: 4px; opacity: .75; }
.bolha-rodape .tique svg { width: 16px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bolha-rodape .tique.lida { color: #8fe3ff; opacity: 1; filter: drop-shadow(0 0 3px rgba(83, 189, 235, .8)); }
.bolha.dele .bolha-rodape .tique.lida, .central-mensagens:not(.x) .bolha:not(.minha) .tique.lida { color: #53bdeb; }
.bolha-rodape .tique.lida svg { stroke-width: 2.2; }

/* confirmacao de apagar para todos */
dialog.zap-confirma {
  width: min(400px, calc(100vw - 32px)); padding: 26px 24px 20px; border: 1px solid rgba(255, 255, 255, .09); border-radius: 22px;
  background: linear-gradient(180deg, #161b23, #10141b); color: #e9edf3; text-align: center;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); animation: zap-confirma-entra .22s cubic-bezier(.2, .8, .2, 1);
}
dialog.zap-confirma::backdrop { background: rgba(3, 5, 9, .6); backdrop-filter: blur(4px); }
dialog.zap-confirma.saindo { animation: zap-confirma-sai .16s ease forwards; }
@keyframes zap-confirma-entra { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes zap-confirma-sai { to { opacity: 0; transform: scale(.97); } }
.zap-confirma-icone { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; color: #ff6b6b; background: rgba(240, 86, 75, .12); box-shadow: inset 0 0 0 1px rgba(240, 86, 75, .25); }
.zap-confirma-icone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.zap-confirma h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: #fff; }
.zap-confirma p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #9aa4b2; }
.zap-confirma p b { color: #cfd6df; font-weight: 600; }
.zap-confirma-previa { margin: 16px 0 0; display: flex; justify-content: flex-end; }
.zap-confirma-previa span { max-width: 85%; padding: 9px 13px; border-radius: 14px 14px 4px 14px; text-align: left; font-size: 13.5px; line-height: 1.45; color: #fff; background: linear-gradient(135deg, #ff7a3d, #e04f14); opacity: .85; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .55); white-space: pre-wrap; word-break: break-word; }
.zap-confirma-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.zap-confirma-acoes button { height: 44px; border-radius: 12px !important; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s; }
.zap-confirma-acoes button:active { transform: scale(.97); }
.zap-confirma-nao { color: #e9edf3 !important; background: rgba(255, 255, 255, .05) !important; border: 1px solid rgba(255, 255, 255, .1) !important; box-shadow: none !important; }
.zap-confirma-nao:hover { background: rgba(255, 255, 255, .09) !important; }
.zap-confirma-sim { color: #fff !important; border: 0 !important; background: linear-gradient(135deg, #f0564b, #c8242b) !important; box-shadow: 0 12px 24px -12px rgba(200, 36, 43, .9) !important; }
.zap-confirma-sim:hover { box-shadow: 0 16px 30px -12px rgba(200, 36, 43, 1) !important; }

/* Como enviar a foto: seletor de duas opcoes com a pilula deslizando */
.anexo-modo {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 10px; padding: 4px; max-width: 420px;
  border-radius: 14px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.anexo-varios .anexo-modo, .anexo-bandeja > .anexo-modo { grid-column: 1 / -1; max-width: none; }
.anexo-modo-luz {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 122, 61, .22), rgba(255, 90, 31, .12)); box-shadow: inset 0 0 0 1px rgba(255, 122, 61, .45), 0 6px 16px -8px rgba(255, 90, 31, .7);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.anexo-modo.arquivo .anexo-modo-luz { transform: translateX(calc(100% + 4px)); }
.anexo-modo button {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 10px !important; text-align: left; cursor: pointer;
  border: 0 !important; border-radius: 10px !important; background: transparent !important; box-shadow: none !important; color: #9aa4b2 !important; font: inherit;
  transition: color .25s;
}
.anexo-modo button[aria-checked="true"] { color: #fff !important; }
.anexo-modo button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.anexo-modo button[aria-checked="true"] svg { color: #ff8a4c; }
.anexo-modo button span { display: grid; gap: 1px; min-width: 0; }
.anexo-modo button b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.anexo-modo button small { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anexo-como-arquivo { display: none !important; }
.central-naolidas { transition: transform .18s ease, opacity .18s ease; }
.central-naolidas.sumindo { transform: scale(.4); opacity: 0; }
.central-lidas { display: grid; place-items: center; width: 42px; height: 42px; padding: 0 !important; border-radius: 12px !important; cursor: pointer; color: #9aa4b2 !important; background: rgba(255, 255, 255, .04) !important; border: 1px solid rgba(255, 255, 255, .08) !important; box-shadow: none !important; transition: color .2s, border-color .2s; }
.central-lidas:hover { color: #53bdeb !important; border-color: rgba(83, 189, 235, .4) !important; }
.central-lidas svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.central-mais-antigas { display: block; margin: 4px auto 14px; padding: 7px 16px !important; border-radius: 999px !important; font: inherit; font-size: 12.5px; cursor: pointer; color: #cfd6df !important; background: rgba(255, 255, 255, .06) !important; border: 1px solid rgba(255, 255, 255, .08) !important; box-shadow: none !important; }
.central-mais-antigas b { margin-left: 4px; color: #ff9a6b; }
