/* ==========================================
   CHATBOT FLUTUANTE IOJ (CORES SUAVES E PREMIUM)
   ========================================== */
.chatbot-trigger-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px; 
    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* BLINDAGEM DO BOTÃO: Forçando ele a ser um círculo perfeito */
#btn-chat-trigger {
    width: 65px !important;
    height: 65px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-image: linear-gradient(135deg, #8fb6e0 0%, #e1ecf1 100%); /* Degradê Predominante para Secundária */
    box-shadow: 0 4px 15px rgba(143, 182, 224, 0.4) !important; /* Sombra baseada no Predominante */
}

#btn-chat-trigger:hover {
    background-color: #8fb6e0 !important; /* Predominante puro no hover */
    background-image: none !important;
    transform: scale(1.05) !important;
}

/* Centralizando o ícone perfeitamente - Ajustado para cor escura para dar contraste */
#btn-chat-trigger i {
    font-size: 32px !important;
    line-height: normal !important;
    margin: 0 !important;
    color: #154880 !important; /* Ícone Auxiliar (Escuro) */
}

/* BLINDAGEM DA INVISIBILIDADE (Para não aparecer antes do scroll) */
.hidden-notification, .hidden-chat {
    opacity: 0 !important;
    transform: scale(0) !important;
    pointer-events: none !important;
    visibility: hidden !important; 
}

/* O Balãozinho de Notificação */
.chat-notification {
    background-color: #fff !important;
    color: #154880 !important; 
    padding: 12px 20px !important;
    border-radius: 20px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    margin-bottom: 15px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    position: relative;
    cursor: pointer;
    border: 1px solid #e1ecf1 !important; 
    transition: all 0.3s ease !important;
    transform-origin: bottom left !important;
    white-space: nowrap !important;
    display: block !important; 
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

.chat-notification span {
    color: #154880 !important; 
    font-weight: 700 !important;
}

/* A perninha do balão */
.notification-tail {
    position: absolute;
    bottom: -8px;
    left: 25px; 
    width: 0; 
    height: 0; 
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

/* A Janela do Chat */
.chatbot-window {
    position: fixed;
    bottom: 110px !important; 
    left: 30px !important;
    width: 350px !important;
    max-width: calc(100vw - 40px) !important;
    height: 500px !important;
    max-height: calc(100vh - 120px) !important;
    background: #e1ecf1 !important; /* Fundo Secundária */
    border-radius: 15px !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform-origin: bottom left !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 10px 40px rgba(21, 72, 128, 0.2) !important; 
}

/* CABEÇALHO DO CHAT */
.chatbot-header {
    background: linear-gradient(135deg, #8fb6e0, #e1ecf1) !important; /* Degradê Predominante -> Secundária */
    color: #154880 !important; /* Texto Escuro Auxiliar para leitura no fundo claro */
    padding: 15px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.chatbot-title {
    display: flex !important;
    align-items: center !important;
    font-family: 'Orbitron', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #154880 !important; /* Texto Escuro Auxiliar */
}

.chatbot-title i { margin-right: 10px !important; color: #154880 !important; }

#btn-close-chat {
    color: #154880 !important; /* Ícone de fechar Escuro Auxiliar */
    padding: 0 !important;
    line-height: 1 !important;
    height: auto !important;
}

.chatbot-body {
    flex-grow: 1 !important;
    padding: 20px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
}

.chat-msg {
    max-width: 85% !important;
    padding: 12px 16px !important;
    border-radius: 15px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    animation: fadeInUp 0.3s ease !important;
}

.chat-msg.bot {
    background: #fff !important;
    color: #154880 !important; 
    align-self: flex-start !important;
    border-bottom-left-radius: 5px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

.chatbot-footer {
    background: #fff !important;
    padding: 10px 15px !important;
    display: flex !important;
    align-items: center !important;
    border-top: 1px solid #e1ecf1 !important; 
}

#chat-input {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: 40px !important;
    color: #154880 !important; 
}

/* Limpa as flutuações das mensagens do chat */
#chat-messages::after {
    content: "";
    clear: both;
    display: table;
}
#chat-messages {
    padding: 15px;
    height: 350px; 
    overflow-y: auto;
    background-color: #ffffff;
}

#btn-send-chat { color: #8fb6e0 !important; padding: 0 10px !important; } /* Botão de envio Predominante */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeInUp 0.3s ease;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #8fb6e0; 
    border-radius: 50%;
    animation: bounce 1.3s linear infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: -1.1s; }
.typing-indicator span:nth-child(3) { animation-delay: -0.9s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

@media (max-width: 600px) {
    .chatbot-window { left: 20px !important; bottom: 100px !important; }
    .chatbot-trigger-wrapper { left: 20px !important; bottom: 20px !important; }
}