/* =========================================
   1. VARIÁVEIS E RESET GLOBAL
   ========================================= */
:root {
    --bg-body: #F9FAFB;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --primary-color: #2563EB;     /* Azul Royal */
    --primary-hover: #1D4ED8;
    --secondary-bg: #F3F4F6;
    --navbar-height: 70px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding-top: var(--navbar-height);
}

a { text-decoration: none; }

/* =========================================
   2. NAVBAR (MENU SUPERIOR)
   ========================================= */
.navbar-indexfit {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #E5E7EB;
    height: var(--navbar-height);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.brand-logo span { color: var(--primary-color); }

.nav-link-custom {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link-custom:hover {
    color: var(--primary-color);
    background-color: var(--secondary-bg);
}

.nav-link-custom.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* =========================================
   3. ESTRUTURA E CONTEÚDO
   ========================================= */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* =========================================
   4. COMPONENTES VISUAIS GERAIS
   ========================================= */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #2563EB 0%, #1E3A8A 100%);
    border-radius: 24px;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.4);
    margin-bottom: 3rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

/* Busca Flutuante (Com correção de z-index) */
.search-floating {
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    gap: 10px;
    max-width: 500px;
    position: relative;
    z-index: 100;
}
.search-floating input { border: none; padding-left: 20px; box-shadow: none; }
.search-floating input:focus { background: transparent; }

/* Cards */
.card-metric, .card-ranking-home, .news-card {
    background: var(--bg-card);
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.card-ranking-home:hover, .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

/* Notícias */
.news-card { padding: 0; display: flex; flex-direction: column; }
.news-img-wrapper { height: 200px; overflow: hidden; position: relative; }
.news-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.news-card:hover .news-img-wrapper img { transform: scale(1.05); }
.news-category {
    position: absolute; top: 15px; left: 15px;
    background: rgba(255,255,255,0.9); color: #000;
    font-size: 0.7rem; font-weight: 700; padding: 4px 10px;
    border-radius: 20px; text-transform: uppercase;
}
.news-body { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.news-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-main); }

/* Badges de Ranking (Home) */
.rank-badge { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.rank-badge.top-1 { color: #FFD700; }
.rank-badge.top-2 { color: #94A3B8; }
.rank-badge.top-3 { color: #B45309; }

/* =========================================
   5. RANKING EM LISTA (NOVO DESIGN)
   ========================================= */

.ranking-list-container {
    max-width: 900px;
    margin: 0 auto;
}

.ranking-item {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
    cursor: pointer;
}

/* Posição (Número) */
.rank-position {
    font-size: 1.5rem;
    font-weight: 800;
    color: #9CA3AF; /* Cinza padrão */
    min-width: 40px;
    text-align: center;
}

/* --- DESTAQUES TOP 3 --- */

/* 1º Lugar - Ouro */
.ranking-item.rank-1 {
    border-left: 6px solid #FFD700;
    background: linear-gradient(to right, #FFFDF5, #FFFFFF);
}
.rank-1 .rank-position { color: #FFD700; font-size: 2rem; }
.medal-icon { font-size: 1.5rem; }

/* 2º Lugar - Prata */
.ranking-item.rank-2 {
    border-left: 6px solid #C0C0C0;
}
.rank-2 .rank-position { color: #A0A0A0; font-size: 1.8rem; }

/* 3º Lugar - Bronze */
.ranking-item.rank-3 {
    border-left: 6px solid #CD7F32;
}
.rank-3 .rank-position { color: #CD7F32; font-size: 1.8rem; }

/* Responsividade da Lista */
@media (max-width: 576px) {
    .ranking-item {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.8rem;
    }
    .ranking-info { width: 100%; }
    .ranking-actions { width: 100%; margin-top: 10px; }
    .btn { width: 100%; }
}


/* =========================================
   6. RESPONSIVIDADE
   ========================================= */
@media (max-width: 991px) {
    .hero-title { font-size: 2rem; }
    .hero-section { padding: 2.5rem 1.5rem; }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        margin-top: 10px;
    }
}

/* Mobile Pódio: Vira uma lista empilhada */
@media (max-width: 768px) {
    .podium-container { flex-direction: column; align-items: center; }
    .podium-place { width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
    .podium-block { width: 100%; height: auto !important; min-height: 80px; border-radius: 15px; }
    .podium-avatar { margin-bottom: -20px; z-index: 5; }
}