/**
 * AI Arena — Dark Theme
 * Matches jarvis-ai.cz dark design system.
 * Background: #0b1326, Text: #dae2fd, Accents: cyan #00dce5, blue #2e5bff
 */

.ai-arena {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: #dae2fd;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.ai-arena__hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.ai-arena__hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 229, 0.4), transparent);
}

.ai-arena__hero-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
  filter: drop-shadow(0 0 12px rgba(0, 220, 229, 0.3));
}

.ai-arena__hero-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #dae2fd;
  letter-spacing: -0.02em;
}

.ai-arena__hero-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #c4c5d9;
  max-width: 42rem;
  margin: 0 auto;
}

/* ── HW Specs Card ──────────────────────────────────────────────────────────── */

.ai-arena__hw-specs {
  background: linear-gradient(135deg, rgba(34, 42, 61, 0.8), rgba(23, 31, 51, 0.6));
  border: 1px solid rgba(142, 144, 162, 0.15);
  border-radius: 1.5rem;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(10px);
}

.ai-arena__hw-specs h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #00dce5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}

.ai-arena__hw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.ai-arena__hw-item {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}

.ai-arena__hw-label {
  font-size: 0.75rem;
  color: #8e90a2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.ai-arena__hw-value {
  font-size: 1rem;
  font-weight: 600;
  color: #dae2fd;
}

/* ── Model Grid ─────────────────────────────────────────────────────────────── */

.ai-arena__model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.ai-arena__model-card {
  display: block;
  background: linear-gradient(145deg, rgba(34, 42, 61, 0.9), rgba(23, 31, 51, 0.7));
  border: 1px solid rgba(142, 144, 162, 0.12);
  border-radius: 1.25rem;
  padding: 1.5rem;
  text-decoration: none;
  color: #dae2fd;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.ai-arena__model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2e5bff, #00dce5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-arena__model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(46, 91, 255, 0.12), 0 0 24px rgba(0, 220, 229, 0.06);
  border-color: rgba(0, 220, 229, 0.25);
}

.ai-arena__model-card:hover::before {
  opacity: 1;
}

.ai-arena__model-card-header {
  margin-bottom: 0.75rem;
}

.ai-arena__model-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: #dae2fd;
}

.ai-arena__model-provider {
  font-size: 0.85rem;
  color: #8e90a2;
}

.ai-arena__model-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ai-arena__cap {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 0.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ai-arena__cap--text { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.2); }
.ai-arena__cap--code { background: rgba(46, 91, 255, 0.12); color: #b8c3ff; border: 1px solid rgba(184, 195, 255, 0.2); }
.ai-arena__cap--image { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.ai-arena__cap--voice { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; border: 1px solid rgba(196, 181, 253, 0.2); }
.ai-arena__cap--video { background: rgba(236, 72, 153, 0.12); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.2); }

.ai-arena__model-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ai-arena__model-stat {
  text-align: center;
  min-width: 3.5rem;
}

.ai-arena__stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #00dce5;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.ai-arena__stat-label {
  font-size: 0.65rem;
  color: #8e90a2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */

.ai-arena__breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: #8e90a2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-arena__breadcrumb a {
  color: #b8c3ff;
  text-decoration: none;
  transition: color 0.2s;
}

.ai-arena__breadcrumb a:hover {
  color: #00dce5;
}

.ai-arena__breadcrumb-sep {
  color: #8e90a2;
  opacity: 0.5;
}

/* ── Sections ───────────────────────────────────────────────────────────────── */

.ai-arena__section {
  margin-bottom: 2.5rem;
}

.ai-arena__section h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: #dae2fd;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(142, 144, 162, 0.12);
}

.ai-arena__admin-note {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04));
  border-left: 3px solid #f59e0b;
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 1rem 1.25rem;
}

.ai-arena__admin-note h2 {
  font-size: 0.85rem;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  margin-bottom: 0.5rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────────── */

.ai-arena__specs-table {
  width: 100%;
  border-collapse: collapse;
}

.ai-arena__specs-table th,
.ai-arena__specs-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(142, 144, 162, 0.1);
}

.ai-arena__specs-table th {
  width: 200px;
  font-weight: 600;
  color: #c4c5d9;
  font-size: 0.9rem;
}

.ai-arena__specs-table td {
  color: #dae2fd;
}

.ai-arena__results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ai-arena__results-table th {
  background: rgba(46, 91, 255, 0.08);
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #b8c3ff;
  border-bottom: 2px solid rgba(46, 91, 255, 0.2);
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-arena__results-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(67, 70, 86, 0.15);
  color: #c4c5d9;
}

.ai-arena__results-table tr:hover td {
  background: rgba(46, 91, 255, 0.04);
}

.ai-arena__results-table a {
  color: #b8c3ff;
  text-decoration: none;
  transition: color 0.2s;
}

.ai-arena__results-table a:hover {
  color: #00dce5;
  text-decoration: underline;
}

.ai-arena__result-row--failed td {
  opacity: 0.5;
}

.ai-arena__stat-highlight {
  font-weight: 700;
  color: #00dce5;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* ── Prompt ─────────────────────────────────────────────────────────────────── */

.ai-arena__prompt {
  background: rgba(6, 14, 32, 0.6);
  border: 1px solid rgba(142, 144, 162, 0.15);
  border-radius: 0.75rem;
  padding: 1.25rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #c4c5d9;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 24rem;
  overflow-y: auto;
}

/* ── Test meta ──────────────────────────────────────────────────────────────── */

.ai-arena__test-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.ai-arena__test-category {
  background: rgba(46, 91, 255, 0.12);
  color: #b8c3ff;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.35rem;
  font-weight: 500;
  border: 1px solid rgba(184, 195, 255, 0.15);
}

.ai-arena__test-complexity {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.35rem;
  font-weight: 500;
  border: 1px solid;
}

.ai-arena__test-complexity--easy { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.2); }
.ai-arena__test-complexity--medium { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.ai-arena__test-complexity--hard { background: rgba(236, 72, 153, 0.12); color: #f472b6; border-color: rgba(244, 114, 182, 0.2); }

/* ── Empty state ───────────────────────────────────────────────────────────── */

.ai-arena__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #8e90a2;
  font-size: 1rem;
  background: rgba(34, 42, 61, 0.4);
  border-radius: 1rem;
  border: 1px dashed rgba(142, 144, 162, 0.15);
}

/* ── Compare ────────────────────────────────────────────────────────────────── */

.ai-arena__compare-controls {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-arena__compare-controls label {
  font-weight: 600;
  color: #c4c5d9;
  font-size: 0.9rem;
}

.ai-arena__select {
  padding: 0.5rem 1rem;
  background: rgba(34, 42, 61, 0.6);
  border: 1px solid rgba(142, 144, 162, 0.2);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #dae2fd;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ai-arena__select:focus {
  outline: none;
  border-color: #00dce5;
  box-shadow: 0 0 0 2px rgba(0, 220, 229, 0.15);
}

.ai-arena__chart-container {
  background: linear-gradient(145deg, rgba(34, 42, 61, 0.6), rgba(23, 31, 51, 0.4));
  border: 1px solid rgba(142, 144, 162, 0.1);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ai-arena__chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

/* ── Admin ──────────────────────────────────────────────────────────────────── */

.ai-arena-admin {
  max-width: 80rem;
  color: #dae2fd;
}

.ai-arena-admin__stats {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ai-arena-admin__stat-card {
  background: linear-gradient(145deg, rgba(34, 42, 61, 0.9), rgba(23, 31, 51, 0.7));
  border: 1px solid rgba(142, 144, 162, 0.12);
  border-radius: 1.25rem;
  padding: 1.5rem 2rem;
  text-align: center;
  min-width: 8rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-arena-admin__stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(46, 91, 255, 0.1);
}

.ai-arena-admin__stat-number {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #00dce5;
}

.ai-arena-admin__stat-label {
  font-size: 0.85rem;
  color: #8e90a2;
  margin-top: 0.25rem;
}

.ai-arena-admin__actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ai-arena-admin__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ai-arena-admin__table th {
  background: rgba(46, 91, 255, 0.08);
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #b8c3ff;
  border-bottom: 2px solid rgba(46, 91, 255, 0.2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-arena-admin__table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(67, 70, 86, 0.15);
  color: #c4c5d9;
}

/* ── Model detail ────────────────────────────────────────────────────────────── */

.ai-arena__model-detail-header {
  margin-bottom: 2rem;
}

.ai-arena__model-detail-header h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #dae2fd;
}

.ai-arena__provider {
  color: #8e90a2;
  font-size: 1.05rem;
  margin: 0;
}

.ai-arena__website a {
  color: #b8c3ff;
  text-decoration: none;
  transition: color 0.2s;
}

.ai-arena__website a:hover {
  color: #00dce5;
  text-decoration: underline;
}

.ai-arena__caps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .ai-arena__hw-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-arena__model-grid {
    grid-template-columns: 1fr;
  }

  .ai-arena-admin__stats {
    flex-direction: column;
  }

  .ai-arena__results-table {
    font-size: 0.8rem;
  }

  .ai-arena__results-table th,
  .ai-arena__results-table td {
    padding: 0.5rem 0.6rem;
  }

  .ai-arena__hero-title {
    font-size: 1.75rem;
  }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */

.ai-arena ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.ai-arena ::-webkit-scrollbar-track {
  background: rgba(11, 19, 38, 0.3);
  border-radius: 3px;
}

.ai-arena ::-webkit-scrollbar-thumb {
  background: rgba(142, 144, 162, 0.3);
  border-radius: 3px;
}

.ai-arena ::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 144, 162, 0.5);
}

/* ── Table scroll wrapper ───────────────────────────────────────────────────── */

.ai-arena__table-scroll {
  overflow-x: auto;
  margin-bottom: 2rem;
  border-radius: 0.75rem;
}

/* ── Output column ──────────────────────────────────────────────────────────── */

.ai-arena__col-output {
  width: 4rem;
  text-align: center;
  vertical-align: middle;
}

.ai-arena__btn-output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(142, 144, 162, 0.2);
  border-radius: 0.5rem;
  background: rgba(46, 91, 255, 0.1);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.ai-arena__btn-output:hover {
  background: rgba(46, 91, 255, 0.25);
  border-color: rgba(0, 220, 229, 0.4);
  transform: scale(1.1);
}

.ai-arena__btn-output--active {
  background: rgba(0, 220, 229, 0.2);
  border-color: #00dce5;
  box-shadow: 0 0 8px rgba(0, 220, 229, 0.25);
}

.ai-arena__no-output {
  color: #555770;
  font-size: 0.85rem;
}

/* ── Output details (collapsible) ───────────────────────────────────────────── */

.ai-arena__output-details {
  background: rgba(6, 14, 32, 0.4);
  border: 1px solid rgba(142, 144, 162, 0.12);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ai-arena__output-details[open] {
  border-color: rgba(0, 220, 229, 0.25);
  background: rgba(6, 14, 32, 0.6);
}

.ai-arena__output-details--highlight {
  box-shadow: 0 0 20px rgba(0, 220, 229, 0.3);
  transition: box-shadow 0.3s ease;
}

.ai-arena__output-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #dae2fd;
  list-style: none;
  transition: background 0.2s;
  user-select: none;
}

.ai-arena__output-summary::-webkit-details-marker {
  display: none;
}

.ai-arena__output-summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: #00dce5;
  transition: transform 0.2s;
}

.ai-arena__output-details[open] .ai-arena__output-summary::before {
  transform: rotate(90deg);
}

.ai-arena__output-summary:hover {
  background: rgba(46, 91, 255, 0.06);
}

.ai-arena__output-summary-name {
  flex: 1;
}

.ai-arena__output-summary-meta {
  font-weight: 400;
  font-size: 0.8rem;
  color: #8e90a2;
}

.ai-arena__output-body {
  padding: 0 1.25rem 1.25rem;
}

.ai-arena__output-pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(142, 144, 162, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #c4c5d9;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 30rem;
  overflow-y: auto;
  margin: 0;
}

.ai-arena__output-pre code {
  font-family: inherit;
  background: none;
  padding: 0;
  color: inherit;
}
