/* Estilos para o LCM AI ChatBot */
:root {
    --lcm-chat-primary-color: #007bff; /* Cor principal (ex: azul) */
    --lcm-chat-header-text-color: #ffffff;
    --lcm-chat-background-color: #ffffff;
    --lcm-chat-width: 350px;
    --lcm-chat-height: 500px;
    --lcm-chat-user-msg-bg: #007bff;
    --lcm-chat-user-msg-text: #ffffff;
    --lcm-chat-bot-msg-bg: #f1f0f0;
    --lcm-chat-bot-msg-text: #000000;
    --lcm-chat-spacing: 20px;
}

#lcm-ai-chat-wrap {
    position: fixed;
    left: 5px; /* Posição ajustada conforme solicitado */
    bottom: var(--lcm-chat-spacing);
    width: var(--lcm-chat-width);
    max-width: calc(100% - (var(--lcm-chat-spacing) * 2));
    max-height: calc(100vh - (var(--lcm-chat-spacing) * 2));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 999999;
}

/* Ícone flutuante para abrir o chat */
#lcm-ai-chat-toggler {
    position: absolute; /* Garante que não interfira com a janela */
    left: 0;
    bottom: 0;
    width: 60px;
    height: 60px;
    background-color: var(--lcm-chat-primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out, opacity 0.3s, visibility 0.3s;
}
#lcm-ai-chat-toggler:hover { transform: scale(1.1); }

/* Bolinha verde 'online' com animação de pulso */
#lcm-ai-chat-toggler::after {
    content: '';
    position: absolute;
    right: 2px; /* Posição da bolinha */
    bottom: 2px; /* Posição da bolinha */
    width: 15px; /* Tamanho da bolinha */
    height: 15px; /* Tamanho da bolinha */
    border-radius: 50%;
    background-color: #28a745; /* Verde */
    box-sizing: border-box;
    animation: lcm-pulse 2s infinite;
}

@keyframes lcm-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

#lcm-ai-chat-toggler img { width: 100%; height: auto; border-radius: 50%; }

#lcm-ai-chat-window { position: relative; bottom: 0; left: 0; width: 100%; background: var(--lcm-chat-background-color); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); overflow: hidden; display: flex; flex-direction: column; height: 100%; max-height: var(--lcm-chat-height); transition: opacity 0.3s, transform 0.3s; transform-origin: bottom left; }

#lcm-ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    color: var(--lcm-chat-header-text-color);
    background: var(--lcm-chat-primary-color);
}

.lcm-ai-header-logo {
    height: 30px;
    width: 30px;
    border-radius: 50%;
}

.lcm-ai-header-title {
    font-weight: normal; /* Garante que o texto não fique em negrito por padrão */
}

/* Remove a margem do parágrafo no cabeçalho para reduzir o espaçamento */
.lcm-ai-header-title p {
    margin: 0;
    padding: 0;
}

#lcm-ai-chat-close-btn {
    background: none;
    border: none;
    color: var(--lcm-chat-header-text-color);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Estilização da barra de rolagem (para navegadores WebKit) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
    border: 2px solid transparent;
}

::-webkit-scrollbar-button { display: none; }

/* Área de Mensagens */
#lcm-ai-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lcm-ai-msg {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
}

.lcm-ai-msg.user {
    background-color: var(--lcm-chat-user-msg-bg);
    color: var(--lcm-chat-user-msg-text);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.lcm-ai-msg.bot {
    background-color: var(--lcm-chat-bot-msg-bg);
    color: var(--lcm-chat-bot-msg-text);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

/* Estilo para imagens dentro da mensagem do bot (thumbnails) */
.lcm-ai-msg.bot img {
    max-width: 100%;
    display: block; /* Garante que a imagem se comporte como um bloco */
    border-radius: 8px; /* Bordas arredondadas para um visual mais suave */
}

/* Indicador de "digitando" */
.lcm-ai-typing-indicator {
    padding: 12px 15px;
}
.lcm-ai-typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: lcm-ai-typing-anim 1.4s infinite both;
}
.lcm-ai-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.lcm-ai-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.lcm-ai-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lcm-ai-typing-anim {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}


/* Estilos para as sugestões iniciais */
.lcm-ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.lcm-ai-suggestion-btn {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    width: 100%;
}

.lcm-ai-suggestion-btn:hover {
    background-color: #f7f7f7;
    border-color: var(--lcm-chat-primary-color);
}

.lcm-ai-suggestion-btn strong {
    display: block;
    font-weight: bold;
    color: #333;
}

.lcm-ai-suggestion-btn span {
    font-size: 0.9em;
    color: #666;
}

/* Rodapé com formulário e disclaimer */
#lcm-ai-chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
}

/* Formulário de Input */
#lcm-ai-chat-form {
    position: relative; /* Necessário para posicionar o botão */
    display: flex;
    align-items: flex-end;
}

#lcm-ai-chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 40px 10px 15px; /* Aumentado padding-right para o botão */
    font-size: 14px;
    outline: none;
    resize: none; /* Impede que o usuário redimensione */
    min-height: 42px; /* Altura inicial */
    max-height: 140px; /* Altura máxima aumentada conforme solicitado */
    line-height: 1.4;    
}
#lcm-ai-chat-input:focus { border-color: var(--lcm-chat-primary-color); }

#lcm-ai-chat-form button {
    position: absolute; /* Posiciona o botão sobre a textarea */
    right: 5px;
    bottom: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcm-ai-send-icon {
    width: 20px;
    height: 20px;
    fill: var(--lcm-chat-primary-color); /* Usa 'fill' para colorir o SVG */
}

/* Disclaimer */
.lcm-ai-disclaimer { font-size: 11px; color: #999; text-align: center; margin: 8px 0 0; padding: 0; }

/* Classe para ocultar/mostrar a janela */
.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
    visibility: hidden;
}