/* widgets.css
   estilos dos elementos flutuantes: chatbot, whatsapp e toast */

/* botao verde do whatsapp que fica fixo no canto */
.btn-whatsapp-float {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: var(--verde-whatsapp);
  color: var(--branco);
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
}

/* textinho que aparece quando passa o mouse em cima */
.btn-whatsapp-float::before {
  content: 'Fale conosco';
  position: absolute;
  right: 66px;
  background: var(--azul-escuro);
  color: var(--branco);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.btn-whatsapp-float:hover::before {
  opacity: 1;
}

/* botao azul do chatbot que fica fixo no canto */
.btn-chatbot-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--azul-claro), var(--azul-medio));
  color: var(--branco);
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  z-index: 1000;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-chatbot-float:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.5);
}

/* janela do chatbot */
.chatbot-janela {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 340px;
  height: 480px;
  max-height: calc(100vh - 130px);
  background: var(--branco);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(10, 22, 40, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* fechado por padrao */
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}

/* classe que o js adiciona quando o usuario abre o chat */
.chatbot-janela.aberto {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* cabecalho do chatbot */
.chatbot-header {
  background: linear-gradient(135deg, var(--azul-escuro), var(--azul-medio));
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  background: var(--laranja);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chatbot-info h6 {
  color: var(--branco);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}
.chatbot-info small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
}

.chatbot-fechar {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.chatbot-fechar:hover {
  color: var(--branco);
}

/* area das mensagens — flex:1 + min-height:0 faz o scroll funcionar certo */
.chatbot-mensagens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

/* balao do bot */
.msg-bot {
  background: var(--branco);
  color: #1e293b;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 85%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  align-self: flex-start;
}

/* balao do usuario */
.msg-usuario {
  background: linear-gradient(135deg, var(--azul-claro), var(--azul-medio));
  color: var(--branco);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 85%;
  align-self: flex-end;
}

/* area de input — flex-shrink:0 garante que nunca some */
.chatbot-input-area {
  padding: 12px 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  background: var(--branco);
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.88rem;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: var(--azul-claro);
}

.btn-enviar-chat {
  background: var(--azul-claro);
  color: var(--branco);
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-enviar-chat:hover {
  background: var(--azul-medio);
}

/* toast — mensagem de feedback que aparece no centro da tela */
.toast-custom {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 9999;
  background: var(--azul-escuro);
  color: var(--branco);
  border-radius: 12px;
  padding: 14px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  opacity: 0;
  transition: all 0.3s ease;
  min-width: 280px;
  max-width: 90vw;
  text-align: center;
  justify-content: center;
}

.toast-custom.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-custom i {
  font-size: 1.2rem;
  color: var(--laranja);
  flex-shrink: 0;
}

/* responsividade dos widgets no celular */
@media (max-width: 768px) {
  .chatbot-janela {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 90px;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
  }
  .btn-chatbot-float {
    right: 16px;
    bottom: 16px;
  }
  .btn-whatsapp-float {
    right: 16px;
    bottom: 84px;
  }
}
