/* Blackbody Radiation Sandbox - Demo-specific styles */

:root {
  --demo-max-width: 1100px;
}

/* Main layout: spectrum + star preview side by side */
.main-viz {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1rem;
  margin-bottom: 1rem;
}

.spectrum-panel {
  background: rgba(18, 18, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.star-preview {
  background: rgba(18, 18, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#spectrum-canvas {
  width: 100%;
  height: 300px;
  display: block;
}

#star-circle {
  border-radius: 50%;
  box-shadow: 0 0 30px currentColor;
  transition: all 0.3s ease;
}

.star-label {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

/* EM band bar */
.em-band-bar {
  background: rgba(18, 18, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.em-band-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.em-band-gradient {
  height: 24px;
  border-radius: 4px;
  position: relative;
  background: linear-gradient(to right,
    #8b00ff 0%,      /* UV */
    #4b0082 8%,
    #0000ff 16%,     /* Blue */
    #00ff00 33%,     /* Green */
    #ffff00 50%,     /* Yellow */
    #ff7f00 66%,     /* Orange */
    #ff0000 75%,     /* Red */
    #8b0000 85%,     /* IR */
    #2d0000 100%     /* Far IR */
  );
}

.em-peak-marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: calc(100% + 10px);
  background: var(--accent-gold);
  transform: translateX(-50%);
}

.em-peak-marker::after {
  content: attr(data-label);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--accent-gold);
  white-space: nowrap;
}

/* Readout panel */
.readout-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* Temperature slider */
.temp-control {
  background: rgba(18, 18, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.temp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.temp-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent-gold);
}

.temp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.scale-toggle {
  display: flex;
  gap: 0.25rem;
}

/* Presets */
.presets-panel {
  background: rgba(18, 18, 31, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.presets-section {
  margin-bottom: 0.75rem;
}

.presets-section:last-child {
  margin-bottom: 0;
}

.presets-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* CMB redshift slider (hidden by default) */
.cmb-controls {
  display: none;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.cmb-controls.visible {
  display: block;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.speed-control select {
  padding: 0.25rem 0.5rem;
  background: var(--space-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Overlays row */
.overlays-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.overlay-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.overlay-toggle input {
  accent-color: var(--cosmic-teal);
}

/* Insight box */
.insight-box {
  background: rgba(18, 18, 31, 0.9);
  border-left: 3px solid var(--accent-gold);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.insight-box h4 {
  margin: 0 0 0.5rem 0;
  color: var(--accent-gold);
  font-size: 0.875rem;
}

.insight-box .formula {
  font-family: var(--font-mono);
  color: var(--cosmic-teal);
  margin: 0.5rem 0;
}

/* Math mode only elements */
.math-mode-only {
  display: none;
}

body.math-mode .math-mode-only {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .main-viz {
    grid-template-columns: 1fr;
  }

  .star-preview {
    order: -1;
  }

  .readout-panel {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
