/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1e40af;
    --secondary-blue: #3b82f6;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 20px;
    font-weight: 400;
}

.header-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-github {
    background-color: #1a1a1a;
    color: white;
}

.btn-github:hover {
    background-color: #2d2d2d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-arxiv {
    background-color: #b31b1b;
    color: white;
}

.btn-arxiv:hover {
    background-color: #c92a2a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-huggingface {
    background-color: #ffd21e;
    color: #1a1a1a;
}

.btn-huggingface:hover {
    background-color: #ffd93d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding-bottom: 60px;
}

.leaderboard-container {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.leaderboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tabs {
    display: flex;
    gap: 8px;
    background-color: var(--bg-light);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(37, 99, 235, 0.1);
}

.tab-btn.active {
    background-color: var(--primary-blue);
    color: white;
}

.leaderboard-description {
    margin-bottom: 24px;
    padding: 16px;
    background-color: var(--bg-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.leaderboard-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.leaderboard-description u {
    text-decoration: underline;
    text-decoration-color: var(--text-secondary);
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-box select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    background-color: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

.filter-box select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.leaderboard-table thead {
    background-color: var(--bg-light);
}

.leaderboard-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.leaderboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 32px;
}

.leaderboard-table th.sortable:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.sort-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--text-muted);
    opacity: 0.5;
}

.sort-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--text-muted);
}

.sort-icon.asc {
    border-bottom-color: var(--primary-blue);
    opacity: 1;
}

.sort-icon.asc::after {
    opacity: 0.3;
}

.sort-icon.desc {
    border-top-color: var(--primary-blue);
    opacity: 1;
}

.sort-icon.desc {
    border-bottom-color: transparent;
}

.sort-icon.desc::after {
    border-top-color: var(--primary-blue);
    opacity: 1;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.leaderboard-table tbody tr:hover {
    background-color: var(--bg-light);
}

.leaderboard-table td {
    padding: 16px;
    color: var(--text-primary);
}

.leaderboard-table td.rank-cell {
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.rank-medal {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.rank-medal.gold {
    color: #fbbf24;
}

.rank-medal.silver {
    color: #9ca3af;
}

.rank-medal.bronze {
    color: #d97706;
}

.verified-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    vertical-align: middle;
    color: var(--success-color);
}

.model-name {
    font-weight: 600;
    color: var(--text-primary);
}

.model-name.best {
    font-weight: 700;
}

.model-name.second-best {
    text-decoration: underline;
    text-decoration-color: var(--text-primary);
}

.org-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.org-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.org-icon.openai {
    background: linear-gradient(135deg, #10a37f 0%, #1a7f72 100%);
}

.org-icon.anthropic {
    background: linear-gradient(135deg, #d97757 0%, #b45309 100%);
}

.org-icon.google {
    background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
}

.org-icon.meta {
    background: linear-gradient(135deg, #1877f2 0%, #0d47a1 100%);
}

.org-icon.deepseek {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.org-icon.other {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.details-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.details-link:hover {
    color: var(--primary-blue-dark);
    text-decoration: underline;
}

.table-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9375rem;
    }

    .leaderboard-container {
        padding: 20px;
    }

    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
    }

    .controls {
        flex-direction: column;
    }

    .search-box,
    .filter-box {
        width: 100%;
    }

    .leaderboard-table {
        font-size: 0.875rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 8px;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}
