/* OmniEvaluator Internal Dashboard - Styles */

:root {
  --lb-border: rgba(255, 255, 255, 0.1);
  --lb-border-light: rgba(255, 255, 255, 0.06);
  --lb-bg: rgba(255, 255, 255, 0.02);
  --lb-bg-hover: rgba(255, 255, 255, 0.04);
  --lb-radius: 8px;
  --lb-radius-lg: 14px;
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-slow: 360ms;
  --motion-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tabs & Layout */
.tab { transition: background-color 0.25s ease, color 0.25s ease; }
.content-wrapper { overflow: hidden; }
.content-track { display: flex; width: 300%; transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.content-panel { flex: 0 0 33.333%; min-width: 0; padding-right: 0.25rem; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

body.motion-ready .motion-stagger {
  opacity: 0;
  transform: translateY(6px);
  animation: fade-up var(--motion-base) var(--motion-ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 24ms);
}

body.motion-ready .motion-pop {
  opacity: 0;
  transform: scale(0.98);
  animation: pop-in var(--motion-base) var(--motion-ease-out) forwards;
}

/* Reflex GLASS_SECTION */
.content-panel section {
  border-radius: 16px;
  border: 1px solid var(--lb-border-light);
  background: var(--lb-bg);
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s ease;
}
.content-panel section:hover {
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body.motion-ready .content-panel section {
  animation: fade-up var(--motion-slow) var(--motion-ease-out) both;
}
body.motion-ready .content-panel section:nth-of-type(2) { animation-delay: 40ms; }
body.motion-ready .content-panel section:nth-of-type(3) { animation-delay: 80ms; }
body.motion-ready .content-panel section:nth-of-type(4) { animation-delay: 120ms; }

/* Pills & Table */
.lb-pill { transition: all var(--motion-fast) var(--motion-ease); }
.lb-pill.active { background: linear-gradient(135deg, rgb(99 102 241), rgb(139 92 246)); color: white; }
.lb-sortable { cursor: pointer; user-select: none; }
.lb-sortable:hover { background: var(--lb-bg-hover); }
.lb-cell-max { color: #d98b8b; font-weight: 700; }
.lb-cell-min { color: #8faad9; font-weight: 700; }
.lb-score-zero { color: #ef4444; font-weight: 700; }
.lb-score-low { color: #f59e0b; font-weight: 700; }
.lb-score-mid { color: #22c55e; font-weight: 700; }
.lb-score-one { color: #60a5fa; font-weight: 700; }

.inf-metric-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  background: rgba(51, 65, 85, 0.8);
  color: #cbd5f5;
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.inf-metric-zero {
  color: #fecaca !important;
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.inf-metric-low {
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.inf-metric-mid {
  color: #bbf7d0 !important;
  background: rgba(34, 197, 94, 0.2) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
}

.inf-metric-one {
  color: #bfdbfe !important;
  background: rgba(96, 165, 250, 0.2) !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
}
.lb-value-sub-group { display: flex; align-items: center; gap: 0.375rem; }
.lb-value-sub-divider { width: 1px; height: 1.25rem; background: rgba(255, 255, 255, 0.2); }
.lb-filter-label { min-width: 9rem; width: 9rem; flex-shrink: 0; }

body.motion-ready .lb-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -10px rgba(99, 102, 241, 0.6);
}

body.motion-ready .lb-sortable {
  transition: background-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}
body.motion-ready .lb-sortable:hover { transform: translateY(-1px); }

body.motion-ready #lb-tbody tr {
  transition: background-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}
body.motion-ready #lb-tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
  transform: translateY(-1px);
}

.model-item {
  transition: background-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}
body.motion-ready .model-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

/* Inference Viewer flow */
.inf-section {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  pointer-events: none;
  margin-top: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease, margin 0.25s ease;
}
.inf-section.is-visible {
  max-height: 3000px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 0.75rem;
}

/* Benchmark panel (extends collapse) */
.lb-bench-row { display: flex; flex-direction: column; gap: 0.5rem; }
.lb-bench-panel-wrap {
  border-radius: var(--lb-radius);
  border: 1px solid var(--lb-border);
  background: var(--lb-bg);
  overflow: hidden;
}
.lb-bench-panel-wrap .lb-bench-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.lb-bench-panel-wrap.open .lb-bench-accordion { grid-template-rows: 1fr; }
.lb-bench-panel-wrap .lb-bench-accordion > * { overflow: hidden; min-height: 0; }
.lb-bench-panel-wrap .lb-bench-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  flex-wrap: wrap;
}
.lb-bench-panel-wrap .lb-bench-search { width: 12rem; min-width: 8rem; }
.lb-bench-panel-wrap #lb-bench-toggle-area:hover { color: rgb(148 163 184); }
.lb-bench-all-none-btn.active { color: rgb(96 165 250); }
.lb-bench-panel-wrap .lb-bench-accordion { /* uses lb-collapse-content */ }
.lb-bench-panel-wrap #lb-bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0 0.75rem 0.5rem;
}
.lb-bench-item { transition: opacity 0.15s; flex-shrink: 0; }
.lb-bench-item.hidden { display: none; }
.inf-bench-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}
.inf-bench-item.active {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.15);
  color: rgb(226 232 240);
}
.inf-bench-radio {
  accent-color: rgb(99 102 241);
}
#inf-bench-panel-wrap .lb-bench-all-none-btn {
  display: none;
}
#inf-bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0 0.75rem 0.5rem;
}
.inf-bench-panel {
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(255, 255, 255, 0.02));
}
.inf-bench-top {
  align-items: center;
  gap: 0.5rem;
}
.inf-bench-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgb(148 163 184);
}
.inf-bench-selected {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(15, 23, 42, 0.4);
  font-size: 0.7rem;
  color: rgb(226 232 240);
  white-space: nowrap;
}
.inf-bench-selected-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.55rem;
  color: rgb(129 140 248);
}
.inf-bench-selected-value {
  font-weight: 600;
  color: rgb(226 232 240);
}
.inf-bench-list-wrap {
  position: relative;
}
.inf-bench-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
  color: rgb(226 232 240);
}
#inf-bench-list.is-loading {
  opacity: 0.3;
}
.inf-bench-panel-wrap #inf-bench-toggle-area {
  cursor: default;
}
.inf-model-item {
  border-radius: 0.5rem;
  padding: 0.2rem 0.4rem;
  transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.inf-model-item.active {
  color: rgb(248 250 252);
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

body.motion-ready .inf-model-item:hover {
  transform: translateY(-1px);
}
.inf-media-card {
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.35);
  padding: 0.75rem;
}
.inf-media-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgb(148 163 184);
  margin-bottom: 0.5rem;
}
.inf-media-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.inf-media-placeholder {
  width: 100%;
  min-height: 8rem;
  border-radius: 0.6rem;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(148 163 184);
  font-size: 0.8rem;
}
.inf-media-img,
.inf-media-video {
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  border-radius: 0.6rem;
}

body.motion-ready .inf-media-card {
  animation: pop-in var(--motion-base) var(--motion-ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.inf-media-audio {
  width: 100%;
}
.inf-media-empty .inf-media-placeholder {
  min-height: 10rem;
}

/* Chart collapse (Models, Benchmarks) */
.lb-chart-collapse-wrap {
  border-radius: var(--lb-radius);
  border: 1px solid var(--lb-border);
  background: var(--lb-bg);
  overflow: hidden;
}
.lb-chart-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lb-chart-collapse-header:hover { background: var(--lb-bg-hover); }
.lb-chart-collapse-wrap.open .lb-chart-collapse-chevron { transform: rotate(180deg); }
.lb-chart-collapse-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.lb-chart-collapse-wrap.open .lb-chart-collapse-content { grid-template-rows: 1fr; }
.lb-chart-collapse-content > * { overflow: hidden; min-height: 0; padding: 0; }
.lb-chart-collapse-wrap.open .lb-chart-collapse-content > * { padding: 0 0.75rem 0.5rem; }

/* Table */
.lb-table-wrap {
  border-radius: var(--lb-radius-lg);
  border: 1px solid var(--lb-border-light);
  padding: 0.4rem;
  background: var(--lb-bg);
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
}
@keyframes lbTableFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lb-table-wrap.lb-table-animate { animation: lbTableFadeIn 0.35s ease-out; }
.lb-table th, .lb-table td {
  border-color: var(--lb-border-light);
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.25rem 0.35rem;
}
.lb-table .lb-col-inference {
  width: 7.5rem;
  min-width: 7rem;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-table th { background: rgba(255, 255, 255, 0.03); }
.lb-table .lb-col-model {
  width: 10rem;
  min-width: 8rem;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-table .lb-col-checkpoint {
  white-space: nowrap;
  min-width: 6rem;
}
.lb-table .lb-col-sum {
  white-space: nowrap;
}
.lb-filters {
  border-radius: var(--lb-radius-lg);
  border: 1px solid var(--lb-border-light);
  background: var(--lb-bg);
}

/* Chart */
.lb-chart-canvas-wrap { transition: opacity 0.3s ease; }
.lb-chart-canvas-wrap.lb-chart-fade { opacity: 0; }

/* Upload spinner */
.upload-spinner {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgb(34 211 238);
  border-radius: 50%;
  animation: upload-spin 0.7s linear infinite;
  vertical-align: -0.2em;
  margin-right: 0.35rem;
}
@keyframes upload-spin { to { transform: rotate(360deg); } }

/* Scrollbar */
html::-webkit-scrollbar { width: 10px; }
.overflow-y-auto::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar,
select::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track,
.overflow-auto::-webkit-scrollbar-track,
select::-webkit-scrollbar-track {
  background: rgb(30 41 59);
  border-radius: 4px;
}
html::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb,
.overflow-auto::-webkit-scrollbar-thumb,
select::-webkit-scrollbar-thumb {
  background: rgb(71 85 105);
  border-radius: 4px;
}
html::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover,
.overflow-auto::-webkit-scrollbar-thumb:hover,
select::-webkit-scrollbar-thumb:hover {
  background: rgb(100 116 139);
}
html, .overflow-y-auto, .overflow-auto, select {
  scrollbar-color: rgb(71 85 105) rgb(30 41 59);
  scrollbar-width: thin;
}

/* Submission tab — compact text */
#content-submission { font-size: 0.8rem; }
#content-submission h2 { font-size: 0.95rem; }
#content-submission h3 { font-size: 0.8rem; }
#content-submission h4 { font-size: 0.8rem; }
#content-submission p { font-size: 0.75rem; }
#content-submission button { font-size: 0.75rem; padding: 0.25rem 0.6rem; }
#content-submission input { font-size: 0.75rem; padding: 0.35rem 0.6rem; }
#content-submission .text-sm { font-size: 0.75rem; }
#content-submission .text-xs { font-size: 0.65rem; }
#content-submission section { padding: 0.75rem; }
#content-submission .p-4 { padding: 0.6rem; }
#content-submission .p-3 { padding: 0.5rem; }
#content-submission .gap-4 { gap: 0.6rem; }
#content-submission .gap-3 { gap: 0.5rem; }
#content-submission .mb-4 { margin-bottom: 0.6rem; }
#content-submission .mb-3 { margin-bottom: 0.4rem; }
#content-submission .mb-2 { margin-bottom: 0.3rem; }
#content-submission .w-9 { width: 1.75rem; height: 1.75rem; }
#content-submission .w-9 svg { width: 14px; height: 14px; }
#content-submission #upload-zone { padding: 0.5rem; }
#content-submission #upload-zone span { font-size: 0.75rem; }
#content-submission .model-item { padding: 0.2rem 0.4rem; margin-bottom: 0.15rem; font-size: 0.65rem; gap: 0.3rem; }
#content-submission .model-item span.text-sm { font-size: 0.65rem; }
#content-submission .model-item .del-btn { font-size: 0.6rem; padding: 0.1rem 0.3rem; }
#content-submission .model-item .w-1\.5 { width: 0.25rem; height: 0.25rem; }
#content-submission #internal-models,
#content-submission #direct-models,
#content-submission #s3-models {
  max-height: 25rem; /* ~10 items */
  overflow-y: auto;
}

/* Leaderboard filters — compact text */
#lb-filters { font-size: 0.75rem; padding: 0.6rem !important; gap: 0.35rem !important; }
#lb-filters .lb-filter-label { font-size: 0.65rem; }
#lb-filters .lb-pill { font-size: 0.65rem; padding: 0.1rem 0.4rem; line-height: 1.2; }
#lb-filters .text-\[0\.6rem\] { font-size: 0.55rem; }
#lb-filters .gap-3 { gap: 0.3rem; }
#lb-filters .gap-2 { gap: 0.3rem; }
#lb-filters .gap-1\.5 { gap: 0.25rem; }
#lb-filters .text-xs { font-size: 0.65rem; }
#lb-filters .text-sm { font-size: 0.7rem; }
#lb-filters .lb-value-sub-pill { font-size: 0.6rem; padding: 0.1rem 0.4rem; }

/* Leaderboard chart — compact */
#lb-chart-wrap { padding: 0.6rem; font-size: 0.75rem; }
#lb-chart-wrap .lb-dropdown-list { font-size: 0.65rem; }
#lb-chart-wrap .lb-chart-collapse-header { font-size: 0.7rem; }
#lb-chart-wrap .grid { gap: 0.6rem; margin-bottom: 0.5rem; }

/* Leaderboard benchmarks panel — compact */
#lb-bench-above-table { font-size: 0.75rem; }
#lb-bench-above-table .lb-bench-top { font-size: 0.7rem; }
#lb-bench-above-table .lb-bench-search { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
#lb-bench-above-table .lb-bench-all-none-btn { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
#lb-bench-above-table .text-sm { font-size: 0.7rem; }
#lb-bench-above-table .text-xs { font-size: 0.65rem; }
#lb-bench-above-table #lb-bench-list { font-size: 0.65rem; }
