/* Leaderboard */
.leaderboard-wrapper {
  background: #fafafa;
  min-height: 100vh;
  width: 100%;
}

.leaderboard-container {
  padding: 60px 24px 100px;
  max-width: 1200px;
  margin: 0 auto;
}

.leaderboard-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #1a202c;
  text-align: center;
  margin-bottom: 32px;
  margin-top: 0;
  line-height: 1.1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* Title row holds the h2 and the table/progress view toggle */
.leaderboard-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.leaderboard-title-row .leaderboard-title {
  margin-bottom: 0;
}

.view-toggle {
  position: relative;
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.view-toggle-option {
  position: relative;
  z-index: 2;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 110px;
  justify-content: center;
  font-family: inherit;
}

.view-toggle-option.active {
  color: #ffffff;
}

.view-toggle-option:hover:not(.active) {
  color: #047857;
}

.view-toggle-option:focus {
  outline: none;
}

.view-toggle-option:focus-visible {
  outline: 2px solid rgba(4, 120, 87, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.view-toggle-icon {
  font-size: 14px;
  line-height: 1;
}

.view-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc((100% - 8px) / 2);
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-radius: 8px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.3);
  z-index: 1;
}

.leaderboard-subtitle {
  font-size: 1.125rem;
  color: #718096;
  text-align: center;
  margin-bottom: 32px;
  font-weight: 400;
}

.recent-updates {
  font-size: 0.95rem;
  color: #dc2626;
  font-weight: 500;
  margin-top: 8px;
  display: inline-block;
}

/* Benchmark Selector (τ-bench / τ-voice toggle) */
.benchmark-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.benchmark-toggle-container {
  position: relative;
  display: flex;
  background: #e2e8f0;
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.benchmark-toggle-option {
  position: relative;
  z-index: 2;
  padding: 10px 28px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
  outline: none;
}

.benchmark-toggle-option:focus {
  outline: none;
}

.benchmark-toggle-option.active {
  color: white;
}

.benchmark-toggle-option:not(.active):hover {
  color: #1e293b;
}

.benchmark-icon {
  font-size: 16px;
}

.benchmark-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc((100% - 8px) / 2);
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-radius: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.3);
  z-index: 1;
}

/* Voice provider badge */
.voice-provider-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
  text-transform: capitalize;
}

/* Leaderboard Controls Row */
.leaderboard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .leaderboard-controls {
    flex-direction: column;
    gap: 24px;
  }
  
  .submission-type-filter {
    width: 100%;
    justify-content: center;
  }

  .benchmark-toggle-option {
    padding: 8px 20px;
    font-size: 14px;
    min-width: 110px;
  }
}

/* Domain Toggle Switch */
.domain-toggle-switch {
  display: flex;
  align-items: center;
}

.domain-toggle-container {
  position: relative;
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.domain-toggle-option {
  position: relative;
  z-index: 2;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  justify-content: center;
  outline: none; /* Remove blue focus outline */
}

.domain-toggle-option:focus {
  outline: none; /* Ensure no focus outline appears */
}

.domain-toggle-option.active {
  color: white;
}

.domain-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  /* width is set dynamically via inline style based on number of domains */
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.3);
  z-index: 1;
}

/* Pass^k Header Toggle (inline in column header) */
.passk-header-cell {
  padding: 12px 8px !important;
}

.passk-header-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 3px;
}

.passk-header-btn {
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  outline: none;
  white-space: nowrap;
}

.passk-header-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.passk-header-btn.active {
  background: #065f46;
  color: white;
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.35);
}

.passk-sort-btn {
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  margin-left: 2px;
}

.passk-sort-btn:hover {
  background: #e2e8f0;
  color: #065f46;
}

/* Submission Type Filter (Checkboxes) */
.submission-type-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.checkbox-container:hover {
  background: rgba(6, 95, 70, 0.08);
}

.checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-container:hover .checkbox-checkmark {
  border-color: #065f46;
}

.checkbox-container input:checked ~ .checkbox-checkmark {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-color: #065f46;
}

.checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 50%;
  top: 45%;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.checkbox-container input:checked ~ .checkbox-checkmark:after {
  display: block;
}

.checkbox-label {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  transition: color 0.2s ease;
}

.checkbox-container input:checked ~ .checkbox-label {
  color: #065f46;
}

.checkbox-container:hover .checkbox-label {
  color: #065f46;
}

/* Filter Info Button and Popup */
.filter-info-container {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-info-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-info-button:hover {
  background: rgba(6, 95, 70, 0.1);
}

.filter-info-button:focus {
  outline: none;
}

.info-icon {
  font-size: 16px;
  color: #64748b;
  transition: color 0.2s ease;
}

.filter-info-button:hover .info-icon {
  color: #065f46;
}

.filter-info-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 100;
  animation: popupFadeIn 0.2s ease-out;
}

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

.filter-info-content {
  padding: 20px;
  position: relative;
}

.filter-info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.filter-info-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.filter-info-content h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-info-item {
  margin-bottom: 12px;
}

.filter-info-item:last-child {
  margin-bottom: 0;
}

.filter-info-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 4px;
}

.filter-info-item p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* Mobile adjustments for filter info popup */
@media (max-width: 768px) {
  .filter-info-popup {
    width: 280px;
    right: -60px;
  }
}

/* Empty State for Filters */
.filter-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid #f7fafc;
  margin-bottom: 3rem;
}

.filter-empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.filter-empty-state h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px 0;
}

.filter-empty-state p {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
  max-width: 400px;
}

/* Empty Results Row (inside table) */
.empty-results-row {
  height: auto !important;
}

.empty-results-cell {
  padding: 48px 32px !important;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.empty-results-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-results-content .empty-icon {
  font-size: 36px;
}

.empty-results-content .empty-text {
  font-size: 1rem;
  color: #64748b;
  font-weight: 500;
}

/* Table View */
.reliability-metrics {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #f7fafc;
  margin-bottom: 3rem;
}

/* Verification Note */
.verification-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fef2f2;
  border-top: 1px solid #fee2e2;
  font-size: 12px;
}

.verification-note .note-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.verification-note .note-text {
  color: #991b1b;
  font-weight: 400;
  line-height: 1.4;
}

.metrics-table-container {
  overflow-x: auto;
  overflow-y: visible;
}

.reliability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.reliability-table thead {
  background: #f8fafc;
}

.reliability-table th {
  color: #2d3748;
  font-weight: 700;
  padding: 20px 16px;
  text-align: center;
  border: none;
  border-bottom: 2px solid #e2e8f0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.reliability-table th:first-child {
  text-align: center;
  width: 40px; /* Rank column */
  padding: 20px 6px;
}

.reliability-table th:nth-child(2) {
  width: 220px; /* Model column */
}

.reliability-table th:nth-child(3) {
  width: 100px; /* Released column */
}

.reliability-table th:nth-child(4) {
  width: 160px; /* Organization / Provider column */
}

.reliability-table th:nth-child(5) {
  width: 100px; /* Reasoning column */
}

.reliability-table th:nth-child(6) {
  width: 120px; /* User Sim column */
}

.reliability-table th:nth-child(7) {
  min-width: 320px; /* Score column with progress bar and inline toggle */
}

.reliability-table th:nth-child(8) {
  width: 36px; /* Expand toggle column */
  padding: 20px 4px;
}

.reliability-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
  height: 70px; /* Consistent row height for all rows */
}

.reliability-table tbody tr:hover {
  background: #f8fafc;
}

.reliability-table tbody tr:last-child {
  border-bottom: none;
}

.reliability-table td {
  padding: 20px 16px;
  color: #2d3748;
  font-weight: 500;
  border: none;
}

/* Submissions Notice */
.submissions-notice {
  margin-top: 64px;
  padding: 32px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.submissions-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.submissions-content p {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.submissions-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.25);
}

.submissions-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 95, 70, 0.35);
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

.submissions-link:active {
  transform: translateY(0px);
}

/* Unverified Badge Styling */
.unverified-badge {
  display: inline-block;
  font-size: 14px;
  margin-left: 8px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.unverified-badge:hover {
  opacity: 1;
}

/* Legacy Model Styling */
.legacy-model {
  opacity: 0.55;
}

.legacy-model:hover {
  opacity: 0.75;
}

.legacy-badge {
  display: inline-block;
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Reasoning Effort Column */
.reasoning-info {
  padding: 20px 16px !important;
  text-align: center;
  vertical-align: middle;
}


/* Retrieval Config Badge */
.retrieval-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
  /* Default styling for unrecognized retrieval configs */
  color: #6b21a8;
  background: #faf5ff;
  border: 1px solid #d8b4fe;
}

.retrieval-terminal {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.retrieval-text-emb-3-large {
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.retrieval-qwen3-emb {
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.retrieval-bm25 {
  color: #4a5568;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
}

/* Missing Data Styling */
.missing-data {
  color: #9ca3af;
  font-size: 18px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.no-data {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Metric cell with score bar */
.metric-cell {
  text-align: center;
  vertical-align: middle;
}

.score-cell {
  min-width: 200px;
  padding: 16px 20px !important;
}

.score-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.score-bar-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #065f46 0%, #059669 50%, #34d399 100%);
  border-radius: 6px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.score-bar-value {
  font-weight: 700;
  font-size: 15px;
  color: #1a202c;
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

/* Colored rank text for top 3 */
.rank-gold {
  color: #d97706 !important;
}

.rank-silver {
  color: #6b7280 !important;
}

.rank-bronze {
  color: #b45309 !important;
}

.metric-value {
  font-weight: 600;
  font-size: 15px;
  color: #1a202c;
}

/* Expand Toggle */
.expand-header {
  width: 36px !important;
  min-width: 36px;
  padding: 0 !important;
}

.expand-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0 8px !important;
  width: 36px;
  cursor: pointer;
  user-select: none;
}

.expand-caret {
  display: inline-block;
  font-size: 10px;
  color: #94a3b8;
  transition: transform 0.25s ease, color 0.2s ease;
}

.expand-caret.open {
  transform: rotate(90deg);
  color: #065f46;
}

.expand-cell:hover .expand-caret {
  color: #065f46;
}

.model-row.expanded {
  border-bottom-color: transparent;
}

/* Expandable Domain Breakdown Row */
.domain-detail-row {
  background: #f8fafc;
  overflow: visible;
}

.domain-detail-row:hover {
  background: #f8fafc !important;
}

.domain-detail-cell {
  padding: 16px 24px 16px 56px !important;
  border-bottom: 1px solid #e2e8f0;
  overflow: visible;
}

.domain-breakdown {
  display: flex;
  flex-direction: row;
  gap: 16px;
  animation: expandIn 0.25s ease-out;
}

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

/* Domain Card */
.domain-breakdown-card {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s ease;
  overflow: visible;
  position: relative;
}

.domain-breakdown-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.domain-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.domain-card-body {
  display: flex;
  align-items: center;
}

/* View trajectories link */
.view-trajectories-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  transition: all 0.15s ease;
  cursor: pointer;
  align-self: flex-start;
}

.view-trajectories-link:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #047857;
}

.domain-breakdown-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
  white-space: nowrap;
}

.domain-breakdown-icon {
  font-size: 14px;
}

.domain-info-icon {
  font-size: 14px;
  color: #94a3b8;
  cursor: help;
  transition: color 0.2s ease;
  position: relative;
}

.domain-info-icon:hover {
  color: #065f46;
}

.domain-info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.domain-info-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.domain-info-icon:hover::after,
.domain-info-icon:hover::before {
  opacity: 1;
}

/* Right-align tooltip on the last card so it doesn't overflow the container */
.domain-breakdown-card:last-child .domain-info-icon::after {
  left: auto;
  right: 0;
  transform: none;
}

.domain-breakdown-card:last-child .domain-info-icon::before {
  left: auto;
  right: 4px;
  transform: none;
}

/* Left-align tooltip on the first card */
.domain-breakdown-card:first-child .domain-info-icon::after {
  left: 0;
  transform: none;
}

.domain-breakdown-card:first-child .domain-info-icon::before {
  left: 4px;
  transform: none;
}

.domain-breakdown-card .score-bar-container {
  flex: 1;
  min-width: 0;
}

.domain-breakdown-card .score-bar-track {
  height: 8px;
}

.domain-bar-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%) !important;
}

.domain-no-data {
  font-size: 13px;
}

/* Sortable Table Headers */
.reliability-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
}

.reliability-table th.sortable:hover {
  background: #e2e8f0;
  color: #065f46;
}

.reliability-table th.sortable.active {
  background: #065f46;
  color: white;
}

/* Rank Column Styling */
.rank-cell {
  text-align: center;
  padding: 20px 6px;
  width: 40px;
  border-right: 2px solid #f1f5f9;
  vertical-align: middle; /* Ensure consistent vertical alignment */
}

.rank-number {
  font-size: 16px;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}


/* Organization Column Styling */
.organization-info {
  padding: 20px 16px !important;
  text-align: left;
}

.organization-info-retrieval {
  text-align: center;
}

.org-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.org-name {
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
}

.voice-pipeline-summary {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.voice-pipeline-info {
  appearance: none;
  background: none;
  border: 0;
  color: #94a3b8;
  cursor: help;
  font-size: 12px;
  line-height: 1;
  margin: 0;
  padding: 0;
  position: relative;
  text-transform: none;
  transition: color 0.2s ease;
}

.voice-pipeline-info.open,
.voice-pipeline-info:hover,
.voice-pipeline-info:focus,
.voice-pipeline-info:focus-visible {
  color: #065f46;
  outline: none;
}

.voice-pipeline-info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: left;
  text-transform: none;
  white-space: pre-line;
  width: max-content;
  max-width: min(270px, 70vw);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.voice-pipeline-info::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  right: 2px;
  border: 5px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.voice-pipeline-info.open::after,
.voice-pipeline-info.open::before,
.voice-pipeline-info:hover::after,
.voice-pipeline-info:hover::before,
.voice-pipeline-info:focus::after,
.voice-pipeline-info:focus::before,
.voice-pipeline-info:focus-visible::after,
.voice-pipeline-info:focus-visible::before {
  opacity: 1;
}

.company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.logo-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.emoji-logo {
  font-size: 14px;
}

.model-info {
  padding: 20px 16px !important;
  text-align: left;
}

.model-name {
  font-weight: 700;
  color: #1a202c;
  font-size: 16px;
}

/* Submission details button (square card in the breakdown row) */
.submission-details-btn {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: stretch;
}

.submission-details-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.submission-details-btn-icon {
  font-size: 20px;
}

.submission-details-btn-label {
  line-height: 1.2;
  text-align: center;
}

/* User Simulator Column Styling */
.user-sim-info {
  padding: 20px 16px !important;
  text-align: center;
  vertical-align: middle;
}

.release-date-cell {
  padding: 20px 16px !important;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 0.85rem;
  color: #475569;
}

.release-date-cell .release-date-link {
  color: #047857;
  text-decoration: none;
  border-bottom: 1px dotted rgba(4, 120, 87, 0.35);
}

.release-date-cell .release-date-link:hover {
  color: #065f46;
  border-bottom-color: rgba(6, 95, 70, 0.6);
}

.user-sim-name {
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  line-height: 1.2;
}

a.user-sim-version-link {
  color: #3182ce;
  text-decoration: none;
}

a.user-sim-version-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .submissions-notice {
    margin-top: 48px;
    padding: 24px 20px;
  }
  
  .submissions-content h3 {
    font-size: 20px;
  }
  
  .submissions-content p {
    font-size: 15px;
  }
  
  .submissions-link {
    padding: 12px 24px;
    font-size: 15px;
  }

  .leaderboard-container {
    padding: 40px 16px 80px;
    max-width: 100%;
  }

  .leaderboard-title {
    font-size: 2.5rem;
    margin-bottom: 24px;
  }

  .leaderboard-subtitle {
    font-size: 1rem;
    margin-bottom: 48px;
    padding: 0 16px;
  }

  .reliability-metrics {
    margin: 0 16px 48px;
    overflow-x: auto;
  }

  .reliability-table {
    min-width: 640px;
    font-size: 14px;
  }

  .reliability-table th {
    padding: 16px 12px;
    font-size: 12px;
  }

  .reliability-table td {
    padding: 16px 12px;
  }

  .rank-number {
    font-size: 14px;
  }

  .model-name {
    font-size: 14px;
  }

  .metric-value {
    font-size: 14px;
  }

  .verification-note {
    padding: 8px 12px;
    font-size: 11px;
  }

  .verification-note .note-icon {
    font-size: 12px;
  }

  .domain-detail-cell {
    padding: 12px 12px 12px 16px !important;
  }

  .domain-breakdown {
    flex-direction: column;
    gap: 10px;
  }

  .domain-breakdown-label {
    font-size: 12px;
  }
}

/* Loading and Error States */
.loading-state, .error-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #065f46;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state p, .error-state p, .empty-state p {
  font-size: 18px;
  color: #4a5568;
  margin: 0;
}

.retry-button {
  margin-top: 16px;
  padding: 12px 24px;
  background: #065f46;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.retry-button:hover {
  background: #047857;
}

/* Updated Submission Links */
.submission-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.submissions-link.primary {
  background: #065f46;
  color: white;
}

.submissions-link.primary:hover {
  background: #047857;
  color: white;
}

.submissions-link.secondary {
  background: transparent;
  color: #065f46;
  border: 2px solid #065f46;
}

.submissions-link.secondary:hover {
  background: #065f46;
  color: white;
}

@media (max-width: 768px) {
  .submission-links {
    flex-direction: column;
    align-items: center;
  }
  
  .submissions-link {
    width: 100%;
    max-width: 300px;
  }
}

/* Submission Details Modal */
.sd-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: sdFadeIn 0.15s ease;
}

@keyframes sdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sd-modal {
  background: white;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  animation: sdSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sd-modal.closing {
  animation: sdSlideDown 0.2s ease-in forwards;
}

@keyframes sdSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes sdSlideDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(20px); opacity: 0; }
}

.sd-modal-header {
  padding: 1.25rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.sd-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.sd-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.15s;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-modal-close:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.sd-modal-body {
  padding: 0.5rem 0 1rem;
}

/* Submission details table */
.sd-table {
  width: 100%;
  border-collapse: collapse;
}

.sd-table td {
  padding: 0.35rem 1.75rem;
  font-size: 0.85rem;
  color: #475569;
  vertical-align: baseline;
  line-height: 1.5;
  word-break: break-word;
}

.sd-table td:first-child {
  width: 42%;
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.8rem;
  white-space: nowrap;
}

.sd-table td:last-child {
  color: #1e293b;
}

.sd-section-header td {
  font-weight: 600 !important;
  color: #475569 !important;
  font-size: 0.7rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 1.1rem !important;
  padding-bottom: 0.4rem !important;
  border-bottom: 1px solid #f1f5f9;
}

.sd-table tbody tr:first-child.sd-section-header td {
  padding-top: 0.6rem !important;
}

.sd-wrap {
  white-space: normal;
  line-height: 1.5;
}

.sd-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.sd-verified {
  color: #065f46;
  background: #ecfdf5;
}

.sd-unverified {
  color: #dc2626;
  background: #fef2f2;
}

.sd-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

.sd-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

@media (max-width: 768px) {
  .sd-modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
  }

  .sd-table td {
    padding: 0.3rem 1rem;
  }
} 
