/* Enhanced Leaderboard Styling */
.anime-sidebar-leaderboard {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1e2030 0%, #0d1117 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.anime-sidebar-leaderboard .card-body {
    padding: 1.25rem;
}

.anime-sidebar-leaderboard h3 {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem !important;
}

.anime-sidebar-leaderboard h3 .text-muted {
    background: #6c5ce7;
    color: white !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.desktop-leaderboard .row {
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px !important;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.desktop-leaderboard .row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.desktop-leaderboard .col-auto {
    position: relative;
    padding-right: 8px;
}

/* Position styling for avatar containers */
.position-relative {
    margin-right: 2px;
}

.desktop-leaderboard .avatar-body,
.leaderboard-full .avatar-body {
    position: relative;
    z-index: 1;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Special styling for top 3 ranks */
.desktop-leaderboard .top-rank {
    padding: 10px;
    border-width: 2px;
}

.desktop-leaderboard .rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.desktop-leaderboard .rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.05) 100%);
    border-color: rgba(192, 192, 192, 0.3);
}

.desktop-leaderboard .rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.05) 100%);
    border-color: rgba(205, 127, 50, 0.3);
}

/* Avatar styling */
.desktop-leaderboard .avatar {
    position: relative;
    transition: transform 0.2s ease;
    margin-right: 5px;
}

.desktop-leaderboard .avatar:hover {
    transform: scale(1.1);
}

/* Remove default star that conflicts with badge */
.desktop-leaderboard .avatar:before,
.leaderboard-full .avatar:before {
    display: none !important;
}

/* Improved avatar badge positioning and styling - now positioned outside avatar */
.desktop-leaderboard .avatar-badge,
.leaderboard-full .avatar-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: white;
    border-radius: 50%;
    border: 2px solid #1e2030;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    transform: translateZ(1px);
}

.desktop-leaderboard .avatar:hover .avatar-badge,
.leaderboard-full .avatar:hover .avatar-badge {
    transform: scale(1.1);
}

.leaderboard-full .avatar-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

/* Enhanced badge styling for top ranks */
.desktop-leaderboard .rank-1 .avatar-badge,
.leaderboard-full .rank-1 .avatar-badge {
    background: linear-gradient(135deg, #ffd700 0%, #e6b800 100%);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: scale(1.1) translateZ(2px);
    animation: gold-pulse 2s infinite;
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.desktop-leaderboard .rank-2 .avatar-badge,
.leaderboard-full .rank-2 .avatar-badge {
    background: linear-gradient(135deg, #c0c0c0 0%, #a6a6a6 100%);
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.desktop-leaderboard .rank-3 .avatar-badge,
.leaderboard-full .rank-3 .avatar-badge {
    background: linear-gradient(135deg, #cd7f32 0%, #b36a1b 100%);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
}

.desktop-leaderboard .row:not(.rank-1):not(.rank-2):not(.rank-3) .avatar-badge,
.leaderboard-full .row:not(.rank-1):not(.rank-2):not(.rank-3) .avatar-badge {
    background: #6c5ce7;
    box-shadow: 0 0 8px rgba(108, 92, 231, 0.5);
}

/* Username and rank styling */
.desktop-leaderboard .text-uppercase {
    font-size: 10px !important;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6) !important;
}

.desktop-leaderboard .text-current {
    color: white !important;
    font-weight: 600;
    font-size: 14px !important;
    transition: color 0.2s ease;
}

.desktop-leaderboard .text-current:hover {
    color: #6c5ce7 !important;
}

/* XP badge styling */
.desktop-leaderboard .xp-badge {
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    color: white !important;
    font-size: 12px !important;
    letter-spacing: 0.5px;
}

.desktop-leaderboard .rank-1 .xp-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.desktop-leaderboard .rank-2 .xp-badge {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.1) 100%);
    border-color: rgba(192, 192, 192, 0.4);
    color: #c0c0c0 !important;
}

.desktop-leaderboard .rank-3 .xp-badge {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.1) 100%);
    border-color: rgba(205, 127, 50, 0.4);
    color: #cd7f32 !important;
}

/* See all button styling */
.see-all-btn {
    background: linear-gradient(135deg, #6c5ce7 0%, #5246bd 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px !important;
}

.see-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.4);
    background: linear-gradient(135deg, #5246bd 0%, #3c32a6 100%) !important;
}

.see-all-btn:active {
    transform: translateY(0);
}

/* Full leaderboard page enhancements */
.anime-leaderboard-card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1e2030 0%, #0d1117 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.leaderboard-full .row {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px !important;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-full .row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

/* Podium styling */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 150px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
}

.podium-first, .podium-second, .podium-third {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.podium-first {
    z-index: 3;
}

.podium-second {
    margin-right: -15px;
    z-index: 2;
}

.podium-third {
    margin-left: -15px;
    z-index: 1;
}

.podium-block {
    width: 100px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.podium-first .podium-block {
    height: 100px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.5);
    width: 120px;
}

.podium-second .podium-block {
    height: 70px;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.4) 0%, rgba(192, 192, 192, 0.1) 100%);
    border: 2px solid rgba(192, 192, 192, 0.5);
}

.podium-third .podium-block {
    height: 50px;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.4) 0%, rgba(205, 127, 50, 0.1) 100%);
    border: 2px solid rgba(205, 127, 50, 0.5);
}

.podium-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    border: 2px solid;
    color: white;
}

.podium-first .podium-number {
    background: linear-gradient(135deg, #ffd700 0%, #e6b800 100%);
    border-color: rgba(255, 215, 0, 0.5);
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.podium-second .podium-number {
    background: linear-gradient(135deg, #c0c0c0 0%, #a6a6a6 100%);
    border-color: rgba(192, 192, 192, 0.5);
}

.podium-third .podium-number {
    background: linear-gradient(135deg, #cd7f32 0%, #b36a1b 100%);
    border-color: rgba(205, 127, 50, 0.5);
}

.podium-crown {
    position: absolute;
    top: -30px;
    font-size: 24px;
    animation: float 2s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.leaderboard-full .row:not(.rank-1):not(.rank-2):not(.rank-3) .avatar-badge {
    background: #6c5ce7;
}

.leaderboard-full .xp-badge {
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.4);
    padding: 6px 10px;
    border-radius: 6px;
    color: white !important;
    font-size: 14px !important;
    letter-spacing: 0.5px;
}

.leaderboard-full .rank-1 .xp-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.4);
    color: #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.leaderboard-full .rank-2 .xp-badge {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.1) 100%);
    border-color: rgba(192, 192, 192, 0.4);
    color: #c0c0c0 !important;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.leaderboard-full .rank-3 .xp-badge {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.1) 100%);
    border-color: rgba(205, 127, 50, 0.4);
    color: #cd7f32 !important;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.anime-info-card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1e2030 0%, #0d1117 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.anime-info-card h3 {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem !important;
}

.anime-list li {
    transition: transform 0.2s ease;
}

.anime-list li:hover {
    transform: translateX(5px);
}

.btn-back {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .desktop-leaderboard .avatar-body {
        width: 36px;
        height: 36px;
    }
    
    .desktop-leaderboard .text-current {
        font-size: 12px !important;
    }
    
    .desktop-leaderboard .text-uppercase {
        font-size: 9px !important;
    }
    
    .desktop-leaderboard .xp-badge {
        font-size: 10px !important;
        padding: 3px 6px;
    }
    
    .desktop-leaderboard .avatar-badge,
    .leaderboard-full .avatar-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -8px;
        right: -8px;
        z-index: 10;
    }
    
    .desktop-leaderboard .rank-1 .avatar-badge,
    .leaderboard-full .rank-1 .avatar-badge {
        width: 22px;
        height: 22px;
    }
    
    /* Hide star overlay on mobile */
    .desktop-leaderboard .avatar:before,
    .leaderboard-full .avatar:before {
        display: none !important;
    }
}

/* Animation classes */
.row-hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.pulse-animation {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.float-animation {
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.gold-shimmer {
    position: relative;
    overflow: hidden;
}

.gold-shimmer::after {
    content: '';
    position: absolute;
    top: -110%;
    left: -210%;
    width: 200%;
    height: 200%;
    opacity: 0;
    transform: rotate(30deg);
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 77%,
        rgba(255, 215, 0, 0.3) 92%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 5s infinite;
}

.silver-shimmer::after {
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 77%,
        rgba(192, 192, 192, 0.3) 92%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 5s infinite 0.5s;
}

.bronze-shimmer::after {
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 77%,
        rgba(205, 127, 50, 0.3) 92%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 5s infinite 1s;
}

@keyframes shimmer {
    0% { opacity: 0; left: -130%; }
    20% { opacity: 0; }
    100% { opacity: 0.3; left: 130%; }
}

.crown-animation {
    animation: crown-float 2s ease-in-out infinite, crown-rotate 6s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes crown-rotate {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-4px) rotate(-5deg); }
    75% { transform: translateY(-4px) rotate(5deg); }
}

.badge-hover {
    transform: scale(1.2) translateZ(2px) !important;
    z-index: 10 !important;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.7) !important;
}

@keyframes gold-pulse {
    0% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
    100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
}

.btn-clicked {
    transform: scale(0.95) !important;
    box-shadow: 0 2px 5px rgba(108, 92, 231, 0.2) !important;
}