/* Custom styles for AI4Sci Bench Leaderboard */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-sublabel {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: 0.25rem;
}

/* Last Updated Note */
.last-updated {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Best Score Highlight (score matrix) */
.best-score {
  background-color: rgba(76, 175, 80, 0.15);
  font-weight: bold;
}

[data-md-color-scheme="slate"] .best-score {
  background-color: rgba(76, 175, 80, 0.25);
}

/* Quick Navigation Cards */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.quick-nav > div {
  padding: 1.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s;
}

.quick-nav > div:hover {
  border-color: #667eea;
  background-color: #f5f7ff;
  transform: translateY(-3px);
}

/* Benchmark Charts Container */
.benchmark-charts {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: #f9f9f9;
  border-radius: 8px;
}

[data-md-color-scheme="slate"] .benchmark-charts {
  background-color: #2d2d2d;
}

/* Benchmark Selector */
.benchmark-selector {
  margin: 2rem 0;
}

.benchmark-selector select {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

.benchmark-selector select:hover {
  border-color: #667eea;
}

.benchmark-selector select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

[data-md-color-scheme="slate"] .benchmark-selector select {
  background-color: #2d2d2d;
  color: white;
  border-color: #444;
}

/* Benchmark Details */
.benchmark-details {
  margin: 2rem 0;
  padding: 2rem;
  background-color: #f5f7ff;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

[data-md-color-scheme="slate"] .benchmark-details {
  background-color: #2d2d2d;
}

/* Benchmark List */
#benchmark-list {
  margin: 2rem 0;
}

.benchmark-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.benchmark-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-md-color-scheme="slate"] .benchmark-item {
  background-color: #2d2d2d;
}

.benchmark-item h3 {
  margin-top: 0;
  color: #667eea;
}

/* Performance Bars */
.performance-bar {
  background-color: #e0e0e0;
  border-radius: 4px;
  height: 24px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.performance-bar-fill {
  background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  transition: width 0.5s ease-out;
}

/* Chart Containers */
#benchmark-comparison,
#performance-chart,
#radar-chart {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

/* Responsive Tables */
.md-typeset table:not([class]) {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quick-nav {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

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

/* Alert/Info Boxes Enhancement */
.md-typeset .admonition {
  border-left-width: 4px;
}

/* Score Badges */
.score-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9rem;
}

.score-badge.high {
  background-color: #4CAF50;
  color: white;
}

.score-badge.medium {
  background-color: #FFC107;
  color: #333;
}

.score-badge.low {
  background-color: #FF5722;
  color: white;
}

/* Model Name Formatting */
.model-name {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  background-color: #f5f5f5;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

[data-md-color-scheme="slate"] .model-name {
  background-color: #3d3d3d;
}

/* Cost Analysis Styles */
.cost-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.cost-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cost-card h3 {
  margin-top: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
}

.cost-card .model-name {
  background-color: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  margin: 1rem 0;
  color: white;
}

.cost-value {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.cost-table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}

.cost-table th,
.cost-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.cost-table th {
  background-color: #f5f7ff;
  font-weight: bold;
}

.cost-table .total-row {
  background-color: #f5f7ff;
  font-weight: bold;
}

[data-md-color-scheme="slate"] .cost-table th,
[data-md-color-scheme="slate"] .cost-table .total-row {
  background-color: #2d2d2d;
}

[data-md-color-scheme="slate"] .cost-table th,
[data-md-color-scheme="slate"] .cost-table td {
  border-bottom-color: #444;
}

#cost-chart {
  max-width: 800px;
  margin: 2rem auto;
}
