Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
| """ | |
| CSS styles for the Agent Leaderboard v2 | |
| This file contains all the styling that doesn't change frequently | |
| """ | |
| def get_leaderboard_css(): | |
| """Return the complete CSS for the leaderboard""" | |
| return """ | |
| <style> | |
| /* Import Geist fonts */ | |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); | |
| @font-face { | |
| font-family: 'Geist'; | |
| src: url('https://raw.githubusercontent.com/vercel/geist-font/main/packages/next/dist/fonts/geist-sans/Geist-Variable.woff2') format('woff2'); | |
| font-weight: 100 900; | |
| font-style: normal; | |
| } | |
| @font-face { | |
| font-family: 'Geist Mono'; | |
| src: url('https://raw.githubusercontent.com/vercel/geist-font/main/packages/next/dist/fonts/geist-mono/GeistMono-Variable.woff2') format('woff2'); | |
| font-weight: 100 900; | |
| font-style: normal; | |
| } | |
| /* Root variables for enhanced color scheme */ | |
| :root, | |
| body, | |
| .gradio-container { | |
| --bg-primary: #01091A; | |
| --bg-secondary: rgba(245, 246, 247, 0.03); | |
| --bg-card: rgba(245, 246, 247, 0.02); | |
| --border-subtle: rgba(245, 246, 247, 0.08); | |
| --border-default: rgba(245, 246, 247, 0.12); | |
| --border-strong: rgba(245, 246, 247, 0.2); | |
| --text-primary: #FFFFFF; | |
| --text-secondary: #E2E8F0; | |
| --text-muted: #94A3B8; | |
| --accent-primary: #ffd21e; | |
| --accent-secondary: #1098F7; | |
| --accent-tertiary: #F5F6F7; | |
| --glow-primary: rgba(255, 210, 30, 0.4); | |
| --glow-secondary: rgba(16, 152, 247, 0.4); | |
| --glow-tertiary: rgba(245, 246, 247, 0.3); | |
| } | |
| html.light, | |
| html.light body, | |
| html.light .gradio-container { | |
| --bg-primary: #F8FAFC; | |
| --bg-secondary: rgba(15, 23, 42, 0.06); | |
| --bg-card: rgba(255, 255, 255, 0.92); | |
| --border-subtle: rgba(15, 23, 42, 0.08); | |
| --border-default: rgba(15, 23, 42, 0.12); | |
| --border-strong: rgba(15, 23, 42, 0.18); | |
| --text-primary: #0B1120; | |
| --text-secondary: #1E293B; | |
| --text-muted: #475569; | |
| --accent-primary: #F59E0B; | |
| --accent-secondary: #2563EB; | |
| --accent-tertiary: #111827; | |
| --glow-primary: rgba(245, 158, 11, 0.25); | |
| --glow-secondary: rgba(37, 99, 235, 0.2); | |
| --glow-tertiary: rgba(15, 23, 42, 0.18); | |
| } | |
| html.light [style*="color: white"], | |
| html.light [style*="color:white"], | |
| html.light [style*="#FFFFFF"], | |
| html.light [style*="#ffffff"] { | |
| color: var(--text-primary) !important; | |
| } | |
| /* Global font and background */ | |
| html, body, .gradio-container { | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif !important; | |
| background: var(--bg-primary) !important; | |
| } | |
| /* Headers and text */ | |
| h1, h2, h3, h4 { | |
| color: var(--text-primary) !important; | |
| font-weight: 700 !important; | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| } | |
| p, span, div, li, ul li { | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| } | |
| /* Labels and info text */ | |
| label { | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| } | |
| .gr-box label { | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| } | |
| .gr-info { | |
| color: var(--text-secondary) !important; | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| } | |
| /* Simple metric cards */ | |
| .metric-card { | |
| background: var(--bg-card); | |
| border-radius: 16px; | |
| padding: 24px; | |
| position: relative; | |
| border: 1px solid var(--border-subtle); | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .metric-card:hover { | |
| transform: translateY(-4px); | |
| border-color: var(--accent-primary); | |
| box-shadow: 0 8px 24px rgba(255, 210, 30, 0.2); | |
| } | |
| /* Metric icon with glow effect */ | |
| .metric-icon { | |
| width: 48px; | |
| height: 48px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 2rem; | |
| margin-bottom: 16px; | |
| filter: drop-shadow(0 0 20px currentColor); | |
| transition: all 0.3s ease; | |
| } | |
| .metric-card:hover .metric-icon { | |
| transform: scale(1.1); | |
| filter: drop-shadow(0 0 30px currentColor); | |
| } | |
| /* Table with tooltips */ | |
| .v2-styled-table th { | |
| position: relative; | |
| } | |
| .tooltip-trigger { | |
| cursor: help; | |
| text-decoration: underline; | |
| text-decoration-style: dotted; | |
| text-underline-offset: 2px; | |
| text-decoration-color: var(--accent-secondary); | |
| } | |
| .tooltip-content { | |
| display: none; | |
| position: absolute; | |
| bottom: 100%; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| background: var(--bg-primary); | |
| border: 1px solid var(--border-default); | |
| border-radius: 8px; | |
| padding: 12px; | |
| max-width: 300px; | |
| font-size: 0.85rem; | |
| color: var(--text-secondary); | |
| z-index: 1000; | |
| white-space: normal; | |
| box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); | |
| margin-bottom: 8px; | |
| } | |
| .tooltip-trigger:hover .tooltip-content { | |
| display: block; | |
| } | |
| /* Enhanced radio buttons with primary accent */ | |
| input[type="radio"] { | |
| background-color: var(--bg-secondary) !important; | |
| border-color: var(--border-default) !important; | |
| } | |
| /* Radio button labels */ | |
| input[type="radio"] + label { | |
| color: var(--text-primary) !important; | |
| } | |
| input[type="radio"]:checked { | |
| background-color: var(--accent-primary) !important; | |
| border-color: var(--accent-primary) !important; | |
| box-shadow: 0 0 10px var(--glow-primary) !important; | |
| } | |
| /* Enhanced dropdown styling */ | |
| .dropdown { | |
| border-color: var(--border-default) !important; | |
| background: var(--bg-card) !important; | |
| transition: all 0.2s ease !important; | |
| } | |
| /* Dropdown option styling */ | |
| .dropdown option { | |
| background: var(--bg-card) !important; | |
| } | |
| /* Gradio dropdown specific styling */ | |
| .gradio-dropdown select, | |
| .gradio-dropdown [role="combobox"], | |
| .gradio-dropdown input { | |
| background: var(--bg-card) !important; | |
| } | |
| .gradio-dropdown option { | |
| background: var(--bg-card) !important; | |
| } | |
| .dropdown:hover { | |
| border-color: var(--accent-primary) !important; | |
| box-shadow: 0 0 15px var(--glow-primary) !important; | |
| } | |
| /* Enhanced table styling */ | |
| .dataframe { | |
| background: var(--bg-card) !important; | |
| border-radius: 16px !important; | |
| overflow: hidden !important; | |
| border: 1px solid var(--border-subtle) !important; | |
| font-size: 15px !important; | |
| max-height: 600px !important; | |
| overflow-y: auto !important; | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important; | |
| } | |
| /* Table cells and headers */ | |
| .dataframe td, | |
| .dataframe th { | |
| } | |
| /* Button styling */ | |
| button { | |
| background: var(--bg-card) !important; | |
| border: 1px solid var(--border-default) !important; | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; | |
| } | |
| button:hover { | |
| transform: translateY(-2px) !important; | |
| border-color: var(--accent-primary) !important; | |
| box-shadow: 0 4px 16px rgba(255, 210, 30, 0.2) !important; | |
| } | |
| /* Info boxes */ | |
| .info-box { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-subtle); | |
| border-radius: 12px; | |
| padding: 20px; | |
| margin: 8px 0; | |
| backdrop-filter: blur(10px); | |
| position: relative; | |
| overflow: hidden; | |
| transition: all 0.3s ease; | |
| } | |
| .info-box:hover { | |
| border-color: var(--accent-primary); | |
| box-shadow: 0 4px 20px var(--glow-primary); | |
| } | |
| /* Dark containers */ | |
| .dark-container { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border-subtle); | |
| border-radius: 20px; | |
| padding: 28px; | |
| box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); | |
| backdrop-filter: blur(10px); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| /* Section headers */ | |
| .section-header { | |
| display: flex; | |
| align-items: center; | |
| gap: 12px; | |
| margin-bottom: 24px; | |
| } | |
| .section-icon { | |
| filter: drop-shadow(0 0 12px currentColor); | |
| transition: all 0.3s ease; | |
| } | |
| /* Scrollbar styling */ | |
| ::-webkit-scrollbar { | |
| width: 8px; | |
| height: 8px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: var(--bg-secondary); | |
| border-radius: 4px; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: var(--accent-secondary); | |
| border-radius: 4px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: var(--accent-primary); | |
| } | |
| /* Pulse animation */ | |
| @keyframes pulse-glow { | |
| 0% { box-shadow: 0 0 0 0 var(--glow-primary); } | |
| 70% { box-shadow: 0 0 0 10px transparent; } | |
| 100% { box-shadow: 0 0 0 0 transparent; } | |
| } | |
| .pulse { | |
| animation: pulse-glow 2s infinite; | |
| } | |
| /* Chart containers */ | |
| .chart-container { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| width: 100%; | |
| margin: 0 auto; | |
| } | |
| .chart-container > div { | |
| width: 100%; | |
| max-width: 1400px; | |
| margin: 0 auto; | |
| } | |
| /* Radar chart - remove all boundaries */ | |
| .radar-chart-container { | |
| width: fit-content !important; | |
| margin: 0 auto !important; | |
| padding: 0 !important; | |
| } | |
| .radar-chart-container > div, | |
| .radar-chart, | |
| .radar-chart .gradio-plot { | |
| width: fit-content !important; | |
| max-width: none !important; | |
| margin: 0 auto !important; | |
| padding: 0 !important; | |
| } | |
| /* Grid layouts for cards */ | |
| .insight-card-grid { | |
| display: grid; | |
| grid-template-columns: repeat(5, 1fr); | |
| gap: 16px; | |
| } | |
| .metric-card-grid { | |
| display: grid; | |
| grid-template-columns: repeat(3, 1fr); | |
| gap: 16px; | |
| } | |
| /* Custom button container */ | |
| .custom-button-container { | |
| text-align: center; | |
| padding: 20px 0 10px 0; | |
| margin-bottom: 10px; | |
| } | |
| .header-action-button { | |
| display: inline-block !important; | |
| padding: 14px 28px !important; | |
| background: #ffd21e !important; | |
| color: var(--text-primary) !important; | |
| text-decoration: none !important; | |
| border-radius: 16px !important; | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| font-weight: 700 !important; | |
| font-size: 1.1rem !important; | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; | |
| border: none !important; | |
| cursor: pointer !important; | |
| box-shadow: 0 8px 24px rgba(255, 210, 30, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important; | |
| position: relative !important; | |
| overflow: hidden !important; | |
| text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important; | |
| } | |
| .header-action-button:hover { | |
| transform: translateY(-3px) !important; | |
| box-shadow: 0 12px 32px rgba(255, 210, 30, 0.5), 0 8px 16px rgba(0, 0, 0, 0.4) !important; | |
| background: #ffd21e !important; | |
| color: var(--text-primary) !important; | |
| text-decoration: none !important; | |
| text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important; | |
| } | |
| /* Navigation buttons */ | |
| .nav-buttons-container { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| gap: 16px; | |
| flex-wrap: wrap; | |
| margin: 24px 0; | |
| padding: 0 20px; | |
| } | |
| .nav-link-button { | |
| display: inline-flex !important; | |
| align-items: center !important; | |
| gap: 8px !important; | |
| padding: 12px 20px !important; | |
| background: rgba(1, 9, 26, 0.8) !important; | |
| color: #F5F6F7 !important; | |
| text-decoration: none !important; | |
| border-radius: 12px !important; | |
| font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
| font-weight: 600 !important; | |
| font-size: 0.95rem !important; | |
| transition: all 0.3s ease !important; | |
| border: 2px solid rgba(245, 246, 247, 0.15) !important; | |
| backdrop-filter: blur(10px) !important; | |
| -webkit-backdrop-filter: blur(10px) !important; | |
| position: relative !important; | |
| overflow: hidden !important; | |
| box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important; | |
| } | |
| .nav-link-button:hover { | |
| transform: translateY(-3px) scale(1.02) !important; | |
| border-color: #ffd21e !important; | |
| box-shadow: 0 8px 24px rgba(255, 210, 30, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4) !important; | |
| text-decoration: none !important; | |
| color: var(--text-primary) !important; | |
| } | |
| /* Ensure key hero/body text stays bright */ | |
| .hero-subtitle, | |
| .section-lead, | |
| .section-subtitle, | |
| .criteria-card li, | |
| .scenario-body, | |
| .hero-action-button, | |
| .hero-action-button span, | |
| #lang-toggle-btn, | |
| #lang-toggle-btn button { | |
| color: #FFFFFF !important; | |
| } | |
| .secondary.svelte-1ixn6qd { | |
| color: #FFFFFF !important; | |
| } | |
| /* Responsive adjustments */ | |
| @media (max-width: 1024px) { | |
| .hero-title { | |
| font-size: 4.5rem !important; | |
| } | |
| .hero-subtitle { | |
| font-size: 1.6rem !important; | |
| } | |
| .hero-actions { | |
| flex-wrap: wrap !important; | |
| gap: 12px !important; | |
| } | |
| .performance-card { | |
| padding: 24px !important; | |
| } | |
| .domain-selector-container { | |
| padding: 24px !important; | |
| } | |
| .dashboard-section { | |
| padding: 28px !important; | |
| } | |
| } | |
| @media (max-width: 768px) { | |
| .hero-banner-wrapper { | |
| width: 100% !important; | |
| margin: 0 0 16px 0 !important; | |
| } | |
| .hero-title { | |
| font-size: 3.2rem !important; | |
| } | |
| .hero-subtitle { | |
| font-size: 1.3rem !important; | |
| } | |
| .hero-actions { | |
| flex-direction: column !important; | |
| align-items: stretch !important; | |
| } | |
| .hero-action-button { | |
| width: 100% !important; | |
| justify-content: center !important; | |
| } | |
| .dashboard-section, | |
| .domain-selector-container, | |
| .performance-card { | |
| margin: 20px 12px !important; | |
| padding: 20px !important; | |
| } | |
| .performance-card .card-body { | |
| grid-template-columns: 1fr !important; | |
| gap: 20px !important; | |
| } | |
| .radar-slot { | |
| width: 100% !important; | |
| max-width: 260px !important; | |
| margin: 0 auto !important; | |
| } | |
| .v2-table-container { | |
| overflow-x: auto !important; | |
| } | |
| .v2-styled-table { | |
| min-width: 720px !important; | |
| } | |
| .hero-actions svg { | |
| width: 18px !important; | |
| height: 18px !important; | |
| } | |
| .section-title { | |
| font-size: 1.8rem !important; | |
| } | |
| .section-lead, | |
| .section-subtitle { | |
| font-size: 1rem !important; | |
| } | |
| .criteria-card { | |
| padding: 16px !important; | |
| } | |
| .criteria-grid { | |
| grid-template-columns: 1fr !important; | |
| gap: 16px !important; | |
| } | |
| .phase-grid { | |
| grid-template-columns: 1fr !important; | |
| } | |
| .hero-subtitle, | |
| .section-lead, | |
| .section-subtitle, | |
| .criteria-card li, | |
| .scenario-body { | |
| text-align: left !important; | |
| } | |
| } | |
| @media (max-width: 480px) { | |
| .hero-title { | |
| font-size: 2.4rem !important; | |
| } | |
| .hero-subtitle { | |
| font-size: 1.1rem !important; | |
| } | |
| .hero-action-button { | |
| font-size: 0.95rem !important; | |
| padding: 10px 16px !important; | |
| } | |
| .performance-card { | |
| padding: 18px !important; | |
| } | |
| .card-top-row { | |
| flex-direction: column !important; | |
| gap: 12px !important; | |
| } | |
| .rank-panel { | |
| align-self: flex-start !important; | |
| } | |
| .model-selector-container, | |
| .level-selector-container { | |
| margin: 0 !important; | |
| } | |
| .hero-banner-wrapper { | |
| margin-bottom: 12px !important; | |
| } | |
| } | |
| } | |
| /* Language toggle button */ | |
| #lang-toggle-btn button, | |
| #lang-toggle-btn { | |
| color: #FFFFFF !important; | |
| border-color: #ffd21e !important; | |
| } | |
| .hero-action-button { | |
| border-color: #ffd21e !important; | |
| } | |
| /* Numeric content styling */ | |
| .numeric-cell, .metric-value, .rank-value, | |
| .level-tile-score, .core-metric-card .metric-value { | |
| color: var(--text-primary) !important; | |
| font-family: 'Geist Mono', monospace !important; | |
| } | |
| /* Table content */ | |
| td, th, table * { | |
| color: var(--text-primary) !important; | |
| } | |
| /* All numeric and data elements */ | |
| .performance-card *, .v2-styled-table *, .dataframe * { | |
| color: var(--text-primary) !important; | |
| } | |
| /* Enhanced dropdown styling - more specific selectors | |
| */ | |
| .gradio-dropdown select, | |
| .gradio-dropdown [role="combobox"], | |
| .gradio-dropdown input, | |
| .gradio-dropdown button, | |
| .model-dropdown select, | |
| .model-dropdown [role="combobox"], | |
| .model-dropdown button { | |
| background: rgba(1, 9, 26, 0.95) !important; | |
| border: 1px solid var(--border-default) !important; | |
| border-radius: 8px !important; | |
| } | |
| .gradio-dropdown option, | |
| .model-dropdown option { | |
| background: rgba(1, 9, 26, 0.95) !important; | |
| } | |
| /* Force dropdown text color */ | |
| /* .gradio-dropdown *, .model-dropdown * { | |
| color: var(--text-primary) !important; | |
| } */ | |
| /* Gradio 5.x compatible dropdown styling */ | |
| .gradio-container .gradio-dropdown, | |
| .gradio-container [data-testid="dropdown"], | |
| .gradio-container select { | |
| background-color: rgba(1, 9, 26, 0.95) !important; | |
| border: 1px solid rgba(245, 246, 247, 0.12) !important; | |
| } | |
| .gradio-container .gradio-dropdown option, | |
| .gradio-container select option { | |
| background-color: rgba(1, 9, 26, 0.95) !important; | |
| } | |
| /* Target the actual visible text in dropdown */ | |
| .gradio-container [role="combobox"], | |
| .gradio-container .gradio-dropdown .wrap > div { | |
| background-color: rgba(1, 9, 26, 0.95) !important; | |
| } | |
| html.light .model-dropdown .gradio-dropdown, | |
| html.light .model-dropdown [role="combobox"], | |
| html.light .model-dropdown button, | |
| html.light .gradio-container [data-testid="dropdown"], | |
| html.light .gradio-container select, | |
| html.light .gradio-container [role="combobox"], | |
| html.light .gradio-container .gradio-dropdown .wrap > div { | |
| background-color: rgba(255, 255, 255, 0.95) !important; | |
| border-color: rgba(15, 23, 42, 0.12) !important; | |
| box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important; | |
| } | |
| </style> | |
| """ | |