/* ========================================= */
/* RESET E ESTILOS BASE (MANTIDOS)           */
/* ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* CONTAINER PRINCIPAL (MANTIDO COMPACTO) */
.container {
    max-width: 700px; /* Mantém o layout compacto que você gosta */
    margin: 0 auto;
    padding: 1rem;
}

/* BARRA SUPERIOR (MANTIDO) */
.topo-acoes {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.btn-meus-bilhetes {
    background-color: #1e293b;
    color: #38bdf8;
    border: 1px solid #334155;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-meus-bilhetes:hover {
    background-color: #334155;
    color: #ffffff;
}

/* TÍTULO E INFOS DA RIFA (MANTIDO) */
h1 {
    color: #f1f5f9;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    text-align: center;
}

.info {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.info strong {
    color: #38bdf8;
}

/* BARRA DE PROGRESSO (MANTIDO) */
.progresso-container {
    margin-bottom: 1.5rem;
}

.progresso-texto {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.progresso-texto strong {
    color: #38bdf8;
}

.barra-fundo {
    background-color: #1e293b;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #334155;
}

.barra-preenchimento {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

/* SUBTÍTULOS DA PÁGINA (MANTIDO) */
h3 {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 0.6rem;
    margin-top: 1rem;
}

/* SEÇÃO DE COTAS RÁPIDAS (MANTIDO) */
.cotas-rapidas {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn-cota {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cota:hover {
    background-color: #38bdf8;
    color: #0f172a;
}

.btn-cota.btn-limpar {
    background-color: #dc2626;
    color: white;
    border: none;
    margin-left: auto;
}

.btn-cota.btn-limpar:hover {
    background-color: #b91c1c;
}

/* FILTROS DE STATUS (MANTIDO) */
.filtros-status {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.btn-filtro {
    background-color: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-filtro.ativo {
    background-color: #2563eb;
    color: #fff;
    border-color: #38bdf8;
}

/* GRADE DE NÚMEROS (MANTIDO) */
.grid-numeros {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 1.5rem;
}

.numero-btn {
    aspect-ratio: 1;
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.numero-btn:active {
    transform: scale(0.92);
}

.numero-btn.selecionado {
    background-color: #2563eb;
    border-color: #60a5fa;
    color: #fff;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

.numero-btn.pendente {
    background-color: #facc15;
    color: #0f172a;
    border-color: #eab308;
    cursor: not-allowed;
}

.numero-btn.reservado, .numero-btn.pago {
    background-color: #16a34a;
    color: #fff;
    border-color: #22c55e;
    cursor: not-allowed;
}

.numero-btn.escondido {
    display: none;
}

.resumo-selecao {
    background-color: #1e293b;
    border-left: 4px solid #38bdf8;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

hr {
    border: 0;
    height: 1px;
    background-color: #334155;
    margin: 1.5rem 0;
}

/* FORMULÁRIO DE CADASTRO (MANTIDO) */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.form-group input:focus {
    border-color: #38bdf8;
}

.btn-comprar {
    width: 100%;
    padding: 1rem;
    background-color: #16a34a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.btn-comprar:hover {
    background-color: #15803d;
}

/* ========================================= */
/* ESTRUTURA DOS MODAIS (CORRIGIDO BACKGROUND) */
/* ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fundo escuro semi-transparente */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.esconde {
    display: none !important;
}

.modal-conteudo {
    /* CORREÇÃO DO PRINT 2: Definindo fundo sólido para não ficar transparente */
    background-color: #1e293b; /* Mesma cor dos cards da página */
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6); /* Sombra projetada */
}

/* Cabeçalho padrão dos modais */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-conteudo h2 {
    color: #f1f5f9;
    font-size: 1.3rem;
}

/* Botão de fechar (X) padrão */
.btn-fechar-x {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.subtitulo-modal {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* ========================================= */
/* CORREÇÕES ESPECÍFICAS PEDIDAS            */
/* ========================================= */

/* 1. BOTÃO TOP COMPRADORES (PRINT 1 - CORRIGIDO) */
#btn-top-compradores {
    width: 100%;
    background-color: #facc15; /* Amarelo ouro */
    color: #0f172a; /* Texto escuro para contraste */
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 1rem; /* Espaço até os filtros */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
}

#btn-top-compradores:hover {
    background-color: #eab308; /* Amarelo mais escuro no hover */
}

/* 2. LISTA TOP COMPRADORES (PRINT 3 - CORRIGIDO VISUALMENTE) */
.lista-ranking {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 1.5rem 0;
}

.item-ranking {
    display: flex;
    align-items: center;
    background-color: #0f172a; /* Fundo mais escuro interno */
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    gap: 15px;
}

/* Posição (1º, 2º...) */
.item-ranking .posicao {
    font-size: 1.2rem;
    font-weight: bold;
    color: #94a3b8;
    width: 35px;
    text-align: center;
}

/* Cores para os 3 primeiros */
.item-ranking.posicao-1 .posicao { color: #facc15; font-size: 1.4rem; } /* Ouro */
.item-ranking.posicao-2 .posicao { color: #cbd5e1; } /* Prata */
.item-ranking.posicao-3 .posicao { color: #cd7f32; } /* Bronze */

/* Bloco central com Nome e Telefone */
.item-ranking .dados {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-ranking .nome {
    font-weight: bold;
    color: #f1f5f9;
    font-size: 0.95rem;
}

.item-ranking .telefone {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Quantidade de Bilhetes */
.item-ranking .quantidade {
    font-size: 0.9rem;
    font-weight: 600;
    color: #38bdf8; /* Azul destaque */
    white-space: nowrap;
}

.nota-ranking {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    font-style: italic;
    margin-top: 1rem;
}

/* ========================================= */
/* ESTILOS RESTANTES (MANTIDOS E ORGANIZADOS)*/
/* ========================================= */

/* MODAL PIX (Detalhes internos) */
.cronometro-box {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #facc15;
    background-color: #0f172a;
    padding: 0.5rem;
    border-radius: 6px;
    margin: 0.8rem 0;
    border: 1px solid #334155;
}

.detalhes-reserva {
    background-color: #0f172a;
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.detalhes-reserva strong {
    color: #38bdf8;
}

.qr-code-box {
    text-align: center;
    margin: 1rem 0;
}

.qr-code-box img {
    border-radius: 8px;
    border: 4px solid #ffffff;
    max-width: 160px;
}

.copia-cola-box {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.copia-cola-box input {
    flex: 1;
    padding: 0.7rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.85rem;
    outline: none;
}

#btn-copiar-pix {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.acoes-modal {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-pago {
    width: 100%;
    background-color: #16a34a;
    color: #ffffff;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-cancelar {
    width: 100%;
    background-color: #334155;
    color: #94a3b8;
    border: none;
    padding: 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

/* MODAL BUSCA (Detalhes internos) */
.resultado-busca {
    margin-top: 1rem;
}

.btn-buscar {
    width: 100%;
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* ESTILIZAÇÃO DOS RESULTADOS DA BUSCA (Cores de Status) */
.card-bilhete-busca {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: left;
}

.card-bilhete-busca p {
    margin-bottom: 0.4rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.card-bilhete-busca strong {
    color: #f1f5f9;
}

.status-pago, .badge-pago {
    color: #22c55e !important; /* Verde */
    font-weight: bold;
}

.status-pendente, .status-reservado, .badge-pendente {
    color: #facc15 !important; /* Amarelo */
    font-weight: bold;
}

/* RESPONSIVIDADE PARA CELULAR */
@media (max-width: 600px) {
    .container {
        padding: 0.5rem;
    }

    .filtros-status {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-numeros {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .copia-cola-box {
        flex-direction: column;
    }

    #btn-copiar-pix {
        width: 100%;
    }

    .item-ranking {
        padding: 0.6rem 0.8rem;
        gap: 10px;
    }

    .item-ranking .posicao {
        font-size: 1rem;
        width: 30px;
    }
}