/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - LANDR-inspired dark navy theme */
  --bg-primary: #282e3e;
  --bg-secondary: #333b4e;
  --bg-tertiary: #3d4a61;
  --bg-darker: #1e2330;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --accent-primary: #4fc3f7;
  --accent-secondary: #ff6b6b;
  --accent-teal: #4dd0e1;
  --accent-cyan: #26c6da;
  --success: #51cf66;
  --warning: #ffd43b;
  --error: #ff6b6b;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xl);
}

/* Header */
header {
    margin-bottom: var(--spacing-xl);
}

.header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

.title-with-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.app-logo {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(77, 208, 225, 0.3));
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.header-right a {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-right a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.header-right a:active {
  transform: translateY(0);
}

/* Sections */
section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(79, 195, 247, 0.1);
}

/* File Section */
.file-section {
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.drop-zone {
  border: 2px dashed rgba(79, 195, 247, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: rgba(79, 195, 247, 0.03);
}

.drop-zone:hover,
.drop-zone.drag-over {
  background-color: rgba(79, 195, 247, 0.08);
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15), var(--shadow-glow);
}

.file-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-md);
  cursor: pointer;
}

.upload-icon {
  color: var(--accent-teal);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.drop-zone:hover .upload-icon {
  transform: translateY(-2px);
}

.upload-text-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.drop-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-subtext {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.file-info {
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background-color: rgba(79, 195, 247, 0.05);
}

.file-info-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.file-icon {
  color: var(--accent-teal);
  flex-shrink: 0;
}

.file-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.change-file-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--accent-teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.change-file-btn:hover {
  background-color: var(--accent-teal);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.change-file-btn:active {
  transform: translateY(0);
}

.file-metadata {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Waveform Section */
.waveform-section {
  position: relative;
  height: 200px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 6px;
  background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-tertiary) 100%);
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  background-color: transparent;
  cursor: pointer;
  display: block;
}

.playhead-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: var(--accent-secondary);
  pointer-events: none;
  transform: translateX(0);
  transition: transform 0.05s linear;
}

/* Spectrum Analyzer Section */
.spectrum-section {
  position: relative;
  height: 300px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 6px;
  background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-tertiary) 100%);
  border: 1px solid rgba(79, 195, 247, 0.15);
}

.spectrum-canvas {
  width: 100%;
  height: 100%;
  background-color: transparent;
  display: block;
}

/* Controls Section */
.controls-section {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--spacing-xl);
  align-items: center;
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  background: none;
  box-shadow: none;
}

.transport-controls {
  display: flex;
  gap: var(--spacing-sm);
  padding-left: var(--spacing-md);
}

.control-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.control-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.control-btn:active:not(:disabled) {
  transform: translateY(0);
}

.control-btn:disabled {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Repeat button - default OFF state (gray) */
.repeat-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.repeat-btn:hover:not(:disabled):not(.active) {
  background: var(--bg-darker);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Repeat button - ON state (teal gradient) */
.repeat-btn.active {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan)) !important;
  color: white !important;
}

.repeat-btn.active:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal)) !important;
}

/* Time Display - now drawn on waveform canvas */
.time-display {
  display: none;
}

.time-separator {
  display: none;
}

/* Toggle Controls Container */
.toggle-controls {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
  justify-content: flex-end;
}

/* Toggle Controls Container */
.toggle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.toggle-label-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.toggle-label-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
  text-align: center;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  user-select: none;
  -webkit-user-select: none;
}

.toggle-switch:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toggle-track {
  display: block;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--text-secondary);
  border-radius: 12px;
  position: relative;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toggle-switch:not(:disabled):hover .toggle-track {
  border-color: var(--accent-teal);
  background-color: rgba(255, 255, 255, 0.15);
}

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Active state - knob moves to right */
.toggle-switch.active .toggle-track {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  border-color: var(--accent-teal);
}

.toggle-switch.active .toggle-knob {
  left: 26px;
  background-color: white;
}

/* Red indicator light for A/B "In" mode */
.indicator-light {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 0, 0, 0.3);
  border: 1px solid rgba(255, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.indicator-light.active {
  background-color: #ff0000;
  border-color: #ff0000;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
}

.keyboard-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Processing Section */
.control-group {
  margin-bottom: var(--spacing-lg);
}

.control-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.control-value {
  color: var(--accent-teal);
  font-variant-numeric: tabular-nums;
}

.slider-container {
  position: relative;
}

#gainSlider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
}

#gainSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

#gainSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

#gainSlider:hover:not(:disabled)::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  transform: scale(1.2);
  box-shadow: var(--shadow-glow);
}

#gainSlider:hover:not(:disabled)::-moz-range-thumb {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  transform: scale(1.2);
  box-shadow: var(--shadow-glow);
}

#gainSlider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slider-markers {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Metering Section */
.metering-section {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  padding: 0;
  background: none;
  box-shadow: none;
}

.level-meter {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: 'Monaco', 'Courier New', monospace;
}

.meter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.meter-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-teal);
  min-width: 60px;
  text-align: right;
  transition: color 0.1s ease;
}

.meter-value.warning {
  color: #ffa500;
}

.meter-value.danger {
  color: var(--error);
}

.meter-value.clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.meter-value.clickable:hover {
  opacity: 0.7;
}

.clipping-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all 0.3s ease;
}

.clipping-indicator.active {
  /* Visual feedback is provided by the indicator light */
}

.indicator-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.clipping-indicator.active .indicator-light {
  background-color: var(--error);
  box-shadow: 0 0 8px var(--error);
}

/* Export Section */
.export-btn {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.export-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.export-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

.export-progress {
  margin-top: var(--spacing-md);
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
  transition: width 0.3s ease;
  width: 0%;
}

/* Error Message */
.error-message {
  background-color: rgba(255, 107, 107, 0.1);
  border: 2px solid var(--error);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-lg);
  color: var(--error);
  font-weight: 500;
}

/* Footer */
footer {
  text-align: center;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Test Tone Panel */
.test-tone-panel {
  margin-top: var(--spacing-lg);
}

.test-tone-panel details {
  cursor: pointer;
}

.test-tone-panel summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: var(--spacing-sm);
  user-select: none;
}

.test-tone-panel summary:hover {
  color: var(--text-primary);
}

.test-tone-buttons {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.test-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--accent-teal);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-btn:hover {
  background-color: var(--accent-teal);
  color: white;
}

/* Effects Chain Section */
.effects-chain-section {
  padding: var(--spacing-lg);
}

.effects-chain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.effects-chain-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Effects Chain Controls Container */
.effects-chain-controls {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

/* Preset Dropdown */
.preset-select {
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.preset-select:hover {
  background-color: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-select:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

.preset-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.preset-select optgroup {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Add Effect Dropdown */
.add-effect-dropdown {
  position: relative;
}

.add-effect-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 2px solid var(--accent-teal);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--accent-teal);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-effect-btn:hover {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
  box-shadow: var(--shadow-glow);
}

/* ACCESSIBILITY: Focus state for add effect button */
.add-effect-btn:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.add-effect-btn:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.add-effect-btn svg {
  width: 16px;
  height: 16px;
}

.add-effect-menu {
  position: absolute;
  top: calc(100% + var(--spacing-xs));
  right: 0;
  min-width: 200px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}

.add-effect-menu-item {
  display: block;
  width: 100%;
  padding: var(--spacing-md);
  border: none;
  background-color: transparent;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-effect-menu-item:hover {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
}

/* Effects List */
.effects-chain-container {
  position: relative;
}

.effects-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.effects-empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
}

/* Individual Effect Item */
.effect-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.3s ease, background 0.5s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0; /* Allow to shrink below content size */
  overflow: visible; /* Allow content to be visible */
  border-left-width: 4px;
  border-left-style: solid;
}

.effect-item:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-sm), 0 0 15px rgba(79, 195, 247, 0.2);
}

.effect-item-locked {
  border-color: rgba(255, 255, 255, 0.15);
  opacity: 0.95;
}

.effect-item-locked:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Effect Type-Specific Colors */
/* Parametric EQ - Blue (analytical, precise) */
.effect-item.effect-parametriceq {
  background: linear-gradient(135deg, #1a2a3a 0%, #243447 100%);
  border-left-color: #4a90e2;
}

.effect-item.effect-parametriceq:hover {
  border-color: #4a90e2;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(74, 144, 226, 0.25);
}

/* Compressor - Red-Orange (dynamic, control) */
.effect-item.effect-compressor {
  background: linear-gradient(135deg, #2a1a1a 0%, #3d2626 100%);
  border-left-color: #e74c3c;
}

.effect-item.effect-compressor:hover {
  border-color: #e74c3c;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(231, 76, 60, 0.25);
}

/* Limiter - Crimson (safety, ceiling) */
.effect-item.effect-limiter {
  background: linear-gradient(135deg, #2a1a1f 0%, #3d2630 100%);
  border-left-color: #c0392b;
}

.effect-item.effect-limiter:hover {
  border-color: #c0392b;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(192, 57, 43, 0.25);
}

/* FET-76 - Purple (vintage, special) */
.effect-item.effect-fet76 {
  background: linear-gradient(135deg, #2a1a2a 0%, #362638 100%);
  border-left-color: #9b59b6;
}

.effect-item.effect-fet76:hover {
  border-color: #9b59b6;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(155, 89, 182, 0.25);
}

/* Saturation - Amber (warmth, harmonics) */
.effect-item.effect-saturation {
  background: linear-gradient(135deg, #2a2a1a 0%, #3d3626 100%);
  border-left-color: #f39c12;
}

.effect-item.effect-saturation:hover {
  border-color: #f39c12;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(243, 156, 18, 0.25);
}

/* Reverb - Teal (space, depth) */
.effect-item.effect-reverb {
  background: linear-gradient(135deg, #1a2a2a 0%, #264038 100%);
  border-left-color: #1abc9c;
}

.effect-item.effect-reverb:hover {
  border-color: #1abc9c;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(26, 188, 156, 0.25);
}

/* Stereo Width - Green (width, spatial) */
.effect-item.effect-stereowidth {
  background: linear-gradient(135deg, #1a2a1f 0%, #26402e 100%);
  border-left-color: #27ae60;
}

.effect-item.effect-stereowidth:hover {
  border-color: #27ae60;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(39, 174, 96, 0.25);
}

/* Master Gain - Neutral Gray (utility, simple) */
.effect-item.effect-mastergain {
  background: linear-gradient(135deg, #222222 0%, #2d2d2d 100%);
  border-left-color: #7f8c8d;
}

.effect-item.effect-mastergain:hover {
  border-color: #7f8c8d;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(127, 140, 141, 0.25);
}

/* Effect Header */
.effect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
}

.effect-name-bypass {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.effect-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.effect-remove-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.effect-remove-btn:hover:not(:disabled) {
  background-color: var(--error);
  color: white;
}

.effect-remove-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Effect Header Buttons Container */
.effect-header-buttons {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
}

/* Effect Move Buttons */
.effect-move-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.effect-move-btn:hover:not(:disabled) {
  background-color: var(--accent-teal);
  color: white;
}

.effect-move-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.effect-move-btn svg {
  width: 16px;
  height: 16px;
}

/* Effect Bypass Button */
.effect-bypass-btn {
  min-width: 40px;
  height: 24px;
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--accent-teal);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 var(--spacing-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--spacing-xs);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1); /* iOS tap feedback */
  user-select: none; /* Prevent text selection on touch */
  -webkit-user-select: none;
}

.effect-bypass-btn:hover {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
}

.effect-bypass-btn.bypassed {
  color: var(--error);
  border-color: var(--error);
  opacity: 0.7;
}

.effect-bypass-btn.bypassed:hover {
  background-color: var(--error);
  color: white;
  opacity: 1;
}

/* Effect Bypassed State */
.effect-bypassed {
  opacity: 0.5;
}

.effect-bypassed .effect-header {
  opacity: 1; /* Keep header at full opacity */
}

/* Effect Mix Control */
.effect-mix-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.effect-mix-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Circular Knob Control */
.effect-mix-knob {
  position: relative;
  width: 45px;
  height: 45px;
  cursor: pointer;
  user-select: none;
}

.effect-mix-knob canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.effect-mix-value {
  font-size: 0.75rem;
  color: var(--accent-teal);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin-top: var(--spacing-xs);
}

/* Effect Controls */
.effect-controls {
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 0; /* Allow to shrink below content size */
  width: 100%;
}

.effect-control-group {
  margin-bottom: var(--spacing-md);
}

.effect-control-group:last-child {
  margin-bottom: 0;
}

.effect-control-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.effect-control-value {
  color: var(--accent-teal);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.effect-slider {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.effect-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.effect-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.effect-slider:hover::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  transform: scale(1.2);
  box-shadow: var(--shadow-glow);
}

.effect-slider:hover::-moz-range-thumb {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  transform: scale(1.2);
  box-shadow: var(--shadow-glow);
}

/* ACCESSIBILITY: Focus state for sliders */
.effect-slider:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.effect-slider:focus:not(:focus-visible) {
  outline: none;
}

.effect-slider-markers {
  display: flex;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.effect-controls-placeholder {
  text-align: center;
  padding: var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.effect-controls-placeholder small {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* EQ Frequency Response Curve */
.eq-curve-container {
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Allow flexbox/grid to shrink below content size */
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-md);
  background-color: rgba(0, 0, 0, 0.3);
  position: relative;
  box-sizing: border-box;
}

.eq-curve-canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: 250px;
  touch-action: none; /* Prevent default touch behaviors */
  box-sizing: border-box;
}

/* EQ Band Cards */
.eq-bands-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.eq-band-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(79, 195, 247, 0.15);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: all 0.2s ease;
}

.eq-band-card:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(79, 195, 247, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(79, 195, 247, 0.1);
}

.eq-band-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.eq-band-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-md);
}

.eq-band-control {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.eq-band-control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.eq-band-control-value {
  color: var(--accent-teal);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md);
  }

  header {
    flex-direction: column;
  }

  header h1 {
    font-size: 2rem;
  }

  .toggle-controls,
  .transport-controls {
    justify-content: center;
  }

  .controls-section {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    text-align: center;
  }

  .ab-toggle {
    align-items: center;
  }

  .file-metadata {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  /* Compact file section on mobile */
  .file-section {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .upload-text-container {
    min-width: 0;
  }

  .drop-text {
    font-size: 0.9rem;
  }

  .drop-subtext {
    font-size: 0.75rem;
  }

  .file-name {
    font-size: 0.85rem;
  }

  section {
    padding: var(--spacing-lg);
  }

  /* Effects Chain Header - Stack vertically on mobile */
  .effects-chain-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
  }

  .effects-chain-header h2 {
    text-align: center;
  }

  .effects-chain-controls {
    flex-direction: column;
    width: 100%;
  }

  .preset-select {
    width: 100%;
    min-width: unset;
  }

  .add-effect-dropdown {
    width: 100%;
  }

  .add-effect-btn {
    width: 100%;
    justify-content: center;
  }

  /* EQ Band Cards - Stack controls vertically on mobile */
  .eq-band-controls-grid {
    grid-template-columns: 1fr;
  }

  /* EQ Curve - Ensure proper constraints on mobile */
  .eq-curve-container {
    width: 100%;
    max-width: 100vw; /* Never exceed viewport width */
  }

  /* Disable touch interaction on EQ curve - use sliders on mobile instead */
  .eq-curve-canvas {
    touch-action: auto !important; /* Allow normal scrolling/panning */
    pointer-events: none; /* Disable all pointer events on mobile */
  }

  .eq-curve-canvas {
    max-width: 100%;
  }

  /* Effect item - Prevent horizontal overflow */
  .effect-item {
    max-width: 100%;
  }

  .effect-controls {
    max-width: 100%;
  }

  /* Hide clipping text on mobile, keep indicator light */
  .clipping-indicator span {
    display: none;
  }

  /* Stack effect header on mobile */
  .effect-header {
    flex-wrap: wrap;
  }

  .effect-mix-control {
    flex-basis: 100%;
    margin-left: 0;
    margin-top: var(--spacing-sm);
  }

  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }

  .container {
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .control-btn {
    width: 40px;
    height: 40px;
  }

  .time-display {
    font-size: 1.2rem;
  }

  .fet76-meters-container {
    flex-direction: column;
  }

  .fet76-vu-meter {
    min-width: 100%;
  }
}

/* Loudness Metering Section */
.loudness-section {
  padding: var(--spacing-lg);
}

.loudness-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.loudness-meter-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.loudness-reset-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--accent-teal);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.loudness-reset-btn:hover {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: white;
  box-shadow: var(--shadow-glow);
}

.loudness-reset-btn svg {
  width: 16px;
  height: 16px;
}

/* Loudness Meters Grid */
.loudness-meters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.loudness-meter-item {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  transition: all 0.3s ease;
}

.loudness-meter-item:hover {
  border-color: rgba(79, 195, 247, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(79, 195, 247, 0.15);
}

.loudness-meter-primary {
  border-color: rgba(79, 195, 247, 0.4);
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.05), rgba(38, 198, 218, 0.05));
}

.loudness-meter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.loudness-meter-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  color: var(--text-primary);
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.loudness-meter-value.good {
  color: #27ae60;
  text-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.loudness-meter-value.warning {
  color: #f39c12;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.loudness-meter-value.danger {
  color: #e74c3c;
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.loudness-meter-value.neutral {
  color: var(--text-primary);
}

.loudness-meter-unit {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loudness Meter Bar */
.loudness-meter-bar {
  width: 100%;
  height: 8px;
  background-color: #1a1a1a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.loudness-meter-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.1s ease-out, background-color 0.3s ease;
  box-shadow: 0 0 8px currentColor;
  background-color: var(--text-secondary);
}

.loudness-meter-bar-fill.good {
  background-color: #27ae60;
  color: #27ae60;
}

.loudness-meter-bar-fill.warning {
  background-color: #f39c12;
  color: #f39c12;
}

.loudness-meter-bar-fill.danger {
  background-color: #e74c3c;
  color: #e74c3c;
}

.loudness-meter-bar-fill.neutral {
  background-color: #4fc3f7;
  color: #4fc3f7;
}

.loudness-meter-status {
  font-size: 0.7rem;
  text-align: center;
  min-height: 1rem;
  color: var(--text-secondary);
}

/* Streaming Targets */
.loudness-targets {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 195, 247, 0.15);
}

.loudness-targets-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.loudness-targets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-sm);
}

.loudness-target-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
}

.loudness-target-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.loudness-target-item.compliant {
  border-color: #27ae60;
  background-color: rgba(39, 174, 96, 0.1);
}

.loudness-target-platform {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.loudness-target-spec {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Courier New', Courier, monospace;
}

.loudness-target-indicator {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.loudness-target-indicator.compliant {
  background-color: #27ae60;
  color: white;
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

/* Loudness History Graph */
.loudness-history {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 195, 247, 0.15);
}

.loudness-history-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
  text-align: center;
}

.loudness-history-canvas {
  width: 100%;
  height: 200px;
  display: block;
  border-radius: var(--radius-sm);
}

/* === HORIZONTAL CHAIN UI (Phase 1) === */

/* Horizontal Chain Container */
.horizontal-chain-container {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  min-height: 140px;
}

/* Custom scrollbar for horizontal chain */
.horizontal-chain-container::-webkit-scrollbar {
  height: 8px;
}

.horizontal-chain-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
}

.horizontal-chain-container::-webkit-scrollbar-thumb {
  background: var(--accent-teal);
  border-radius: var(--radius-sm);
}

.horizontal-chain-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Firefox scrollbar */
.horizontal-chain-container {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-teal) rgba(0, 0, 0, 0.3);
}

/* Effect Card */
.effect-card {
  flex-shrink: 0;
  width: 180px;
  height: 120px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 2px solid rgba(79, 195, 247, 0.2);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.effect-card:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-md), 0 0 15px rgba(79, 195, 247, 0.3);
  transform: translateY(-2px);
}

/* ACCESSIBILITY: Focus state for keyboard navigation */
.effect-card:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  box-shadow: var(--shadow-md), 0 0 20px rgba(79, 195, 247, 0.4);
}

.effect-card:focus:not(:focus-visible) {
  outline: none;
}

.effect-card.selected {
  border-color: var(--accent-teal);
  border-width: 3px;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 195, 247, 0.5);
  transition: border-width 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ACCESSIBILITY: Combined selected and focused state */
.effect-card.selected:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(79, 195, 247, 0.6);
}

/* Drag and drop states */
.effect-card.dragging {
  opacity: 0.5;
  border-style: dashed;
  transform: scale(0.95);
  transition: all 0.15s ease;
}

.effect-card.drop-left {
  border-left: 4px solid var(--accent-teal);
  box-shadow: -4px 0 0 0 var(--accent-teal);
  transition: border-left 0.15s ease, box-shadow 0.15s ease;
}

.effect-card.drop-right {
  border-right: 4px solid var(--accent-teal);
  box-shadow: 4px 0 0 0 var(--accent-teal);
  transition: border-right 0.15s ease, box-shadow 0.15s ease;
}

/* Effect Card Header */
.effect-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm);
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.effect-card-drag-handle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: grab;
  user-select: none;
  opacity: 0.5;
}

.effect-card-drag-handle:hover {
  opacity: 1;
}

.effect-card-drag-handle:active {
  cursor: grabbing;
}

.effect-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.effect-card-remove {
  width: 20px;
  height: 20px;
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.effect-card-remove:hover {
  color: var(--error);
  transform: scale(1.2);
}

/* ACCESSIBILITY: Focus state for remove button */
.effect-card-remove:focus {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

.effect-card-remove:focus:not(:focus-visible) {
  outline: none;
}

/* Effect Card Body (for meters, visualizations) */
.effect-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Effect Type-Specific Card Colors */
.effect-card.effect-parametriceq {
  background: linear-gradient(135deg, #1a2a3a 0%, #243447 100%);
  border-left-color: #4a90e2;
}

.effect-card.effect-parametriceq.selected {
  border-color: #4a90e2;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(74, 144, 226, 0.5);
}

.effect-card.effect-compressor {
  background: linear-gradient(135deg, #2a1a1a 0%, #3d2626 100%);
  border-left-color: #e74c3c;
}

.effect-card.effect-compressor.selected {
  border-color: #e74c3c;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(231, 76, 60, 0.5);
}

.effect-card.effect-limiter {
  background: linear-gradient(135deg, #2a1a1f 0%, #3d2630 100%);
  border-left-color: #c0392b;
}

.effect-card.effect-limiter.selected {
  border-color: #c0392b;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(192, 57, 43, 0.5);
}

.effect-card.effect-fet76 {
  background: linear-gradient(135deg, #2a1a2a 0%, #362638 100%);
  border-left-color: #9b59b6;
}

.effect-card.effect-fet76.selected {
  border-color: #9b59b6;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(155, 89, 182, 0.5);
}

.effect-card.effect-saturation {
  background: linear-gradient(135deg, #2a2a1a 0%, #3d3626 100%);
  border-left-color: #f39c12;
}

.effect-card.effect-saturation.selected {
  border-color: #f39c12;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(243, 156, 18, 0.5);
}

.effect-card.effect-reverb {
  background: linear-gradient(135deg, #1a2a2a 0%, #264038 100%);
  border-left-color: #1abc9c;
}

.effect-card.effect-reverb.selected {
  border-color: #1abc9c;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(26, 188, 156, 0.5);
}

.effect-card.effect-stereowidth {
  background: linear-gradient(135deg, #1a2a1f 0%, #26402e 100%);
  border-left-color: #27ae60;
}

.effect-card.effect-stereowidth.selected {
  border-color: #27ae60;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(39, 174, 96, 0.5);
}

.effect-card.effect-mastergain {
  background: linear-gradient(135deg, #222222 0%, #2d2d2d 100%);
  border-left-color: #7f8c8d;
}

.effect-card.effect-mastergain.selected {
  border-color: #7f8c8d;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(127, 140, 141, 0.5);
}

/* Settings Panel */
.settings-panel {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 195, 247, 0.2);
  margin-bottom: var(--spacing-lg);
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.settings-panel.hidden {
  display: none;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-controls {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Custom scrollbar for settings panel */
.settings-controls::-webkit-scrollbar {
  width: 8px;
}

.settings-controls::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
}

.settings-controls::-webkit-scrollbar-thumb {
  background: var(--accent-teal);
  border-radius: var(--radius-sm);
}

.settings-controls::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Firefox scrollbar */
.settings-controls {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-teal) rgba(0, 0, 0, 0.3);
}

/* Responsive breakpoints for horizontal chain */
@media (max-width: 1024px) {
  .effect-card {
    width: 160px;
    height: 110px;
  }
}

@media (max-width: 768px) {
  .horizontal-chain-container {
    padding: var(--spacing-md);
  }

  .effect-card {
    width: 140px;
    height: 100px;
  }

  .effect-card-title {
    font-size: 0.8rem;
  }
}

/* Effect Card Meter Area (Phase 3) */
.effect-card-meter {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  gap: 0.25rem;
}

/* Mini meter container */
.mini-meter {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* Bar meter */
.meter-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  transition: width 0.1s ease-out;
  border-radius: 4px;
}

/* Default meter color (for GR meters) */
.mini-meter-gr .meter-bar-fill {
  background: linear-gradient(90deg, #FF6B9D 0%, #C0392B 100%);
}

/* Level meter colors */
.meter-bar-fill.meter-green {
  background: #32CD32;
}

.meter-bar-fill.meter-yellow {
  background: #FFD700;
}

.meter-bar-fill.meter-red {
  background: #FF4444;
}

/* Meter label */
.mini-meter .meter-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-family: monospace;
}

/* Saturation dual meter */
.mini-meter-saturation {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.meter-sublabel {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-family: monospace;
  margin: 0;
  line-height: 1;
}

.meter-bar-small {
  height: 6px;
  margin: 0 0 4px 0;
}

.meter-bar-small:last-of-type {
  margin-bottom: 2px;
}

/* VU meter canvas */
.vu-meter-canvas {
  width: 100%;
  height: auto;
}

/* EQ curve canvas */
.eq-curve-canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* === END HORIZONTAL CHAIN UI === */

/* FET-76 VU Meters */
.fet76-meters-container {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.fet76-vu-meter {
  flex: 1;
  min-width: 150px;
  padding: var(--spacing-sm);
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  border: 1px solid rgba(79, 195, 247, 0.1);
  transition: border-color 0.3s ease;
}

.fet76-vu-meter:hover {
  border-color: rgba(79, 195, 247, 0.3);
}

.fet76-vu-meter-label {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.fet76-vu-meter-bar-container {
  width: 100%;
  height: 24px;
  background-color: #1a1a1a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.fet76-vu-meter-bar {
  height: 100%;
  width: 0%;
  transition: width 0.05s ease-out, background-color 0.2s ease;
  box-shadow: 0 0 8px currentColor;
  position: relative;
}

/* Animated gradient for bars */
.fet76-vu-meter-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.fet76-vu-meter-bar-input {
  background-color: #4ade80;
  color: #4ade80;
}

.fet76-vu-meter-bar-reduction {
  background-color: #ff6b35;
  color: #ff6b35;
}

.fet76-vu-meter-bar-output {
  background-color: #4ade80;
  color: #4ade80;
}

.fet76-vu-meter-peak {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ffffff;
  left: 0%;
  opacity: 0.8;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  transition: left 0.05s ease-out;
  z-index: 10;
}

.fet76-vu-meter-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: 500;
  font-family: 'Courier New', Courier, monospace;
  min-height: 1.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
