/* VX Chat Internal Widget Style - v9 DEFINITIVE POSITION & PARAGRAPH FIX */
:root {
    --vx-blue: #00B4D8;
    --vx-dark: #1a1a1a;
    --vx-light: #f4f4f4;
}

/* Container principal - Remove larguras rígidas para não prender o layout nas bordas */
.wp-wa-auto-container {
    position: fixed !important;
    bottom: 20px !important;
    z-index: 9999999 !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    line-height: normal !important;
}

/* CORREÇÃO CRÍTICA DO CONTAINER: Modifica dinamicamente a posição global baseada no Painel do WP */
.wp-wa-auto-right { right: 20px !important; left: auto !important; }
.wp-wa-auto-left { left: 20px !important; right: auto !important; }

/* Botão Flutuante Circular */
.wp-wa-auto-float {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    background-color: var(--vx-blue) !important;
    position: relative !important;
}

.wp-wa-auto-float:hover { transform: scale(1.1) !important; }

/* Ícone SVG dentro do botão do WhatsApp */
.wp-wa-auto-float svg {
    width: 32px !important;
    height: 32px !important;
    fill: white !important;
    display: block !important;
}

/* Notificação Vermelha */
.wp-wa-auto-float.has-notification::after {
    content: '1' !important;
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    background: #ff3b30 !important;
    color: white !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    border: 2px solid white !important;
}

/* Janela de Chat - Caixa do diálogo principal */
.wp-wa-auto-box {
    position: fixed !important;
    bottom: 90px !important;
    width: 320px !important;
    height: 450px !important;
    max-height: 80vh !important;
    background: white !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

/* CORREÇÃO CRÍTICA DA CAIXA: Zera o lado oposto ('auto') para destravar e mover perfeitamente */
.wp-wa-auto-right .wp-wa-auto-box { right: 20px !important; left: auto !important; }
.wp-wa-auto-left .wp-wa-auto-box { left: 20px !important; right: auto !important; }

.wp-wa-auto-box.active {
    display: flex !important;
    animation: wpWaFadeUp 0.3s ease !important;
}

/* Cabeçalho do Chat */
.wp-wa-auto-header {
    padding: 15px !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background-color: var(--vx-blue) !important;
}

.wp-wa-auto-header-info { display: flex !important; align-items: center !important; }

.wp-wa-auto-avatar {
    width: 35px !important;
    height: 35px !important;
    background: rgba(255,255,255,0.2) !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
}

.wp-wa-auto-info h4 { margin: 0 !important; font-size: 15px !important; color: white !important; }
.wp-wa-auto-info span { font-size: 11px !important; opacity: 0.9 !important; color: white !important; }

.wp-wa-auto-close {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 0 5px !important;
}

/* Corpo e Área interna de Mensagens */
.wp-wa-auto-body {
    flex: 1 !important;
    padding: 15px !important;
    background: #f0f2f5 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* CLASSE DAS BOLHAS DE CHAT - CORREÇÃO DE FORMATAÇÃO E PARÁGRAFOS */
.msg {
    max-width: 85% !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;       /* Garante uma leitura confortável */
    position: relative !important;
    white-space: pre-wrap !important;   /* OBRIGATÓRIO: Força o navegador a respeitar os Enters/Parágrafos da IA */
    word-break: break-word !important;  /* Evita que textos longos quebrem o design */
}

/* Links automáticos criados pelo JS dentro das bolhas */
.msg a {
    color: #0ea5b7 !important;
    text-decoration: underline !important;
    font-weight: bold !important;
    word-break: break-all !important;
}

.msg-bot {
    align-self: flex-start !important;
    background: white !important;
    color: #333 !important;
}

.msg-bot a { color: #0ea5b7 !important; }
.msg-user a { color: #ffffff !important; }

.msg-user {
    align-self: flex-end !important;
    background: var(--vx-blue) !important;
    color: white !important;
}

.msg-time {
    font-size: 9px !important;
    opacity: 0.6 !important;
    display: block !important;
    text-align: right !important;
    margin-top: 6px !important;
}

/* Rodapé / Input de Mensagens */
.wp-wa-auto-input-area {
    padding: 10px !important;
    background: white !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-top: 1px solid #eee !important;
}

.wp-wa-auto-input-area input {
    flex: 1 !important;
    border: 1px solid #ddd !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    outline: none !important;
    font-size: 13px !important;
}

/* Botão Redondo de Envio (Estilo Seta do WhatsApp) */
.wp-wa-auto-send-btn {
    background: #0ea5b7 !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

.wp-wa-auto-send-btn svg {
    width: 18px !important;
    height: 18px !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* Efeito de carregamento / Digitando */
.wp-wa-auto-body .vxchat-typing {
    opacity: .8 !important;
    font-style: italic !important;
}

/* Animação de Entrada do Chat */
@keyframes wpWaFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Suporte à Responsividade Mobile */
@media (max-width: 400px) {
    .wp-wa-auto-box {
        width: calc(100vw - 40px) !important;
    }
}