/**
 * Viral Leaderboard - 2advanced-Inspired Stylesheet
 * 
 * Premium leaderboard design with creative flair
 * Glassmorphism, gradients, animations, and micro-interactions
 * 
 * Save to: public/css/viral-leaderboard.css
 */

/* ============================================
   VARIABLES & THEME
   ============================================ */

:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --gradient-silver: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    --gradient-bronze: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
    --gradient-champion: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   PAGE LAYOUT
   ============================================ */

.viral-leaderboard-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.leaderboard-hero {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 0;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    margin: 0 0 16px 0;
    letter-spacing: -2px;
    line-height: 1.1;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 48px 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Statistics Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
}

.stat-item {
    text-align: center;
    animation: fadeInUp 0.6s ease backwards;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

.stat-value {
    font-size: 36px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.leaderboard-content {
    padding: 48px 0;
}

.leaderboard-tabs {
    position: relative;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 32px;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #ffffff;
}

.tab-indicator {
    position: absolute;
    height: calc(100% - 16px);
    background: var(--gradient-primary);
    border-radius: 12px;
    transition: var(--transition-smooth);
    z-index: 0;
    top: 8px;
}

/* Last Updated */
.last-updated {
    text-align: right;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.last-updated i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TAB CONTENT
   ============================================ */

.tab-content-wrapper {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CHAMPION SPOTLIGHT
   ============================================ */

.champion-spotlight {
    position: relative;
    margin-bottom: 64px;
    padding: 48px 0;
}

.spotlight-background {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: var(--gradient-champion);
    filter: blur(150px);
    opacity: 0.2;
    z-index: 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.2; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 0.3; }
}

.spotlight-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.champion-badge-large {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.champion-badge-large i {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 12px rgba(246, 211, 101, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.champion-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 32px 0;
    letter-spacing: -1px;
}

.gradient-text-champion {
    background: var(--gradient-champion);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.champion-card {
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.champion-image {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
}

.champion-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.champion-info {
    padding: 32px;
}

.tattoo-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #ffffff;
}

.artist-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.artist-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.artist-name {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.verified {
    color: #4facfe;
    font-size: 16px;
}

.champion-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.champion-stats .stat {
    flex: 1;
    text-align: center;
}

.champion-stats .stat i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
    background: var(--gradient-champion);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.champion-stats .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.champion-stats .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-view-champion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-champion);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.btn-view-champion:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.5);
}

/* ============================================
   PODIUM SECTION
   ============================================ */

.podium-section {
    margin-bottom: 64px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 32px 0;
    text-align: center;
    letter-spacing: -0.5px;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: end;
    max-width: 1000px;
    margin: 0 auto;
}

.podium-card {
    position: relative;
    overflow: hidden;
    transition: var(--transition-bounce);
    animation: fadeInUp 0.6s ease backwards;
}

.podium-card.podium-1 {
    animation-delay: 0.2s;
    transform: translateY(-20px);
}

.podium-card.podium-2 {
    animation-delay: 0.1s;
}

.podium-card.podium-3 {
    animation-delay: 0.3s;
}

.podium-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.podium-rank {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.gold-rank {
    background: var(--gradient-gold);
    color: #ffffff;
}

.silver-rank {
    background: var(--gradient-silver);
    color: #333333;
}

.bronze-rank {
    background: var(--gradient-bronze);
    color: #ffffff;
}

.podium-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
}

.podium-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.podium-card:hover .podium-image img {
    transform: scale(1.1);
}

.image-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.podium-content {
    padding: 24px;
}

.podium-tattoo-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #ffffff;
}

.podium-artist {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.podium-artist-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.podium-artist-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.podium-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ff6b6b;
}

.btn-podium-view {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-podium-view:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   LEADERBOARD LIST/TABLE
   ============================================ */

.leaderboard-list {
    margin-top: 64px;
}

.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 80px 1fr 200px 150px 60px;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: var(--transition-smooth);
    animation: fadeInUp 0.4s ease backwards;
}

.leaderboard-row:nth-child(n) {
    animation-delay: calc(0.05s * var(--index, 1));
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

/* Rank */
.row-rank {
    text-align: center;
}

.rank-number {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image */
.row-image {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
}

.row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.leaderboard-row:hover .row-image img {
    transform: scale(1.1);
}

.row-badge-mini {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Info */
.row-info {
    min-width: 0;
}

.row-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-title a {
    color: #ffffff;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.row-title a:hover {
    color: #667eea;
}

.row-artist {
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-artist-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.row-artist-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.row-artist-name:hover {
    color: #ffffff;
}

/* Stats */
.row-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.row-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Score */
.row-score {
    text-align: right;
}

.score-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.score-value {
    font-size: 20px;
    font-weight: 700;
    color: #ff6b6b;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.score-value.velocity {
    color: #a855f7;
}

/* Action */
.row-action {
    text-align: center;
}

.btn-row-view {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-row-view:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: scale(1.1);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .leaderboard-row {
        grid-template-columns: 50px 70px 1fr 180px 120px 50px;
        gap: 12px;
        padding: 14px 16px;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 48px;
    }
    
    .stats-bar {
        gap: 32px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .podium {
        gap: 16px;
    }
    
    .leaderboard-row {
        grid-template-columns: 40px 60px 1fr 100px 50px;
        gap: 10px;
    }
    
    .row-stats {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        gap: 24px;
    }
    
    .stat-item {
        flex: 0 0 calc(50% - 12px);
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: flex-start;
    }
    
    .podium {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .podium-card.podium-1 {
        transform: translateY(0);
        order: 1;
    }
    
    .podium-card.podium-2 {
        order: 2;
    }
    
    .podium-card.podium-3 {
        order: 3;
    }
    
    .leaderboard-row {
        grid-template-columns: 30px 60px 1fr 80px;
        gap: 8px;
        padding: 12px;
    }
    
    .row-action {
        display: none;
    }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

.leaderboard-table::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-table::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.leaderboard-table::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

.leaderboard-table::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
    .glass-card {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

