/* CLS Prevention - WOW.js override
 * Evita que elementos com classe .wow causem layout shift
 * Elementos devem estar sempre visíveis, animação usa apenas opacity/transform */
.wow {
    visibility: visible !important;
}

/* Font swap to reduce CLS/FOIT */
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: local("Roboto Thin"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Thin.woff2") format("woff2"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Thin.woff") format("woff");
}
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local("Roboto Light"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Light.woff2") format("woff2"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Light.woff") format("woff");
}
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local("Roboto Regular"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Regular.woff2") format("woff2"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Regular.woff") format("woff");
}
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local("Roboto Medium"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Medium.woff2") format("woff2"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Medium.woff") format("woff");
}
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local("Roboto Bold"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Bold.woff2") format("woff2"),
         url("../../MDB-Pro_4.11.0/font/roboto/Roboto-Bold.woff") format("woff");
}
@font-face {
    font-family: "Font Awesome 5 Free";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-regular-400.woff2") format("woff2"),
         url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-regular-400.woff") format("woff");
}
@font-face {
    font-family: "Font Awesome 5 Free";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-solid-900.woff2") format("woff2"),
         url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-solid-900.woff") format("woff");
}
@font-face {
    font-family: "Font Awesome 5 Brands";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-brands-400.woff2") format("woff2"),
         url("https://use.fontawesome.com/releases/v5.11.2/webfonts/fa-brands-400.woff") format("woff");
}

:root {
    --cor-fundo: #0f0f1a;
    --cor-fundo-chat: #0f0f1a;
    --cor-balao-ia: #1e2a3a;
    --cor-balao-usuario: rgba(167, 139, 250, 0.12);
    --cor-texto-principal: #f1f5f9;
    --cor-texto-secundario: #94a3b8;
    /* --cor-primaria etc vêm de css/site-palette.css (paleta da página principal) */
}
/* Estilos mantidos do arquivo original */
html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
}

body.chat-page {
    min-height: 100%;
    background: var(--cor-fundo);
    color: var(--cor-texto-principal);
    display: flex;
    justify-content: center;
    align-items: center;
}
.chat-container { width: 100%; height: 100%; max-width: 800px; background: var(--cor-fundo-chat); box-shadow: 0 8px 32px rgba(0,0,0,0.4); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; align-items: center; padding: 10px 15px; background: rgba(15, 15, 26, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-bottom: 1px solid rgba(255, 255, 255, 0.06); z-index: 100; justify-content: space-between; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 15px; }
.chat-title h3 { font-size: 1rem; font-weight: 600; color: var(--cor-texto-principal); }
.chat-title p { font-size: 0.7rem; color: #22c55e; }
.btn-perfil { margin-left: auto; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.25); color: #f87171; padding: 5px 12px; border-radius: 20px; cursor: pointer; font-size: 0.75rem; text-decoration: none; }
.chat-box { flex-grow: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; }
.mensagem { display: flex; margin-bottom: 15px; max-width: 85%; animation: fadeIn 0.5s ease; }
.mensagem.usuario { align-self: flex-end; flex-direction: row-reverse; }
.balao { padding: 12px 18px; border-radius: 18px; line-height: 1.5; font-size: 0.95rem; white-space: pre-wrap; }
.mensagem.usuario .balao { background: var(--cor-balao-usuario); color: var(--cor-texto-principal); border-bottom-right-radius: 4px; border: 1px solid rgba(255, 215, 0, 0.15); }
.mensagem.babalorixa .balao { background: var(--cor-balao-ia); color: #e2e8f0; border-bottom-left-radius: 4px; }
.chat-input-area { padding: 15px; padding-bottom: calc(15px + env(safe-area-inset-bottom)); background: var(--cor-fundo-chat); border-top: 1px solid rgba(255, 255, 255, 0.06); flex-shrink: 0; }
.input-wrapper { display: flex; align-items: center; background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 25px; padding: 5px 15px; }
#pergunta { flex-grow: 1; border: none; background: transparent; color: var(--cor-texto-principal); padding: 10px 0; font-size: 1rem; resize: none; max-height: 100px; overflow-y: auto; }
#pergunta:focus { outline: none; }
.btn-enviar { background: var(--cor-primaria); border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; margin-left: 10px; flex-shrink: 0; }
@media (min-width: 768px) { .chat-container { max-height: 95vh; border-radius: 12px; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Botão de voltar */
.back-btn {
    background: rgba(255, 215, 0, 0.1);
    color: var(--cor-primaria);
    padding: 8px 16px;
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    font-size: 0.8rem;
}

.back-btn:hover {
    background: var(--cor-primaria);
    color: #fff;
}

/* Informações de cobrança */
.chat-info {
    margin-left: auto;
    text-align: right;
}

.billing-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

#minutes-counter {
    font-size: 18px;
    font-weight: 700;
    color: var(--cor-primaria);
    font-family: monospace;
}

.rate {
    font-size: 12px;
    color: var(--cor-texto-secundario);
}

.balance-display {
    font-size: 12px;
    color: var(--cor-texto-secundario);
}

#balance-counter {
    font-weight: 600;
    color: #10b981;
}

.balance-low #balance-counter {
    color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Modal de fim de saldo */
.saldo-finished-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.saldo-finished-content {
    background: var(--cor-fundo-chat);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    border: 2px solid var(--cor-erro);
}

.saldo-finished-content h3 {
    color: var(--cor-erro);
    margin-bottom: 15px;
}

.saldo-finished-content p {
    color: var(--cor-texto-principal);
    margin-bottom: 20px;
}

.btn-comprar-creditos {
    background: var(--cor-sucesso);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
}

.btn-voltar {
    background: transparent;
    color: var(--cor-texto-secundario);
    border: 1px solid var(--cor-texto-secundario);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================================================
   MDB UI Refresh - Estilos Globais
   ========================================================================== */

/* Fundo Global Dark */
body.dark-skin {
    background: #0f0f1a !important;
    background-color: #0f0f1a !important;
    color: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Utilitários de Texto */
.text-amber { color: #ffc107 !important; }
.text-gold { color: #FFD700 !important; }
.hover-gold:hover { color: #e2e8f0 !important; text-decoration: underline; transition: 0.3s; }

/* Botões Customizados */
/* CSS DELETADO - usando apenas MDB puro */

/* Cards com Efeito Vidro */
.card-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.3);
}

/* Dropdown Dark */
.dropdown-menu.dropdown-default {
    background-color: #1a1a2e;
    border: 1px solid rgba(167, 139, 250, 0.12);
}
.dropdown-item { color: #e2e8f0 !important; }
.dropdown-item:hover { background-color: rgba(167, 139, 250, 0.08); color: #c4b5fd !important; }

/* Modal Dark */
.modal-content.dark-content {
    background-color: #1a1a2e;
    color: #f1f5f9;
    border: 1px solid rgba(167, 139, 250, 0.12);
}
.close.text-white { opacity: 0.8; }
.close.text-white:hover { opacity: 1; }

/* Scrollbar Bonita */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
