#vec-chat-widget-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: 'Inter', 'Roboto', sans-serif;
    --chat-primary-color: #3498db; /* Default, overridden by inline style */
}

#vec-chat-widget-container.vec-chat-position-right {
    right: 20px;
}

#vec-chat-widget-container.vec-chat-position-left {
    left: 20px;
}

/* O Botão Flutuante */
#vec-chat-toggle-btn {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background-color: var(--chat-primary-color) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

#vec-chat-toggle-btn svg {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
}

#vec-chat-toggle-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3) !important;
}

#vec-chat-toggle-btn.vec-chat-has-custom-icon {
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#vec-chat-toggle-btn.vec-chat-has-custom-icon img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    object-fit: contain !important;
}

/* A Janela do Chat */
#vec-chat-window {
    position: absolute;
    bottom: 80px;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Alinhamento e Origem de Transformação */
.vec-chat-position-right #vec-chat-window {
    right: 0;
    transform-origin: bottom right;
}

.vec-chat-position-left #vec-chat-window {
    left: 0;
    transform-origin: bottom left;
}

#vec-chat-window.vec-chat-hidden {
    opacity: 0;
    transform: scale(0.9);
    visibility: hidden;
    pointer-events: none;
}

#vec-chat-window.vec-chat-visible {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    pointer-events: auto;
}

/* Cabeçalho */
#vec-chat-header {
    background: var(--chat-primary-color);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.vec-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    background: #ffffff; /* Fundo branco para garantir que GIFs transparentes não fiquem escuros */
}

.vec-chat-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

#vec-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.vec-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vec-chat-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

#vec-chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#vec-chat-close-btn:hover {
    opacity: 1;
}

/* Área de Mensagens */
#vec-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vec-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

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

.vec-message-bot a {
    color: var(--chat-primary-color);
    text-decoration: underline;
}

.vec-message-user {
    background: var(--chat-primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(var(--chat-primary-color), 0.2);
}

/* Indicador de Digitação (Typing) */
.vec-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.vec-typing-indicator span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: vec-bounce 1.4s infinite ease-in-out both;
}

.vec-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.vec-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes vec-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
#vec-chat-input-area {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

#vec-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
    color: #0f172a;
}

#vec-chat-input:focus {
    border-color: var(--chat-primary-color);
}

#vec-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chat-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

#vec-chat-send-btn:hover {
    transform: scale(1.05);
    background-color: var(--chat-primary-color); /* Pode-se aplicar filtro brightness aqui */
    filter: brightness(1.1);
}

#vec-chat-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    #vec-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        position: fixed;
    }

    #vec-chat-toggle-btn {
        bottom: 20px;
        right: 20px;
        z-index: 9999999;
    }
}
