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 { | |
--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: #F5F6F7; | |
--text-secondary: #94A3B8; | |
--text-muted: #64748B; | |
--accent-primary: #E35454; | |
--accent-secondary: #1098F7; | |
--accent-tertiary: #F5F6F7; | |
--glow-primary: rgba(227, 84, 84, 0.4); | |
--glow-secondary: rgba(16, 152, 247, 0.4); | |
--glow-tertiary: rgba(245, 246, 247, 0.3); | |
} | |
/* Global font and background */ | |
.gradio-container { | |
font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif !important; | |
background: var(--bg-primary) !important; | |
color: var(--text-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 { | |
color: var(--text-primary) !important; | |
font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
} | |
/* Labels and info text */ | |
label { | |
color: var(--text-primary) !important; | |
font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important; | |
} | |
.gr-box label { | |
color: var(--text-primary) !important; | |
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(227, 84, 84, 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; | |
} | |
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; | |
color: var(--text-primary) !important; | |
transition: all 0.2s ease !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; | |
} | |
/* Button styling */ | |
button { | |
background: var(--bg-card) !important; | |
color: var(--text-primary) !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(227, 84, 84, 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; | |
} | |
/* 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: linear-gradient(135deg, #E35454 0%, #C84545 100%) !important; | |
color: #FFFFFF !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(227, 84, 84, 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.3) !important; | |
} | |
.header-action-button:hover { | |
transform: translateY(-3px) !important; | |
box-shadow: 0 12px 32px rgba(227, 84, 84, 0.5), 0 8px 16px rgba(0, 0, 0, 0.4) !important; | |
background: linear-gradient(135deg, #F46464 0%, #D84F4F 100%) !important; | |
color: #FFFFFF !important; | |
text-decoration: none !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: #E35454 !important; | |
box-shadow: 0 8px 24px rgba(227, 84, 84, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4) !important; | |
text-decoration: none !important; | |
color: #FFFFFF !important; | |
} | |
</style> | |
""" |