/* ==============================
   RANKING DE FREQUÊNCIA
   ============================== */

.page-ranking {
    min-height: 100vh;
    background: var(--color-obsidian);
    color: var(--color-card-foreground);
    padding-top: 80px;
}

/* Hero */
.page-ranking .page-hero {
    padding: 80px 0 40px;
    position: relative;
    overflow: hidden;
}

.page-ranking .page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(220, 38, 38, 0.16), transparent 60%);
    pointer-events: none;
}

.page-ranking .page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    line-height: 1;
}

.page-ranking .page-title span {
    color: var(--color-crimson);
}

.page-ranking .page-subtitle {
    max-width: 600px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
}

/* Destaques */
.destaques-section {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
}

.destaques-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateY(-2px);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-sub {
    display: block;
    font-size: 0.9rem;
    color: var(--color-crimson);
}

/* Toolbar */
.ranking-toolbar {
    padding: 30px 0;
}

.toolbar-group {
    margin-bottom: 15px;
}

.toolbar-group:last-child {
    margin-bottom: 0;
}

.toolbar-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.categorias-chips,
.periodo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.35;
}

.chip:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.4);
}

.chip.is-active {
    background: var(--color-crimson);
    border-color: var(--color-crimson);
}

/* Tabela */
.ranking-section {
    padding: 40px 0 80px;
}

.ranking-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    min-width: max(800px, 100%);
}

.ranking-table th {
    text-align: left;
    padding: 16px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
}

.ranking-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-row:hover {
    background: rgba(220, 38, 38, 0.05);
}

.ranking-pos {
    font-weight: 700;
    position: relative;
    width: 60px;
}

.pos-number {
    font-size: 1.2rem;
    color: #fff;
}

.crown-icon {
    position: absolute;
    top: 10px;
    left: 40px;
    color: gold;
    width: 18px;
    height: 18px;
}

.atleta-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.atleta-foto {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(220, 38, 38, 0.3);
    flex-shrink: 0;
}

.atleta-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atleta-dados {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.atleta-nome {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow-wrap: break-word;
}

.atleta-faixa {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.ranking-frequencia {
    text-align: center;
}

.freq-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

.freq-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.ranking-porcentagem {
    min-width: 120px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 24px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--color-crimson), #ef4444);
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ranking-streak {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f97316;
}

.streak-icon {
    width: 18px;
    height: 18px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    display: none;
}

.empty-state.is-showing {
    display: block;
}

/* Responsivo */
@media (max-width: 768px) {
    .page-ranking {
        padding-top: 70px;
    }

    .destaques-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .toolbar-group {
        margin-bottom: 20px;
    }
    
    .categorias-chips,
    .periodo-chips {
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .chip {
        white-space: nowrap;
    }
    
    .ranking-table th:nth-child(4),
    .ranking-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .ranking-table th:nth-child(3),
    .ranking-table td:nth-child(3) {
        display: none;
    }
}
