/* Meet-in-the-Middle visualization styles */

.mitm-stage {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.array-split {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.half-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.half-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  font-family: 'system-ui', sans-serif;
}

.elements-row {
  display: flex;
  gap: 8px;
}

.element-pill {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-family: 'system-ui', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.mitm-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.mitm-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.mitm-table-header {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}

.mitm-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'system-ui', monospace;
  font-size: 12px;
}

.mitm-table th, .mitm-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.mitm-table th {
  background: var(--surface-2);
  font-family: 'system-ui', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

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

/* Row states */
.mitm-table tr.current td {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--accent-deep);
}

.mitm-table tr.match td {
  background: var(--good-soft);
  font-weight: 700;
  color: oklch(0.32 0.1 145);
}

.mitm-table tr.highlight td {
  background: var(--cool-soft);
}

.mitm-table tr.dimmed {
  opacity: 0.35;
}

.mitm-table tr.mid-point td {
  background: var(--cool);
  color: white;
  font-weight: 600;
}

.binary-search-info {
  margin-top: 4px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  font-family: 'system-ui', monospace;
  color: var(--ink);
}

.stat-op {
  font-size: 20px;
  color: var(--line-strong);
  font-weight: 300;
}

.needed-val {
  color: var(--accent);
}

.complexity-comparison {
  margin-top: 15px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.comparison-row:last-child {
  margin-bottom: 0;
}

.comparison-label {
  color: var(--muted);
  font-weight: 500;
}

.comparison-value {
  font-family: 'system-ui', monospace;
  font-weight: 600;
}

.comparison-value.highlight {
  color: var(--accent);
}

.work-meter-wrap {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.work-meter-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.work-meter-fill.brute {
  background: var(--ink-soft);
}

.problem-chooser {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.problem-chooser button {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.problem-chooser button:hover {
  color: var(--ink);
}

.problem-chooser button.active {
  background: var(--ink);
  color: var(--bg);
}

/* Brute force table specific */
.brute-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto;
}

.brute-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'system-ui', monospace;
  font-size: 12px;
}

.brute-table th, .brute-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.brute-table tr.current td {
  background: var(--accent-soft);
  font-weight: 600;
}

.brute-table tr.match td {
  background: var(--good-soft);
  color: oklch(0.32 0.1 145);
  font-weight: 700;
}

.brute-table tr.dimmed {
  opacity: 0.4;
}

.sum-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-weight: 700;
  color: var(--accent);
}
