/* Prefixo global para evitar conflitos com outros plugins */
.wp-flow-plugin {
    /* Variáveis globais aprimoradas */
    --wp-flow-primary-color: #2196F3;
    --wp-flow-secondary-color: #1976D2;
    --wp-flow-text-color: #333;
    --wp-flow-bg-color: #fff;
    --wp-flow-border-color: #e1e8ed;
    --wp-flow-shadow: 0 8px 25px rgba(0,0,0,0.15);
    --wp-flow-border-radius: 16px;
    --wp-flow-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --wp-flow-message-spacing: 12px;
    --wp-flow-chat-width: 420px;
    --wp-flow-chat-height: 600px;
}

/* Classe para ocultar elementos */
.wp-flow-plugin .hidden, 
.wp-flow-plugin .google-visualization-orgchart-nodesel {
    display: none !important;
}

/* Flowchart nodes - mantido original */
.wp-flow-plugin .flowchart-node {
    position: relative;
    padding: 10px;
    border: 1px solid var(--wp-flow-border-color, #ccc);
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--wp-flow-transition);
}

.wp-flow-plugin .flowchart-node:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.wp-flow-plugin .flowchart-node .edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--wp-flow-text-color, #333);
    transition: var(--wp-flow-transition);
    padding: 4px;
    border-radius: 4px;
}

.wp-flow-plugin .flowchart-node .edit-icon:hover {
    color: var(--wp-flow-primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.wp-flow-plugin .flowchart-node .node-text {
    margin-top: 20px;
}

.wp-flow-plugin .support-button {
    background: linear-gradient(135deg, var(--wp-flow-primary-color, #2196F3), var(--wp-flow-secondary-color, #1976D2));
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: var(--wp-flow-transition);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.wp-flow-plugin .support-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Contêiner para o ícone do bot e o botão de áudio */
.wp-flow-plugin .bot-message .icon-container {
    margin-right: 12px;
}

/* Wrapper para posicionar o botão de áudio sobre o ícone - MELHORADO */
.wp-flow-plugin .icon-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
}

/* Ícone do bot - MELHORADO */
.wp-flow-plugin .bot-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 2px solid white;
    transition: var(--wp-flow-transition);
}

/* Botão de áudio sobre o ícone - MUITO MELHORADO */
.wp-flow-plugin .audio-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--wp-flow-transition);
    opacity: 0.7;
    z-index: 2;
}

.wp-flow-plugin .icon-wrapper:hover .audio-button {
    opacity: 1 !important;
    opacity: 1;
}

.wp-flow-plugin .audio-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--wp-flow-primary-color);
}

.wp-flow-plugin .audio-button img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Estilos para o contêiner do texto - mantido */
.wp-flow-plugin .text-container {
    display: block;
}

/* Estilos para o contêiner do botão de áudio - mantido */
.wp-flow-plugin .audio-container {
    margin-top: 5px;
    text-align: left;
}


/* Adicione esta regra no final do seu CSS */
.wp-flow-plugin div#chatTeaser {
    bottom: 50px !important;
    position: fixed !important;
    right: 80px !important;
}

/* Estilos para o Teaser do Chat - CORRIGIDO */
.wp-flow-plugin #chatTeaser {
    position: fixed !important;
    bottom: 50px !important; /* Garante que fica acima do ícone */
    right: 40px !important;
    background: white;
    padding: 10px 15px;
    border-radius: var(--wp-flow-border-radius, 10px);
    box-shadow: var(--wp-flow-shadow, 0 2px 5px rgba(0, 0, 0, 0.2));
    max-width: 250px;
    z-index: 1000;
    opacity: 0;
    animation: fadeInTeaser 1s forwards;
    animation-delay: 2s;
    transition: opacity 0.5s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Desktop e tablets maiores */
@media (min-width: 769px) {
    .wp-flow-plugin #chatTeaser {
        bottom: 50px !important; /* Bem acima do ícone em desktop */
        right: 50px;
        max-width: 250px;
    }
}

/* Tablets pequenos */
@media (max-width: 768px) and (min-width: 481px) {
    .wp-flow-plugin #chatTeaser {
        bottom: 50px !important; /* Ajustado para tablet */
        right: 50px;
        max-width: calc(100vw - 120px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .wp-flow-plugin #chatTeaser {
        bottom: 50px !important; /* Ajustado para mobile */
        right: 50px;
        max-width: calc(100vw - 100px);
        padding: 8px 12px;
    }
}


/* Para garantir que funcione em todos os dispositivos */
@media screen {
    .wp-flow-plugin div#chatTeaser {
        bottom: 50px !important;
    }
}

@media screen and (max-width: 768px) {
    .wp-flow-plugin div#chatTeaser {
        bottom: 50px !important;
    }
}

@media screen and (max-width: 480px) {
    .wp-flow-plugin div#chatTeaser {
        bottom: 50px !important;
    }
}

/* CORREÇÃO 2: Efeito de degradê limitado apenas ao teaser */
.wp-flow-plugin #chatTeaser::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.1), transparent);
    transition: left 0.8s ease;
    pointer-events: none; /* NOVO: Garante que não interfira com cliques */
    z-index: 1; /* NOVO: Garante que fique atrás do conteúdo */
}

.wp-flow-plugin #chatTeaser:hover::before {
    left: 100%;
}

.wp-flow-plugin #chatTeaser:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.wp-flow-plugin #chatTeaser .text {
    position: relative;
    z-index: 2;
}


.wp-flow-plugin #chatTeaser::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Animação melhorada para o teaser */
@keyframes slideInTeaser {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Garantir que o teaser seja visível mesmo se a animação falhar */
.wp-flow-plugin #chatTeaser.force-visible {
    opacity: 1 !important;
    animation: none !important;
    transform: translateY(0) scale(1) !important;
}

/* Esconder o teaser quando necessário */
.wp-flow-plugin #chatTeaser.hidden {
    display: none !important;
}

/* Container do ícone do chat - CORRIGIDO */
.wp-flow-plugin #chatIconContainer {
    position: fixed;
    bottom: 30px !important; /* Posição fixa para referência */
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--wp-flow-shadow, 0 2px 10px rgba(0,0,0,0.1));
    cursor: pointer;
    overflow: hidden;
    transition: var(--wp-flow-transition);
}


.wp-flow-plugin #chatIconContainer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.wp-flow-plugin #chatIconContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    border-radius: 50%;
}

/* Efeito de fade-in para o ícone do chat - CORRIGIDO */
.wp-flow-plugin #chatIcon {
    /* Removido width e height fixos - serão definidos dinamicamente via JavaScript */
    cursor: pointer;
    opacity: 0;
    animation: fadeInIcon 1s forwards;
    animation-delay: 2s;
    position: relative;
    border-radius: 50%;
    object-fit: cover;
}

/* Keyframes para o fade-in do ícone */
@keyframes fadeInIcon {
    to {
        opacity: 1;
    }
}

/* Indicador online - CORRIGIDO */
.wp-flow-plugin #chatIconContainer::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background-color: #2ecc71;
    border-radius: 50%;
    z-index: 1000;
}

@keyframes pulse-online {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Container do Chat - CORRIGIDO */
.wp-flow-plugin #chatContainer {
    position: fixed;
    bottom: 50px;
    right: 10px;
    width: 400px;
    max-width: 420px;
    max-height: 420px;
    background: var(--wp-flow-bg-color, #fff);
    border: 0px solid var(--wp-flow-border-color, #ccc);
    border-radius: var(--wp-flow-border-radius, 10px);
    box-shadow: var(--wp-flow-shadow, 0 0 10px rgba(0, 0, 0, 0.1));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
    overflow: hidden;
}

.wp-flow-plugin #chatContainer.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Flowchat Container - melhorado */
.wp-flow-plugin #flowchat {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    border: none !important;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

/* Scrollbar personalizada */
.wp-flow-plugin #flowchat::-webkit-scrollbar {
    width: 6px;
}

.wp-flow-plugin #flowchat::-webkit-scrollbar-track {
    background: transparent;
}

.wp-flow-plugin #flowchat::-webkit-scrollbar-thumb {
    background: rgba(33, 150, 243, 0.3);
    border-radius: 3px;
}

.wp-flow-plugin #flowchat::-webkit-scrollbar-thumb:hover {
    background: rgba(33, 150, 243, 0.5);
}

/* Estilos do cabeçalho do chat - CORRIGIDO */
.wp-flow-plugin #chatHeader {
    display: flex;
    align-items: center;
    background-color: var(--wp-flow-primary-color, #2196F3);
    padding: 10px;
    border-top-left-radius: var(--wp-flow-border-radius, 10px);
    border-top-right-radius: var(--wp-flow-border-radius, 10px);
    position: relative;
    flex-shrink: 0;
}

/* Ícone do usuário no cabeçalho - CORRIGIDO */
.wp-flow-plugin .header-user-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 10px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    /* Tamanho será definido dinamicamente via JavaScript baseado no attendant_icon_size */
}

.wp-flow-plugin .header-user-wrapper img,
.wp-flow-plugin .header-user-wrapper .attendant-image,
.wp-flow-plugin #headerUserIcon {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    border: 2px solid white !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    background-color: var(--wp-flow-primary-color, #2196F3) !important;
    opacity: 1 !important;
    visibility: visible !important;
}


.wp-flow-plugin .header-user-wrapper video,
.wp-flow-plugin .header-user-wrapper .attendant-video,
.wp-flow-plugin .header-user-wrapper .wp-flow-video-background video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    border-radius: 50% !important;
    background-color: var(--wp-flow-primary-color, #000) !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: 2px solid white !important; /* ADICIONADO: borda branca igual às imagens */
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important; /* ADICIONADO: sombra igual às imagens */
}

.wp-flow-plugin .header-user-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 15px;
    height: 15px;
    background-color: #2ecc71;
    border-radius: 50%;
    z-index: 3;
    border: 2px solid white;
    pointer-events: none;
}

@media (max-width: 768px) {
    .wp-flow-plugin #chatTeaser {
        bottom: 110px !important; /* Ajustado para mobile */
        right: 20px;
        max-width: calc(100vw - 120px);
    }
    
    .wp-flow-plugin #chatIconContainer {
        bottom: 20px !important; /* Mantém posição fixa no mobile */
        right: 20px;
    }
}

@media (max-width: 480px) {
    .wp-flow-plugin #chatTeaser {
        bottom: 100px !important; /* Mais ajustado para telas muito pequenas */
        right: 15px;
        max-width: calc(100vw - 100px);
        padding: 8px 12px; /* Padding menor em telas pequenas */
    }
    
    .wp-flow-plugin #chatIconContainer {
        bottom: 15px !important;
        right: 15px;
    }
}

/* Container de fundo para vídeos - CORRIGIDO */
.wp-flow-plugin .wp-flow-video-background {
    border-radius: 50% !important;
    background-color: var(--wp-flow-primary-color, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
}

.wp-flow-plugin .header-user-wrapper .wp-flow-video-background {
    border-radius: 50% !important;
    background-color: var(--wp-flow-primary-color, #000) !important;
    display: block !important;
    overflow: hidden !important;
    position: relative !important;
    aspect-ratio: 1/1 !important;
    width: 100% !important;
    height: 100% !important;
     border: none !important; /* REMOVIDO: borda para evitar dupla borda */
    box-shadow: none !important; /* REMOVIDO: sombra para evitar dupla sombra */
}

/* Forçar exibição de todos os elementos de vídeo */
.wp-flow-plugin .wp-flow-video-background,
.wp-flow-plugin .wp-flow-video-background video,
.wp-flow-plugin video.bot-icon,
.wp-flow-plugin video.wp-flow-video {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Estilo para vídeos dentro do container */
.wp-flow-plugin .wp-flow-video-background video,
.wp-flow-plugin #headerUserIcon {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Garante que o vídeo cubra toda a área sem distorção */
    object-position: center center !important;
    display: block;
    position: absolute !important;
    top: 0;
    left: 0;
    border-radius: 50% !important; /* Força formato redondo para o vídeo também */
    background-color: var(--wp-flow-primary-color, #000);
}

/* Garantir que o botão de áudio funcione sobre vídeos */
.wp-flow-plugin .icon-wrapper .audio-button {
    opacity: 0.7 !important;
    z-index: 10 !important;
    background: rgba(33, 150, 243, 0.9) !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(33, 150, 243, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--wp-flow-transition) !important;
    backdrop-filter: blur(10px) !important;

    z-index: 10 !important; /* Maior z-index para ficar sobre o vídeo */
}

.wp-flow-plugin #headerUserIcon {
    border-radius: 50%;
    object-fit: cover;
    /* Tamanhos serão definidos dinamicamente via JavaScript baseado no attendant_icon_size */
}


.wp-flow-plugin .icon-wrapper .wp-flow-video-background {
    border-radius: 50% !important;
    aspect-ratio: 1/1 !important;
}

.wp-flow-plugin .icon-wrapper .wp-flow-video-background video {
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* CORREÇÃO 9: Animação aprimorada para o teaser */
@keyframes fadeInTeaser {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Texto do cabeçalho - CORRIGIDO */
.wp-flow-plugin #headerText {
    flex: 1;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    padding-left: 10px;
    line-height: 1.1;
}

/* Status online - CORRIGIDO */
.wp-flow-plugin .online-status {
    color: #fff;
    font-size: 12px;
    font-weight: 400;
}

/* Botão de fechar no cabeçalho - CORRIGIDO */
.wp-flow-plugin #chatCloseButton {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    background-color: transparent;
    width: 40px;
    height: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-flow-plugin #chatCloseButton:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.wp-flow-plugin #chatCloseButton img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    display: block;
    margin: auto;
}

/* Estilos do campo de entrada - CORRIGIDO */
.wp-flow-plugin .input-field {
    display: flex;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    height: auto;
}

.wp-flow-plugin .input-field .user-input {
    flex: 1;
    padding: 10px 40px 10px 25px;
    border-radius: var(--wp-flow-border-radius, 10px);
    border: 1px solid var(--wp-flow-border-color, #ccc);
    font-size: 14px;
    outline: none;
    transition: border 0.3s ease;
    width: 100%;
    margin: 0;
    height: auto;
    line-height: 40px;
}

.wp-flow-plugin .input-field .user-input:focus {
    border-color: var(--wp-flow-primary-color, #2196F3);
}

.wp-flow-plugin .input-field button,
.wp-flow-plugin .send-button {
    margin-left: -40px;
    padding: 5px;
    border: none;
    background: var(--wp-flow-bg-color, #fff);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    top: 5px;
}

.wp-flow-plugin .input-field button img,
.wp-flow-plugin .send-button img {
    width: 28px;
    height: 28px;
    filter: none;
}

.wp-flow-plugin .input-field button svg,
.wp-flow-plugin .send-button svg {
    fill: white;
}

/* Remove elementos antigos */
.wp-flow-plugin .input-field button::after {
    content: none;
}

.wp-flow-plugin .input-field button::before {
    content: '';
}

/* Aplica a cor do chat ao ícone SVG dinamicamente via JS */
.wp-flow-plugin .send-button svg {
    fill: var(--wp-flow-primary-color, #007bff);
}

/* Estilos da janela do chat - MELHORADO */
.wp-flow-plugin ul.chat-window {
    width: 100%;
    padding: 24px 20px;
    list-style: none;
    margin: 0;
    box-sizing: border-box;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 100%;
}

/* Espaçamento entre as mensagens - MELHORADO */
.wp-flow-plugin ul.chat-window > li {
    margin-bottom: var(--wp-flow-message-spacing, 12px);
    clear: both;
    max-width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    animation: slideInMessage 0.4s ease-out;
}

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

.wp-flow-plugin ul.chat-window > li .text {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Mensagens do usuário - MELHORADAS */
.wp-flow-plugin ul.chat-window > li.user {
    float: right;
    text-align: right;
}

.wp-flow-plugin ul.chat-window > li.user .text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 20px 20px 6px 20px;
    max-width: 80%;
    display: inline-block;
    position: relative;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    word-wrap: break-word;
    font-weight: 500;
}

/* Mensagens do bot - MELHORADAS */
.wp-flow-plugin ul.chat-window > li.bot {
    float: left;
    text-align: left;
}

.wp-flow-plugin ul.chat-window > li.bot .text {
    background: white;
    color: var(--wp-flow-text-color);
    padding: 14px 18px;
    border-radius: 6px 20px 20px 20px;
    max-width: 80%;
    display: inline-block;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--wp-flow-border-color);
    word-wrap: break-word;
    line-height: 1.5;
}

/* Estilos para a mensagem do bot com ícone - MELHORADO */
.wp-flow-plugin .bot-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Estilos para as opções - MUITO MELHORADAS */
.wp-flow-plugin .options-list {
    padding: 0;
    margin: 8px 0 0 56px;
    list-style: none;
}

.wp-flow-plugin .options-list > li {
    background: white;
    border: 2px solid var(--wp-flow-primary-color, #2196F3);
    border-radius: 25px;
    padding: 12px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--wp-flow-transition);
    color: var(--wp-flow-primary-color, #2196F3);
    font-weight: 500;
    text-align: center;
    position: relative;
    overflow: hidden;
    word-break: break-word;
}

.wp-flow-plugin .options-list > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.wp-flow-plugin .options-list > li:hover {
    background: var(--wp-flow-primary-color, #2196F3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.wp-flow-plugin .options-list > li:hover::before {
    left: 100%;
}

/* Estilos do indicador de digitação - MELHORADO */
.wp-flow-plugin .typing-indicator {
    background: white;
    border-radius: 20px;
    padding: 16px 20px;
    margin-left: 56px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--wp-flow-border-color);
    animation: fadeInTyping 0.3s ease-out;
    width: auto;
    position: relative;
}

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

.wp-flow-plugin .typing-indicator::before,
.wp-flow-plugin .typing-indicator::after {
    display: none;
}

.wp-flow-plugin .typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--wp-flow-primary-color);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
    float: none;
    margin: 0;
    display: block;
}

.wp-flow-plugin .typing-indicator span:nth-of-type(1) {
    animation-delay: 0s;
}

.wp-flow-plugin .typing-indicator span:nth-of-type(2) {
    animation-delay: 0.2s;
}

.wp-flow-plugin .typing-indicator span:nth-of-type(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Remove animações antigas */
@keyframes blink {
    50% {
        opacity: 1;
    }
}

@keyframes bulge {
    50% {
        transform: scale(1.05);
    }
}

/* Estilos adicionais */
.wp-flow-plugin body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.wp-flow-plugin * {
    box-sizing: border-box;
}

/* Media Queries para telas menores - MELHORADAS */
@media (max-width: 768px) {
    .wp-flow-plugin {
        --wp-flow-chat-width: calc(100vw - 20px);
        --wp-flow-chat-height: calc(100vh - 120px);
    }

    .wp-flow-plugin #chatContainer {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .wp-flow-plugin #chatIconContainer {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .wp-flow-plugin #chatIcon {
        width: 32px;
        height: 32px;
    }

    .wp-flow-plugin #chatTeaser {
        right: 85px;
        max-width: calc(100vw - 120px);
    }

    .wp-flow-plugin ul.chat-window {
        padding: 16px 12px;
    }

    .wp-flow-plugin .options-list {
        margin-left: 48px;
    }

    .wp-flow-plugin .typing-indicator {
        margin-left: 48px;
    }

    .wp-flow-plugin .options-list > li {
        display: block;
        margin-right: 0;
        width: 100%;
        text-align: center;
    }

    .wp-flow-plugin ul.chat-window > li.user .text,
    .wp-flow-plugin ul.chat-window > li.bot .text {
        max-width: 100%;
    }
}

/* Ajustes adicionais para evitar overflow em dispositivos móveis */
.wp-flow-plugin #chatContainer * {
    box-sizing: border-box;
    max-width: 100%;
}

.wp-flow-plugin #chatContainer img {
    max-width: 100%;
    height: auto;
}

.wp-flow-plugin ul.chat-window {
    max-width: 100%;
    overflow-x: hidden;
}

.wp-flow-plugin .options-list > li {
    max-width: 100%;
    word-wrap: break-word;
}

/* Componentes de switch - mantidos originais */
.wp-flow-plugin .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.wp-flow-plugin .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wp-flow-plugin .slider.round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.wp-flow-plugin .slider.round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.wp-flow-plugin input:checked + .slider.round {
    background-color: var(--wp-flow-primary-color, #2196F3);
}

.wp-flow-plugin input:checked + .slider.round:before {
    transform: translateX(26px);
}

/* Modal - melhorado */
.wp-flow-plugin .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.wp-flow-plugin .modal-content {
    background-color: var(--wp-flow-bg-color, #fff);
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: var(--wp-flow-border-radius);
    box-shadow: var(--wp-flow-shadow);
}

/* Responsive styles for the admin panel - mantidos */
@media (max-width: 768px) {
    .wp-flow-plugin .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .wp-flow-plugin .form-row label {
        margin-bottom: 5px;
        min-width: unset;
    }
    .wp-flow-plugin .form-row input[type="text"],
    .wp-flow-plugin .form-row input[type="number"],
    .wp-flow-plugin .form-row select {
        max-width: 100%;
        margin-right: 0;
    }
    .wp-flow-plugin #form-container {
        max-width: 90%;
    }
}

.wp-flow-plugin #message-table-container {
    overflow-x: auto;
}

.wp-flow-plugin #message-table-container table {
    min-width: 800px;
}

.wp-flow-plugin table th, 
.wp-flow-plugin table td {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .wp-flow-plugin .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .wp-flow-plugin .form-row label {
        margin-bottom: 5px;
    }
    .wp-flow-plugin .form-row input,
    .wp-flow-plugin .form-row select,
    .wp-flow-plugin .form-row button {
        width: 100%;
        max-width: 100%;
    }
}

.wp-flow-plugin #message-table-container tbody {
    background-color: white !important;
}

/* Estilo para o menu "Comece Aqui!" - mantido */
.wp-flow-plugin .wp-admin #adminmenu a[href="admin.php?page=chatbot-jquery-documentation"] {
    background-color: #dc3545 !important;
    color: white !important;
}

.wp-flow-plugin .wp-admin #adminmenu a[href="admin.php?page=chatbot-jquery-documentation"]:hover {
    background-color: #c82333 !important;
}

/* Ocultar apenas li's com atributos específicos - mantido */
.wp-flow-plugin li[data-nextid="undefined"][data-action-url="undefined"][data-redirect-type="manual"] {
    display: none !important;
}

/* Estilos para o botão Adicionar - melhorado */
.wp-flow-plugin .add-button {
    background: linear-gradient(135deg, var(--wp-flow-primary-color, #2196F3), var(--wp-flow-secondary-color, #1976D2));
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-left: 10px;
    display: inline-block;
    transition: var(--wp-flow-transition);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.wp-flow-plugin .add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Estados especiais mantidos */
.wp-flow-plugin .force-visible {
    opacity: 1 !important;
    animation: none !important;
}

/* Suporte a estados não suportados */
.wp-flow-plugin .send-button.unsupported {
    cursor: not-allowed !important;
    opacity: 0.6;
}

.wp-flow-plugin .send-button.unsupported:hover::after {
    content: 'Seu navegador não suporta áudio';
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 99;
}


/* Estilos para ícones de vídeo no WP Flow */

/* Container de fundo para vídeos */
.wp-flow-video-background {
    border-radius: 50%;
    background-color: var(--wp-flow-video-bg-color, #000000); /* Fundo preto para vídeos não quadrados, com variável CSS para personalização */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Estilo para vídeos dentro do container */
.wp-flow-video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que o vídeo cubra todo o espaço disponível */
    position: absolute;
    top: 0;
    left: 0;
}

/* Correção para ícones de vídeo nas mensagens do chat */
.icon-wrapper .wp-flow-video-background {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
}

/* Correção para o ícone do atendente no cabeçalho */
#headerUserIcon.wp-flow-video {
    object-fit: cover;
}

/* Correção para o ícone flutuante do chat */
#chatIcon.wp-flow-video {
    object-fit: cover;
    width: 100%;
    height: 100%;
}
