/* backend/static/css/chatbot.css */

.chatbot-container {
    position: fixed;
    /* --- INÍCIO DA CORREÇÃO DE LAYOUT --- */
    bottom: 40px; /* Aumentado de 30px para 40px para evitar cortes */
    /* --- FIM DA CORREÇÃO DE LAYOUT --- */
    right: 20px;
    z-index: 1055; /* Alto para ficar sobre outros elementos */
}
.chatbot-toggle-button {
    /* --- INÍCIO DA CORREÇÃO DE LAYOUT --- */
    width: 45px;  /* Reduzido de 60px para 45px (75%) */
    height: 45px; /* Reduzido de 60px para 45px (75%) */
    /* --- FIM DA CORREÇÃO DE LAYOUT --- */
    border-radius: 50%;
    background-color: transparent;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
#rhafael-avatar-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.chatbot-toggle-button:hover {
    transform: scale(1.1);
}
.chatbot-window {
    display: none;
    position: absolute;
    /* --- INÍCIO DA CORREÇÃO DE LAYOUT --- */
    bottom: 65px; /* Ajustado para alinhar com o novo tamanho do botão (45px + 20px de margem) */
    /* --- FIM DA CORREÇÃO DE LAYOUT --- */
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dee2e6;
    transition: width 0.3s ease, height 0.3s ease;
}

.chatbot-window.chatbot-window-large {
    width: 450px;
    height: 650px;
}

.chatbot-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chatbot-header h5 {
    margin: 0;
    font-family: var(--font-family-headings);
}
.chatbot-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.message {
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.4;
}
.message.user {
    background-color: #0d6efd;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
    max-width: 90%;
}
.message.model {
    background-color: #e9ecef;
    color: #212529;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    max-width: 90%;
}
.chatbot-input-form {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
}
.chatbot-input-form input {
    flex-grow: 1;
}
.chatbot-spinner {
    display: none; /* Escondido por padrão */
    align-self: flex-start;
}

/* --- INÍCIO: Estilos para o Chat Proativo --- */
.proactive-chat-container {
    display: none; /* Começa oculto */
    position: fixed;
    inset: 0;
    z-index: 1060; /* Acima do chatbot normal */
    justify-content: flex-end;
    align-items: flex-end;
}
.proactive-chat-container.visible {
    display: flex; /* Mostra o container */
}
.proactive-chat-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
}
.proactive-chat-box {
    position: relative;
    width: 380px;
    max-width: 90vw;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    margin: 20px;
    /* --- INÍCIO DA CORREÇÃO DE LAYOUT --- */
    margin-bottom: 105px; /* Ajustado para alinhar com a nova posição do botão (40px + 45px + 20px) */
    /* --- FIM DA CORREÇÃO DE LAYOUT --- */
    padding: 1.5rem;
    animation: slideUp 0.8s ease-out;
    border: 1px solid #dee2e6;
}
#proactive-chat-content h5 {
    font-family: var(--font-family-headings);
    font-weight: 600;
    color: #333;
}
#proactive-chat-content p, #proactive-chat-content li {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}
#proactive-chat-content ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
#proactive-chat-content .privacy-link {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    margin-top: 1rem;
}
.proactive-chat-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.2rem;
}
.proactive-chat-actions .btn {
    width: 100%;
    padding: 0.6rem;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* --- FIM: Estilos para o Chat Proativo --- */

.message.model.fade-in {
  opacity: 0;
  animation: fadeInMessage 0.4s ease forwards;
}

@keyframes fadeInMessage {
  to { opacity: 1; }
}

/* --- INÍCIO DA ALTERAÇÃO CIRÚRGICA (EFEITO DIGITAÇÃO) --- */
.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1rem;
    background-color: #333;
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: 2px;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: #333; }
}
/* --- FIM DA ALTERAÇÃO CIRÚRGICA (EFEITO DIGITAÇÃO) --- */