/* style.css
   Modern Cyberpunk Glassmorphism Styling for Aether Synth */

:root {
  /* Color Palette */
  --bg-color: #08090f;
  --panel-bg: rgba(14, 18, 30, 0.45);
  --panel-border: rgba(0, 242, 254, 0.15);
  --panel-border-focus: rgba(0, 242, 254, 0.6);
  --text-primary: #e2e8f0;
  --text-muted: #64748b;

  /* Neon Accents */
  --cyan: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.4);
  --magenta: #ff007f;
  --magenta-glow: rgba(255, 0, 127, 0.4);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.4);
  --amber: #ff7300;
  --amber-glow: rgba(255, 115, 0, 0.4);

  /* Fonts */
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 0, 127, 0.08) 0, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 242, 254, 0.08) 0, transparent 50%),
    linear-gradient(rgba(14, 18, 30, 0.95), rgba(8, 9, 15, 0.98));
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

#app-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
  background: linear-gradient(to bottom, #11141e, #07080c);
  padding: 16px;
  box-shadow: none;
}

/* Glassmorphic Panel Styles */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  position: relative;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.panel.glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel:hover {
  border-color: rgba(0, 242, 254, 0.25);
}

.panel-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  text-transform: uppercase;
}

/* Header & Visualizer Panel */
header.panel {
  display: grid;
  grid-template-columns: auto 1fr 320px;
  align-items: center;
  gap: 24px;
}

.logo-area h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 30%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.logo-area h1 span {
  color: var(--cyan);
  text-shadow: 0 0 15px var(--cyan-glow);
}

.logo-area .subtitle {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* System Controls (Preset & BPM) */
.system-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

select {
  background: #0e121e;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: all 0.2s ease;
}

select:focus,
select:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.bpm-control {
  display: flex;
  gap: 6px;
}

input[type="number"] {
  background: #0e121e;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  width: 65px;
  text-align: center;
  outline: none;
}

input[type="number"]:focus {
  border-color: var(--cyan);
}

/* Buttons styling */
button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

button.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.glow-btn-cyan {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 242, 254, 0.15);
}

.glow-btn-cyan:hover,
.glow-btn-cyan.active {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 15px var(--cyan);
}

.seq-transport {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Live Visualizer Canvas */
.visualizer-container {
  height: 60px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

canvas#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Grid Layout for Synth Engine panels */
.synth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Equal 50/50 balance */
  gap: 16px;
}

/* Oscillator Section - Horizontal stacking of 4 oscillators */
.oscillator-blocks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.osc-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px;
}

.osc-block .knobs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 6px;
  justify-items: center;
}

.block-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.wave-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 6px;
}

.wave-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 0;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.wave-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.1s ease;
}

.wave-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.wave-btn.active {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.wave-btn.active svg {
  transform: scale(1.1);
}

/* Knob Styling (SVG-based implementation) */
.knobs-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
}

.knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: ns-resize;
  position: relative;
  width: 55px;
}

.knob-container.large {
  width: 75px;
}

.knob-svg {
  width: 42px;
  height: 42px;
  display: block;
}

.knob-container.large .knob-svg {
  width: 58px;
  height: 58px;
}

.knob-track {
  fill: none;
  stroke: rgba(0, 242, 254, 0.08);
  stroke-width: 4px;
  stroke-linecap: round;
}

.knob-val-arc {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4px;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px var(--cyan-glow));
  transition:
    stroke 0.3s ease,
    filter 0.3s ease;
}

.knob-body {
  /* Fill url(#knob-metal) inside SVG */
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1px;
}

.knob-pointer {
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
  transition: stroke 0.2s ease;
}

.knob-container:hover .knob-pointer {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 3px var(--cyan));
}

.knob-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.knob-value {
  position: absolute;
  top: 15px;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  text-shadow: 0 0 4px #000;
}

.knob-container.large .knob-value {
  top: 22px;
}

.knob-container:hover .knob-value {
  opacity: 1;
}

/* Filter Section */
.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-subblock {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
}

.filter-type-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-btn {
  flex: 1;
  font-size: 0.65rem;
  padding: 8px 0;
  border-color: rgba(255, 0, 127, 0.15);
  color: var(--text-muted);
}

.filter-btn:hover {
  border-color: var(--magenta);
  color: var(--text-primary);
}

.filter-btn.active {
  background: rgba(255, 0, 127, 0.1);
  border-color: var(--magenta);
  color: var(--magenta);
  box-shadow: 0 0 10px var(--magenta-glow);
}

.oberheim-mode-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  justify-content: center;
  animation: slideDown 0.2s ease-out;
}

.oberheim-mode-selector.hide {
  display: none;
}

.mode-btn {
  font-size: 0.6rem;
  padding: 4px 10px;
}

.mode-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  box-shadow: 0 0 8px var(--gold-glow);
}

.knobs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columns for filter row */
  gap: 8px;
  justify-items: center;
  margin-top: 8px;
}

/* Envelopes Section */
.envelope-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.env-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.env-visualizer {
  height: 120px; /* Taller display for better visibility and node dragging */
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.env-visualizer canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sliders-row {
  display: flex;
  justify-content: space-around;
  height: 100px; /* Fixed height to prevent flexbox overlap / layout collapse */
  padding-bottom: 4px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.slider-group label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Vertical Sliders styling */
.vertical-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 6px;
  height: 70px; /* More compact slider height */
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  border-radius: 3px;
  writing-mode: vertical-lr; /* for standard vertical rendering in some browsers */
  direction: rtl; /* reverse direction for vertical standard */
}

/* Custom Webkit slider thumb */
.vertical-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 12px;
  border-radius: 3px;
  background: var(--magenta);
  cursor: pointer;
  box-shadow: 0 0 6px var(--magenta-glow);
  transition: background 0.15s;
}

.vertical-slider::-webkit-slider-thumb:hover {
  background: #fff;
  box-shadow: 0 0 10px #fff;
}

/* Firefox slider style */
.vertical-slider::-moz-range-thumb {
  width: 16px;
  height: 12px;
  border: none;
  border-radius: 3px;
  background: var(--magenta);
  cursor: pointer;
  box-shadow: 0 0 6px var(--magenta-glow);
}

.vertical-slider::-moz-range-thumb:hover {
  background: #fff;
}

/* LFOs section */
.lfo-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lfo-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
}

.lfo-wave-row {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 6px;
}

.lfo-wave-btn {
  flex: 1;
  font-size: 0.55rem;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.lfo-wave-btn:hover {
  color: var(--text-primary);
}

.lfo-wave-btn.active {
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 8px var(--gold-glow);
}

.fx-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.fx-block {
  padding: 4px 12px;
}

.border-right {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-buttons {
  display: flex;
  gap: 8px;
}

.voice-btn {
  flex: 1;
  font-size: 0.65rem;
  padding: 8px 0;
}

/* Master Saturation Buttons */
.dist-type-selector {
  display: flex;
  gap: 4px;
}

.dist-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dist-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}

.dist-btn.active {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Step Sequencer Panel */
.seq-panel {
  grid-column: span 2;
}

.seq-settings-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 16px;
  border-radius: 8px;
}

.seq-lane-selector {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.lane-tab {
  font-size: 0.65rem;
  padding: 6px 12px;
}

.lane-tab.active {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Sequencer Grid Matrix */
.sequencer-grid-container {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  overflow-x: auto;
}

.seq-grid-labels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
}

.seq-row-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  height: 28px;
  display: flex;
  align-items: center;
}

.seq-row-label.label-val {
  height: 100px;
}

.seq-step-cols {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 6px;
  min-width: 700px; /* guarantees columns don't shrink too much */
}

/* Step Column items */
.seq-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  position: relative;
}

.seq-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.1s ease;
  margin-bottom: 4px;
}

.seq-led.active {
  background: var(--cyan);
  box-shadow:
    0 0 10px var(--cyan),
    0 0 20px var(--cyan);
}

/* Step triggers */
.step-trigger-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.55rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.step-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.step-trigger-btn.step-on {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.step-trigger-btn.step-tie {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  box-shadow: 0 0 10px var(--gold-glow);
}

/* Step pitch/cutoff slider */
.step-slider-container {
  height: 100px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.seq-step-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 100px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  writing-mode: vertical-lr;
  direction: rtl;
}

.seq-step-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 5px var(--cyan-glow);
  transition: background 0.1s;
}

.seq-step-slider::-webkit-slider-thumb:hover {
  background: #fff;
  box-shadow: 0 0 8px #fff;
}

.seq-step-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 5px var(--cyan-glow);
}

/* Display notes/values above sliders on hover */
.step-tooltip {
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 4px var(--cyan-glow);
  margin-top: 4px;
  height: 12px;
}

.step-extra-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.5rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.step-extra-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: #000;
  box-shadow: 0 0 6px var(--amber-glow);
}

/* Keyboard Styling */
.keyboard-panel {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 12px 16px;
}

/* ── Left Controller Column (Pro 3 style) ─────────────────────── */
.kb-left-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 128px;
  flex-shrink: 0;
}

.kb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Transpose */
.transpose-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.transpose-label {
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.transpose-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.transpose-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  transition: all 0.15s ease;
}

.transpose-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.transpose-display {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
  min-width: 28px;
  text-align: center;
  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.transpose-display.active {
  color: var(--magenta);
  text-shadow: 0 0 10px var(--magenta-glow);
}

.transpose-reset-btn {
  font-family: var(--font-display);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  padding: 2px 9px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.transpose-reset-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-primary);
}

/* Hold button (in-flow, inside left controls) */
.hold-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

.hold-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}

.hold-btn.active {
  background: rgba(255, 0, 127, 0.2);
  border-color: var(--magenta);
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.6);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.25);
}

/* Pitch Bend & Mod Wheel strips */
.strips-area {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex: 1;
  align-items: stretch;
}

.strip-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.strip-label {
  font-family: var(--font-display);
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.strip-track {
  width: 28px;
  flex: 1;
  min-height: 56px;
  background: #06070f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  position: relative;
  cursor: ns-resize;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  touch-action: none;
  user-select: none;
}

/* inner groove channel */
.strip-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 4px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border-radius: 2px;
  pointer-events: none;
}

/* center-return mark on pitch strip */
.strip-center-mark {
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  z-index: 2;
  pointer-events: none;
}

.strip-thumb {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 16px;
  background: linear-gradient(to bottom, #2e3555 0%, #14172a 100%);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: 8px;
  transform: translateY(-50%);
  z-index: 3;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.6),
    0 0 6px rgba(0, 242, 254, 0.12);
  pointer-events: none;
  /* smooth spring-back for pitch bend */
  transition:
    top 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.1s ease,
    border-color 0.1s ease;
}

.strip-track.dragging .strip-thumb {
  /* no position transition while actively dragging */
  transition:
    box-shadow 0.1s ease,
    border-color 0.1s ease;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.7),
    0 0 14px rgba(0, 242, 254, 0.45);
  border-color: var(--cyan);
}

/* MIDI status indicator (now in-flow) */
.midi-indicator {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  padding-right: 2px;
}

.midi-indicator.online {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.midi-indicator.online::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
  box-shadow: 0 0 8px var(--cyan);
}

/* Piano Keyboard Container */
.piano-keyboard {
  position: relative;
  height: 160px; /* Slightly taller for better playing target */
  background: #080a10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  user-select: none;
}

/* White keys cover the bottom layer entirely */
.white-keys-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.key {
  cursor: pointer;
  user-select: none;
  font-family: var(--font-display);
  font-weight: 700;
  box-sizing: border-box;
}

/* White Keys Styling */
.key.white {
  flex: 1;
  height: 100%;
  background: linear-gradient(to bottom, #ffffff 0%, #f4f4f6 85%, #e1e3e8 100%);
  border-right: 1px solid #bcbfc6;
  border-bottom: 4px solid #b0b4be;
  border-radius: 0 0 5px 5px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 12px;
  z-index: 1;
  color: #5b6270;
  transition:
    background 0.05s ease,
    border-bottom-width 0.05s ease,
    padding-bottom 0.05s ease;
}

.key.white:hover {
  background: linear-gradient(to bottom, #ffffff 0%, #eceef2 85%, #d5d8e0 100%);
}

.key.white.active {
  background: linear-gradient(to bottom, #00f2fe 0%, #00b9d6 85%, #009db6 100%);
  color: #001015;
  border-bottom-width: 1px;
  border-bottom-color: #00768c;
  padding-bottom: 9px;
  box-shadow:
    inset 0 6px 12px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(0, 242, 254, 0.5);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Black Keys Styling */
.key.black {
  position: absolute;
  top: 0;
  height: 100px; /* Sits over white keys */
  width: 4.4%; /* Proportional width */
  transform: translateX(-50%);
  background: linear-gradient(to bottom, #2d313b 0%, #15181f 75%, #08090d 100%);
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  border-bottom: 6px solid #000;
  border-radius: 0 0 4px 4px;
  box-shadow:
    2px 4px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  z-index: 2;
  color: #7b8393;
  transition:
    background 0.05s ease,
    border-bottom-width 0.05s ease,
    padding-bottom 0.05s ease;
}

.key.black:hover {
  background: linear-gradient(to bottom, #393e4a 0%, #20242e 75%, #0d0f14 100%);
}

.key.black.active {
  background: linear-gradient(to bottom, #ff007f 0%, #d60067 85%, #b60055 100%);
  color: #fff;
  border-bottom-width: 1px;
  padding-bottom: 5px;
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 0, 127, 0.6);
}

/* Keyboard Text labels */
.key-shortcut {
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.55;
  margin-bottom: 6px;
}

.key.white .key-shortcut {
  color: #6c7585;
}

.key.black .key-shortcut {
  color: #a4adc1;
}

.key-note {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Activation Overlay screen */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.activation-card {
  width: 480px;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 242, 254, 0.15);
  animation: zoomIn 0.4s ease-out;
}

.activation-card h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan-glow);
  margin-bottom: 20px;
}

.activation-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.activation-card button {
  font-size: 1rem;
  padding: 12px 30px;
  border-radius: 8px;
}

/* Slide Down / Fade In Keyframe animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Master Saturation Side-by-Side and Grid */
.dist-block {
  grid-column: span 1;
}

.dist-layout {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  margin-top: 5px;
}

.dist-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.dist-knobs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dist-knobs-grid .knob-container {
  width: 48px;
}

/* Vacuum Tube Graphic CSS */

/* Responsive adjustments */
@media (max-width: 1200px) {
  .synth-grid {
    grid-template-columns: 1fr;
  }
  header.panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .system-bar {
    width: 100%;
    justify-content: center;
  }
  .visualizer-container {
    width: 100%;
  }
}
/* --- DEDICATED DISTORTION LAB PANEL --- */
.dist-lab-panel {
  grid-column: span 2; /* full width */
}

.dist-lab-layout {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1.3fr;
  gap: 16px;
  align-items: stretch;
}

/* Left Column: Controls (Simplified) */
.dist-lab-controls-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  justify-content: center;
}

.dist-lab-knobs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px 10px;
  flex: 1;
  justify-items: center;
  align-items: center;
}

.dist-lab-knobs .knob-container {
  width: 54px;
}

/* Middle Column: Transfer Curve Lab */
.dist-lab-curve-col {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
}

.curve-drawer-container {
  position: relative;
  height: 220px; /* Taller display (220px) */
  background: #060810;
  border: 1.5px solid rgba(0, 242, 254, 0.2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.12);
}

.curve-drawer-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  cursor: crosshair;
}

.canvas-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0, 242, 254, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 242, 254, 0.04) 1px, transparent 1px);
  background-size: 10% 10%;
  z-index: 1;
}

/* Draw your own distortion action buttons */
.curve-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.dist-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.dist-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.dist-action-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

#curve-reset-btn {
  border-color: rgba(255, 0, 127, 0.2);
}
#curve-reset-btn:hover {
  border-color: var(--magenta);
  color: var(--magenta);
}

/* Right Column: Oscilloscope Display */
.dist-lab-scope-col {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
}

.scope-container {
  position: relative;
  height: 220px; /* Taller display (220px) */
  background: #04050a;
  border: 1.5px solid rgba(255, 215, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.08);
}

.scope-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

.scope-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 215, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 215, 0, 0.03) 1px, transparent 1px);
  background-size: 12.5% 12.5%;
  z-index: 1;
}

.scope-legend {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 8px;
  z-index: 3;
  font-family: var(--font-display);
  font-size: 0.5rem;
  font-weight: 700;
}

.scope-legend span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.scope-legend .bullet {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.scope-legend .legend-pre {
  color: #7f8c8d;
}
.scope-legend .legend-pre .bullet {
  background: #7f8c8d;
}

.scope-legend .legend-post {
  color: var(--cyan);
  text-shadow: 0 0 3px var(--cyan);
}
.scope-legend .legend-post .bullet {
  background: var(--cyan);
  box-shadow: 0 0 3px var(--cyan);
}

/* ── XY Performance Pad (standalone panel in synth-grid) ────── */
.xy-pad-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Axis source selectors */
.xy-selectors {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.xy-selector-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.xy-axis-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.xy-axis-x {
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan-glow);
}
.xy-axis-y {
  color: var(--magenta);
  text-shadow: 0 0 6px var(--magenta-glow);
}

.xy-param-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.52rem;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.xy-param-select:hover,
.xy-param-select:focus {
  border-color: rgba(0, 242, 254, 0.4);
}

/* The canvas wrapper */
.xy-pad-container {
  position: relative;
  flex: 1;
  min-height: 160px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 0, 127, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  cursor: crosshair;
}

.xy-pad-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}

.xy-pad-container.active {
  border-color: rgba(255, 0, 127, 0.6);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(255, 0, 127, 0.2);
}

/* Live value readout */
.xy-readout {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.xy-readout-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: var(--font-display);
  font-size: 0.55rem;
  overflow: hidden;
}

.xy-readout-axis {
  font-size: 0.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.xy-readout-x .xy-readout-axis {
  color: var(--cyan);
}
.xy-readout-y .xy-readout-axis {
  color: var(--magenta);
}

.xy-readout-item span:last-child {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
