/* chatbot.css */

/* Variáveis de Cores (Opcional, mas bom para consistência) */
:root {
    --chat-blue: #A7D9EE; /* Azul mais claro para o balão do bot */
    --chat-green: #C6EDC6; /* Verde mais claro para o balão do usuário */
    --chat-dark-blue: #007bff; /* Azul primário para botões/cabeçalho */
    --chat-dark-green: #28a745; /* Verde primário */
    --chat-bg: #f5f5f5; /* Fundo do chat */
    --text-color: #333;
    --border-color: #ccc;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

/* Botão Flutuante do Chat */
.chatbot-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--chat-dark-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px var(--shadow-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.chatbot-toggle-button:hover {
    transform: scale(1.05);
}

/* Container Principal do Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 16px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: translateY(100%) scale(0.9); /* Escondido e reduzido */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.chatbot-container.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Cabeçalho do Chatbot */
.chatbot-header {
    background-color: var(--chat-dark-blue);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 1.1em;
}

.chatbot-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

/* Área de Mensagens */
.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 15px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.9em;
}

.chatbot-message.bot {
    align-self: flex-start;
    background-color: var(--chat-blue);
    color: var(--text-color);
    border-bottom-left-radius: 3px;
}

.chatbot-message.user {
    align-self: flex-end;
    background-color: var(--chat-green);
    color: var(--text-color);
    border-bottom-right-radius: 3px;
}

/* Indicador de Digitação */
.chatbot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-style: italic;
    font-size: 0.8em;
    color: #666;
    align-self: flex-start;
}

.chatbot-typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #666;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.chatbot-typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Sugestões Rápidas */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-top: 1px solid var(--border-color);
}

.chatbot-suggestion-button {
    background-color: var(--chat-dark-green);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
}

.chatbot-suggestion-button:hover {
    background-color: #218838;
}

/* Área de Input */
.chatbot-input-area {
    display: flex;
    border-top: 1px solid var(--border-color);
    padding: 10px;
    background-color: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.chatbot-input-area input[type="text"] {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9em;
    outline: none;
    margin-right: 10px;
}

.chatbot-input-area button {
    background-color: var(--chat-dark-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chatbot-input-area button:hover {
    background-color: #0056b3;
}

/* Informações de Emergência (sempre visível) */
.chatbot-emergency-info {
    position: absolute; /* Ajuste para dentro do container do chat, ou fixo na tela */
    bottom: 5px; /* Ajuste a posição conforme necessário */
    left: 15px; /* Ajuste a posição conforme necessário */
    right: 15px; /* Ajuste a posição conforme necessário */
    text-align: center;
    font-size: 0.75em;
    color: #888;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

/* Responsividade */
@media (max-width: 768px) {
    .chatbot-container {
        width: 90%;
        height: 80%;
        bottom: 10px;
        right: 5%;
        left: 5%;
        max-width: unset; /* Remove max-width para ocupar mais espaço em mobile */
        max-height: unset; /* Remove max-height */
    }
    .chatbot-toggle-button {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}