/* style.css */

/* --- Container Principal --- */
#chatbot-container {
  width: 350px;
  height: 500px;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Arial, sans-serif;
  margin: 50px auto; /* Para centralizar na web. Mude para 'position: fixed; bottom: 20px; right: 20px;' para flutuar no canto. */
}

/* --- Cabeçalho --- */
#chat-header {
  padding: 15px;
  background-color: #2e7d32;
  color: white;
  font-weight: bold;
  /* NOVO: Ajuste para posicionar o botão de reiniciar */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#restart-button {
  background: none;
  border: none;
  color: white;
  font-size: 1.2em; /* Tamanho do ícone */
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: background-color 0.2s;
}

#restart-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#restart-button img {
  width: 75px;
  height: 75px;
}

/* --- Corpo do Chat e Scroll --- */
#chat-body {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #f7f7f7;
  display: flex;
  flex-direction: column;
}

/* --- Mensagens (Com Animação de Entrada) --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  max-width: 80%;
  /* Aplica a animação "WhatsApp" */
  animation: fadeInUp 0.5s ease-out;
}

/* Mensagens do BOT (Esquerda) */
.bot-message {
  background-color: #fff;
  align-self: flex-start;
  border: 1px solid #eee;
}

/* Links dentro das mensagens do BOT (para URL e TEL) */
.bot-message a {
  color: #007bff; /* Garante que os links sejam azuis e clicáveis */
  text-decoration: underline;
}

/* Mensagens do Usuário (Direita) */
.user-message {
  background-color: #6deea3;
  align-self: flex-end;
}

/* --- Botões de Opções --- */
.user-button-container {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.user-button {
  background-color: #388e3c;
  color: white;
  border: none;
  padding: 10px;
  margin-top: 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.user-button:hover {
  background-color: #2e7d32;
}

/* --- Animação de Loading (Humanização) --- */
.loading-dots {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  margin-bottom: 10px;
  border-radius: 10px;
  max-width: 250px; /* Limita a largura do balão de loading */
  background-color: #fff;
  border: 1px solid #eee;
}

.loading-dots span {
  width: 20px;
  height: 20px;
  margin: 0 7px;
  background-color: #555;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@media (min-width: 375px) {
  #chatbot-container {
    width: 90%;
    height: 90vh;
  }

  #chat-header {
    padding: 2.5rem;
    font-size: 4.5rem;
  }

  .message {
    font-size: 3.25rem;
    margin: 1.25rem 0;

    padding: 2rem;
    border-radius: 20px;
  }

  .user-button-container {
    margin-top: 2rem;
  }

  .user-button {
    border-radius: 10px;
    font-size: 2.75rem;
    padding: 1.5rem 1rem;
    margin-top: 1rem;
  }
}

@media (min-width: 768px) {
  #chat-header {
    padding: 1rem;
    font-size: 2.5rem;
  }

  #restart-button img {
    width: 60px;
    height: auto;
  }

  .message {
    font-size: 2.25rem;
  }

  .user-button {
    font-size: 2rem;
    padding: 1rem;
    margin-top: 1rem;
  }
}

@media (min-width: 1024px) {
  #chat-header {
    padding: 1rem;
    font-size: 1.5rem;
  }

  #restart-button img {
    width: 40px;
    height: auto;
    margin-right: 1rem;
  }

  .message {
    font-size: 1rem;
  }

  .user-button {
    font-size: 1rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
  }

  #chatbot-container {
    width: 50%;
    height: 95vh;
  }

  #chatbot-container {
    margin: 10px auto;
  }

  /* --- Animação de Loading (Humanização) --- */
  .loading-dots {
    padding: 10px;
  }

  .loading-dots span {
    width: 10px;
    height: 10px;
    margin: 0 4px;
  }
}

@media (min-width: 1366px) {
  #chatbot-container {
    width: 40%;
    height: 90vh;
  }
  .message {
    padding: 1rem;
  }
}
