/* ==========================================================================
   WB Neon Designer — prototype styles (3D rotatable sign)
   Namespaced under .wbnf.
   ========================================================================== */

.wbnf {
  --wbnf-card: #ffffff;
  --wbnf-ink: #1a1a1a;
  --wbnf-muted: #6b7280;
  --wbnf-line: #e5e7eb;
  --wbnf-accent: #e2211c;   /* active button color (admin-controlled) */
  --wbnf-default: #2f333b;  /* default/secondary button color (admin-controlled) */
  --wbnf-radius: 14px;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--wbnf-ink);
}
.wbnf *, .wbnf *::before, .wbnf *::after { box-sizing: border-box; }

.wbnf-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- preview ---------- */
.wbnf-preview {
  position: relative;
  border-radius: var(--wbnf-radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 0.72;
  min-height: 380px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.wbnf-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.wbnf-preview.has-bg .wbnf-bg { display: block; }

/* 3D stage: perspective + centering */
.wbnf-stage3d {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 1100px;
  z-index: 2;
}

/* the sign we rotate */
.wbnf-sign {
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.wbnf-sign.is-dragging { cursor: grabbing; }

/* the extruded 3D text container (sized by the front face) */
.wbnf-3d {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
  font-family: "MS Gothic", "MS PGothic", "Osaka-Mono", monospace; /* default; overridden by JS */
}

/* shared glyph typography for front + extrusion layers */
.wbnf-glyphs {
  margin: 0;
  font-family: inherit;
  line-height: 1;
  white-space: pre-wrap;
  text-align: center;
  font-weight: 400;
  letter-spacing: 0;
}

/* front face = the glowing LED */
.wbnf-neon {
  position: relative;
  transition: color .12s ease, text-shadow .12s ease, opacity .12s ease;
}

/* extrusion layers = the construction material behind the letters */
.wbnf-layer {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
}
.wbnf-3d[data-material="wood"] .wbnf-layer {
  background-image: linear-gradient(180deg, #8a5a33 0%, #6b4226 50%, #4d3018 100%);
}
.wbnf-3d[data-material="aluminium"] .wbnf-layer {
  background-image: linear-gradient(135deg, #d3d7dc 0%, #9aa0a7 35%, #eef1f4 50%, #9aa0a7 65%, #cfd3d8 100%);
}
/* darkest back cap for a solid edge */
.wbnf-3d[data-material="wood"] .wbnf-layer.is-back { background-image: none; background-color: #3a2413; }
.wbnf-3d[data-material="aluminium"] .wbnf-layer.is-back { background-image: none; background-color: #6b7076; }

/* hint + tools */
/* diagonal repeated copyright watermark (over the whole preview) */
.wbnf-watermark {
  position: absolute; inset: 0;
  z-index: 3;
  opacity: 0.2;
  pointer-events: none;
  background-repeat: repeat;
}

/* dimension guides overlay (non-rotating) */
.wbnf-dims { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: none; }
.wbnf-dim { position: absolute; }
.wbnf-dim-line { position: absolute; background: rgba(255,255,255,.85); }
.wbnf-dim-w .wbnf-dim-line { left: 0; top: 0; width: 100%; height: 1px; }
.wbnf-dim-w .wbnf-dim-line::before,
.wbnf-dim-w .wbnf-dim-line::after {
  content: ""; position: absolute; top: -3px; width: 1px; height: 7px; background: rgba(255,255,255,.85);
}
.wbnf-dim-w .wbnf-dim-line::before { left: 0; }
.wbnf-dim-w .wbnf-dim-line::after { right: 0; }
.wbnf-dim-h .wbnf-dim-line { left: 0; top: 0; width: 1px; height: 100%; }
.wbnf-dim-h .wbnf-dim-line::before,
.wbnf-dim-h .wbnf-dim-line::after {
  content: ""; position: absolute; left: -3px; height: 1px; width: 7px; background: rgba(255,255,255,.85);
}
.wbnf-dim-h .wbnf-dim-line::before { top: 0; }
.wbnf-dim-h .wbnf-dim-line::after { bottom: 0; }
.wbnf-dim-label {
  position: absolute; color: #fff; font-size: 12px; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.wbnf-dim-w .wbnf-dim-label { top: 6px; left: 50%; transform: translateX(-50%); }
.wbnf-dim-h .wbnf-dim-label { left: -6px; top: 50%; transform: translate(-100%, -50%); }

.wbnf-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: 12px;
  background: rgba(0,0,0,.35); padding: 4px 10px; border-radius: 999px;
  pointer-events: none; z-index: 5;
}
.wbnf-tools {
  position: absolute; right: 14px; bottom: 14px;
  display: flex; flex-direction: column; gap: 8px; z-index: 5;
}
.wbnf-tool { display: flex; align-items: center; gap: 8px; }
.wbnf-switch { position: relative; width: 42px; height: 22px; }
.wbnf-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wbnf-slider { position: absolute; inset: 0; border-radius: 999px; background: #6b7280; transition: background .2s ease; }
.wbnf-slider::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s ease;
}
.wbnf-switch input:checked + .wbnf-slider { background: var(--wbnf-accent); }
.wbnf-switch input:checked + .wbnf-slider::before { transform: translateX(20px); }
.wbnf-tool-icon { color: #fff; font-size: 16px; width: 18px; text-align: center; }

/* reset-rotation chip */
.wbnf-reset3d {
  position: absolute; left: 14px; bottom: 12px; z-index: 5;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 12px; padding: 5px 12px; cursor: pointer;
}
.wbnf-reset3d:hover { background: rgba(255,255,255,.24); }

/* ---------- material picker (pre-rotated 3D previews) ---------- */
.wbnf-materials { display: flex; gap: 12px; }
.wbnf-material-opt {
  flex: 1;
  border: 2px solid var(--wbnf-line);
  border-radius: 10px;
  background: var(--wbnf-card);
  padding: 8px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wbnf-material-opt:hover { border-color: #c9ccd1; }
.wbnf-material-opt.is-active { border-color: var(--wbnf-accent); box-shadow: 0 0 0 1px var(--wbnf-accent) inset; }
.wbnf-mini {
  width: 100%; height: 66px; border-radius: 6px;
  background: #111318;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; perspective: 500px;
}
.wbnf-mini .wbnf-sign { transform: rotateX(-14deg) rotateY(-34deg); cursor: default; }
.wbnf-material-name { font-size: 13px; font-weight: 600; color: var(--wbnf-ink); }

/* ---------- background control ---------- */
.wbnf-bg-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.wbnf-bg-control .wbnf-bg-label { font-weight: 700; }
.wbnf-chip {
  border: 1px solid var(--wbnf-line); background: #fff;
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.wbnf-chip:hover { border-color: #c9ccd1; }

/* ---------- controls card ---------- */
.wbnf-controls {
  background: var(--wbnf-card); border-radius: 18px; padding: 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,.10);
}
.wbnf-field + .wbnf-field { margin-top: 18px; }
.wbnf-input {
  width: 100%; border: 1px solid var(--wbnf-line); border-radius: 12px;
  padding: 16px; font-size: 18px; resize: none; min-height: 92px; font-family: inherit;
}
.wbnf-input:focus { outline: none; border-color: var(--wbnf-accent); }
.wbnf-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.wbnf-label small { font-weight: 600; color: var(--wbnf-muted); }

.wbnf-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.wbnf-btn {
  border: 1px solid var(--wbnf-line); background: #fff; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .12s ease;
}
.wbnf-btn:hover { border-color: #c9ccd1; }
.wbnf-btn.is-active { background: var(--wbnf-accent); border-color: var(--wbnf-accent); color: #fff; }

.wbnf-colors { display: flex; flex-wrap: wrap; gap: 12px; }
.wbnf-color {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12); transition: transform .1s ease;
}
.wbnf-color:hover { transform: scale(1.06); }
.wbnf-color.is-active { border-color: #1a1a1a; box-shadow: 0 0 0 2px #1a1a1a; }

.wbnf-actions { display: flex; gap: 10px; margin-top: 22px; }
.wbnf-action {
  flex: 1; border: none; border-radius: 12px; padding: 16px;
  font-size: 16px; font-weight: 700; cursor: pointer; color: #fff;
}
.wbnf-action--share { flex: 0 0 40%; background: var(--wbnf-default); }
.wbnf-action--buy { background: var(--wbnf-accent); }

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