/* ===================== */
/* Tuning Panel Styles   */
/* ===================== */
#tuning-container {
  width: 100%;
  max-width: var(--canvas-max-width);
  margin-left: auto;
  margin-right: auto;
  align-self: stretch; /* flex: take full width so panel is visible below canvas */
}

.tuning-panel {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 1rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  border-top: 2px solid #3a3a5e;
}

.tuning-panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.tuning-panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #00ff88;
}

.tuning-panel-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tuning-section {
  background: #252540;
  border-radius: 8px;
  padding: 1rem;
  min-width: 0;
  overflow: hidden;
}

.tuning-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #3a3a5e;
}

.tuning-section-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #90CAE5;
}

.tuning-reset-btn {
  background: transparent;
  border: 1px solid #3a3a5e;
  color: #888;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.tuning-reset-btn:hover {
  background: #3a3a5e;
  color: #e0e0e0;
}

.tuning-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.tuning-control {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.tuning-label {
  font-size: 0.75rem;
  color: #aaa;
  cursor: help;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.tuning-number-container,
.tuning-color-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.tuning-slider {
  flex: 1;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  background: #3a3a5e;
  border-radius: 2px;
  outline: none;
}

.tuning-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #00ff88;
  border-radius: 50%;
  cursor: pointer;
}

.tuning-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #00ff88;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.tuning-value {
  min-width: 0;
  flex-shrink: 0;
  text-align: right;
  font-family: monospace;
  font-size: 0.75rem;
  color: #00ff88;
  white-space: nowrap;
}

.tuning-color-picker {
  width: 32px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.tuning-hex {
  font-family: monospace;
  font-size: 0.75rem;
  color: #888;
}

.tuning-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #3a3a5e;
}

.tuning-btn {
  background: #3a3a5e;
  border: none;
  color: #e0e0e0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.tuning-btn:hover {
  background: #4a4a6e;
}

/* Checkbox control */
.tuning-control-checkbox {
  grid-template-columns: 1fr auto;
}

.tuning-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tuning-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #00ff88;
}

/* Select control */
.tuning-control-select {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tuning-select-container {
  display: flex;
  align-items: center;
}

.tuning-select {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 200px;
}

.tuning-select:focus {
  outline: 1px solid #00ff88;
  border-color: #00ff88;
}

.tuning-select option {
  background: #1a1a2e;
  color: #ccc;
}

/* Gradient control */
.tuning-control-gradient {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.tuning-control-gradient .tuning-label {
  margin-bottom: 0.25rem;
}

.tuning-gradient-container {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.tuning-gradient-picker {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

/* Grapick overrides for dark theme */
.tuning-panel .grp-wrapper {
  background: #252540;
  border: 1px solid #3a3a5e;
  border-radius: 4px;
}

.tuning-panel .grp-handler {
  width: 12px;
  height: 28px;
  margin-top: -4px;
  border: 2px solid #fff;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tuning-panel .grp-handler-selected {
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0,255,136,0.3);
}

.tuning-panel .grp-handler-close {
  display: none; /* Hide delete button, double-click to delete */
}

.tuning-panel .grp-preview {
  height: 30px;
  border-radius: 3px;
}

