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

:root {
    /* High-contrast DSP Dark Theme */
    --bg-base: #0b0f19;
    --bg-panel: #151b2b;
    --bg-card: #1f293f;
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    --pole-color: #ef4444;    /* Red for Poles */
    --zero-color: #3b82f6;    /* Blue for Zeros */
    --stable-bg: rgba(16, 185, 129, 0.08); /* Green tint */
    --unstable-bg: rgba(239, 68, 68, 0.08); /* Red tint */
    --roc-bg: rgba(234, 179, 8, 0.15);     /* Yellow tint for ROC */
    
    --time-curve: #10b981;    /* Green */
    --envelope-color: #f59e0b;/* Yellow */
    --freq-curve: #8b5cf6;    /* Purple */
    --axis-color: #475569;
    --border: #334155;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
}

.dashboard {
    padding: 15px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 15px;
}

header h1 { margin: 0; font-size: 1.4rem; color: #fff; }
header p { margin: 4px 0 0 0; color: var(--text-muted); font-size: 0.9rem; }

.header-controls { display: flex; gap: 10px; }

.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    color: white;
}
.btn:hover { opacity: 0.8; }
.pole-btn { background-color: var(--pole-color); }
.zero-btn { background-color: var(--zero-color); }
.clear-btn { background-color: transparent; border: 1px solid var(--border); }

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 2fr 1fr;
    gap: 15px;
    flex: 1;
    min-height: 0; /* allows flex children to shrink */
}

.panel {
    background: var(--bg-panel);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

h2 { margin: 0; font-size: 1.1rem; color: #fff; }
.subtitle { margin: 4px 15px 0; font-size: 0.8rem; color: var(--text-muted); }

.toggles select, .toggles input { cursor: pointer; }
.toggles select { background: var(--bg-base); color: #fff; border: 1px solid var(--border); padding: 4px; border-radius: 4px;}

.canvas-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    background-color: #000;
    overflow: hidden;
}

canvas { display: block; width: 100%; height: 100%; cursor: grab; }
canvas:active { cursor: grabbing; }

.splane-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    pointer-events: none;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none;
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.1s;
    white-space: pre-line;
    z-index: 10;
}

/* Math Panel */
.math-panel { padding: 15px; overflow-y: auto; }
.math-content {
    background: var(--bg-base);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 15px;
}
.placeholder-text { color: var(--text-muted); font-style: italic; }

.intuition-guide {
    background: rgba(56, 189, 248, 0.1);
    border-left: 3px solid var(--zero-color);
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .grid-container { display: flex; flex-direction: column; overflow-y: auto; }
    .panel { min-height: 350px; }
}




/* 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;
  font-family: var(--font-sans) !important;
  background: var(--bg) !important;
  color: var(--text-primary) !important;
}
.dashboard {
  height: auto !important;
  min-height: calc(100vh - 72px) !important;
  box-sizing: border-box !important;
}
.grid-container {
  min-height: 0 !important;
  flex: 1 !important;
}
.panel {
  overflow: visible !important;
  min-height: 200px;
}
canvas { max-width: 100% !important; }
@media (max-width: 900px) {
  .grid-container {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }
  .panel { min-height: 280px !important; }
}

