/* ─────────────────────────────────────────
   controls.css — All control components
───────────────────────────────────────── */

/* ── Generic row & label ── */
.control-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.control-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ── Ratio grid ── */
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.ratio-btn {
  padding: 6px 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--t-fast);
}

.ratio-btn:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}

.ratio-btn.active {
  background: var(--accent-dim);
  border-color: rgba(76,240,200,0.3);
  color: var(--accent);
}

/* ── Dimension inputs ── */
.dims-row {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-sm);
}

.dim-input-group {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.dim-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 24px 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  transition: border-color var(--t-fast);
  -moz-appearance: textfield;
}

.dim-input::-webkit-inner-spin-button,
.dim-input::-webkit-outer-spin-button { appearance: none; }

.dim-input:focus {
  border-color: var(--border-focus);
}

.dim-label {
  position: absolute;
  right: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  pointer-events: none;
}

.dim-sep {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dim-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Direction buttons ── */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.dir-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all var(--t-fast);
}

.dir-btn:hover {
  background: var(--bg-input-hover);
  color: var(--text-secondary);
}

.dir-btn.active {
  background: var(--accent-dim);
  border-color: rgba(76,240,200,0.3);
  color: var(--accent);
}

/* ── Color input row ── */
.color-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  transition: border-color var(--t-fast);
}

.color-input-row:focus-within {
  border-color: var(--border-focus);
}

.color-swatch-wrap {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}

.color-native {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.color-swatch {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
}

.hex-hash {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.hex-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: none;
  text-transform: uppercase;
  min-width: 0;
}

/* ── Icon buttons ── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--t-fast), background var(--t-fast);
}

.icon-btn:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
}

.icon-btn.active {
  color: var(--accent);
}

/* ── Wave color list ── */
.wave-color-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wave-color-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  transition: border-color var(--t-fast);
}

.wave-color-item:focus-within {
  border-color: var(--border-focus);
}

.delete-color-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  color: var(--text-muted);
  transition: color var(--t-fast);
  flex-shrink: 0;
}

.delete-color-btn:hover {
  color: #ff6b6b;
}

/* ── Add color button ── */
.add-color-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}

.add-color-btn:hover {
  color: var(--accent);
  border-color: rgba(76,240,200,0.3);
  background: var(--accent-dim);
}

/* ── Color distribution grid ── */
.color-dir-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.coldir-btn {
  padding: 4px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coldir-btn:hover {
  background: var(--bg-input-hover);
}

.coldir-btn.active {
  border-color: rgba(76,240,200,0.3);
  background: var(--accent-dim);
}

/* Preview swatches for color direction */
.coldir-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}

.coldir-preview.linear {
  background: linear-gradient(to bottom, #4cf0c8, #7b2fff);
}
.coldir-preview.radial {
  background: radial-gradient(circle at center, #4cf0c8, #7b2fff);
}
.coldir-preview.diagonal {
  background: linear-gradient(135deg, #4cf0c8, #7b2fff);
}
.coldir-preview.inverted {
  background: linear-gradient(to top, #4cf0c8, #7b2fff);
}

/* ── Select ── */
.select-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-primary);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237a7a88' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

.select-input:hover,
.select-input:focus {
  border-color: var(--border-focus);
  outline: none;
}

.select-input option {
  background: #1e1e22;
}

/* ── Preset grid ── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.preset-btn {
  padding: 7px 4px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--t-fast);
}

.preset-btn:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}

.preset-btn.active {
  background: var(--accent-dim);
  border-color: rgba(76,240,200,0.3);
  color: var(--accent);
}

/* ── Slider control ── */
.slider-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

/* Slider track */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  outline: none;
  cursor: pointer;
  position: relative;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-panel);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-panel);
  cursor: pointer;
}

.slider:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Seed row ── */
.seed-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seed-row .slider {
  flex: 1;
}

.seed-random-btn {
  flex-shrink: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 28px;
  height: 28px;
}

.seed-random-btn:hover {
  color: var(--accent);
  border-color: rgba(76,240,200,0.3);
  background: var(--accent-dim);
}

/* ── Scale grid ── */
.scale-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.scale-btn {
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--t-fast);
}

.scale-btn:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}

.scale-btn.active {
  background: var(--accent-dim);
  border-color: rgba(76,240,200,0.3);
  color: var(--accent);
}

/* ── Download buttons ── */
.download-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}

.dl-svg {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
}

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

.dl-png {
  background: var(--accent);
  color: #0d0d0f;
  border: 1px solid transparent;
}

.dl-png:hover {
  background: #6ef5d5;
  box-shadow: 0 0 16px var(--accent-glow);
}

.dl-png:active,
.dl-svg:active {
  transform: scale(0.97);
}
