/* ==========================================================================
   AMAS BOT - Chatbot Inteligente de Atendimento & FAQ
   ========================================================================== */

/* Botão Flutuante do Chat */
.chatbot-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 37, 107, 0.35);
  z-index: 150;
  transition: var(--transition);
  animation: pulseBot 3s infinite;
}

@keyframes pulseBot {
  0% { transform: scale(1); box-shadow: 0 8px 20px rgba(0, 37, 107, 0.35); }
  50% { transform: scale(1.03); box-shadow: 0 12px 25px rgba(15, 110, 86, 0.45); }
  100% { transform: scale(1); box-shadow: 0 8px 20px rgba(0, 37, 107, 0.35); }
}

.chatbot-trigger-btn:hover {
  transform: translateY(-2px);
}

.bot-badge-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

/* Janela do Chatbot */
.chatbot-widget-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  height: 540px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 160;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-widget-window.active {
  display: flex;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary), #00369a);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.bot-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.bot-info p {
  font-size: 0.72rem;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: var(--transition);
}

.chatbot-close-btn:hover {
  opacity: 1;
}

/* Área de Mensagens */
.chatbot-messages-area {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-msg p {
  margin-bottom: 6px;
}

.chat-msg p:last-child {
  margin-bottom: 0;
}

.chat-msg strong {
  color: var(--primary);
}

.chat-msg.user strong {
  color: #ffffff;
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* Sugestões Rápidas (Pills) */
.quick-replies-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.quick-reply-pill {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(0, 37, 107, 0.2);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quick-reply-pill:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Área de Input */
.chatbot-input-box {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex-grow: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.chatbot-input:focus {
  border-color: var(--primary);
}

.chatbot-send-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.chatbot-send-btn:hover {
  background: var(--primary-dark);
}

@media (max-width: 480px) {
  .chatbot-widget-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    height: 75vh;
  }
}
