/* ==========================================================================
   ESTILOS JÁ EXISTENTES (HISTÓRIA E PDF)
   ========================================================================== */

.sobre-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Lato', sans-serif;
}

.history-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: start;
}

.history-section h2 {
    font-family: 'Oswald', sans-serif;
    color: #1F314C;
    text-transform: uppercase;
    font-size: 2.5rem;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--secondary-color);
    display: inline-block;
}

.text-block p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 15px;
    text-align: justify;
}

.quote-box {
    background-color: white;
    padding: 20px;
    border-left: 5px solid var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    font-style: italic;
    margin: 20px 0;
}

/* --- ESTILO DO VISUALIZADOR (REGRAS) --- */
.rules-wrapper {
    margin-top: 50px;
    clear: both; /* Evita que o footer suba */
    width: 100%;
    display: block;
}

.rules-wrapper h2 {
    font-family: 'Oswald', sans-serif;
    color: #1F314C;
    font-size: 2.5rem;
    text-transform: uppercase;
}

.pdf-viewer-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    margin-bottom: 50px; /* Margem de segurança para o footer */
}

.pdf-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.pdf-body {
    width: 100%;
    height: 600px; /* Altura fixa evita que o footer ignore o iframe */
    background: #eee;
}

.pdf-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* Remove espaços vazios de linha */
}

.btn-pdf {
    background-color: var(--link-hover-color);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.8rem;
    transition: 0.3s;
}

.btn-pdf:hover {
    background-color: #333;
}


/* ==========================================================================
   NOVA SEÇÃO: RANKING DINÂMICO (EQUIPES E ATLETAS)
   ========================================================================== */

.ranking-wrapper {
    margin-top: 50px;
    margin-bottom: 60px;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #E2E8F0;
}

.ranking-wrapper h2 {
    font-family: 'Oswald', sans-serif;
    color: #1F314C;
    font-size: 2.5rem;
    text-transform: uppercase;
}

/* Alternador de Abas (Tabs) */
.ranking-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.rank-tab-btn {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #475569;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-tab-btn:hover {
    background: #E2E8F0;
    color: #1E293B;
}

.rank-tab-btn.active {
    background: #CBD5E1;
    color: #1E293B;
    box-shadow: 0 4px 12px rgba(138, 174, 79, 0.25);
}

/* Filtros Seletores (Ano e Categoria) */
.ranking-filters {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group.hidden {
    display: none !important;
}

.filter-group label {
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}

.filter-group select {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #1E293B;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:focus {
    border-color: var(--secondary-color);
}

/* Tabelas Customizadas do Ranking */
.ranking-table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #FFFFFF;
}

.ranking-table th {
    background: #F8FAFC;
    padding: 18px 20px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E2E8F0;
}

.ranking-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    color: #334155;
    font-size: 1rem;
}

/* Sistema de Pódio Visual (Ouro, Prata, Bronze) */
.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F1F5F9;
    color: #475569;
    font-weight: 700;
    font-size: 0.9rem;
}

.pos-1 { background-color: #FFFDF0; }
.pos-1 .pos-badge { background: #FFD700; color: #7A5C00; box-shadow: 0 2px 5px rgba(255,215,0,0.2); }
.pos-1 td { font-weight: 600; }

.pos-2 { background-color: #F8FAFC; }
.pos-2 .pos-badge { background: #C0C0C0; color: #4A4A4A; }

.pos-3 { background-color: #FAF6F0; }
.pos-3 .pos-badge { background: #CD7F32; color: #FFFFFF; }

.rank-pts {
    font-weight: 700;
    color: var(--link-hover-color);
    font-size: 1.05rem;
}

/* Feedbacks e Loaders */
.ranking-placeholder {
    text-align: center;
    padding: 50px 20px;
    color: #64748B;
    font-size: 1.1rem;
}

.ranking-placeholder i {
    font-size: 1.6rem;
    margin-right: 10px;
    color: var(--secondary-color);
}

.no-data-alert, .select-category-alert {
    text-align: center;
    padding: 50px 20px;
    background: #F8FAFC;
    border-radius: 12px;
    color: #64748B;
    border: 1px dashed #CBD5E1;
    font-size: 1.05rem;
}

.no-data-alert i, .select-category-alert i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 12px;
}

.select-category-alert i {
    color: var(--secondary-color);
}


/* ==========================================================================
   MEDIA QUERIES (RESPONSIVIDADE GERAL)
   ========================================================================== */

@media (max-width: 768px) {
    .history-section {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .history-section h2, .rules-wrapper h2, .ranking-wrapper h2 {
        font-size: 2rem;
    }

    .pdf-body {
        height: 450px;
    }

    .ranking-wrapper {
        padding: 20px 16px;
    }

    .ranking-nav {
        flex-direction: column;
        gap: 10px;
    }

    .rank-tab-btn {
        width: 100%;
        justify-content: center;
    }

    .ranking-filters {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .filter-group select {
        width: 100%;
    }
}