/* ==========================================================================
   WHATSAPP DO TREINADOR (Modo Carreira)
   Ícone flutuante no canto inferior esquerdo + badge de não-lidas, e a tela
   dentro de um "celular" (frame) com as mensagens no estilo WhatsApp.
   Criado em 25/07/2026 a pedido do proprietário.
   ========================================================================== */

/* ---- Ícone flutuante (FAB) ---- */
.wa-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  cursor: pointer;
  z-index: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.wa-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 24px rgba(0,0,0,0.34);
}
.wa-fab img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
}
/* Badge [N] em cima do ícone */
.wa-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
  box-sizing: border-box;
}

/* ---- Celular (frame) ---- */
.wa-phone-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 20px;
}
.wa-phone {
  position: relative;
  width: 320px;
  max-width: 92vw;
  aspect-ratio: 320 / 660;
  background: #000;
  border-radius: 42px;
  padding: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  box-sizing: border-box;
}
/* Notch (entalhe) no topo */
.wa-phone::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 20px;
  background: #000;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 3;
}
.wa-phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: #ECE5DD; /* fundo bege clássico do whatsapp */
  display: flex;
  flex-direction: column;
}

/* ---- Barra de topo (contato) ---- */
.wa-topbar {
  background: #075E54; /* verde whatsapp */
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 12px 10px; /* padding-top maior por causa do notch */
  flex-shrink: 0;
}
.wa-back {
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  color: #fff;
}
.wa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #128C7E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.wa-contact { flex: 1; min-width: 0; }
.wa-contact-name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.wa-contact-status { font-size: 11px; opacity: 0.85; }
.wa-topbar-logo { width: 20px; height: 20px; object-fit: contain; opacity: 0.9; }

/* ---- Área de conversa ---- */
.wa-chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* leve textura clássica do whatsapp */
  background-color: #ECE5DD;
}
.wa-msg-row { display: flex; }
.wa-bubble {
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px 6px;
  max-width: 85%;
  box-shadow: 0 1px 1px rgba(0,0,0,0.14);
  position: relative;
  font-size: 13px;
  color: #111;
}
/* "rabinho" do balão recebido */
.wa-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  width: 0; height: 0;
  border-top: 8px solid #fff;
  border-left: 6px solid transparent;
}
.wa-bubble--unread { box-shadow: 0 0 0 2px #25D366, 0 1px 1px rgba(0,0,0,0.14); }
.wa-bubble--sys { background: #FFF7D6; max-width: 92%; }
.wa-bubble--sys::before { border-top-color: #FFF7D6; }
.wa-sys-title { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.wa-bubble-name {
  font-weight: 700;
  font-size: 12px;
  color: #128C7E;
  margin-bottom: 2px;
}
.wa-bubble-text { line-height: 1.4; }
.wa-bubble-time {
  font-size: 10px;
  color: #667781;
  text-align: right;
  margin-top: 3px;
}
.wa-empty {
  margin: auto;
  text-align: center;
  font-size: 12px;
  color: #667781;
  padding: 20px;
  line-height: 1.5;
}

/* Botões de aceitar/recusar dentro do balão */
.wa-actions { display: flex; gap: 8px; margin-top: 8px; }
.wa-btn {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.wa-btn--ok { background: #25D366; color: #fff; }
.wa-btn--no { background: #eee; color: #555; }

/* Em telas pequenas o celular ocupa quase a largura toda */
@media (max-width: 480px) {
  .wa-phone { width: 90vw; }
  .wa-fab { left: 12px; bottom: 12px; width: 50px; height: 50px; }
  .wa-fab img { width: 36px; height: 36px; }
}

/* Modal do WhatsApp: sem a moldura do quick-modal, só o celular limpo.
   O X de fechar também some (o celular tem seu próprio "‹" no topo). */
.quick-modal-box--phone {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  max-width: 96vw !important;
}
.quick-modal-box--phone .quick-modal-close { display: none; }
.quick-modal-box--phone .quick-modal-content { padding: 0; }
