/* Leaderboard Dashlet Styles */

.dashlet-leaderboard {
    padding: 10px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    flex-wrap: wrap;
    gap: 10px;
}

.period-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.track-badge {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.participants-count {
    font-size: 13px;
    color: #6c757d;
}

.participants-count .badge {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-right: 5px;
}

.leaderboard-table {
    overflow-x: auto;
    margin-bottom: 15px;
}

.leaderboard-table table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: #f8f9fa;
}

.leaderboard-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 10px 8px;
    text-align: left;
}

.leaderboard-table td {
    padding: 12px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.rank-col {
    width: 60px;
    text-align: center;
}

.user-col {
    min-width: 150px;
}

.points-col {
    width: 120px;
    white-space: nowrap;
}

.streaks-col {
    width: 60px;
    text-align: center;
}

.change-col {
    width: 60px;
    text-align: center;
}

.leader-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.leader-row:hover {
    background-color: #f8f9fa;
}

.leader-row.current-user {
    background-color: #e7f3ff;
}

.leader-row.current-user:hover {
    background-color: #d0e8ff;
}

.rank-medal {
    font-size: 20px;
    display: inline-block;
}

.rank-medal.gold {
    color: #ffd700;
}

.rank-medal.silver {
    color: #c0c0c0;
}

.rank-medal.bronze {
    color: #cd7f32;
}

.rank-number {
    font-weight: 600;
    font-size: 16px;
    color: #6c757d;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-small-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    color: #212529;
}

.transaction-count {
    font-size: 11px;
    margin-left: 4px;
}

.streak-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.change-up {
    color: #28a745;
    font-weight: 600;
    font-size: 12px;
}

.change-down {
    color: #dc3545;
    font-weight: 600;
    font-size: 12px;
}

.change-same {
    color: #6c757d;
    font-size: 12px;
}

.change-new {
    color: #ffc107;
    font-size: 16px;
}

.my-rank-panel {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-rank-label {
    font-size: 14px;
    opacity: 0.9;
}

.my-rank-value {
    display: flex;
    align-items: center;
    gap: 15px;
}

.my-rank-value .rank {
    font-size: 24px;
    font-weight: 700;
}

.my-rank-value .points {
    font-size: 16px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 10px;
}

.loading-container {
    padding: 40px;
    font-size: 16px;
    color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .period-info {
        font-size: 13px;
    }
    
    .participants-count {
        font-size: 12px;
    }
    
    .leaderboard-table th {
        font-size: 11px;
        padding: 8px 6px;
    }
    
    .leaderboard-table td {
        padding: 10px 6px;
    }
    
    .user-avatar-small,
    .user-avatar-small-placeholder {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .rank-medal {
        font-size: 18px;
    }
    
    .rank-number {
        font-size: 14px;
    }
    
    .my-rank-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .my-rank-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .my-rank-value .rank {
        font-size: 20px;
    }
    
    .my-rank-value .points {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .streaks-col,
    .change-col {
        display: none;
    }
    
    .points-col {
        font-size: 13px;
    }
    
    .transaction-count {
        display: none;
    }
}
