@import "_variables";
@import "_mixins";

/* nbplay SamplerWidget – sampler panel themed to Jupyter environment */

.nbplay-sampler {
  font-family: @nb-font-mono;
  background: @nb-bg;
  color: @nb-text;
  border: 1px solid @nb-border;
  border-radius: @nb-radius;
  padding: 16px;
  min-width: 480px;
  user-select: none;
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────── */
.nbplay-samp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.nbplay-samp-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: @nb-text;
  letter-spacing: 0.5px;
}

.nbplay-sampler .nbplay-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: @nb-radius-round;
  background: @nb-green;
  color: var(--jp-layout-color0, #000);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nbplay-samp-name {
  font-size: 12px;
  color: @nb-dim;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ── Waveform ───────────────────────────────────────────────────── */
.nbplay-samp-waveform-wrap {
  margin-bottom: 10px;
  border: 1px solid @nb-border;
  border-radius: @nb-radius-sm;
  overflow: hidden;
}

.nbplay-samp-waveform {
  width: 100%;
  height: 100px;
  display: block;
}

/* ── Info bar ───────────────────────────────────────────────────── */
.nbplay-samp-info {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 10px;
  color: @nb-dim;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Envelope section ───────────────────────────────────────────── */
.nbplay-samp-envelope {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.nbplay-samp-env-display {
  border: 1px solid @nb-border;
  border-radius: @nb-radius-sm;
  overflow: hidden;
  flex-shrink: 0;
}

.nbplay-samp-env-canvas {
  width: 200px;
  height: 60px;
  display: block;
}

.nbplay-samp-env-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.nbplay-samp-knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 80px;
}

.nbplay-samp-knob label {
  font-size: 9px;
  color: @nb-dim;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nbplay-samp-knob input[type="range"] {
  width: 72px;
  accent-color: @nb-purple;
}

.nbplay-samp-knob span {
  font-size: 10px;
  color: @nb-cyan;
}

/* ── Voices ─────────────────────────────────────────────────────── */
.nbplay-samp-voices-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nbplay-samp-label {
  font-size: 10px;
  color: @nb-dim;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nbplay-samp-max-voices {
  width: 100px;
  accent-color: @nb-purple;
}

.nbplay-samp-voices-val {
  font-size: 12px;
  color: @nb-cyan;
  min-width: 24px;
}

/* ── Pads section ───────────────────────────────────────────────── */
.nbplay-samp-pads-section {
  margin-top: 16px;
}

.nbplay-samp-pads-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.nbplay-samp-pad {
  padding: 12px 8px;
  border: 1px solid @nb-border;
  border-radius: @nb-radius-xs;
  background: @nb-surface;
  color: @nb-cyan;
  font-family: @nb-font-mono;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.05s ease-out;
  user-select: none;
  touch-action: none;
}

.nbplay-samp-pad:hover {
  background: var(--jp-layout-color2, #1a1a30);
  border-color: @nb-cyan;
}

.nbplay-samp-pad:active,
.nbplay-samp-pad.active {
  background: @nb-cyan;
  color: var(--jp-layout-color0, @nb-bg);
  border-color: @nb-cyan;
  transform: scale(0.95);
  box-shadow: 0 0 12px color-mix(in srgb, @nb-cyan 40%, transparent);
}

.nbplay-samp-active-voices {
  display: inline-block;
  font-size: 10px;
  color: @nb-green;
  margin-left: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Inline edit input ────────────────────────────────────────── */

.nbplay-samp-inline-edit {
  font-family: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  background: @nb-surface;
  color: @nb-cyan;
  border: 1px solid @nb-cyan;
  border-radius: 4px;
  padding: 1px 4px;
  outline: none;
  text-align: right;
  box-sizing: border-box;
}

.nbplay-samp-pad .nbplay-samp-inline-edit {
  width: 100%;
  font-size: 12px;
  text-align: center;
  padding: 0;
}
