/* =========================
   BOT.CSS COMPLETO
   ========================= */

/* Container geral do chat */
.chat-container {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 20px;
  background: #fff9;
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 8px 20px #0002;
  display: flex;
  flex-direction: column;
  height: 70vh;
  transition: all 0.3s ease;
  position: relative;

}

/* Área onde as mensagens aparecem */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mensagens */
.message {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 75%;
  word-wrap: break-word;
  line-height: 1.4;
}

/* Mensagens do usuário */
.message.user {
  background: var(--highlight);
  color: #0B2559;
  align-self: flex-end;
}

/* Mensagens da IA */
.message.bot {
  background: #f1e3cc;
  color: #573100;
  align-self: flex-start;
}

/* Formulário do chat */
.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0; /* garante que não suma */
  z-index: 12;
}

/* Textarea do usuário */
.chat-form textarea {
  flex: 1;
  padding: 5px 16px;
  border-radius: 100px;
  border: 2px solid #ccc;
  font-size: 1rem;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
  background: #fff;
  color: #111;
}

/* Botão de enviar */
.chat-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: none;
  border-radius: 100px;
  background: var(--highlight);
  cursor: pointer;
  transition: background 0.2s;
}

.chat-form button:hover {
  background: #0B2559;
}

.chat-form button svg {
  width: 24px;
  height: 24px;
  stroke: #111;
}

.chat-form button svg:hover {
  stroke: #fff;
}

/* Botão desativado durante loading */
.chat-form button.disabled {
  background-color: black;
  color: white;
  cursor: not-allowed;
}

.chat-form button.disabled svg {
  stroke: white;
}

/* Mensagem de digitação */
.chat-form button.typing {
  background-color: #222;
  cursor: not-allowed;
}

.chat-form button.typing svg {
  fill: white;
  stroke: none;
}

/* Mensagem inicial */
.welcome-message h2 {
  font-size: 2.1rem;
  font-weight: 600;
  color: #111;
  text-align: center;
  margin-top: 20%;
}

/* Scrollbar estilizada */
.chat-box::-webkit-scrollbar {
  width: 8px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}

.chat-box::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
}

/* =========================
   MOBILE / RESPONSIVO
   ========================= */
@media (max-width: 768px) {
  .chat-container {
    position: absolute; /* antes era fixed */
    top: 64px; 
    left: 0;
    width: 100vw;
    height: calc(100vh - 64px);
    margin: 0;
    border-radius: 0;
    padding: 10px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    background: #f5f5f500;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0);
  }

  .chat-form {
    margin-top: auto;
    padding: 10px 0;
    background: #f5f5f557;
    backdrop-filter: blur(12px);
    box-shadow: 20px 8px 20px rgba(0, 0, 0, 0);
    position: fixed; /* adicionado */
    bottom: 0;         /* sempre grudado na parte inferior */
  }

  header {
    position: fixed;
    background-color: #f5f5f557;
    backdrop-filter: blur(12px);
    top: 0
  }
}


main {
  text-align: left;
}

.welcome-message {
  text-align: center;
}

