@import url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/style.min.css');
@import url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-mono/style.min.css');

:root {
  --ds-background-100: #0a0a0a;
  --ds-background-200: #111111;
  --ds-background-300: #1a1a1a;
  --ds-gray-100: #1a1a1a;
  --ds-gray-200: #2e2e2e;
  --ds-gray-400: #666666;
  --ds-gray-600: #a0a0a0;
  --ds-gray-900: #ededed;
  --ds-gray-1000: #ffffff;
  --ds-green: #22c55e;
  --ds-red: #ef4444;
  --ds-amber: #f59e0b;
  --ds-blue: #3b82f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--ds-background-100);
  color: var(--ds-gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono { font-family: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace; }

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

/* Landing — client grid */
.page-title { font-size: 24px; font-weight: 600; color: var(--ds-gray-1000); margin-bottom: 32px; }

.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.client-card {
  background: var(--ds-background-200);
  border: 1px solid var(--ds-gray-200);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.client-card:hover { border-color: var(--ds-gray-400); background: var(--ds-background-300); }
.client-card-name { font-size: 16px; font-weight: 600; color: var(--ds-gray-1000); margin-bottom: 8px; }
.client-card-meta { font-size: 13px; color: var(--ds-gray-600); display: flex; justify-content: space-between; }
.client-card-count { font-family: 'Geist Mono', monospace; color: var(--ds-gray-400); }

/* Client page */
.back-link { display: inline-block; font-size: 13px; color: var(--ds-gray-600); text-decoration: none; margin-bottom: 24px; transition: color 0.15s; }
.back-link:hover { color: var(--ds-gray-900); }

.client-header { margin-bottom: 40px; }
.client-name { font-size: 28px; font-weight: 600; color: var(--ds-gray-1000); margin-bottom: 4px; }
.client-time { font-size: 13px; color: var(--ds-gray-600); }

/* Test entry card */
.test-entry {
  background: var(--ds-background-200);
  border: 1px solid var(--ds-gray-200);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.test-label {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ds-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.test-label-name { font-size: 14px; font-weight: 600; color: var(--ds-gray-1000); }
.test-label-time { font-size: 12px; font-family: 'Geist Mono', monospace; color: var(--ds-gray-400); }

/* Analysis card */
.test-analysis-card { padding: 0; }

.analysis-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ds-gray-100);
  font-size: 12px;
  color: var(--ds-gray-600);
}
.analysis-metric { font-weight: 600; color: var(--ds-gray-900); }
.analysis-visitors { font-family: 'Geist Mono', monospace; margin-left: auto; }

/* Variations table */
.variations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.variations-table th {
  padding: 8px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--ds-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ds-gray-100);
  background: var(--ds-background-300);
}

.variations-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ds-gray-100);
  color: var(--ds-gray-600);
}

.variations-table tr:last-child td { border-bottom: none; }

.variations-table .col-name { color: var(--ds-gray-900); font-weight: 500; min-width: 180px; }
.variations-table .col-num { text-align: right; font-family: 'Geist Mono', monospace; font-size: 12px; white-space: nowrap; }
.variations-table .col-status { text-align: center; }

.variations-table .positive { color: var(--ds-green); }
.variations-table .negative { color: var(--ds-red); }

.row-winner td { background: rgba(34, 197, 94, 0.05); }
.row-loser td { background: rgba(239, 68, 68, 0.03); }
.row-disabled td { opacity: 0.4; text-decoration: line-through; }
.row-disabled td.col-name { text-decoration: none; }

/* Disabled tag */
.disabled-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: var(--ds-red);
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* Hypertask link */
.ht-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ds-blue);
  text-decoration: none;
  margin-left: 12px;
  vertical-align: middle;
}
.ht-link:hover { text-decoration: underline; }

/* Control tag */
.control-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--ds-blue);
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}
.status-collecting { color: var(--ds-gray-400); background: var(--ds-gray-100); }
.status-winner { color: var(--ds-green); background: rgba(34, 197, 94, 0.12); }
.status-loser { color: var(--ds-red); background: rgba(239, 68, 68, 0.1); }
.status-control { color: var(--ds-blue); background: rgba(59, 130, 246, 0.1); }
.status-inconclusive { color: var(--ds-amber); background: rgba(245, 158, 11, 0.1); }

/* Footer: verdict + action */
.analysis-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ds-gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.analysis-verdict { font-size: 13px; color: var(--ds-gray-600); flex: 1; }

.action-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.action-running { color: var(--ds-amber); background: rgba(245, 158, 11, 0.1); }
.action-winner { color: var(--ds-green); background: rgba(34, 197, 94, 0.12); }
.action-stop { color: var(--ds-red); background: rgba(239, 68, 68, 0.1); }

/* Screenshot toggle */
.screenshot-toggle { border-top: 1px solid var(--ds-gray-100); }
.screenshot-summary {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--ds-gray-400);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.screenshot-summary::-webkit-details-marker { display: none; }
.screenshot-summary::before { content: "▸ "; }
details[open] .screenshot-summary::before { content: "▾ "; }
.screenshot-summary:hover { color: var(--ds-gray-600); }

.test-screenshot { width: 100%; display: block; background: var(--ds-background-300); }

/* Secondary metrics toggle */
.toggle-bar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--ds-gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-btn {
  background: var(--ds-background-300);
  border: 1px solid var(--ds-gray-200);
  border-radius: 6px;
  color: var(--ds-gray-600);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  border-color: var(--ds-gray-400);
  color: var(--ds-gray-900);
}

.toggle-btn.active {
  background: var(--ds-gray-200);
  color: var(--ds-gray-1000);
  border-color: var(--ds-gray-400);
}

.test-entry[data-metric="secondary"] {
  display: none;
}

.show-secondary .test-entry[data-metric="secondary"] {
  display: block;
}

.metric-badge {
  display: inline-block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ds-blue-400);
  background: rgba(82, 168, 255, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
}

/* States */
.loading, .empty-state { text-align: center; padding: 80px 0; color: var(--ds-gray-400); font-size: 14px; }
.error-state { text-align: center; padding: 80px 0; color: var(--ds-red); font-size: 14px; }
