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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #1f2937;
}

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

/* Header */
.header {
    background: white;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.6s ease-out;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.trophy-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
}

.trophy-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 2.5;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.header p {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.header-stats {
    display: flex;
    gap: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 24px 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 200px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    color: #667eea;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 4px;
}

/* Loading State */
.loading-state {
    background: white;
    border-radius: 24px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

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

.loading-state p {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 500;
}

/* Error State */
.error-state {
    background: white;
    border-radius: 24px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-state svg {
    width: 64px;
    height: 64px;
    color: #ef4444;
    stroke-width: 2;
}

.error-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.error-state p {
    font-size: 1rem;
    color: #6b7280;
}

.retry-btn {
    margin-top: 16px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* Podium Section */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 24px;
    margin-bottom: 60px;
    padding: 40px 20px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: scaleUp 0.6s ease-out;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.podium-item {
    flex: 1;
    max-width: 300px;
    text-align: center;
    position: relative;
    animation: slideUp 0.6s ease-out;
}

.podium-item.first {
    animation-delay: 0.1s;
}

.podium-item.second {
    animation-delay: 0.2s;
}

.podium-item.third {
    animation-delay: 0.3s;
}

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

.podium-rank {
    position: absolute;
    top: -10px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    color: #6b7280;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.podium-rank.winner {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5);
}

.crown {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    animation: bounce 1s ease-in-out infinite;
}

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

.crown svg {
    width: 100%;
    height: 100%;
    color: #fbbf24;
    filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.5));
}

.podium-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 4px solid white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.podium-avatar.gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.podium-avatar.silver {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
}

.podium-avatar.bronze {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.podium-avatar svg {
    width: 50px;
    height: 50px;
    color: white;
    stroke-width: 2;
}

.podium-item.first .podium-avatar {
    width: 120px;
    height: 120px;
}

.podium-item.first .podium-avatar svg {
    width: 60px;
    height: 60px;
}

.podium-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.podium-item.first .podium-name {
    font-size: 1.5rem;
}

.podium-tests {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 16px;
}

.podium-tests svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.podium-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.subject-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subject-badge.more {
    background: #e5e7eb;
    color: #6b7280;
}

.podium-classes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}

.class-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.class-badge.more {
    background: #e5e7eb;
    color: #6b7280;
}

.podium-stand {
    height: 120px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    margin-top: 24px;
}

.podium-item.first .podium-stand {
    height: 160px;
}

.gold-stand {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 -8px 24px rgba(251, 191, 36, 0.3);
}

.silver-stand {
    background: linear-gradient(180deg, #e5e7eb 0%, #9ca3af 100%);
    box-shadow: 0 -8px 24px rgba(156, 163, 175, 0.3);
}

.bronze-stand {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 -8px 24px rgba(217, 119, 6, 0.3);
}

.stand-label {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Rankings Section */
.rankings-section {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 24px;
}

.section-title svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.rankings-list {
    display: grid;
    gap: 16px;
}

.ranking-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeInCard 0.5s ease-out both;
}

.ranking-card:nth-child(1) { animation-delay: 0.05s; }
.ranking-card:nth-child(2) { animation-delay: 0.1s; }
.ranking-card:nth-child(3) { animation-delay: 0.15s; }
.ranking-card:nth-child(4) { animation-delay: 0.2s; }
.ranking-card:nth-child(5) { animation-delay: 0.25s; }
.ranking-card:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ranking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.rank-badge {
    min-width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    background: #f3f4f6;
    color: #6b7280;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(156, 163, 175, 0.4);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.4);
}

.medal {
    font-size: 2rem;
}

.rank-number {
    font-size: 1.25rem;
}

.teacher-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teacher-avatar svg {
    width: 30px;
    height: 30px;
    color: white;
    stroke-width: 2;
}

.teacher-info {
    flex: 1;
    min-width: 0;
}

.teacher-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.teacher-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-tag {
    padding: 4px 12px;
    background: #f3f4f6;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.teacher-stats {
    display: flex;
    gap: 32px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item svg {
    width: 24px;
    height: 24px;
    color: #667eea;
    stroke-width: 2;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.stat-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-stats {
        width: 100%;
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-item {
        max-width: 400px;
        width: 100%;
    }

    .podium-item.first {
        order: -1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }

    .header {
        padding: 24px;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .trophy-icon {
        width: 60px;
        height: 60px;
    }

    .trophy-icon svg {
        width: 30px;
        height: 30px;
    }

    .ranking-card {
        flex-wrap: wrap;
        gap: 16px;
    }

    .teacher-stats {
        width: 100%;
        justify-content: space-around;
    }

    .section-title {
        font-size: 1.5rem;
    }
}