/* =============================================
   Placeholder Image Generator — pig-
   ============================================= */

/* Two-column layout */
.pig-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 860px) {
  .pig-layout {
    grid-template-columns: 1fr;
  }
}

/* Sections */
.pig-section {
  margin-bottom: 1.25rem;
}

.pig-section:last-child {
  margin-bottom: 0;
}

.pig-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.5rem;
}

/* Fields */
.pig-field {
  margin-bottom: 0.75rem;
}

.pig-field:last-child {
  margin-bottom: 0;
}

.pig-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text-primary, #111827);
}

/* Dimensions row */
.pig-dimensions-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.pig-dimensions-row .pig-field {
  flex: 1;
  margin-bottom: 0;
}

.pig-input-px {
  display: flex;
  align-items: center;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.pig-input-px:focus-within {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: -1px;
}

.pig-input-px input[type="number"] {
  flex: 1;
  border: none;
  padding: 0.45rem 0.5rem;
  font-size: 0.9375rem;
  min-width: 0;
  background: transparent;
  color: var(--text-primary, #111827);
}

.pig-input-px input[type="number"]:focus {
  outline: none;
}

.pig-unit {
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  user-select: none;
  flex-shrink: 0;
}

/* Swap button */
.pig-swap-btn {
  background: none;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted, #6b7280);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0;
}

.pig-swap-btn:hover {
  background: var(--hover-bg, #f3f4f6);
  color: var(--text-primary, #111827);
}

/* Error */
.pig-error {
  font-size: 0.8125rem;
  color: #ef4444;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Presets */
.pig-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.pig-preset-chip {
  background: var(--surface-alt, #f3f4f6);
  border: 1px solid var(--border, #d1d5db);
  border-radius: 20px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-primary, #111827);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.pig-preset-chip:hover {
  background: var(--primary-light, #eff6ff);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}

/* Color pickers */
.pig-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pig-color-pick {
  display: flex;
  align-items: center;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.pig-color-pick:focus-within {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: -1px;
}

.pig-color-pick input[type="color"] {
  -webkit-appearance: none;
  width: 2.5rem;
  height: 2.25rem;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
}

.pig-hex-input {
  flex: 1;
  border: none;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  font-family: monospace;
  min-width: 0;
  background: transparent;
  color: var(--text-primary, #111827);
}

.pig-hex-input:focus {
  outline: none;
}

.pig-btn-full {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Text input */
.pig-text-input {
  width: 100%;
  padding: 0.45rem 0.625rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-size: 0.9375rem;
  color: var(--text-primary, #111827);
  background: var(--surface, #fff);
  box-sizing: border-box;
}

.pig-text-input:focus {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: -1px;
}

/* Range slider */
.pig-range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pig-range-row input[type="range"] {
  flex: 1;
  min-width: 0;
}

.pig-range-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  min-width: 3.25rem;
  text-align: right;
  white-space: nowrap;
}

/* Select */
.pig-select {
  width: 100%;
  padding: 0.45rem 0.625rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-size: 0.9375rem;
  color: var(--text-primary, #111827);
  background: var(--surface, #fff);
  cursor: pointer;
}

.pig-select:focus {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: -1px;
}

/* Wireframe toggle */
.pig-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9375rem;
  user-select: none;
}

.pig-toggle-check {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border, #d1d5db);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.pig-toggle-check::after {
  content: '';
  position: absolute;
  left: 0.125rem;
  top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pig-toggle-check:checked {
  background: var(--primary, #3b82f6);
}

.pig-toggle-check:checked::after {
  transform: translateX(1.125rem);
}

/* Format radio group */
.pig-format-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pig-radio-label {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 20px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.pig-radio-label:has(input:checked) {
  background: var(--primary-light, #eff6ff);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
  font-weight: 600;
}

.pig-radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Actions */
.pig-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Preview panel */
.pig-preview-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.pig-preview-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #f9fafb 0% 50%) 0 0 / 16px 16px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 1rem;
  min-height: 140px;
  box-sizing: border-box;
}

.pig-preview-canvas {
  display: block;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.pig-preview-label {
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
  text-align: center;
}

.pig-rendering {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  text-align: center;
  margin: 0;
}

/* Utility */
.is-hidden {
  display: none !important;
}
