/**
 * TEAM-X Top 10 Students - Frontend Styles
 * Top 3 highlighted with large colored cards, others in grid
 */

.teamx-leaderboard {
    width: 100%;
    margin: 20px 0;
}

/* Top 3 Section */
.teamx-top3-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.teamx-top3-card {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 200px;
    max-width: 280px;
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.teamx-top3-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Rank 1 - Gold */
.teamx-rank-1 {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-rank-1 .teamx-top3-name,
.teamx-rank-1 .teamx-score-value,
.teamx-rank-1 .teamx-rank-label,
.teamx-rank-1 .teamx-score-label {
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

/* Rank 2 - Silver */
.teamx-rank-2 {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-rank-2 .teamx-top3-name,
.teamx-rank-2 .teamx-score-value,
.teamx-rank-2 .teamx-rank-label,
.teamx-rank-2 .teamx-score-label {
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

/* Rank 3 - Bronze */
.teamx-rank-3 {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-rank-3 .teamx-top3-name,
.teamx-rank-3 .teamx-score-value,
.teamx-rank-3 .teamx-rank-label,
.teamx-rank-3 .teamx-score-label {
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

/* Top 3 Icon */
.teamx-top3-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teamx-top3-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.teamx-icon-placeholder {
    font-size: 60px;
    line-height: 1;
}

/* Top 3 Info */
.teamx-top3-info {
    width: 100%;
}

.teamx-top3-name {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-top3-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.teamx-score-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-score-label {
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

.teamx-rank-label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    opacity: 0.9;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
}

/* Others Section */
.teamx-others-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.teamx-other-card {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 80px;
}

.teamx-other-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.teamx-other-rank {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--rank-color, var(--teamx-rank-other, rgba(245, 245, 245, 0.5)));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.teamx-other-info {
    flex: 1;
    min-width: 0;
}

.teamx-other-name {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.teamx-other-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--teamx-card-text, var(--teamx-text-dark, #333333));
    line-height: 1;
}

/* RTL Support */
[dir="rtl"] .teamx-leaderboard {
    direction: rtl;
}

[dir="rtl"] .teamx-other-card {
    flex-direction: row-reverse;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .teamx-top3-section {
        gap: 15px;
    }
    
    .teamx-top3-card {
        min-width: 180px;
        max-width: 240px;
        padding: 25px 20px;
    }
    
    .teamx-top3-icon {
        width: 70px;
        height: 70px;
    }
    
    .teamx-icon-placeholder {
        font-size: 50px;
    }
    
    .teamx-top3-name {
        font-size: 16px;
    }
    
    .teamx-score-value {
        font-size: 28px;
    }
}

@media (max-width: 992px) {
    .teamx-top3-section {
        flex-direction: column;
        align-items: center;
    }
    
    .teamx-top3-card {
        max-width: 100%;
        width: 100%;
        min-width: auto;
    }
    
    .teamx-others-section {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .teamx-top3-card {
        padding: 20px 15px;
    }
    
    .teamx-top3-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .teamx-icon-placeholder {
        font-size: 40px;
    }
    
    .teamx-top3-name {
        font-size: 15px;
    }
    
    .teamx-score-value {
        font-size: 24px;
    }
    
    .teamx-others-section {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .teamx-other-card {
        padding: 15px;
        min-height: 70px;
    }
    
    .teamx-other-rank {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .teamx-other-name {
        font-size: 14px;
    }
    
    .teamx-other-score {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .teamx-top3-section {
        gap: 15px;
    }
    
    .teamx-others-section {
        grid-template-columns: 1fr;
    }
    
    .teamx-other-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    [dir="rtl"] .teamx-other-card {
        flex-direction: column;
    }
}

/* Utility Classes */
.teamx-leaderboard * {
    box-sizing: border-box;
}

.teamx-leaderboard img {
    max-width: 100%;
    height: auto;
}
