/* tomography.css — styles for the Tomography Explainer module */

/* ── Page-level layout: stack nav + app vertically ── */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── App container: display-panel left, control-panel right ── */
.app {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

/* ── Two-canvas visualisation layout ── */
.tomo-viz-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  flex: 1;
  min-height: 0;
}

.viz-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.viz-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
}

/* ── Canvas containers ── */
.tomo-canvas-wrap {
  background: var(--bg-card);
  border: 1px solid rgba(108, 99, 255, 0.18);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  padding: 0;
  overflow: hidden;
  line-height: 0;  /* prevent gap under canvas */
}

#objectCanvas,
#sinoCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Display panel overrides ── */
.display-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 8px;
  min-width: 0;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.display-panel h1 {
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ── Status bar ── */
.status-bar {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 18px;
}

/* ── Control panel ── */
.control-panel {
  width: 300px;
  min-width: 280px;
  background: var(--bg-slide);
  border-left: 1px solid rgba(108, 99, 255, 0.1);
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(108, 99, 255, 0.12);
}

.section {
  background: var(--bg-card);
  border: 1px solid rgba(108, 99, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-3);
  margin: 0 0 2px;
}

/* ── Slider group ── */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.param-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.val {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--accent-4);
  min-width: 48px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(108, 99, 255, 0.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-1);
  cursor: pointer;
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-1);
  border: none;
  cursor: pointer;
}

/* ── Info rows (read-only parameters) ── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.info-row .param-name {
  color: var(--text-muted);
}

.info-row .val {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ── Toggle (show/hide beam) ── */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Custom checkbox */
.toggle-group input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 16px;
  background: rgba(108,99,255,0.2);
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: 1px solid rgba(108,99,255,0.3);
}

.toggle-group input[type="checkbox"]:checked {
  background: var(--accent-3);
  border-color: var(--accent-3);
}

.toggle-group input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-group input[type="checkbox"]:checked::before {
  transform: translateX(16px);
}

/* ── Help text ── */
.help-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.help-text em {
  color: var(--accent-4);
  font-style: normal;
  font-weight: 500;
}

/* ── Loading overlay ── */
.loading {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  color: var(--accent-1);
  z-index: 999;
  transition: opacity 0.3s;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}
