/* Botão flutuante do chatbot */
.chatbot-float {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 60px;
  height: 60px;
  background-color: #001f3f;
  color: #FFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 31, 63, 0.3);
  transition: all 0.3s ease;
}

.chatbot-float:hover {
  background-color: #003366;
  transform: scale(1.05);
}

.chatbot-icon {
  font-size: 24px;
}

/* Container principal do chatbot */
.chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  max-width: 90%;
  height: 500px;
  max-height: 80vh;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 31, 63, 0.2);
  display: none;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

/* Cabeçalho do chatbot */
.chatbot-header {
  background: #001f3f;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  font-weight: 600;
}

.chatbot-header .close-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.chatbot-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Corpo do chatbot - Área de mensagens */
.chatbot-body {
  flex: 1;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
}

/* Container das mensagens */
#chatbot-messages {
  max-height: 300px; /* ou a altura desejada */
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Estilos das mensagens */
.chat-message {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}

.chat-message.user {
  background: #001f3f;
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

.chat-message.bot {
  background: #e9ecef;
  color: #333;
  margin-right: auto;
  border-bottom-left-radius: 5px;
}

/* Rodapé do chatbot (área de input) */
.chatbot-footer {
  padding: 12px;
  border-top: 1px solid #eee;
  background: white;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.chatbot-footer input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  margin-right: 10px;
  outline: none;
  font-size: 14px;
  transition: border 0.3s;
}

.chatbot-footer input:focus {
  border-color: #001f3f;
}

.chatbot-footer button {
  background: #001f3f;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-footer button:hover {
  background: #003366;
}

/* Botões de voz */
#chatbot-listen, #chatbot-speak {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin-left: 5px;
}

#chatbot-listen {
  background-color: #f8f9fa;
  border: 1px solid #001f3f;
  color: #001f3f;
}

#chatbot-listen:hover {
  background-color: #001f3f;
  color: white;
}

#chatbot-listen.active {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
  animation: pulse 1.5s infinite;
}

#chatbot-speak {
  background-color: #f8f9fa;
  border: 1px solid #6c757d;
  color: #6c757d;
}

#chatbot-speak:not(:disabled):hover {
  background-color: #6c757d;
  color: white;
}

/* Personalização da scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Links no chat */
.chat-link {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.chat-link:hover {
  color: #004d99;
}

/* Indicador de digitação */
.fa-ellipsis-h {
  animation: pulse 1.5s infinite;
}

/* Mensagens de erro */
.chat-message.error {
  background: #ffe6e6;
  color: #d32f2f;
  border-left: 3px solid #d32f2f;
}

/* Responsividade */
@media (max-width: 768px) {
  .chatbot-container {
    width: 90%;
    right: 5%;
    bottom: 80px;
    height: 60vh;
  }
  
  .chatbot-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }
  
  .chatbot-icon {
    font-size: 20px;
  }
  
  .chat-message {
    max-width: 90%;
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    height: 70vh;
    bottom: 10px;
  }
  
  .chatbot-footer {
    padding: 10px;
  }
  
  .chatbot-footer input {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  #chatbot-listen, #chatbot-speak {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
}