/* ============================================
   RANKINGS CSS - Sistema de Gamificación
   ============================================ */

.rankings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.rankings-header {
    text-align: center;
    margin-bottom: 32px;
}

.rankings-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.rankings-subtitle {
    color: var(--text-secondary, #6b7280);
    font-size: 1rem;
}

.rankings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.rankings-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.rankings-tab:hover {
    color: var(--text-primary, #111827);
    background: #f9fafb;
}

.rankings-tab.active {
    color: #374151;
    border-bottom-color: #53fc1b;
}

.rankings-section {
    display: none;
}

.rankings-section.active {
    display: block;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-description {
    color: var(--text-secondary, #6b7280);
    margin-bottom: 24px;
}

.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s;
}

.ranking-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ranking-position {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ranking-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-secondary, #6b7280);
}

.ranking-medal {
    font-size: 1.5rem;
}

.ranking-medal--gold { 
    color: #FFD700; 
}

.ranking-medal--silver { 
    color: #C0C0C0; 
}

.ranking-medal--bronze { 
    color: #CD7F32; 
}

.ranking-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-name {
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

.ranking-username {
    color: var(--text-secondary, #6b7280);
    font-weight: 400;
    margin-left: 8px;
}

.ranking-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
}

.ranking-badges {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.badge-mini {
    font-size: 1.25rem;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #6b7280);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   SELECTOR DE PERÍODO
   ============================================ */

.rankings-period-selector {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.period-btn {
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.period-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.period-btn.active {
    background: #53fc1b;
    color: #000;
    border-color: #53fc1b !important;
}

/* ============================================
   MODO OSCURO
   ============================================ */

.dark-mode .rankings-container {
    background: transparent;
}

.dark-mode .rankings-title,
.dark-mode .section-title,
.dark-mode .ranking-name {
    color: #E4E6EB;
}

.dark-mode .rankings-subtitle,
.dark-mode .section-description,
.dark-mode .ranking-username,
.dark-mode .stat-item {
    color: #B0B3B8;
}

.dark-mode .rankings-tabs {
    border-bottom-color: #2a2b2d;
}

.dark-mode .rankings-tab {
    color: #B0B3B8;
}

.dark-mode .rankings-tab:hover {
    background: #242526;
    color: #E4E6EB;
}

.dark-mode .rankings-tab.active {
    color: #53fc1b;
    border-bottom-color: #53fc1b;
}

.dark-mode .ranking-item {
    background: #1a1b1d;
    border-color: #2a2b2d;
}

.dark-mode .ranking-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    background: #242526;
}

.dark-mode .ranking-number {
    color: #B0B3B8;
}

.dark-mode .empty-state {
    color: #B0B3B8;
}

.dark-mode .period-btn {
    background: #2a2b2d;
    color: #B0B3B8;
    border-color: #3a3b3d !important;
}

.dark-mode .period-btn:hover {
    background: #3a3b3d;
    color: #E4E6EB;
}

.dark-mode .period-btn.active {
    background: #53fc1b;
    color: #fff;
    border-color: #53fc1b !important;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .rankings-container {
        padding: 16px;
    }
    
    .rankings-title {
        font-size: 1.5rem;
    }
    
    .rankings-tabs {
        gap: 4px;
    }
    
    .rankings-tab {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .ranking-item {
        padding: 12px;
        gap: 12px;
    }
    
    .ranking-avatar {
        width: 48px;
        height: 48px;
    }
    
    .ranking-stats {
        gap: 12px;
    }
    
    .period-btn {
        padding: 6px 16px;
        font-size: 0.875rem;
    }
}

