/* TJEapp v2 — designer.css
   TEMPORARY SCAFFOLDING — remove with designer.js when done.
   All classes prefixed ds- to avoid any collision with main styles. */

/* ── TOPBAR DESIGN BUTTON ── */
.topbar__design-btn {
  background: var(--accent); border: none; color: #fff;
  border-radius: 6px; padding: 5px 10px; font-size: 12px;
  font-weight: 700; cursor: pointer; flex-shrink: 0;
  margin-left: 4px;
}
.topbar__design-btn:active { opacity: 0.8; }

/* ── OVERLAY ── */
.ds-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  display: flex; align-items: flex-end;
  justify-content: center;
}

/* ── PANEL ── */
.ds-panel {
  background: var(--surface);
  width: 100%; max-width: 780px;
  height: 88vh;
  border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.2);
}

/* ── HEADER ── */
.ds-header {
  display: flex; align-items: center; gap: 10px;
  background: var(--navy); padding: 12px 16px; flex-shrink: 0;
}
.ds-title { font-size: 15px; font-weight: 800; color: var(--accent); }
.ds-sub   { font-size: 10px; color: rgba(255,255,255,0.4); flex: 1; }
.ds-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; cursor: pointer; padding: 2px 8px;
}

/* ── MODULE TABS ── */
.ds-tabs {
  display: flex; overflow-x: auto; gap: 0;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.ds-tab {
  padding: 9px 14px; font-size: 12px; font-weight: 600;
  color: var(--text3); border: none; background: none;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.ds-tab.active {
  color: var(--navy); border-bottom-color: var(--navy);
  background: var(--surface);
}

/* ── BODY — split controls / preview ── */
.ds-body {
  display: flex; flex: 1; overflow: hidden;
  gap: 0;
}

/* ── CONTROLS PANEL ── */
.ds-controls {
  width: 260px; flex-shrink: 0;
  overflow-y: auto;
  padding: 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

/* ── PREVIEW PANEL ── */
.ds-preview-wrap {
  flex: 1; overflow-y: auto;
  padding: 12px;
  background: var(--bg);
}
.ds-preview-label {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.ds-preview { }

/* ── CONTROL GROUPS ── */
.ds-group {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ds-group-title {
  font-size: 10px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--surface2);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.ds-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.ds-row:last-child { border-bottom: none; }
.ds-row label { width: 80px; flex-shrink: 0; font-size: 11px; }

/* ── CONTROLS ── */
.ds-select {
  flex: 1; padding: 4px 6px; font-size: 11px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px; background: var(--surface); color: var(--text);
}
.ds-input {
  flex: 1; padding: 4px 6px; font-size: 11px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px; background: var(--surface); color: var(--text);
}
.ds-slider-row {
  display: flex; align-items: center; gap: 6px; flex: 1;
}
.ds-slider { flex: 1; }
.ds-slider-lbl {
  font-size: 11px; color: var(--navy); font-weight: 600;
  min-width: 32px; text-align: right;
}
.ds-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; cursor: pointer;
}
.ds-toggle input { cursor: pointer; }

/* ── FOOTER ── */
.ds-footer {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  flex-wrap: wrap;
}
.ds-btn {
  padding: 8px 14px; border-radius: 7px; font-size: 12px;
  font-weight: 700; cursor: pointer; border: none;
}
.ds-btn--save  { background: var(--navy);    color: #fff; }
.ds-btn--reset { background: var(--surface2); color: var(--text2); border: 1.5px solid var(--border-strong); }
.ds-btn--copy  { background: var(--blue-light); color: var(--blue); }
.ds-btn--nuke  { background: var(--red-light);  color: var(--red);  margin-left: auto; }

/* ── MOBILE: stack controls above preview ── */
@media (max-width: 600px) {
  .ds-body { flex-direction: column; }
  .ds-controls {
    width: 100%; border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 45vh;
  }
  .ds-preview-wrap { max-height: 35vh; }
}

/* ── DRAG ZONES ── */
.ds-hint {
  font-size: 11px; color: var(--text2); padding: 8px 10px;
  background: var(--surface2); border-radius: 6px; margin-bottom: 10px;
}
.ds-hint--active {
  background: #FFF3E0; color: #854F0B; border: 1px solid #f97316;
}
.ds-hint strong { font-weight: 700; }

.ds-zone {
  border: 2px dashed var(--border-strong); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; transition: border-color 0.15s;
}
.ds-zone--droppable {
  border-color: var(--accent); cursor: pointer; background: #FFF9F5;
}
.ds-zone--droppable:hover { background: #FFF3E0; }
.ds-zone-header { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.ds-zone-name   { font-size: 11px; font-weight: 700; color: var(--navy); }
.ds-zone-hint   { font-size: 10px; color: var(--text3); }
.ds-zone-chips  { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }

.ds-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 8px; cursor: pointer; user-select: none;
}
.ds-chip--placed { background: var(--tag); color: var(--navy); border: 1px solid #d6e4f5; }
.ds-chip--placed:hover { background: #d6e4f5; }
.ds-chip--picked { background: var(--accent); color: #fff; }
.ds-chip-empty  { font-size: 10px; color: var(--text3); font-style: italic; padding: 3px 0; }

.ds-lbl { width: 70px; flex-shrink: 0; font-size: 11px; color: var(--text2); }

/* ── COLOUR THEME CARDS ── */
.ds-theme-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.ds-theme-card {
  border: 2px solid var(--border); border-radius: 8px;
  padding: 8px; cursor: pointer; position: relative;
  background: var(--surface); transition: border-color 0.15s;
}
.ds-theme-card:hover { border-color: var(--navy); }
.ds-theme-card--active { border-color: var(--navy); background: var(--surface2); }
.ds-theme-active-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 8px; font-weight: 700; background: var(--navy);
  color: var(--accent); padding: 1px 5px; border-radius: 3px;
}
.ds-theme-name    { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ds-theme-swatches { display: flex; gap: 3px; margin-bottom: 5px; }
.ds-swatch {
  width: 16px; height: 16px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.1); display: inline-block;
}
.ds-theme-use {
  font-size: 10px; font-weight: 700; color: var(--navy);
  background: none; border: 1px solid var(--navy);
  border-radius: 4px; padding: 2px 7px; cursor: pointer; margin-top: 2px;
}
.ds-color-input {
  width: 32px; height: 24px; border: 1.5px solid var(--border-strong);
  border-radius: 4px; padding: 1px; cursor: pointer;
}

/* ── NEW JETTER FORM DESIGNER ── */
.njd-add-sec-btn {
  display: block; width: calc(100% - 16px); margin: 8px;
  padding: 8px; border: 2px dashed var(--accent); border-radius: 6px;
  background: none; color: var(--accent); font-size: 12px; font-weight: 700;
  cursor: pointer; text-align: center;
}

.njd-section {
  border: 1.5px solid var(--border); border-radius: 8px;
  margin: 6px 8px; overflow: hidden; cursor: pointer;
}
.njd-section.njd-picked     { border-color: var(--accent); background: #FFF9F5; }
.njd-section.njd-droppable  { border-color: var(--navy); border-style: dashed; }
.njd-section.njd-drop-field { border-color: var(--blue); border-style: dashed; }

.njd-sec-header {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.njd-seq-num {
  width: 20px; height: 20px; background: var(--navy); color: var(--accent);
  border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.njd-sec-label { flex: 1; font-size: 12px; font-weight: 700; color: var(--text); }
.njd-sec-eye, .njd-eye {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 3px; cursor: pointer; flex-shrink: 0;
}
.njd-sec-eye.on, .njd-eye.on { background: #EAF3DE; color: var(--green); }
.njd-sec-eye.off,.njd-eye.off{ background: #FCEBEB; color: var(--red);   }
.njd-move-hint { font-size: 9px; color: var(--text3); flex-shrink: 0; }
.njd-del-sec {
  font-size: 9px; font-weight: 700; color: var(--red);
  border: 1px solid var(--red); border-radius: 3px;
  padding: 1px 5px; cursor: pointer; flex-shrink: 0;
}

.njd-fields { padding: 2px 0; }
.njd-field {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-bottom: 0.5px solid var(--border);
  font-size: 11px; cursor: pointer;
}
.njd-field:last-child { border-bottom: none; }
.njd-field.njd-picked   { background: #FFF3E0; }
.njd-field.njd-droppable{ background: var(--tag); }
.njd-seq { font-size: 9px; color: var(--text3); width: 14px; text-align: center; flex-shrink: 0; }
.njd-field-label { flex: 1; color: var(--text); }
.njd-note-preview { font-size: 9px; color: var(--text3); font-style: italic; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.njd-note-btn { font-size: 9px; color: var(--blue); border: 0.5px solid var(--blue); border-radius: 3px; padding: 1px 4px; flex-shrink: 0; }

/* Preview */
.njd-prev-sec { margin-bottom: 8px; background: var(--surface); border: 1.5px solid var(--navy); border-radius: 8px; overflow: hidden; }
.njd-prev-title { font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 10px; background: var(--surface2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.njd-prev-num { width: 16px; height: 16px; background: var(--navy); color: var(--accent); border-radius: 50%; font-size: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.njd-prev-field { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 0.5px solid var(--border); }
.njd-prev-field:last-child { border-bottom: none; }
.njd-prev-lbl { font-size: 11px; color: var(--text2); width: 120px; flex-shrink: 0; }
.njd-prev-bar { flex: 1; height: 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; }
.njd-prev-note { font-size: 9px; color: var(--text3); font-style: italic; }
.njd-prev-hidden { font-size: 11px; color: var(--text3); font-style: italic; margin-bottom: 6px; padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; }
.njd-prev-empty { font-size: 10px; color: var(--text3); font-style: italic; padding: 5px 10px; }
