/* ==========================================================================
   CHATBOX AGENTE IA 24H — WEBXTEC (ACADEMIAS E ESTÚDIOS FITNESS)
   CSS Otimizado, Responsivo e Compatível com Bootstrap 5
   Cores Oficiais: Esmeralda (#10b981, #34d399), Dark (#060d0a, #0b1411)
   ========================================================================== */

:root {
  --wxt-primary: #10b981;
  --wxt-primary-light: #34d399;
  --wxt-primary-glow: rgba(16, 185, 129, 0.25);
  --wxt-bg-dark: #060d0a;
  --wxt-bg-card: rgba(11, 20, 17, 0.95);
  --wxt-bg-glass: rgba(15, 26, 22, 0.82);
  --wxt-border: rgba(52, 211, 153, 0.22);
  --wxt-border-subtle: rgba(255, 255, 255, 0.08);
  --wxt-text: #f1f5f9;
  --wxt-text-muted: #94a3b8;
  --wxt-radius: 18px;
  --wxt-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(16, 185, 129, 0.12);
}

/* Container do Widget Flutuante */
.wxt-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Botão Flutuante (Launcher) */
.wxt-chat-launcher {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid rgba(52, 211, 153, 0.5);
  color: #060d0a;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
  outline: none;
}

.wxt-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.55), 0 6px 16px rgba(0, 0, 0, 0.6);
  border-color: #34d399;
}

.wxt-chat-launcher:active {
  transform: scale(0.96);
}

.wxt-launcher-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #34d399;
  animation: wxtPulse 2.4s infinite cubic-bezier(0.24, 0, 0.38, 1);
  pointer-events: none;
  opacity: 0.6;
}

@keyframes wxtPulse {
  0% { transform: scale(1); opacity: 0.7; }
  60% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.wxt-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #22c55e;
  border: 2px solid #060d0a;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #060d0a;
  padding: 2px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

/* Janela Principal do Chat */
.wxt-chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--wxt-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--wxt-border);
  border-radius: var(--wxt-radius);
  box-shadow: var(--wxt-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s;
}

.wxt-chat-panel.wxt-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Cabeçalho do Chat */
.wxt-chat-header {
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(20, 36, 30, 0.95) 0%, rgba(11, 20, 17, 0.85) 100%);
  border-bottom: 1px solid var(--wxt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wxt-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wxt-agent-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid var(--wxt-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  flex-shrink: 0;
}

.wxt-agent-avatar svg {
  width: 22px;
  height: 22px;
}

.wxt-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #060d0a;
}

.wxt-header-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.wxt-header-subtitle {
  font-size: 11.5px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.wxt-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wxt-header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.wxt-header-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.wxt-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Alerta de Comunicação Segura e Neutra */
.wxt-neutral-disclaimer {
  background: rgba(16, 185, 129, 0.06);
  border-bottom: 1px solid rgba(52, 211, 153, 0.15);
  padding: 7px 14px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wxt-neutral-disclaimer span {
  color: #34d399;
  font-weight: 600;
}

/* Área de Mensagens */
.wxt-messages-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.3) transparent;
}

.wxt-messages-area::-webkit-scrollbar {
  width: 5px;
}

.wxt-messages-area::-webkit-scrollbar-track {
  background: transparent;
}

.wxt-messages-area::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.25);
  border-radius: 10px;
}

/* Bolhas de Mensagens */
.wxt-message {
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.55;
  border-radius: 14px;
  padding: 10px 14px;
  position: relative;
  word-break: break-word;
}

.wxt-message-agent {
  align-self: flex-start;
  background: rgba(20, 32, 27, 0.85);
  color: #f1f5f9;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-bottom-left-radius: 4px;
}

.wxt-message-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #060d0a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.wxt-message-time {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 4px;
  display: block;
  text-align: right;
}

/* Efeito de Cursor de Digitação Suave */
.wxt-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  background-color: #34d399;
  margin-left: 2px;
  vertical-align: middle;
  animation: wxtBlink 0.7s infinite;
}

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

/* Indicador de "Digitando..." */
.wxt-typing-bubble {
  align-self: flex-start;
  background: rgba(20, 32, 27, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wxt-typing-bubble span {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  animation: wxtDotBounce 1.3s infinite ease-in-out;
}

.wxt-typing-bubble span:nth-child(2) {
  animation-delay: 0.2s;
}

.wxt-typing-bubble span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes wxtDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Chips de Respostas Prontas / Dúvidas Frequentes */
.wxt-quick-replies {
  padding: 6px 14px 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wxt-quick-replies::-webkit-scrollbar {
  display: none;
}

.wxt-chip-btn {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34d399;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.wxt-chip-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
  color: #fff;
  transform: translateY(-1px);
}

/* Campo de Entrada de Mensagem */
.wxt-chat-input-area {
  padding: 12px 14px;
  background: rgba(11, 20, 17, 0.98);
  border-top: 1px solid var(--wxt-border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wxt-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  font-size: 13.5px;
  padding: 9px 13px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.wxt-chat-input::placeholder {
  color: #64748b;
  font-size: 12.5px;
}

.wxt-chat-input:focus {
  border-color: #34d399;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.wxt-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #10b981;
  border: none;
  color: #060d0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.wxt-send-btn:hover {
  background: #34d399;
  transform: scale(1.05);
}

.wxt-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Rodapé com Link do WhatsApp */
.wxt-chat-footer {
  padding: 6px 14px 10px;
  background: rgba(6, 13, 10, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.wxt-footer-brand {
  color: #64748b;
  font-size: 10.5px;
}

.wxt-footer-whatsapp {
  color: #34d399;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.wxt-footer-whatsapp:hover {
  color: #6ee7b7;
  text-decoration: underline;
}

/* Responsividade Mobile */
@media (max-width: 480px) {
  .wxt-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .wxt-chat-panel {
    bottom: 74px;
    right: 0;
    width: calc(100vw - 32px);
    height: calc(100vh - 110px);
    max-height: 540px;
  }
}
