/**
 * MDS Creator Platforms - Pixel Owners Specific Styles
 * 
 * Additional styling for pixel owners leaderboards that extends the base leaderboard styles
 * Focuses on user avatars, profile links, and individual user presentation
 */

/* ==========================================================================
   Avatar Styling for Pixel Owners
   ========================================================================== */

.mds-lb-entry-avatar {
    flex: 0 0 48px;
    margin-right: 12px;
}

.mds-lb-entry-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
    object-fit: cover;
}

/* Avatar placeholder for when no custom image is available */
.mds-lb-entry-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--platform-color, #808080);
    background-color: var(--platform-color, #808080);
    transition: all 0.2s ease;
}

.mds-lb-entry:hover .mds-lb-entry-avatar-img,
.mds-lb-entry:hover .mds-lb-entry-avatar-placeholder {
    border-color: var(--platform-color, #667eea);
    transform: scale(1.05);
}

.mds-lb-entry-top-3 .mds-lb-entry-avatar-img,
.mds-lb-entry-top-3 .mds-lb-entry-avatar-placeholder {
    border-color: var(--platform-color, #ffd700);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   User Information Layout
   ========================================================================== */

.mds-lb-entry-user {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.mds-lb-entry-user-info {
    flex: 1;
    min-width: 0;
}

.mds-lb-entry-user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mds-lb-entry-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.mds-lb-entry-profile-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mds-lb-entry-profile-link:hover {
    color: var(--platform-color, #667eea);
    text-decoration: none;
}

.mds-lb-entry-username {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 400;
    margin-left: 8px;
}

/* ==========================================================================
   Platform Information Styling
   ========================================================================== */

.mds-lb-entry-platform-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 2px;
    min-height: 20px; /* Ensure consistent height for alignment */
}

.mds-lb-entry-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mds-lb-entry-platform-name {
    font-weight: 500;
    color: #495057;
}

.mds-lb-entry-platform-link {
    color: var(--platform-color, #667eea);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.mds-lb-entry-platform-link:hover {
    color: var(--platform-color, #667eea);
    text-decoration: none;
    opacity: 0.8;
}

.mds-lb-entry-external-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.mds-lb-entry-platform-username {
    color: #6c757d;
    font-weight: 400;
}

.mds-lb-entry-platform-username-container {
    margin-left: 8px; /* Small spacing from platform name */
    flex-shrink: 0; /* Prevent shrinking */
    display: flex;
    align-items: center;
    min-width: 0; /* Allow content to shrink if needed */
}

/* Enhanced hover effects for platform links with intelligent background colors */
.mds-lb-entry-platform-username-container:hover .mds-lb-entry-platform-link {
    background-color: var(--platform-hover-bg, rgba(108, 117, 125, 0.1));
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: all 0.2s ease;
}

/* Additional contrast enhancement for better readability */
.mds-lb-entry-platform-username-container:hover .mds-lb-entry-platform-link {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Hover effect for non-linked platform usernames */
.mds-lb-entry-platform-username-container:hover .mds-lb-entry-platform-username {
    background-color: var(--platform-hover-bg, rgba(108, 117, 125, 0.1));
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Ensure platform usernames have consistent styling whether linked or not */
.mds-lb-entry-platform-link,
.mds-lb-entry-platform-username {
    display: inline-block;
    position: relative;
}

/* Responsive adjustments for platform info */
@media (max-width: 768px) {
    .mds-lb-entry-platform-info {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .mds-lb-entry-platform-username-container {
        margin-left: 0; /* Reset spacing on mobile */
        margin-top: 2px;
        flex-basis: auto; /* Allow flexible sizing on mobile */
    }
}

/* ==========================================================================
   Enhanced Stats Display
   ========================================================================== */

.mds-lb-entry-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.mds-lb-entry-blocks,
.mds-lb-entry-pixels,
.mds-lb-entry-percentage {
    text-align: center;
    min-width: 60px;
}

.mds-lb-entry-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.mds-lb-entry-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ==========================================================================
   Progress Bar Styling - UPDATED
   ========================================================================== */

/* Progress bar now positioned at bottom of entry like platform leaderboard */
.mds-pixel-owners-leaderboard .mds-lb-entry-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e9ecef;
    overflow: hidden;
    border-radius: 0; /* Remove border radius for full-width effect */
}

.mds-pixel-owners-leaderboard .mds-lb-entry-progress-bar {
    height: 100%;
    background: var(--platform-color);
    transition: width 0.8s ease;
    position: relative;
}

/* Shimmer effect - only on top 3 entries (subtle glow) */
.mds-pixel-owners-leaderboard .mds-lb-entry-top-3::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}


/* ==========================================================================
   Recent Activity Indicators
   ========================================================================== */

.mds-lb-entry-activity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mds-lb-entry-activity-indicator {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mds-lb-entry-activity-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4caf50;
}

.mds-lb-entry-activity-label {
    font-size: 0.7rem;
    color: #4caf50;
    opacity: 0.8;
}

/* ==========================================================================
   Responsive Design for Pixel Owners
   ========================================================================== */

@media (max-width: 768px) {
    .mds-lb-entry-avatar {
        flex: 0 0 40px;
        margin-right: 10px;
    }
    
    .mds-lb-entry-avatar-img {
        width: 40px;
        height: 40px;
    }
    
    .mds-lb-entry-stats {
        gap: 16px;
    }
    
    .mds-lb-entry-blocks,
    .mds-lb-entry-pixels,
    .mds-lb-entry-percentage {
        min-width: 50px;
    }
    
    .mds-lb-entry-value {
        font-size: 1rem;
    }
    
    .mds-pixel-owners-leaderboard .mds-lb-entry-progress {
        height: 2px; /* Slightly thinner on mobile */
    }
    
    .mds-lb-entry-platform-info {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .mds-lb-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    .mds-lb-entry-rank {
        align-self: flex-end;
        position: absolute;
        top: 12px;
        right: 12px;
    }
    
    .mds-lb-entry-user {
        width: 100%;
        margin-top: 8px;
    }
    
    .mds-lb-entry-stats {
        width: 100%;
        justify-content: space-around;
        border-top: 1px solid #e9ecef;
        padding-top: 12px;
        margin-top: 8px;
    }
    
    .mds-lb-entry-avatar {
        flex: 0 0 36px;
        margin-right: 8px;
    }
    
    .mds-lb-entry-avatar-img {
        width: 36px;
        height: 36px;
    }
    
    .mds-pixel-owners-leaderboard .mds-lb-entry-progress {
        height: 2px; /* Thinner on small mobile */
    }
}

/* ==========================================================================
   Dark Theme Support for Pixel Owners
   ========================================================================== */

.mds-theme-dark .mds-lb-entry-name {
    color: #e9ecef;
}

.mds-theme-dark .mds-lb-entry-username {
    color: #adb5bd;
}

.mds-theme-dark .mds-lb-entry-platform-name {
    color: #dee2e6;
}

.mds-theme-dark .mds-lb-entry-platform-username {
    color: #adb5bd;
}

.mds-theme-dark .mds-lb-entry-value {
    color: #e9ecef;
}

.mds-theme-dark .mds-lb-entry-label {
    color: #adb5bd;
}

.mds-theme-dark .mds-lb-entry-avatar-img {
    border-color: #495057;
}

.mds-theme-dark .mds-lb-entry:hover .mds-lb-entry-avatar-img {
    border-color: var(--platform-color, #667eea);
}

.mds-theme-dark .mds-pixel-owners-leaderboard .mds-lb-entry-progress {
    background: #495057;
}

.mds-theme-dark .mds-lb-entry-activity-indicator {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

/* ==========================================================================
   Animation Enhancements for Pixel Owners
   ========================================================================== */

.mds-lb-entry-avatar-img {
    animation: fadeIn 0.3s ease-out;
}

.mds-pixel-owners-leaderboard .mds-lb-entry-progress-bar {
    animation: progressFill 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width, 0%);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.mds-lb-entry-profile-link:focus,
.mds-lb-entry-platform-link:focus {
    outline: 2px solid var(--platform-color, #667eea);
    outline-offset: 2px;
    border-radius: 2px;
}

.mds-lb-entry-avatar-img {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mds-lb-entry-avatar-img {
        border-width: 3px;
    }
    
    .mds-lb-entry-color-indicator {
        border: 1px solid currentColor;
    }
    
    .mds-pixel-owners-leaderboard .mds-lb-entry-progress {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mds-lb-entry-avatar-img,
    .mds-pixel-owners-leaderboard .mds-lb-entry-progress-bar {
        animation: none;
        transition: none;
    }
    
    .mds-lb-entry:hover .mds-lb-entry-avatar-img {
        transform: none;
    }
}

/* ==========================================================================
   Print Styles for Pixel Owners
   ========================================================================== */

@media print {
    .mds-lb-entry-avatar-img {
        border: 1px solid #000;
    }
    
    .mds-lb-entry-platform-link,
    .mds-lb-entry-profile-link {
        color: #000 !important;
        text-decoration: underline;
    }
    
    .mds-lb-entry-external-icon {
        display: none;
    }
    
    .mds-pixel-owners-leaderboard .mds-lb-entry-progress-bar {
        background: #000 !important;
    }
} 