:root {
    --chat-main-color: #007bff; /* Azul vivo padrão */
    --chat-bg: #f5f5f5;
    --chat-text: #333;
    --chat-bot-msg: #ffffff;
    --chat-user-msg: var(--chat-main-color);
    --chat-user-text: #ffffff;
    --pulse-color: #25D366; /* Verde para o círculo piscante */
}

/* Container & Floating Button */
.ai-chat-container {
    position: fixed;
    bottom: 25px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ai-chat-container.pos-right { right: 25px; }
.ai-chat-container.pos-left { left: 25px; }

/* Botão Redondo e Piscante */
.ai-chat-toggle {
    background-color: #007bff; /* Azul Vivo */
    color: white;
    border: none;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    transition: transform 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
}

/* Círculo Verde Piscante (Animação de Atenção) */
.ai-chat-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--pulse-color);
    opacity: 0.6;
    z-index: -1;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Imagem da Menina / Avatar no Botão */
.ai-chat-avatar-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.ai-chat-icon-fallback {
    font-size: 30px;
}

/* Janela de Chat */
.ai-chat-window {
    position: absolute;
    bottom: 85px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.ai-chat-container.pos-right .ai-chat-window { right: 0; }
.ai-chat-container.pos-left .ai-chat-window { left: 0; }

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

/* Header */
.ai-chat-header {
    background: var(--chat-main-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar-header {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-chat-avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-chat-status { display: flex; flex-direction: column; }
.ai-chat-name { font-weight: 600; font-size: 15px; }
.ai-chat-online { font-size: 11px; opacity: 0.9; }
.ai-chat-close { background: none; border: none; color: white; font-size: 28px; cursor: pointer; }

/* Mensagens */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.ai-message-bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ai-message-user {
    align-self: flex-end;
    background: var(--chat-main-color);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Footer & Input */
.ai-chat-footer { padding: 15px; background: white; border-top: 1px solid #eee; }
.ai-chat-input-wrapper {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid #dee2e6;
}

.ai-chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    font-size: 14px;
    outline: none;
    max-height: 80px;
}

.ai-chat-send { color: var(--chat-main-color); background: none; border: none; cursor: pointer; display: flex; align-items: center; }

/* WhatsApp */
.ai-chat-whatsapp-btn {
    display: block;
    background: #25D366;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

/* Mobile Responsivo - Ajuste de Tela Cheia */
@media (max-width: 480px) {
    .ai-chat-container {
        bottom: 15px;
    }
    .ai-chat-container.pos-right { right: 15px; }
    .ai-chat-container.pos-left { left: 15px; }

    .ai-chat-window {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        z-index: 100000;
    }

    .ai-chat-header {
        padding: 20px 15px;
        border-radius: 0;
    }

    .ai-chat-messages {
        padding: 15px;
    }

    .ai-chat-footer {
        padding: 15px 15px 30px 15px; /* Espaço extra para teclados mobile */
    }

    .ai-chat-toggle {
        width: 60px;
        height: 60px;
    }
}
