/* ========== صفحة المتصدرين ========== */
.leaderboard-section {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.leaderboard-header i {
    font-size: 4rem;
    color: #ffd700;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.leaderboard-header h2 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.leaderboard-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
}

/* فلتر المتصدرين */
.leaderboard-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.leaderboard-filter .filter-btn {
    padding: 12px 30px;
    border: none;
    background: #f0f2f5;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.leaderboard-filter .filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.leaderboard-filter .filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* منصة التتويج */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 50px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    min-height: 350px;
    position: relative;
    overflow: hidden;
}

.leaderboard-podium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.podium-item {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.podium-item:hover {
    transform: translateY(-10px);
}

.podium-item.first-place {
    transform: scale(1.1);
    order: 2;
}

.podium-item.second-place {
    order: 1;
}

.podium-item.third-place {
    order: 3;
}

.crown {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #ffd700;
    animation: shine 2s infinite;
}

@keyframes shine {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.podium-rank {
    margin-bottom: 15px;
}

.podium-rank i {
    font-size: 2rem;
}

.podium-rank i.gold { color: #ffd700; }
.podium-rank i.silver { color: #c0c0c0; }
.podium-rank i.bronze { color: #cd7f32; }

.podium-rank span {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 5px;
}

.podium-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 20px;
    border: 3px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

.first-place .podium-avatar {
    width: 120px;
    height: 120px;
    font-size: 3.5rem;
    border-color: gold;
    box-shadow: 0 0 30px rgba(255,215,0,0.5);
}

.podium-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.podium-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    font-size: 0.9rem;
}

.podium-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 30px;
}

/* جدول المتصدرين */
.leaderboard-table-container {
    margin-top: 40px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.table-header h3 i {
    color: var(--primary-color);
    margin-left: 10px;
}

.search-box.small {
    max-width: 250px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.leaderboard-table thead th {
    background: #f8f9fa;
    padding: 15px;
    font-weight: 600;
    color: var(--dark-color);
    text-align: right;
    border-radius: 10px;
}

.leaderboard-table tbody tr {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.leaderboard-table tbody tr.top-1 {
    background: linear-gradient(90deg, #fff9e6, white);
    border-right: 4px solid gold;
}

.leaderboard-table tbody tr.top-2 {
    border-right: 4px solid silver;
}

.leaderboard-table tbody tr.top-3 {
    border-right: 4px solid #cd7f32;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: none;
}

.rank-cell {
    font-size: 1.2rem;
    font-weight: 700;
}

.rank-cell i.fa-crown { color: #ffd700; }
.rank-cell i.fa-trophy.silver { color: #c0c0c0; }
.rank-cell i.fa-trophy.bronze { color: #cd7f32; }

.rank-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: 700;
    color: #666;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.badge-exam-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-score {
    background: #e8f5e9;
    color: #388e3c;
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
}

.badge-avg {
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-avg.excellent {
    background: #4caf50;
    color: white;
}

.badge-avg.good {
    background: #2196f3;
    color: white;
}

.badge-avg.average {
    background: #ff9800;
    color: white;
}

.badge-avg.poor {
    background: #f44336;
    color: white;
}

/* إحصائيات المتصدرين */
.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
    background: #e8f0fe;
    padding: 12px;
    border-radius: 12px;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-color);
}

.stat-item .stat-label {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .leaderboard-podium {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .podium-item {
        width: 100%;
    }
    
    .podium-item.first-place {
        order: -1;
    }
    
    .leaderboard-filter {
        flex-direction: column;
    }
    
    .leaderboard-filter .filter-btn {
        width: 100%;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box.small {
        max-width: 100%;
    }
    
    .leaderboard-table {
        font-size: 0.9rem;
    }
    
    .student-info i {
        font-size: 1.2rem;
    }
    
    .badge-exam-count,
    .badge-score,
    .badge-avg {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    .leaderboard-stats {
        grid-template-columns: 1fr;
    }
}
/* تحسينات لصفحة المتصدرين */
.badge-score.highlight {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #333;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 8px 15px;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.badge-highest {
    background: #4caf50;
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* تحسين عرض الإحصائيات */
.stat-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    background: #e8f0fe;
    padding: 15px;
    border-radius: 12px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-color);
}
/* أنيميشن */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-section {
    animation: fadeInUp 0.5s ease;
}

.leaderboard-table tbody tr {
    animation: fadeInUp 0.3s ease;
    animation-fill-mode: both;
}

.leaderboard-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.leaderboard-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.leaderboard-table tbody tr:nth-child(5) { animation-delay: 0.5s; }