/* ===========================
   Custom Neon Sign Maker
   Plugin Stylesheet v1.0.0
   =========================== */

.nsm-outer {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 960px;
  margin: 0 auto;
}

.nsm-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 500px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ── Preview Panel ── */
.nsm-preview-panel {
  background: #1a1a2e;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 2rem;
}
.nsm-bg-preview {
  position: absolute;
  inset: 0;
  transition: background 0.3s;
  background: #1a1a2e;
}

/* ON/OFF toggle */
.nsm-on-off {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
}
.nsm-on-off button {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.15s;
}
.nsm-on-off button.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.nsm-on-off button:first-child { border-radius: 4px 0 0 4px; }
.nsm-on-off button:last-child  { border-radius: 0 4px 4px 0; border-left: none; }

/* Neon text */
.nsm-neon-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  transition: all 0.3s;
}
.nsm-neon-text {
  font-family: 'Sacramento', cursive;
  font-size: 52px;
  text-align: center;
  white-space: pre-line;
  max-width: 100%;
  word-break: break-word;
  transition: font-family 0.2s;
}

/* Backboard wrap states */
.nsm-neon-wrap.backboard-cut-around {
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  outline: 2px dashed rgba(255,255,255,0.3);
  outline-offset: 6px;
}
.nsm-neon-wrap.backboard-rectangle {
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  outline: 2px dashed rgba(255,255,255,0.3);
  outline-offset: 6px;
}
.nsm-neon-wrap.backboard-naked { background: none; border: none; }
.nsm-neon-wrap.backboard-acrylic {
  border-radius: 4px;
  background: rgba(180,210,255,0.12);
  border: 2px solid rgba(180,210,255,0.3);
  box-shadow: inset 0 0 20px rgba(180,210,255,0.08);
}
.nsm-neon-wrap.backboard-open-box {
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 3px solid rgba(255,255,255,0.35);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}

/* Background selector */
.nsm-bg-selector {
  display: flex;
  gap: 6px;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.nsm-bg-btn {
  width: 28px; height: 28px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: border-color 0.15s;
}
.nsm-bg-btn.active { border-color: #fff; }

/* ── Controls Panel ── */
.nsm-controls {
  background: #fff;
  overflow-y: auto;
  max-height: 680px;
  border-left: 1px solid #e0e0e0;
}

.nsm-section {
  border-bottom: 1px solid #f0f0f0;
  padding: 14px 16px;
}
.nsm-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.nsm-step-badge {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #6c63ff;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nsm-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #222;
}

/* Textarea */
#nsm-sign-text {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  color: #222;
  font-family: inherit;
  box-sizing: border-box;
}

/* Font grid */
.nsm-font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}
.nsm-font-card {
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.nsm-font-card.active {
  border-color: #6c63ff;
  background: rgba(108,99,255,0.07);
}
.nsm-font-card-name {
  font-size: 22px;
  line-height: 1.1;
  color: #222;
}
.nsm-new-badge {
  position: absolute;
  top: 4px; left: 4px;
  background: #6c63ff;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: inherit;
}

/* Effects */
.nsm-effect-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  cursor: pointer;
}
.nsm-effect-option input[type=radio] { margin-top: 3px; accent-color: #6c63ff; }
.nsm-effect-label { font-size: 13px; font-weight: 600; color: #222; }
.nsm-effect-sub   { font-size: 11px; color: #888; margin-top: 1px; }

/* Color grid */
.nsm-color-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
}
.nsm-color-item  { display: flex; flex-direction: column; align-items: center; }
.nsm-color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.nsm-color-swatch.active { border-color: #222; }
.nsm-color-label { font-size: 9px; text-align: center; color: #888; margin-top: 2px; }

/* Color section locked */
#nsm-color-section.nsm-effect-locked {
  opacity: 0.4;
  pointer-events: none;
}

/* Size row */
.nsm-size-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nsm-size-btn {
  flex: 1;
  min-width: 58px;
  padding: 7px 4px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  color: #222;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}
.nsm-size-btn.active {
  border-color: #6c63ff;
  background: rgba(108,99,255,0.08);
  color: #6c63ff;
  font-weight: 600;
}
.nsm-size-price { color: #888; font-size: 11px; }

/* Backboard grid */
.nsm-bb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.nsm-bb-card {
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 6px 6px;
  cursor: pointer;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.nsm-bb-card.active {
  border-color: #e91e8c;
  background: rgba(233,30,140,0.05);
}
.nsm-bb-card-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.nsm-bb-card-title { font-size: 10px; color: #888; }
.nsm-bb-card-price { font-size: 10px; font-weight: 700; color: #222; }
.nsm-bb-preview {
  width: 80px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.nsm-bb-hello {
  font-family: 'Dancing Script', cursive;
  font-size: 24px;
  color: #222;
  position: relative;
  z-index: 1;
}
.nsm-bb-cut-around .nsm-bb-bg { position:absolute;inset:-4px;border-radius:50px;border:1.5px dashed #aaa;background:#ebebeb; }
.nsm-bb-rectangle  .nsm-bb-bg { position:absolute;inset:-4px;border-radius:3px; border:1.5px dashed #aaa;background:#ebebeb; }
.nsm-bb-naked      .nsm-bb-bg { display:none; }
.nsm-bb-acrylic    .nsm-bb-bg { position:absolute;inset:-4px;border-radius:3px;border:1.5px solid #b0c8e8;background:rgba(200,220,255,0.35); }
.nsm-bb-open-box   .nsm-bb-bg { position:absolute;inset:-4px;border-radius:3px;border:2px solid #aaa;background:#f0f0f0;box-shadow:2px 2px 0 #aaa; }

/* Price & CTA */
.nsm-price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f7f7f7;
  border-top: 1px solid #f0f0f0;
}
.nsm-price-label  { font-size: 13px; color: #888; }
.nsm-price-amount { font-size: 22px; font-weight: 700; color: #222; }
.nsm-add-cart-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px;
  padding: 12px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
.nsm-add-cart-btn:hover { opacity: 0.88; }

/* Responsive */
@media (max-width: 720px) {
  .nsm-wrap { grid-template-columns: 1fr; }
  .nsm-preview-panel { min-height: 280px; }
  .nsm-controls { max-height: none; border-left: none; border-top: 1px solid #e0e0e0; }
  .nsm-neon-text { font-size: 36px; }
  .nsm-color-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── Customer form ── */
.nsm-customer-form { display: flex; flex-direction: column; gap: 8px; }
.nsm-customer-form input,
.nsm-customer-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fafafa; color: #222;
  box-sizing: border-box;
}
.nsm-customer-form input:focus,
.nsm-customer-form textarea:focus { border-color: #6c63ff; outline: none; background: #fff; }
.nsm-customer-form textarea { resize: vertical; min-height: 70px; }

/* Order message */
#nsm-order-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#nsm-order-message.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Loading state */
.nsm-add-cart-btn.loading { opacity: 0.7; pointer-events: none; }
