/* Side Panel Styles */
.side-panel {
    position: fixed;
    top: 0;
    right: -330px;
    width: 330px;
    height: 100vh;
    background: #000;
    border-left: 1px solid #333;
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    box-shadow: -4px 0 20px rgba(74, 67, 67, 0.3);
}

.side-panel.visible {
    right: 0;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    background: #111;
    min-height: 48px;
}

.panel-tabs {
    display: flex;
    gap: 2px;
    height: 100%;
    flex: 1;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    border-radius: 2px;
    font-family: inherit;
    flex: 1;
    justify-content: center;
}

.tab-btn:hover {
    background: #222;
    color: #fff;
}

.tab-btn.active {
    background: #333;
    color: #fff;
}

.tab-btn ion-icon {
    font-size: 14px;
}

.toggle-panel-btn {
    background: none;
    border: none;
    margin-right: 7px;
    color: #888;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    padding: 0;
}

.toggle-panel-btn:hover {
    color: #fff;
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Canvas Controls Styles */
.canvas-controls {
    padding: 20px;
}

.control-section {
    margin-bottom: 30px;
}

.control-section h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker {
    width: 100%;
    height: 32px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    cursor: pointer;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.palette-color {
    width: 32px;
    height: 32px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    background: #111;
}

.pitch-color-example {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-left: 10px;
}

.pitch-color-item {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #000;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-info {
    margin-top: 6px;
}

.setting-info small {
    color: #888;
    font-size: 11px;
    font-style: italic;
    line-height: 1.3;
}

.tracks-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    border: 1px solid #333;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.track-tile {
    background: #111;
    border: 1px solid #333;
    padding: 8px;
    transition: all 0.15s ease;
}

.track-tile:hover {
    border-color: #444;
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.track-activity-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.track-activity-indicator.active {
    background: #51cf66;
    box-shadow: 0 0 6px rgba(81, 207, 102, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.track-number {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Inconsolata', monospace;
}

.track-controls {
    display: flex;
    gap: 4px;
}

.mute-btn, .solo-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border-radius: 2px;
}

.mute-btn:hover, .solo-btn:hover {
    background: #222;
    border-color: #555;
    color: #fff;
}

.mute-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.solo-btn.active {
    background: #51cf66;
    border-color: #51cf66;
    color: #fff;
}

.mute-btn ion-icon, .solo-btn ion-icon {
    font-size: 10px;
}

.track-assignments {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assignment-row {
  display: flex;
  gap: 8px;
}

.assignment-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.assignment-group label {
    color: #888;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.assignment-group label ion-icon {
    font-size: 9px;
    opacity: 0.8;
}

/* Luminode Configuration Styles */
.luminode-config {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.config-header {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
  padding: 4px 0;
  border-radius: 0;
  transition: background-color 0.2s ease;
  height: 24px;
}

.config-header label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.config-icon {
  width: 10px;
  height: 10px;
  opacity: 0.8;
}

.config-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 8px;
}

.config-control-row {
  display: flex;
  gap: 8px;
}

.config-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.config-control-spacer {
  flex: 1;
}

.config-control label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-slider {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.config-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #51cf66;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-slider::-webkit-slider-thumb:hover {
  background: #69db7c;
  transform: scale(1.1);
}

.config-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #51cf66;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.config-slider::-moz-range-thumb:hover {
  background: #69db7c;
  transform: scale(1.1);
}

.slider-value {
  color: #51cf66;
  font-size: 10px;
  font-weight: 600;
  min-width: 30px;
  text-align: right;
  font-family: "Inconsolata", monospace;
}

.config-number {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: white;
  font-size: 11px;
  padding: 6px 8px;
  font-family: "Inconsolata", monospace;
  outline: none;
  transition: all 0.2s ease;
}

.config-number:focus {
  border-color: #51cf66;
  background: rgba(255, 255, 255, 0.08);
}

.config-number:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.luminode-icon {
    width: 10px;
    height: 10px;
    opacity: 0.8;
    color: currentColor;
}

.midi-device-select, .luminode-select {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 4px 6px;
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 2px;
}

.midi-device-select:hover, .luminode-select:hover {
    background: #333;
    border-color: #555;
}

.midi-device-select:focus, .luminode-select:focus {
    outline: none;
    border-color: #51cf66;
    background: #333;
}

.midi-device-select option, .luminode-select option {
    background: #111;
    color: #ffffff;
    padding: 6px;
}

/* Grid Controls */
.grid-controls {
    margin-top: 8px;
}

.grid-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grid-control-row {
    display: flex;
    gap: 8px;
}

.grid-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-control label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    font-weight: 500;
}

/* Noise Controls */
.noise-controls {
    margin-top: 8px;
}

.noise-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.noise-control-row {
    display: flex;
    gap: 8px;
}

.noise-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.noise-control label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    font-weight: 500;
}

/* Modulation Controls */
.modulation-controls {
    padding: 20px;
}

.modulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modulator-header h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.add-modulator-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.add-modulator-btn:hover:not(:disabled) {
    background: #444;
    border-color: #666;
}

.add-modulator-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-modulator-btn ion-icon {
    font-size: 12px;
}

.no-modulators {
    color: #888;
    font-size: 12px;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.modulators-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modulator-item {
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    transition: border-color 0.15s ease;
}

.modulator-item:hover {
    border-color: #444;
}

.modulator-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modulator-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.modulator-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #51cf66;
}

.toggle-label {
    color: #ccc;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remove-modulator-btn {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border-radius: 2px;
    padding: 0;
}

.remove-modulator-btn:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.remove-modulator-btn ion-icon {
    font-size: 12px;
}

.modulator-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modulator-row {
    display: flex;
    gap: 12px;
}

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

.modulator-control-group label {
    color: #ccc;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modulator-control-group select {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 8px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 3px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.modulator-control-group select:hover {
    background: #333;
    border-color: #555;
}

.modulator-control-group select:focus {
    outline: none;
    border-color: #51cf66;
    background: #333;
}

.waveform-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.waveform-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #51cf66;
}

.waveform-svg {
    width: 100%;
    height: 100%;
}

.modulator-luminode-display {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.luminode-name {
    color: #51cf66;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Inconsolata', monospace;
    text-transform: lowercase;
}

.axis-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    font-weight: 600;
    margin-right: 4px;
    font-family: 'Inconsolata', monospace;
}

.waveform-preview-row {
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-left: 0;
}

.waveform-preview-container {
    padding: 4px 8px;
    background: var(--tp-container-background-color);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 4px;
    width: 40px;
    height: 20px;
    flex-shrink: 0;
}

.waveform-preview-container .waveform-svg {
    color: var(--tp-input-foreground-color);
    width: 100%;
    height: 100%;
    display: block;
}