/* ========================================
   DJ STUDIO - Pioneer XDJ-RX3 Replica
   Hardware-realistic dark styling
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 1px solid var(--accent-blue);
  outline-offset: 1px;
}

:root {
  --body-bg: #0d0d0d;
  --hw-surface: #1a1a1a;
  --hw-surface-light: #252525;
  --hw-border: #333;
  --hw-inset: #111;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --text-dim: #555;
  --accent-blue: #00b4ff;
  --accent-red: #ff3333;
  --accent-green: #00e676;
  --accent-orange: #ff9100;
  --accent-cyan: #00e5ff;
  --screen-bg: #0a0e14;
  --screen-border: #1a2030;
  --knob-size: 44px;
  --knob-small: 36px;
  --pad-size: 52px;
}

body {
  background: var(--body-bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(30,40,60,0.3) 0%, transparent 60%);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

#djController {
  width: 1320px;
  max-width: 100%;
  background: var(--hw-surface);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255,255,255,0.008) 1px,
      rgba(255,255,255,0.008) 2px
    );
  border-radius: 14px;
  border: 1px solid var(--hw-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 2px 0 rgba(255,255,255,0.02) inset,
    0 24px 80px rgba(0,0,0,0.85),
    0 0 0 4px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
}

/* ========== SCREEN AREA ========== */
.screen-area {
  background: var(--screen-bg);
  border-bottom: 2px solid var(--screen-border);
  padding: 14px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4) inset;
}

.screen-inner {
  display: grid;
  grid-template-columns: 1fr 340px 1fr;
  gap: 10px;
  align-items: stretch;
}

.screen-deck {
  background: #0d1117;
  border: 1px solid #1a2030;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screen-deck-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.deck-a-color {
  background: #1a3a5c;
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.deck-b-color {
  background: #3a1a1a;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

.track-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.waveform-canvas {
  width: 100%;
  height: 80px;
  touch-action: none;
  background: #060a0e;
  border-radius: 4px;
  border: 1px solid #151a22;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5) inset;
}

.screen-deck-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.bpm-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.bpm-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.bpm-label {
  font-size: 9px;
  color: var(--text-secondary);
}

.time-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.time-value {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.time-separator {
  color: var(--text-dim);
  margin: 0 2px;
}

.time-total {
  font-size: 12px;
  color: var(--text-secondary);
}

.pitch-value {
  font-size: 12px;
  color: var(--accent-green);
}

/* Browser / Track List */
.screen-browser {
  background: #080c14;
  border: 1px solid #1a2a3a;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
}

.browser-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #141e2e;
}

.browser-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  margin-right: auto;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.track-count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: #0a0f1a;
  background: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 4px;
}

.import-btn {
  background: #1a2a3a;
  color: var(--accent-blue);
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}

.import-btn:hover {
  background: #253545;
  border-color: var(--accent-blue);
}

.import-btn svg {
  flex-shrink: 0;
}

/* ---- Provider Selector ---- */
.provider-select {
  background: #111822;
  color: var(--accent-cyan);
  border: 1px solid #1e3040;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  letter-spacing: 0.3px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%2300e5ff' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  padding-right: 18px;
  transition: all 0.15s;
}

.provider-select:hover,
.provider-select:focus {
  background-color: #162030;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.15);
}

.provider-select option {
  background: #111822;
  color: var(--text-primary);
  padding: 4px 6px;
}

/* ---- Jamendo API Key Button ---- */
.api-key-btn {
  background: #121e18;
  color: var(--accent-green);
  border-color: #1e3428;
  font-size: 8px;
  padding: 3px 6px;
}

.api-key-btn:hover {
  background: #1a2e22;
  border-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.15);
}

.api-key-btn.configured {
  color: #0f0;
  border-color: rgba(0, 255, 0, 0.25);
  background: #0e1e10;
  box-shadow: 0 0 4px rgba(0, 255, 0, 0.08);
}

/* ---- API Config Panel ---- */
.api-config-panel {
  background: #0c1218;
  border: 1px solid #1e3040;
  border-radius: 5px;
  padding: 8px 10px;
  animation: panelSlideDown 0.2s ease-out;
}

@keyframes panelSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.api-config-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.api-config-row {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.api-config-input {
  flex: 1;
  background: #080c10;
  border: 1px solid #1e3040;
  border-radius: 3px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 5px 8px;
  transition: border-color 0.15s;
}

.api-config-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px rgba(0, 180, 255, 0.12);
}

.api-config-save {
  background: linear-gradient(180deg, #00c8ff, #009ad9);
  color: #000;
  border: none;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.api-config-save:hover {
  background: linear-gradient(180deg, #33d4ff, #00b4ff);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.3);
}

.api-config-hint {
  font-size: 8px;
  color: var(--text-dim);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.api-link {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  transition: border-color 0.15s;
}

.api-link:hover {
  border-bottom-color: var(--accent-cyan);
}

.api-status {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.5px;
}

.api-status.ok {
  color: #0f0;
  text-shadow: 0 0 4px rgba(0, 255, 0, 0.3);
}

.api-status.err {
  color: var(--accent-red);
  text-shadow: 0 0 4px rgba(255, 51, 51, 0.3);
}

/* ---- Auto-Import Progress Bar ---- */
.auto-import-bar {
  background: #0c1218;
  border: 1px solid #1e3040;
  border-radius: 5px;
  padding: 7px 10px;
  animation: panelSlideDown 0.2s ease-out;
}

.auto-import-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auto-import-progress {
  height: 3px;
  background: #080c10;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

.auto-import-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-blue));
  background-size: 200% 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
  animation: progressShimmer 2s linear infinite;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}

@keyframes progressShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Track list artist badge ---- */
.track-item-artist {
  font-size: 8px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
}

/* ---- Track list empty state ---- */

.track-list {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
  max-height: 300px;
  max-height: 130px;
  scrollbar-width: thin;
  scrollbar-color: #1e3040 transparent;
}

.track-list::-webkit-scrollbar {
  width: 4px;
}

.track-list::-webkit-scrollbar-track {
  background: transparent;
}

.track-list::-webkit-scrollbar-thumb {
  background: #1e3040;
  border-radius: 2px;
}

.track-list::-webkit-scrollbar-thumb:hover {
  background: #2a4050;
}

.track-list-empty {
  color: #3a4a5a;
  font-size: 11px;
  text-align: center;
  padding: 20px 8px;
  line-height: 1.5;
}

.track-list-empty small {
  color: #3a4a5a;
  font-size: 8px;
  display: block;
  margin-top: 4px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  color: #b0bec5;
  transition: background 0.15s, box-shadow 0.15s;
  border-left: 2px solid transparent;
}

.track-item:hover {
  background: #131c2c;
  color: #e0e8f0;
  border-left-color: var(--accent-cyan);
  box-shadow: 0 1px 4px rgba(0, 229, 255, 0.06);
}

.track-item:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.track-item.loaded-a {
  color: var(--accent-blue);
  background: rgba(0, 180, 255, 0.1);
  border-left-color: var(--accent-blue);
}

.track-item.loaded-b {
  color: var(--accent-red);
  background: rgba(255, 51, 51, 0.1);
  border-left-color: var(--accent-red);
}

.track-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.track-item-bpm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.1);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
}

.track-item-mood {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-orange);
  background: rgba(255, 145, 0, 0.1);
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.track-item-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #607080;
  font-weight: 500;
}

.track-item-load {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #2a3a4a;
  background: #0e1520;
  color: #506070;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.track-item:hover .track-item-load {
  opacity: 1;
  color: #90a0b0;
}

.track-item-load:hover {
  background: var(--accent-blue);
  color: #000 !important;
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px rgba(0, 180, 255, 0.3);
}

.track-item-load.load-b:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 6px rgba(255, 51, 51, 0.3);
}

/* ---- Drag handle & number ---- */
.track-drag-handle {
  cursor: grab;
  color: #3a4a5a;
  font-size: 14px;
  line-height: 1;
  user-select: none;
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  padding: 4px 0;
}
.track-drag-handle:active { cursor: grabbing; transform: scale(1.15); }
.track-item:hover .track-drag-handle { color: #8a9aaa; }
.track-item-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #3a4a5a;
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}

/* ---- Cover art ---- */
.track-item-cover {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0a0f1a;
  border: 1px solid #1a2535;
}
.track-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Track info block ---- */
.track-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.track-item-info .track-item-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.track-item-artist {
  font-size: 9px;
  color: #5a6a7a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.track-item-provider {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #3a4858;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Popularity badge ---- */
.track-item-pop {
  font-size: 9px;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  color: #404858;
}
.track-item-pop.warm { color: #f0a030; text-shadow: 0 0 4px rgba(240, 160, 48, 0.3); }
.track-item-pop.hot { color: #ff4444; font-size: 10px; text-shadow: 0 0 6px rgba(255, 68, 68, 0.4); }

/* ---- Streaming indicator ---- */
.track-item.not-cached { opacity: 0.75; }
.track-item.not-cached .track-item-name::after {
  content: ' ☁';
  font-size: 7px;
  color: #3a4a5a;
  margin-left: 3px;
}
.track-item.cached .track-item-name::after {
  content: ' ✓';
  font-size: 8px;
  color: var(--accent-cyan);
  margin-left: 3px;
}
.streaming {
  animation: streamPulse 0.8s ease-in-out infinite;
  color: var(--accent-cyan) !important;
}
@keyframes streamPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Drag-and-drop states ---- */
.track-item.dragging {
  opacity: 0.3;
  background: rgba(0, 180, 255, 0.05);
}
.track-item.drag-over-top {
  border-top: 2px solid var(--accent-cyan) !important;
  padding-top: 2px;
}
.track-item.drag-over-bottom {
  border-bottom: 2px solid var(--accent-cyan) !important;
  padding-bottom: 2px;
}

/* ---- Deck drop zone (drag track onto jog wheel) ---- */
.jog-wheel-container.deck-drop-hover {
  outline: 3px dashed var(--accent-cyan);
  outline-offset: 4px;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.25), inset 0 0 20px rgba(0, 229, 255, 0.08);
}
.deck-b .jog-wheel-container.deck-drop-hover {
  outline-color: var(--accent-red);
  box-shadow: 0 0 30px rgba(255, 51, 51, 0.25), inset 0 0 20px rgba(255, 51, 51, 0.08);
}
.deck-drop-label {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  z-index: 10;
  pointer-events: none;
  text-align: center;
  line-height: 1.4;
}
.deck-b .deck-drop-label { color: var(--accent-red); text-shadow: 0 0 10px rgba(255, 51, 51, 0.5); }
.jog-wheel-container.deck-drop-hover .deck-drop-label { display: block; }
.jog-wheel-container.deck-drop-hover .jog-wheel { opacity: 0.3; }

/* ========== HARDWARE BODY ========== */
.hardware-body {
  display: grid;
  grid-template-columns: 1fr 300px 1fr;
  gap: 0;
  padding: 0;
}

/* ========== DECK STYLING ========== */
.deck {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #1d1d1d 0%, #171717 100%);
}

.deck-a {
  border-right: 1px solid #222;
}

.deck-b {
  border-left: 1px solid #222;
}

/* Top Controls */
.deck-top-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ========== HARDWARE BUTTONS ========== */
.hw-btn {
  background: linear-gradient(180deg, #2e2e2e 0%, #252525 100%);
  border: 1px solid #3a3a3a;
  border-bottom-color: #2a2a2a;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hw-btn:hover {
  background: #333;
  border-color: #4a4a4a;
}

.hw-btn:active {
  background: #1e1e1e;
  transform: scale(0.96);
  box-shadow: 0 0 1px rgba(0,0,0,0.4) inset;
}

.hw-btn.active {
  background: #333;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(0, 180, 255, 0.2);
}

.hw-btn.small {
  font-size: 8px;
  padding: 4px 7px;
}

.hw-btn.tiny {
  font-size: 8px;
  padding: 3px 6px;
}

.load-btn {
  background: #1a2a3a;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  flex: 1;
}

.deck-b .load-btn {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: #2a1a1a;
}

.load-btn:hover {
  background: #253545;
}

.deck-b .load-btn:hover {
  background: #3a2525;
}

/* Tempo Section */
.tempo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tempo-controls-top {
  display: flex;
  gap: 6px;
}

.tempo-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

/* Vertical Tempo Slider */
.tempo-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 140px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.tempo-slider::-webkit-slider-runnable-track {
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, #2a2a2a, #181818);
  border-radius: 3px;
  border: 1px solid #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5) inset;
}

.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 14px;
  background: linear-gradient(to bottom, #888, #555);
  border: 1px solid #999;
  border-bottom-color: #444;
  border-radius: 3px;
  margin-left: -12px;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

.tempo-slider::-moz-range-track {
  width: 6px;
  background: linear-gradient(to bottom, #2a2a2a, #181818);
  border-radius: 3px;
  border: 1px solid #333;
}

.tempo-slider::-moz-range-thumb {
  width: 30px;
  height: 14px;
  background: linear-gradient(to bottom, #888, #555);
  border: 1px solid #999;
  border-bottom-color: #444;
  border-radius: 3px;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

.tempo-marks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 140px;
  font-size: 8px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* ========== JOG WHEEL ========== */
.jog-section {
  display: flex;
  justify-content: center;
  padding: 5px 0;
}

.jog-wheel-container {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.6),
    0 0 0 3px #222,
    0 0 0 4px #2a2a2a;
}

.jog-wheel {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  cursor: pointer;
  display: block;
  touch-action: none;
}

.jog-center-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.jog-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

/* ========== TRANSPORT CONTROLS ========== */
.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.transport-left {
  display: flex;
  gap: 4px;
}

.transport-center {
  display: flex;
  gap: 6px;
}

.play-btn {
  width: 58px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #333 0%, #252525 100%);
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.play-btn.active {
  background: linear-gradient(180deg, #00f080, #00c060);
  border-color: #00e676;
  color: #000;
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.5), 0 2px 4px rgba(0,0,0,0.3);
}

.play-btn.active svg {
  fill: #000;
}

.cue-btn {
  width: 58px;
  height: 44px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.cue-btn.active {
  background: linear-gradient(180deg, #ffaa00, #ff8800);
  border-color: var(--accent-orange);
  color: #000;
  box-shadow: 0 0 14px rgba(255, 145, 0, 0.4), 0 2px 4px rgba(0,0,0,0.3);
}

.sync-btn {
  font-size: 8px;
  padding: 4px 8px;
}

.sync-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #000;
  box-shadow: 0 0 8px rgba(0, 180, 255, 0.3);
}

.master-btn {
  font-size: 8px;
  padding: 4px 6px;
}

.master-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #000;
}

/* ========== LOOP CONTROLS ========== */
.loop-controls {
  display: flex;
  gap: 4px;
  justify-content: center;
}

/* ========== PERFORMANCE PADS ========== */
.pads-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pad-modes {
  display: flex;
  gap: 3px;
}

.pad-mode {
  flex: 1;
  font-size: 7px;
  padding: 3px 2px;
  text-align: center;
}

.pad-mode.active {
  background: #333;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.pads-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pad {
  width: 100%;
  aspect-ratio: 1.15;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  background: linear-gradient(180deg, #282828 0%, #1e1e1e 100%);
  cursor: pointer;
  transition: all 0.08s;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  touch-action: manipulation;
}

.pad::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  background: var(--pad-color);
  opacity: 0.15;
  transition: opacity 0.08s;
}

.pad:hover::after {
  opacity: 0.3;
}

.pad:active,
.pad.active {
  border-color: var(--pad-color);
  box-shadow: 0 0 12px var(--pad-color), 0 0 4px var(--pad-color) inset;
  transform: scale(0.95);
}

.pad:active::after,
.pad.active::after {
  opacity: 0.6;
}

/* ========== MIXER ========== */
.mixer {
  background: linear-gradient(180deg, #1c1c1c 0%, #141414 100%);
  border-left: 1px solid #282828;
  border-right: 1px solid #282828;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Beat FX */
.beat-fx-section {
  background: linear-gradient(180deg, #161616 0%, #111 100%);
  border: 1px solid #282828;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2) inset;
}

.beat-fx-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  text-align: center;
  margin-bottom: 6px;
}

.beat-fx-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fx-select, .fx-assign {
  background: #181818;
  border: 1px solid #333;
  color: var(--text-primary);
  font-size: 9px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
}

.fx-select:hover, .fx-assign:hover {
  border-color: #444;
}

.fx-select {
  width: 100%;
}

.fx-select option, .fx-assign option {
  background: #1a1a1a;
  color: var(--text-primary);
}

.beat-fx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.beat-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.beat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 24px;
  text-align: center;
}

.fx-on-btn {
  padding: 5px 12px;
  font-size: 9px;
}

.fx-on-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 145, 0, 0.3);
}

/* Channel Strips */
.channel-strips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.channel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: linear-gradient(180deg, #161616 0%, #111 100%);
  border: 1px solid #252525;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) inset;
}

/* ========== KNOBS ========== */
.knob-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.knob-group.small .knob {
  width: var(--knob-small);
  height: var(--knob-small);
}

.knob {
  width: var(--knob-size);
  height: var(--knob-size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #383838 0%, #282828 40%, #1c1c1c 100%);
  border: 2px solid #404040;
  border-bottom-color: #2a2a2a;
  border-top-color: #4a4a4a;
  position: relative;
  cursor: pointer;
  box-shadow:
    0 3px 8px rgba(0,0,0,0.7),
    0 1px 0 rgba(255,255,255,0.06) inset;
  user-select: none;
  touch-action: none;
}

.knob:hover {
  border-color: #505050;
  border-bottom-color: #333;
}

.knob-indicator {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2.5px;
  height: 11px;
  background: #eee;
  border-radius: 1.5px;
  transform-origin: bottom center;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 3px rgba(255,255,255,0.3);
}

.eq-knob {
  background: radial-gradient(circle at 40% 35%, #556, #2a2a3a 50%, #1a1a2a);
}

.color-knob {
  background: radial-gradient(circle at 40% 35%, #655, #3a2a2a 50%, #2a1a1a);
}

.knob-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #777;
  text-transform: uppercase;
}

/* Color FX Strip */
.color-fx-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.color-fx-btns {
  display: flex;
  gap: 2px;
  width: 100%;
}

.color-fx-btn {
  flex: 1;
  font-size: 7px;
  padding: 2px 2px;
  text-align: center;
}

/* CUE PFL Button */
.cue-ch-btn {
  width: 100%;
  font-size: 9px;
  padding: 5px;
  border-radius: 4px;
}

.cue-ch-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #000;
}

/* ========== VU METER ========== */
.vu-meter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  width: 100%;
  background: #0a0a0a;
  border-radius: 3px;
  border: 1px solid #1a1a1a;
}

.vu-segment {
  height: 3.5px;
  border-radius: 1px;
  opacity: 0.12;
  transition: opacity 0.06s;
}

.vu-segment.green { background: var(--accent-green); }
.vu-segment.yellow { background: #ffc107; }
.vu-segment.red { background: var(--accent-red); }
.vu-segment.lit { opacity: 1; box-shadow: 0 0 4px currentColor; }

/* ========== CHANNEL FADER ========== */
.fader-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.channel-fader {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 30px;
  height: 110px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.channel-fader::-webkit-slider-runnable-track {
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #2a2a2a, #151515);
  border-radius: 2.5px;
  border: 1px solid #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5) inset;
}

.channel-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 12px;
  background: linear-gradient(to bottom, #999, #666);
  border: 1px solid #aaa;
  border-bottom-color: #555;
  border-radius: 2px;
  margin-left: -12px;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

.channel-fader::-moz-range-track {
  width: 5px;
  background: linear-gradient(to bottom, #2a2a2a, #151515);
  border-radius: 2.5px;
  border: 1px solid #333;
}

.channel-fader::-moz-range-thumb {
  width: 28px;
  height: 12px;
  background: linear-gradient(to bottom, #999, #666);
  border: 1px solid #aaa;
  border-bottom-color: #555;
  border-radius: 2px;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

/* ========== CROSSFADER ========== */
.crossfader-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  margin-top: 2px;
  border-top: 1px solid #1e1e1e;
}

.cf-label {
  font-size: 10px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #666;
}

.crossfader {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 28px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.crossfader::-webkit-slider-runnable-track {
  height: 8px;
  background:
    linear-gradient(to right,
      rgba(0,180,255,0.3), #1a1a1a 35%, #1a1a1a 65%, rgba(255,51,51,0.3));
  border-radius: 4px;
  border: 1px solid #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5) inset;
}

.crossfader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: linear-gradient(to bottom, #999, #666);
  border: 1px solid #aaa;
  border-bottom-color: #555;
  border-radius: 3px;
  margin-top: -7px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.crossfader::-moz-range-track {
  height: 8px;
  background:
    linear-gradient(to right,
      rgba(0,180,255,0.3), #1a1a1a 35%, #1a1a1a 65%, rgba(255,51,51,0.3));
  border-radius: 4px;
  border: 1px solid #333;
}

.crossfader::-moz-range-thumb {
  width: 36px;
  height: 20px;
  background: linear-gradient(to bottom, #999, #666);
  border: 1px solid #aaa;
  border-bottom-color: #555;
  border-radius: 3px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* ========== MASTER CONTROLS ========== */
.master-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 4px 4px;
  border-top: 1px solid #252525;
  margin-top: 2px;
}

/* ========== DROP OVERLAY ========== */
/* ========== SETTINGS BUTTON ========== */
.settings-btn {
  position: relative;
  background: #121820;
  color: var(--text-secondary);
  border-color: #1e2a38;
  padding: 3px 7px;
  gap: 0;
}

.settings-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: #162030;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.12);
}

.settings-btn svg {
  transition: transform 0.3s;
}

.settings-btn:hover svg {
  transform: rotate(45deg);
}

.settings-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  background: var(--accent-green);
  color: #000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  font-weight: 900;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.4);
}

.settings-badge[data-count="0"] {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(255, 51, 51, 0.4);
}

/* ========== SETTINGS MODAL ========== */
.settings-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 5, 15, 0.88);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  z-index: 200;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.settings-overlay.visible {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.settings-modal {
  background: #0c1018;
  border: 1px solid #1a2540;
  border-radius: 10px;
  width: 560px;
  max-width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 4px 40px rgba(0, 0, 0, 0.6),
    0 0 1px rgba(0, 180, 255, 0.15),
    inset 0 1px 0 rgba(255,255,255, 0.03);
  animation: modalSlide 0.25s ease-out;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #1a2540;
  position: relative;
}

.settings-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  display: block;
}

.settings-subtitle {
  font-size: 9px;
  color: var(--text-dim);
  display: block;
  margin-top: 3px;
}

.settings-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
  line-height: 1;
}

.settings-close:hover {
  color: var(--accent-red);
  background: rgba(255, 51, 51, 0.08);
  border-color: rgba(255, 51, 51, 0.2);
}

.settings-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #1a2540 transparent;
}

.settings-footer {
  padding: 10px 20px;
  border-top: 1px solid #1a2540;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-mode-label {
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.mode-switch {
  display: flex;
  background: #0a0f1a;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #1a2540;
}
.mode-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.mode-btn.active {
  background: var(--accent-cyan);
  color: #000;
}
.mode-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(0, 200, 255, 0.1);
}
.settings-mode-desc {
  font-size: 8px;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- Inline Mode Toggle (always visible above track list) ---- */
.mode-toggle-bar {
  padding: 4px 8px;
  background: linear-gradient(180deg, #0d1220 0%, #0a0f1a 100%);
  border-bottom: 1px solid #1a2540;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-toggle-inline {
  display: flex;
  background: #060a12;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #1a2540;
  width: 100%;
}
.mode-toggle-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-align: center;
}
.mode-toggle-btn.active[data-mode="stream"] {
  background: linear-gradient(135deg, #00b4ff 0%, #0088cc 100%);
  color: #000;
  text-shadow: 0 0 8px rgba(0,180,255,0.4);
}
.mode-toggle-btn.active[data-mode="download"] {
  background: linear-gradient(135deg, #76ff03 0%, #4caf50 100%);
  color: #000;
  text-shadow: 0 0 8px rgba(118,255,3,0.4);
}
.mode-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.settings-tip {
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

/* ---- Provider Card ---- */
.provider-card {
  background: #0f1520;
  border: 1px solid #1a2540;
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 0.15s;
}

.provider-card:hover {
  border-color: #253550;
  background: #111828;
}

.provider-card.active {
  border-color: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.06);
}

.provider-card.selected {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.12);
  background: #0e1825;
}

.provider-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
  color: #fff;
}

.provider-icon.archive  { background: linear-gradient(135deg, #2a1a3a, #1a2a4a); }
.provider-icon.jamendo  { background: linear-gradient(135deg, #1a3a2a, #0a2a1a); }
.provider-icon.freesound { background: linear-gradient(135deg, #3a2a1a, #2a1a0a); }
.provider-icon.ccmixter { background: linear-gradient(135deg, #1a1a3a, #2a0a3a); }

.provider-info {
  flex: 1;
  min-width: 0;
}

.provider-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.provider-free {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-green);
  background: rgba(0, 230, 118, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.provider-needs-key {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-orange);
  background: rgba(255, 145, 0, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.provider-desc {
  font-size: 8px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}

/* ---- Toggle Switch ---- */
.provider-toggle-wrap {
  flex-shrink: 0;
}

.provider-toggle {
  width: 38px;
  height: 20px;
  background: #1a2030;
  border: 1px solid #2a3545;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: block;
}

.provider-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #3a4555;
  border-radius: 50%;
  transition: all 0.2s;
}

.provider-toggle.on {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
}

.provider-toggle.on::after {
  left: 20px;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
}

/* ---- API Key Row ---- */
.provider-key-row {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  align-items: center;
}

.provider-key-input {
  flex: 1;
  background: #080c10;
  border: 1px solid #1e2a3a;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  padding: 5px 8px;
  transition: border-color 0.15s;
}

.provider-key-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px rgba(0, 180, 255, 0.12);
}

.provider-key-input::placeholder {
  color: #2a3545;
}

.provider-key-save {
  background: linear-gradient(180deg, #00c8ff, #009ad9);
  color: #000;
  border: none;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  white-space: nowrap;
}

.provider-key-save:hover {
  background: linear-gradient(180deg, #33d4ff, #00b4ff);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.3);
}

.provider-key-link {
  font-size: 7px;
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  white-space: nowrap;
  transition: border-color 0.15s;
}

.provider-key-link:hover {
  border-bottom-color: var(--accent-cyan);
}

.provider-key-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.provider-key-status.ok {
  color: var(--accent-green);
  text-shadow: 0 0 4px rgba(0, 230, 118, 0.3);
}

.provider-key-status.err {
  color: var(--accent-red);
}

/* ---- Select as Active Provider ---- */
.provider-use-btn {
  margin-top: 8px;
  background: none;
  border: 1px solid #1e2a3a;
  border-radius: 4px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s;
  width: 100%;
}

.provider-use-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.05);
}

.provider-use-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
}

.drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 15, 30, 0.85);
  backdrop-filter: blur(4px);
  border: 3px dashed var(--accent-blue);
  border-radius: 14px;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.drop-overlay.visible {
  display: flex;
}

.drop-message {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue);
  text-shadow: 0 0 30px rgba(0, 180, 255, 0.6);
  letter-spacing: 1px;
}

/* ========== SCROLLBAR ========== */
.track-list::-webkit-scrollbar {
  width: 4px;
}

.track-list::-webkit-scrollbar-track {
  background: transparent;
}

.track-list::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

/* ========== AI DJ PANEL ========== */
.ai-dj-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #141820 0%, #101418 100%);
  border-bottom: 1px solid #1a2030;
  border-top: 1px solid #1a2030;
  position: relative;
}

.ai-dj-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ai-dj-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-dj-icon {
  color: var(--accent-cyan);
  display: flex;
  animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.ai-dj-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

.ai-dj-status {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #1a1a1a;
  color: var(--text-dim);
  border: 1px solid #2a2a2a;
}

.ai-dj-status.status-active {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border-color: rgba(0, 230, 118, 0.3);
  animation: statusBlink 1.5s ease-in-out infinite;
}

.ai-dj-status.status-working {
  background: rgba(0, 180, 255, 0.15);
  color: var(--accent-blue);
  border-color: rgba(0, 180, 255, 0.3);
}

.ai-dj-status.status-ready {
  background: rgba(255, 145, 0, 0.15);
  color: var(--accent-orange);
  border-color: rgba(255, 145, 0, 0.3);
}

.ai-dj-status.status-error {
  background: rgba(255, 51, 51, 0.15);
  color: var(--accent-red);
  border-color: rgba(255, 51, 51, 0.3);
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ai-dj-prompt-row {
  display: flex;
  gap: 6px;
}

.ai-dj-prompt {
  flex: 1;
  background: #0d1117;
  border: 1px solid #252a35;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  padding: 6px 10px;
  outline: none;
}

.ai-dj-prompt::placeholder {
  color: #444;
}

.ai-dj-prompt:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
}

.ai-dj-go {
  background: linear-gradient(180deg, #00c8e0 0%, #0090a0 100%);
  border: 1px solid #00d4e8;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-dj-go:hover {
  background: linear-gradient(180deg, #00e0f0 0%, #00a8b8 100%);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.ai-dj-go:active {
  transform: scale(0.96);
}

.ai-dj-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ai-dj-select {
  background: #0d1117;
  border: 1px solid #252a35;
  color: var(--text-secondary);
  font-size: 9px;
  font-family: 'Inter', sans-serif;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  min-width: 0;
}

.ai-dj-select:focus {
  border-color: #3a4a5a;
}

.ai-dj-select option {
  background: #0d1117;
}
.ai-dj-select optgroup {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 9px;
}
.ai-dj-select optgroup option {
  color: var(--text-secondary);
  font-weight: 400;
}

/* Artist / Song row */
.ai-dj-artist-row {
  display: flex;
  gap: 5px;
}
.ai-dj-input-sm {
  flex: 1;
  background: #0d1117;
  border: 1px solid #252a35;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 9.5px;
  font-family: 'Inter', sans-serif;
  padding: 5px 8px;
  outline: none;
  min-width: 0;
}
.ai-dj-input-sm::placeholder {
  color: #3a4550;
  font-size: 9px;
}
.ai-dj-input-sm:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.08);
}

/* Song List Button */
.ai-dj-list-btn {
  background: linear-gradient(180deg, #ff9100 0%, #e67c00 100%) !important;
  border-color: #ffab40 !important;
  font-size: 9px !important;
  padding: 6px 10px !important;
  white-space: nowrap;
}
.ai-dj-list-btn:hover {
  background: linear-gradient(180deg, #ffab40 0%, #ff9100 100%) !important;
}

/* Song List Modal */
.ai-dj-list-modal {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #0c1018;
  border: 1px solid #1a2540;
  border-top: 2px solid var(--accent-orange);
  border-radius: 0 0 8px 8px;
  padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.ai-dj-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-orange);
  font-family: 'JetBrains Mono', monospace;
}
.ai-dj-list-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.ai-dj-list-close:hover { color: var(--accent-red); }

.ai-dj-list-textarea {
  width: 100%;
  height: 120px;
  background: #060a12;
  border: 1px solid #1a2540;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 8px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}
.ai-dj-list-textarea::placeholder {
  color: #2a3545;
}
.ai-dj-list-textarea:focus {
  border-color: var(--accent-orange);
}
.ai-dj-list-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ai-dj-list-count {
  font-size: 9px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.ai-dj-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  min-width: 200px;
}

.ai-dj-transport {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ai-dj-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2a2a2a 0%, #202020 100%);
  border: 1px solid #3a3a3a;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.1s;
}

.ai-dj-btn:hover {
  background: #333;
  border-color: #4a4a4a;
}

.ai-dj-btn:active {
  transform: scale(0.92);
}

.ai-dj-play {
  width: 44px;
  height: 44px;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.ai-dj-play.active {
  background: linear-gradient(180deg, #00e0a0 0%, #00b080 100%);
  border-color: var(--accent-green);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.4);
}

.ai-dj-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.ai-dj-now, .ai-dj-next, .ai-dj-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.ai-info-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #444;
  min-width: 28px;
  text-align: right;
}

.ai-info-value {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.ai-dj-now .ai-info-value {
  color: var(--accent-cyan);
  font-weight: 600;
}

.ai-dj-fx-display {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.ai-fx-indicator {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #555;
  transition: color 0.3s, text-shadow 0.3s;
}

.ai-fx-indicator.active {
  color: #ff9100;
  text-shadow: 0 0 6px rgba(255, 145, 0, 0.5);
  animation: fxPulse 0.6s ease-in-out 2;
}

@keyframes fxPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ai-autofx-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid #333;
  border-radius: 3px;
  background: #1a1a1a;
  color: #555;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.ai-autofx-btn:hover {
  border-color: #ff9100;
  color: #ff9100;
}

.ai-autofx-btn.active {
  background: linear-gradient(135deg, #ff9100 0%, #ff5500 100%);
  color: #000;
  border-color: #ff9100;
  box-shadow: 0 0 8px rgba(255, 145, 0, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1340px) {
  #djController {
    width: 100%;
  }
}

/* ===== TABLET (≤960px) ===== */
@media (max-width: 960px) {
  body { padding: 8px; align-items: flex-start; }
  #djController { border-radius: 10px; }
  .hardware-body {
    grid-template-columns: 1fr;
  }
  .screen-inner {
    grid-template-columns: 1fr 1fr;
  }
  .screen-browser {
    grid-column: 1 / -1;
    order: -1;
    min-height: 120px;
  }
  .mixer {
    order: -1;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #282828;
  }
  .channel-strips {
    grid-template-columns: 1fr 1fr;
  }
  .deck-a { border-right: none; border-bottom: 1px solid #222; }
  .deck-b { border-left: none; border-top: 1px solid #222; }
  .jog-wheel-container,
  .jog-wheel {
    width: 200px;
    height: 200px;
  }
  .ai-dj-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 14px;
  }
  .ai-dj-right {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .ai-dj-info {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ===== MOBILE (≤640px) ===== */
@media (max-width: 640px) {
  body {
    padding: 0;
    align-items: flex-start;
  }
  #djController {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .screen-area {
    padding: 8px;
  }
  .screen-inner {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .screen-browser {
    order: -1;
    min-height: 100px;
    max-height: 180px;
  }
  .track-list {
    max-height: 100px;
  }
  .waveform-canvas {
    height: 50px;
  }
  .screen-deck {
    padding: 6px 8px;
  }
  .screen-deck-header {
    gap: 6px;
  }

  /* AI DJ Panel — mobile vertical layout */
  .ai-dj-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 10px;
  }
  .ai-dj-prompt-row {
    flex-wrap: wrap;
  }
  .ai-dj-prompt {
    width: 100%;
    font-size: 14px; /* bigger for mobile keyboards */
    padding: 8px 10px;
  }
  .ai-dj-go {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .ai-dj-list-btn {
    flex: 0;
  }
  .ai-dj-filters {
    gap: 4px;
  }
  .ai-dj-select {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    padding: 6px 4px;
  }
  .ai-dj-artist-row {
    flex-direction: column;
    gap: 4px;
  }
  .ai-dj-input-sm {
    font-size: 13px;
    padding: 7px 8px;
  }
  .ai-dj-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .ai-dj-transport {
    gap: 4px;
  }
  .ai-dj-btn {
    width: 36px;
    height: 36px;
  }
  .ai-dj-play {
    width: 44px;
    height: 44px;
  }
  .ai-dj-info {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
    min-width: 0;
  }
  .ai-dj-now, .ai-dj-next, .ai-dj-progress, .ai-dj-fx-display {
    min-width: 0;
  }
  .ai-info-value {
    max-width: 120px;
  }

  /* Hardware — stacked layout */
  .hardware-body {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .deck {
    padding: 10px 12px 12px;
    gap: 10px;
  }
  .deck-a { border-right: none; border-bottom: 1px solid #222; }
  .deck-b { border-left: none; }

  /* Mixer at top */
  .mixer {
    order: -1;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #282828;
    padding: 8px 10px;
  }
  .channel-strips {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .channel-strip {
    padding: 6px 4px;
  }

  /* Smaller knobs on mobile */
  :root {
    --knob-size: 38px;
    --knob-small: 30px;
  }
  .knob-label {
    font-size: 7px;
  }

  /* Jog wheels — smaller */
  .jog-wheel-container,
  .jog-wheel {
    width: 160px;
    height: 160px;
  }
  .jog-center-display {
    width: 60px;
    height: 60px;
  }
  .jog-time {
    font-size: 12px;
  }

  /* Tempo slider — shorter */
  .tempo-slider {
    height: 100px;
  }
  .tempo-marks {
    height: 100px;
    font-size: 7px;
  }

  /* Channel fader — shorter */
  .channel-fader {
    height: 80px;
  }

  /* VU meter — compact */
  .vu-meter {
    padding: 3px 6px;
  }
  .vu-segment {
    height: 2.5px;
  }

  /* Transport — bigger touch targets */
  .play-btn {
    width: 54px;
    height: 44px;
  }
  .cue-btn {
    width: 54px;
    height: 44px;
  }

  /* Loop controls */
  .loop-controls {
    gap: 3px;
  }
  .loop-controls .hw-btn {
    padding: 5px 8px;
    font-size: 9px;
  }

  /* Pads — 4 columns still works */
  .pads-grid {
    gap: 5px;
  }
  .pad {
    aspect-ratio: 1;
    min-height: 40px;
  }
  .pad-modes {
    gap: 2px;
  }
  .pad-mode {
    font-size: 7px;
    padding: 4px 2px;
  }

  /* Beat FX compact */
  .beat-fx-section {
    padding: 6px 8px;
  }

  /* Master controls — horizontal */
  .master-controls {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Crossfader */
  .crossfader-section {
    padding: 6px 4px;
  }

  /* Color FX buttons */
  .color-fx-btn {
    font-size: 6px;
    padding: 3px 2px;
  }

  /* Settings modal */
  .settings-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    max-height: 100vh;
  }

  /* Song list modal */
  .ai-dj-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    max-height: 100vh;
  }
}

/* ===== SMALL PHONE (≤400px) ===== */
@media (max-width: 400px) {
  .jog-wheel-container,
  .jog-wheel {
    width: 130px;
    height: 130px;
  }
  .jog-center-display {
    width: 50px;
    height: 50px;
  }
  .jog-time {
    font-size: 10px;
  }
  :root {
    --knob-size: 34px;
    --knob-small: 28px;
  }
  .tempo-slider {
    height: 80px;
  }
  .tempo-marks {
    height: 80px;
  }
  .channel-fader {
    height: 65px;
  }
  .screen-deck-info {
    gap: 4px;
  }
  .bpm-value {
    font-size: 14px;
  }
  .time-value {
    font-size: 11px;
  }
  .ai-dj-filters {
    flex-direction: column;
    gap: 4px;
  }
  .ai-dj-select {
    width: 100%;
    font-size: 12px;
    padding: 8px 6px;
  }
  .play-btn, .cue-btn {
    width: 48px;
    height: 40px;
  }
  .deck-top-controls {
    flex-wrap: wrap;
    gap: 4px;
  }
}
