:root {
    --cor-fundo: #2c1a2e;
    --cor-fundo-chat: #0f172a;
    --cor-balao-ia: #334155;
    --cor-balao-usuario: #7c3aed;
    --cor-texto-principal: #f1f5f9;
    --cor-texto-secundario: #cbd5e1;
    --cor-primaria: #a855f7;
}
/* 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: linear-gradient(135deg, #2c1a2e 0%, #1a1a2e 100%);
    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 10px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; align-items: center; padding: 10px 15px; background: rgba(51, 65, 85, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); z-index: 100; justify-content: space-between; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-right: 15px; }
.chat-title h3 { font-size: 1rem; font-weight: 600; color: var(--cor-texto-principal); }
.chat-title p { font-size: 0.75rem; color: var(--cor-primaria); }
.btn-perfil { margin-left: auto; background: transparent; border: 1px solid var(--cor-texto-secundario); color: var(--cor-texto-secundario); padding: 5px 10px; 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; }
.mensagem.babalorixa .balao { background: var(--cor-balao-ia); color: var(--cor-texto-principal); border-bottom-left-radius: 4px; }
.chat-input-area { padding: 15px; padding-bottom: calc(15px + env(safe-area-inset-bottom)); background: rgba(51, 65, 85, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0; }
.input-wrapper { display: flex; align-items: center; background: var(--cor-balao-ia); 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: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 10px; }
@media (min-width: 768px) { .chat-container { max-height: 95vh; border-radius: 12px; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; translateY(0); } }

/* Botão de voltar */
.back-btn {
    background: rgba(168, 85, 247, 0.1);
    color: var(--cor-primaria);
    padding: 8px 16px;
    border: 1px solid var(--cor-primaria);
    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: #000;
}

/* 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: #1a1a2e;
    color: #f5f5f5;
    font-family: 'Roboto', sans-serif;
}

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

/* Botões Customizados */
.btn-amber {
    background: linear-gradient(40deg, #FFD700, #ff8f00) !important;
    color: #fff !important;
}

/* Cards com Efeito Vidro */
.card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Dropdown Dark */
.dropdown-menu.dropdown-default {
    background-color: #2e2e4e;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.dropdown-item { color: #fff !important; }
.dropdown-item:hover { background-color: rgba(255, 215, 0, 0.1); color: #FFD700 !important; }

/* Modal Dark */
.modal-content.dark-content {
    background-color: #22223a;
    color: #fff;
    border: 1px solid rgba(255, 215, 0, 0.2);
}
.close.text-white { opacity: 0.8; }
.close.text-white:hover { opacity: 1; }

/* Scrollbar Bonita */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #FFD700; }
