
/* CSS ESPECÍFICO DO CHAT */

body {
    background-color: #0d223a; /* Fallback se var falhar */
    background-image: var(--cor-fundo);
    color: #d1d9e6; /* Fallback */
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 1rem;
}

.chat-header {
    text-align: center;
    background: #122b45; /* Fallback var(--fundo-form) */
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(13,34,58,0.25);
}

.chat-header h1 {
    color: #0088cc; /* Cor principal */
    margin: 0;
    font-size: 2rem;
    letter-spacing: 1px;
}

.chat-header p {
    margin: 0.5rem 0 0 0;
    color: #b3c7e6;
    font-size: 1.1rem;
}

#chat-container {
    background: #122b45;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(13,34,58,0.25);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 500px;
}

#chat {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: #0088cc;
    color: #fff;
    border-bottom-right-radius: 6px;
}

.message.bot .message-bubble {
    background: #1a263a;
    color: #e3f2fd;
    border-bottom-left-radius: 6px;
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-dots {
    display: flex;
    gap: 3px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0088cc;
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

.input-section {
    background: #1a263a;
    padding: 1.5rem;
    border-top: 1px solid #2a3a52;
}

.input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#mensagem {
    flex: 1;
    padding: 1rem 1.2rem;
    border: 2px solid #2a3a52;
    border-radius: 25px;
    background: #122b45;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#mensagem:focus {
    border-color: #0088cc;
}

#mensagem::placeholder {
    color: #b3c7e6;
    opacity: 0.7;
}

.send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #0088cc;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%23ffffff'%3E%3Cpath d='M120-160v-640l760 320-760 320Zm80-120 474-200-474-200v140l240 60-240 60v140Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.send-button:hover {
    background-color: #1976d2;
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Scrollbar */
#chat::-webkit-scrollbar { width: 6px; }
#chat::-webkit-scrollbar-track { background: #1a263a; }
#chat::-webkit-scrollbar-thumb { background: #0088cc; border-radius: 3px; }

@media (max-width: 768px) {
    .chat-header h1 { font-size: 1.5rem; }
    .message-bubble { max-width: 85%; }
    #chat { padding: 1rem; }
}
