@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: all 0.3s ease;
    padding: 20px;
}

.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
}

#darkModeToggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: #333;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#darkModeToggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.dark-mode #darkModeToggle {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    text-align: center;
}

.header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title::before {
    content: "🏆";
    font-size: 2.5rem;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
}

.leaderboard-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease;
    overflow: hidden;
}

.dark-mode .leaderboard-container {
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.podium {
    display: flex;
    justify-content: center;
    align-items: end;
    margin-bottom: 3rem;
    gap: 1rem;
    height: 200px;
}

.podium-position {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px 16px 0 0;
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.podium-position:hover {
    transform: translateY(-5px);
}

.podium-position::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.first-place {
    height: 160px;
    width: 140px;
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
}

.second-place {
    height: 130px;
    width: 120px;
    background: linear-gradient(135deg, #c0c0c0, #e2e8f0);
    color: #333;
}

.third-place {
    height: 100px;
    width: 120px;
    background: linear-gradient(135deg, #cd7f32, #d69e2e);
    color: white;
}

.podium-rank {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.podium-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.podium-score {
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.9;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.table-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.table-header th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.table-header th:first-child {
    border-radius: 12px 0 0 0;
    text-align: center;
}

.table-header th:last-child {
    border-radius: 0 12px 0 0;
    text-align: center;
}

tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
}

.dark-mode tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

td {
    padding: 1.25rem 1rem;
    font-weight: 500;
}

.rank-cell {
    text-align: center;
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.dark-mode .rank-cell {
    color: #9f7aea;
}

.name-cell {
    font-weight: 600;
    color: #2d3748;
}

.dark-mode .name-cell {
    color: #e2e8f0;
}

.score-cell {
    text-align: center;
    font-weight: 700;
    color: #38a169;
    font-size: 1.1rem;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-4, .rank-5, .rank-6, .rank-7, .rank-8, .rank-9, .rank-10 {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    color: #4a5568;
}

.navigation-buttons {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

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

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

@media (max-width: 768px) {
    .container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
        height: auto;
        gap: 1rem;
    }
    
    .podium-position {
        width: 200px;
        height: auto !important;
    }
    
    .leaderboard-container {
        padding: 1.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    td, th {
        padding: 1rem 0.5rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-button {
        width: 200px;
        justify-content: center;
    }
}