/*
 * ============================================================
 *  CHATBOT PRO — ESTILOS PRINCIPAIS
 * ============================================================
 *
 *  O design segue o padrão do exemplo de alta conversão:
 *  - Interface limpa, sem distrações
 *  - Bolhas de mensagem simples (bot = cinza, usuário = cor primária)
 *  - Botões de resposta em coluna, largura total
 *  - Anúncio integrado no fluxo natural do chat
 *
 *  As cores são aplicadas via variáveis CSS definidas pelo
 *  chatbot.js com base no CHATBOT_CONFIG (config.js).
 * ============================================================
 */

/* ============================================================
   VARIÁVEIS DE COR — sobrescritas pelo JS via config
   ============================================================ */
:root {
    --cor-primaria:     #6C63FF;   /* botões e bolha do usuário */
    --cor-primaria-hover: #5a52d5;
    --cor-secundaria:   #FF6B9D;   /* destaques e acentos */

    /* Tema claro (padrão) */
    --fundo-body:       #f9f9f9;
    --fundo-container:  #ffffff;
    --fundo-bot-msg:    #f1f1f1;
    --borda-bot-msg:    #ddd;
    --texto-bot:        #333333;
    --texto-usuario:    #ffffff;
    --rodape-texto:     #888888;
    --rodape-link:      #888888;
}

/* Tema escuro — classe aplicada pelo JS quando tema: "escuro" */
body.tema-escuro {
    --fundo-body:       #0F0E17;
    --fundo-container:  #1A1826;
    --fundo-bot-msg:    #252336;
    --borda-bot-msg:    #33304f;
    --texto-bot:        #E8E6F0;
    --texto-usuario:    #ffffff;
    --rodape-texto:     #555577;
    --rodape-link:      #666688;
}

/* Tema WhatsApp */
body.tema-whatsapp {
    --fundo-body:       #e5ddd5;
    --fundo-container:  #e5ddd5;
    --fundo-bot-msg:    #ffffff;
    --borda-bot-msg:    #ffffff;
    --texto-bot:        #111b21;
    --cor-primaria:     #00a884;
    --cor-primaria-hover: #008f6f;
    --texto-usuario:    #111b21;
    --fundo-usuario-msg:#dcf8c6;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    background-size: 400px;
}

/* Container Adjustments for Header */
body.tema-whatsapp #chat-container {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

/* WhatsApp Header */
body.tema-whatsapp #chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #008069;
    color: white;
    padding: 0 14px;
    height: 64px;
    min-height: 64px;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Garante que o chat-box ocupe o espaço correto */
body.tema-whatsapp #chat-box {
    padding-top: 10px;
}

body.tema-whatsapp #chat-header .header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.tema-whatsapp #chat-header .back-btn {
    background: none;
    border: none;
    color: white;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

body.tema-whatsapp #chat-header .profile-pic {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    overflow: hidden;
}

body.tema-whatsapp #chat-header .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

body.tema-whatsapp #chat-header .user-info .name {
    font-size: 16px;
    font-weight: 500;
}

body.tema-whatsapp #chat-header .user-info .status {
    font-size: 12px;
    opacity: 0.85;
}

body.tema-whatsapp #chat-header .header-icons {
    display: flex;
    gap: 16px;
    color: white;
}

body.tema-whatsapp #chat-header .header-icons .icon-more {
    display: none;
}

/* WhatsApp Bubbles with Tails */
body.tema-whatsapp #chat-box .chat-message {
    max-width: 85%;
    margin-bottom: 4px;
}

body.tema-whatsapp #chat-box .bot-message {
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
    position: relative;
    margin-left: 18px;
    background-color: white;
    border: none;
    padding: 8px 12px;
}

body.tema-whatsapp #chat-box .bot-message::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    width: 0; height: 0;
    border-top: 0px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid white;
}

body.tema-whatsapp #chat-box .user-message {
    background-color: #dcf8c6 !important;
    color: #111b21 !important;
    border: none !important;
    border-radius: 8px 0 8px 8px !important;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
    position: relative;
    margin-right: 18px !important;
    padding: 8px 12px;
    text-align: left !important;
}

body.tema-whatsapp #chat-box .user-message::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 0;
    width: 0; height: 0;
    border-top: 0px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 12px solid #dcf8c6;
}

/* WhatsApp Fake Footer */
body.tema-whatsapp #chat-fake-footer {
    display: block !important;
    padding: 8px;
    background: transparent;
}
body.tema-whatsapp #chat-fake-footer .input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.tema-whatsapp #chat-fake-footer .input-content {
    flex: 1;
    background: white;
    border-radius: 24px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
body.tema-whatsapp #chat-fake-footer .placeholder {
    flex: 1;
    color: #8696a0;
    font-size: 16px;
}
body.tema-whatsapp #chat-fake-footer .mic-circle {
    width: 48px;
    height: 48px;
    background-color: #128c7e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}


/* Telegram */
body.tema-telegram {
    --fundo-body:       #547594;
    --fundo-container:  #547594;
    --fundo-bot-msg:    #ffffff;
    --borda-bot-msg:    #ffffff;
    --texto-bot:        #000000;
    --cor-primaria:     #2481cc;
    --cor-primaria-hover: #1c6ba8;
    --texto-usuario:    #ffffff;
}

/* Telegram Header */
body.tema-telegram #chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #2481cc;
    color: white;
    padding: 0 16px;
    height: 56px;
    position: relative;
    z-index: 100;
}
body.tema-telegram #chat-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
body.tema-telegram #chat-header .back-btn {
    background: none;
    border: none;
    color: white;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}
body.tema-telegram #chat-header .profile-pic {
    width: 40px;
    height: 40px;
    background-color: #3bb2e1;
    border-radius: 50%;
    border: none;
}
body.tema-telegram #chat-header .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
body.tema-telegram #chat-header .user-info .name {
    font-size: 18px;
    font-weight: 600;
}
body.tema-telegram #chat-header .user-info .status {
    font-size: 13px;
    opacity: 0.85;
}

/* Telegram Messages */
body.tema-telegram .chat-message {
    border-radius: 15px;
    margin: 4px 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    font-size: 15.5px;
}
body.tema-telegram .chat-message.bot-message {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #f1f1f1;
    align-self: flex-start;
}
body.tema-telegram .chat-message.user-message {
    background-color: #effdde !important;
    color: #222 !important;
    border: none !important;
    align-self: flex-end;
    box-shadow: 0 1.5px 1px rgba(0,0,0,0.08);
}

/* Telegram Fake Footer */
body.tema-telegram #chat-fake-footer {
    display: flex !important;
    padding: 10px 12px;
    background-color: #ffffff;
    border-top: 1px solid #f2f2f2;
}
body.tema-telegram #chat-fake-footer .input-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}
body.tema-telegram #chat-fake-footer .input-content {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    height: auto;
    box-shadow: none;
}
body.tema-telegram #chat-fake-footer .placeholder {
    flex: 1;
    color: #999;
    font-size: 16px;
}
body.tema-telegram #chat-fake-footer .mic-circle {
    width: 24px;
    height: 24px;
    background: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.tema-telegram #chat-fake-footer svg {
    fill: #2481cc !important;
    opacity: 1;
    width: 24px;
    height: 24px;
}

/* ============================================================
   SUPORTE RTL (Right-to-Left) - Árabe, Hebraico, etc.
   ============================================================ */
body.is-rtl {
    direction: rtl;
    text-align: right;
}

/* Inverter Ícone de Voltar */
body.is-rtl #chat-header .back-btn {
    transform: rotate(180deg);
}

/* Ajustes WhatsApp RTL */
body.is-rtl.tema-whatsapp #chat-box .bot-message {
    margin-left: 0;
    margin-right: 18px;
    border-radius: 8px 0 8px 8px;
}
body.is-rtl.tema-whatsapp #chat-box .bot-message::before {
    left: auto;
    right: -10px;
    border-right: none;
    border-left: 12px solid white;
}

body.is-rtl.tema-whatsapp #chat-box .user-message {
    margin-right: 0 !important;
    margin-left: 18px !important;
    border-radius: 0 8px 8px 8px !important;
}
body.is-rtl.tema-whatsapp #chat-box .user-message::before {
    right: auto !important;
    left: -10px !important;
    border-left: none !important;
    border-right: 12px solid #dcf8c6 !important;
}

/* Ajustes Telegram RTL */
body.is-rtl.tema-telegram .chat-message {
    border-radius: 12px 12px 4px 12px;
}
body.is-rtl.tema-telegram .chat-message.user-message {
    border-radius: 12px 12px 12px 4px !important;
}

/* Ajustes Gerais Botões e Inputs */
body.is-rtl .header-icons {
    flex-direction: row-reverse;
}
body.is-rtl #chat-fake-footer .input-content {
    flex-direction: row-reverse;
}
body.is-rtl #chat-fake-footer .placeholder {
    text-align: right;
}

/* Tema Instagram */
body.tema-instagram {
    --fundo-body:       #fafafa;
    --fundo-container:  #ffffff;
    --fundo-bot-msg:    #efefef;
    --borda-bot-msg:    #dbdbdb;
    --texto-bot:        #262626;
    --cor-primaria:     #0095f6;
    --cor-primaria-hover: #1877f2;
}
body.tema-instagram .chat-message {
    border-radius: 22px;
    padding: 8px 16px;
    border: 1px solid var(--borda-bot-msg);
}
body.tema-instagram .chat-message.user-message {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    border: none;
}

/* Tema Messenger */
body.tema-messenger {
    --fundo-body:       #ffffff;
    --fundo-container:  #ffffff;
    --fundo-bot-msg:    #e4e6eb;
    --borda-bot-msg:    #e4e6eb;
    --texto-bot:        #050505;
    --cor-primaria:     #0084ff;
}
body.tema-messenger .chat-message {
    border-radius: 20px;
    padding: 8px 12px;
}
body.tema-messenger .chat-message.user-message {
    background: #0084ff;
}

/* ============================================================
   RESET E BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Melhor suporte para mobile */
    align-items: stretch;
    transition: background-color 0.3s;
    overflow: hidden; /* Evitar scroll duplo */
}

.hidden {
    display: none !important;
}

/* ============================================================
   SPINNER DE LOADING INICIAL
   Aparece enquanto o idioma e as questões são carregados
   ============================================================ */
#overlay {
    position: fixed;
    inset: 0;
    background: var(--fundo-container);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#overlay.esconder {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ddd;
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: girar 0.9s linear infinite;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

.mensagem-loader {
    margin-top: 16px;
    font-size: 15px;
    color: var(--texto-bot);
    opacity: 0.7;
}

/* ============================================================
   CONTAINER PRINCIPAL DO CHAT
   ============================================================ */
#chat-container {
    width: 100%;
    max-width: 100%;
    flex: 1;
    background-color: var(--fundo-container);
    box-shadow: none;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

/* Em celulares, usa largura total */
@media (max-width: 520px) {
    #chat-container {
        max-width: 100%;
    }
}

/* ============================================================
   ÁREA DE MENSAGENS — onde as bolhas aparecem
   ============================================================ */
#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Barra de rolagem invisível (como no exemplo) */
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding-bottom: 12px;
}

#chat-box::-webkit-scrollbar {
    display: none;
}

/* ============================================================
   BOLHAS DE MENSAGEM
   ============================================================ */
.chat-message {
    padding: 12px 18px;
    border-radius: 25px;
    margin: 8px 10px;
    font-size: 16px;
    max-width: 82%;
    line-height: 1.5;
    word-wrap: break-word;
    animation: entrarBolha 0.25s ease-out;
}

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

/* Mensagem do BOT — fundo cinza, alinhada à esquerda */
.bot-message {
    background-color: var(--fundo-bot-msg);
    color: var(--texto-bot);
    align-self: flex-start;
    border: 1px solid var(--borda-bot-msg);
    margin-right: 50px;
}

/* Mensagem do USUÁRIO — cor primária, alinhada à direita */
.user-message {
    background-color: var(--cor-primaria);
    color: var(--texto-usuario);
    align-self: flex-end;
    margin-left: 50px;
    margin-right: 10px;
    text-align: center;
}

/* ============================================================
   ANIMAÇÃO "DIGITANDO..." (3 pontos pulsando)
   Exibida entre as mensagens do bot para simular digitação real
   ============================================================ */
.typing-indicator {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 12px 10px;
    gap: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--borda-bot-msg);
    animation: pulsar 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s;    }
.dot:nth-child(2) { animation-delay: 0.25s; }
.dot:nth-child(3) { animation-delay: 0.5s;  }

@keyframes pulsar {
    0%, 80%, 100% { transform: scale(1);   opacity: 0.5; }
    40%           { transform: scale(1.5); opacity: 1;   }
}

/* ============================================================
   BOTÕES DE RESPOSTA RÁPIDA
   Aparecem em coluna, com largura total, alinhados à direita
   Estratégia: elimina fricção, o usuário só precisa clicar
   ============================================================ */
.button-container {
    display: flex;
    flex-direction: column;
    margin: 10px 10px 10px 50px;  /* indentação = parece continuação do bot */
    gap: 8px;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: entrarBolha 0.3s ease-out;
}

.button-container button {
    padding: 13px 18px;
    background-color: var(--cor-primaria);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    width: 100%;
    text-align: center;
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.button-container button:hover {
    background-color: var(--cor-primaria-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.button-container button:active {
    transform: translateY(0);
    box-shadow: none;
}

.button-container button:disabled {
    background-color: #b2b2b2;
    cursor: not-allowed;
    transform: none;
}

/* Botão que é um link (CTA final) */
.button-container a {
    display: block;
    text-decoration: none;
}

.button-container a button {
    background-color: var(--cor-secundaria);
}

.button-container a button:hover {
    filter: brightness(0.9);
}

/* ============================================================
   BLOCO DE ANÚNCIO — inserido no fluxo da conversa
   Usa as classes geradas pelo AdsManager (ads-manager.js)
   ============================================================ */
.ad-container {
    margin: 12px 10px;
    border-radius: 10px;
    /*animation: entrarBolha 0.4s ease-out; */
}

.ad-label {
    font-size: 11px;
    color: var(--rodape-texto);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding: 0 4px;
    text-transform: uppercase;
}

/* .ad-wrapper {
    border-radius: 10px;
    border: 1px solid var(--borda-bot-msg);
    background: var(--fundo-bot-msg);
}
*/

/* --- Placeholder IN-ARTICLE (banner fino) --- */
.ad-placeholder.ad-in-article {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.ad-placeholder.ad-in-article:hover {
    background: var(--fundo-bot-msg);
    filter: brightness(0.95);
}

.ad-placeholder-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.ad-placeholder-content {
    flex: 1;
}

.ad-placeholder-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--texto-bot);
    margin-bottom: 3px;
}

.ad-placeholder-desc {
    font-size: 12px;
    color: var(--rodape-texto);
    line-height: 1.4;
}

.ad-placeholder-cta {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cor-primaria);
}

.ad-placeholder-badge {
    font-size: 10px;
    color: var(--rodape-texto);
    margin-top: 6px;
    padding: 0 14px 8px;
    text-align: right;
}

/* --- Placeholder DISPLAY (banner maior) --- */
.ad-placeholder.ad-display {
    position: relative;
    min-height: 140px;
    cursor: pointer;
}

.ad-display-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    opacity: 0.08;
    border-radius: 10px;
}

.ad-display-content {
    position: relative;
    padding: 18px;
    z-index: 1;
}

.ad-display-brand {
    font-size: 11px;
    color: var(--rodape-texto);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-display-headline {
    font-size: 17px;
    font-weight: 700;
    color: var(--texto-bot);
    margin-bottom: 6px;
    line-height: 1.3;
}

.ad-display-sub {
    font-size: 13px;
    color: var(--rodape-texto);
    margin-bottom: 14px;
    line-height: 1.4;
}

.ad-display-btn {
    background: var(--cor-primaria);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
}

.ad-display-btn:hover {
    background: var(--cor-primaria-hover);
    transform: translateY(-1px);
}

/* --- Placeholder MULTIPLEX (grade de cards) --- */
.ad-placeholder.ad-multiplex {
    padding: 14px;
}

.ad-multiplex-header {
    font-size: 12px;
    color: var(--rodape-texto);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ad-multiplex-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ad-multiplex-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--borda-bot-msg);
    transition: transform 0.2s;
}

.ad-multiplex-item:hover {
    transform: translateY(-2px);
}

.ad-multiplex-thumb {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ad-multiplex-text {
    font-size: 11px;
    color: var(--texto-bot);
    padding: 6px 8px;
    line-height: 1.3;
    font-weight: 500;
}

/* Animação de entrada do bloco de anúncio 
.ad-entrada {
    animation: entrarAnuncio 0.4s ease-out;
}

*/

@keyframes entrarAnuncio {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1);    }
}

/* ============================================================
   BARRA DE PROGRESSO (opcional, para redirect final)
   ============================================================ */
.progress-container {
    width: calc(100% - 20px);
    height: 6px;
    background-color: var(--borda-bot-msg);
    border-radius: 3px;
    margin: 10px 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cor-primaria), var(--cor-secundaria));
    border-radius: 3px;
    transition: width 0.8s ease-in-out;
}

/* ============================================================
   ANÚNCIO DE TELA TODA (intersticial)
   Cobre toda a viewport, pausa o chat até ser fechado
   ============================================================ */
.ad-tela-toda {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-tela-toda.ad-tt-visivel {
    opacity: 1;
}

/* Caixa central do anúncio */
.ad-tt-conteudo {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Rótulo "Patrocinado" no topo */
.ad-tt-badge {
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Barra de progresso (contagem regressiva) */
.ad-tt-barra-container {
    width: 100%;
    height: 3px;
    background: #eee;
}

.ad-tt-barra-progresso {
    height: 100%;
    width: 100%;
    background: var(--cor-primaria);
}

/* Botão de fechar */
.ad-tt-fechar {
    width: calc(100% - 32px);
    margin: 12px 16px 16px;
    padding: 12px;
    background: var(--cor-primaria);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.ad-tt-fechar:hover {
    background: var(--cor-primaria-hover);
}

/* ── Modo TESTE ─────────────────────────────────────────── */
.ad-tt-area-teste {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    gap: 8px;
    min-height: 200px;
    width: 100%;
    border: 2px dashed #ddd;
    margin: 12px;
    border-radius: 8px;
    width: calc(100% - 24px);
    background: #fafafa;
    box-sizing: border-box;
}

.ad-tt-teste-icone { font-size: 36px; }

.ad-tt-teste-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #555;
}

.ad-tt-teste-desc {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    line-height: 1.5;
}

/* ── Modo REAL (placeholder) ────────────────────────────── */
.ad-tt-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px;
    gap: 10px;
    text-align: center;
}

.ad-tt-placeholder-icone { font-size: 40px; }

.ad-tt-placeholder-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.ad-tt-placeholder-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.ad-tt-placeholder-cta {
    background: var(--cor-primaria);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
    transition: background 0.2s;
}

.ad-tt-placeholder-cta:hover {
    background: var(--cor-primaria-hover);
}

/* ── AdSense real (tela toda) ───────────────────────────── */
.ad-tt-ins {
    width: 100%;
    min-height: 200px;
}

/* ============================================================
   BLOCO DE TESTE DE ANÚNCIO
   Exibido quando modoTesteAnuncios: true no config.js
   ============================================================ */
.ad-teste {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px;
    padding: 18px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    text-align: center;
    animation: entrarBolha 0.3s ease-out;
    gap: 4px;
}

.ad-teste-icone {
    font-size: 22px;
}

.ad-teste-texto {
    font-size: 15px;
    font-weight: 700;
    color: #555;
}

.ad-teste-info {
    font-size: 11px;
    color: #aaa;
}

/* ============================================================
   SELETOR DE IDIOMAS — barra no topo do chat
   Gerado pelo chatbot.js com base em CHATBOT_CONFIG.idiomasDisponiveis
   ============================================================ */
.seletor-idioma {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 12px;
    background: var(--fundo-container);
    border-bottom: 1px solid var(--borda-bot-msg);
    flex-shrink: 0;
}

.btn-idioma {
    background: transparent;
    border: 1px solid var(--borda-bot-msg);
    color: var(--texto-bot);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-idioma:hover {
    border-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

.btn-idioma.ativo {
    background: var(--cor-primaria);
    border-color: var(--cor-primaria);
    color: #ffffff;
}

/* ============================================================
   RODAPÉ — links de Termos e Privacidade
   ============================================================ */
#rodape {
    text-align: center;
    font-size: 12px;
    color: var(--rodape-texto);
    padding: 10px;
    width: 100%;
    background: var(--fundo-container);
    flex-shrink: 0; /* Garante que mantém o tamanho */
}

#rodape a {
    color: var(--rodape-link);
    text-decoration: none;
    margin: 0 6px;
    transition: color 0.2s;
}

#rodape a:hover {
    color: var(--cor-primaria);
    text-decoration: underline;
}

@media (max-width: 520px) {
    #rodape { max-width: 100%; }
}

/* ============================================================
   MODAL DE COOKIES DENTRO DO CHAT
   ============================================================ */
#modal-cookies-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    animation: fadeInModal 0.25s ease-out;
}

.modal-cookies-box {
    background: var(--fundo-bot-msg, #fff);
    border: 1px solid var(--borda-bot-msg, #eee);
    color: var(--texto-bot, #333);
    border-radius: 12px;
    width: 85%;
    max-width: 320px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: inherit;
}

.modal-cookies-box h3 {
    margin-top: 0;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.cookie-option:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.cookie-option-info {
    flex: 1;
    padding-right: 10px;
}

.cookie-option-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.cookie-option-info p {
    margin: 0;
    font-size: 11px;
    opacity: 0.7;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 20px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.cookie-toggle.disabled .cookie-slider {
    cursor: not-allowed;
    background-color: var(--cor-primaria, #4CAF50);
    opacity: 0.7;
}

input:checked + .cookie-slider {
    background-color: var(--cor-primaria, #4CAF50);
}

input:focus + .cookie-slider {
    box-shadow: 0 0 1px var(--cor-primaria, #4CAF50);
}

input:checked + .cookie-slider:before {
    transform: translateX(20px);
}

.modal-cookies-box button {
    width: 100%;
    padding: 12px;
    background-color: var(--cor-primaria, #4CAF50);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.modal-cookies-box button:hover {
    background-color: var(--cor-primaria-hover, #45a049);
}

.fade-out-cookies {
    animation: fadeOutModal 0.25s ease-in forwards !important;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOutModal {
    from { opacity: 1; }
    to { opacity: 0; }
}
