/* Shared design system loaded via shared.css */

:root {
    /* Enhanced Dark Theme with high contrast */
    --bg-base: #0a0a0a;
    --bg-panel: #171717;
    --bg-card: #262626;
    
    --text-main: #f5f5f5;
    --text-muted: #a3a3a3;
    
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-yellow: #eab308;
    --accent-green: #22c55e;
    
    --border-color: #333;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    /* Removed overflow: hidden to allow scrolling */
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 800px;
}

header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    margin: 0;
    color: var(--accent-cyan);
    font-size: 1.5rem;
}

header p { margin: 5px 0 0 0; color: var(--text-muted); font-size: 0.9rem; }

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

button {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

button.btn-primary { background-color: var(--accent-cyan); color: #000; border: none; }
button.btn-primary:hover { background-color: #0891b2; }

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panels */
.controls-panel, .guide-panel {
    width: 300px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.guide-panel {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.visualization-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

h2 { font-size: 1.1rem; color: var(--text-main); margin-top: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
h3.overlay-title { margin: 0; font-size: 0.9rem; color: var(--text-muted); position: absolute; top: 10px; left: 10px; z-index: 2; pointer-events: none;}
.hint { font-size: 0.8rem; color: var(--text-muted); }

/* Controls */
select {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 20px;
    cursor: pointer;
}

.harmonic-row {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.harmonic-row:hover, .harmonic-row.active {
    border-color: var(--accent-cyan);
    background: #2a2a2a;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}
.control-group label { width: 40px; font-size: 0.8rem; color: var(--text-muted); }
input[type="range"] { flex: 1; accent-color: var(--accent-cyan); }

/* Equation */
.equation-box {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: var(--accent-yellow);
    text-align: center;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
}

/* Canvases */
.canvas-wrapper {
    position: relative;
    background-color: #0f0f0f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
}

.main-canvas-wrapper { flex: 2; min-height: 300px; }
.spectrum-wrapper { flex: 1; min-height: 150px; }

canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

@media (max-width: 1024px) {
    main { flex-direction: column; overflow-y: auto; }
    .controls-panel, .guide-panel { width: 100%; border: none; border-bottom: 1px solid var(--border-color); }
    .container { min-height: auto; }
}




/* Ensure the body allows absolute positioning */



/* ================================================================
   DESIGN SYSTEM OVERRIDE — Applied via shared.css variables
   These overrides unify all pages to the shared dark-lab aesthetic
   ================================================================ */

/* Reset old colors to use CSS variables from shared.css */
body {
  font-family: var(--font-sans) !important;
  background-color: var(--bg) !important;
  color: var(--text-primary) !important;
  padding-top: 72px !important;
}

h1, h2, h3 {
  font-family: var(--font-mono) !important;
}

h1 { color: var(--text-primary) !important; }
h2 { color: var(--cyan) !important; }

/* Panel backgrounds */
.controls-panel, .panel, .dashboard > *, .grid-container > *,
.info-panel, .visualizer-panel, aside, section.panel {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-panel) !important;
  color: var(--text-primary) !important;
}

.panel-header, header.panel-header {
  background: var(--panel-2) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
}

/* Inputs */
input[type="text"], input[type="number"], select, textarea {
  background: var(--bg-2) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  border-radius: var(--radius-sm) !important;
}

label {
  color: var(--text-secondary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

/* Buttons */
button {
  font-family: var(--font-mono) !important;
  border-radius: var(--radius-sm) !important;
}

/* Canvas containers */
.canvas-container, .canvas-wrapper {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

/* Metrics / data boxes */
.metrics-box, .data-box, .explanation-panel,
.instruction-box, .dynamic-explanation {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
}

/* Highlights */
.highlight, .highlight-k { color: var(--amber) !important; }
span[style*="color: #89b4fa"], .text-blue { color: var(--cyan) !important; }

/* Subtitles */
.subtitle, .page-subtitle, p.subtitle {
  color: var(--text-secondary) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.82rem !important;
}

/* Fix dashboard flex → still works but adds top padding spacing */
.dashboard {
  padding-top: 8px;
}

/* ── SCROLL & HOME-BTN FIX ── */
body {
  padding-top: 72px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh !important;
  font-family: var(--font-sans) !important;
  background: var(--bg) !important;
  color: var(--text-primary) !important;
}
.container {
  height: auto !important;
  min-height: calc(100vh - 72px) !important;
  display: flex !important;
  flex-direction: column !important;
}
main {
  flex: 1 !important;
  overflow: visible !important;
  min-height: 0 !important;
}
.left-panel, .right-panel {
  overflow-y: auto !important;
}
@media (max-width: 900px) {
  main { flex-direction: column !important; overflow-y: auto !important; }
  .main-canvas-wrapper, .spectrum-wrapper { width: 100% !important; }
}

