/* CF GF SVG Configurator ─────────────────────────────────────── */

/* Layout is on inline styles in the PHP so it cannot be overridden
   by theme or GF stylesheets. This file handles appearance only. */

/* ── Left column: field rows ──────────────────────────────────── */

.cf-svgc-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cf-svgc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Colour swatch (input[type="color"]) ──────────────────────── */

.cf-svgc-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  border: 1px solid #c4c4c4 !important;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.cf-svgc-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cf-svgc-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cf-svgc-swatch::-moz-color-swatch {
  border: none;
  border-radius: 0;
  width: 100%;
  height: 100%;
}

/* ── Image upload field ───────────────────────────────────────── */

.cf-svgc-image-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cf-svgc-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #b0b0b0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  background: #e6e6e6;
  color: #333;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}

.cf-svgc-image-btn:hover {
  background: #d4d4d4;
  border-color: #999;
}

.cf-svgc-image-btn:active {
  background: #c8c8c8;
}

.cf-svgc-image-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}

/* Hex input — width set inline; inherit GF text-input appearance */
.cf-svgc-hex {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

/* ── Right column: SVG previews ───────────────────────────────── */

.cf-svgc-previews {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

.cf-svgc-preview {
  flex: 1 1 0;
  min-width: 0;
  max-width: 220px;
}

/* ── Phone frame — structural styles are inline in PHP ────────── */
/* Only aesthetic overrides live here. */

.cf-svgc-phone-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.cf-svgc-svg-wrap {
  width: 100%;
  display: block;
}

.cf-svgc-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Mobile: stack everything into a single column ───────────── */

@media (max-width: 767px) {
  .cf-svgc-wrapper {
    flex-direction: column !important;
  }
  .cf-svgc-previews {
    flex-direction: column !important;
  }
  .cf-svgc-preview {
    max-width: 100% !important;
  }
}

/* ── Entry detail display ─────────────────────────────────────── */

.cf-svgc-entry-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 0.875rem;
}

.cf-svgc-entry-dl dt { font-weight: 600; }
.cf-svgc-entry-dl dd { margin: 0; }

.cf-svgc-entry-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 5px;
}
