/* ============================================================
   LAYOUT EDITOR — layoutEditor.css
   © 2026 Paradiddle Publishing. All rights reserved.
   ============================================================ */

/* ── CONTAINER + VARIABLES ───────────────────────────────── */

#leContainer {
  --brand: #5B2D8E;
  --bd: rgba(91,45,142,0.2);
  --bb: rgba(91,45,142,0.5);
  background: #0a0a0a;
  color: #e2e2e2;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

#leContainer[hidden] { display: none !important; }

/* ── TOP BAR ─────────────────────────────────────────────── */

#leContainer #topBar {
  height: 46px;
  background: #181818;
  border-bottom: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
  overflow-x: auto;
}

#leContainer #topBar::-webkit-scrollbar { display: none; }

#leContainer .tb-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #e2e2e2;
  white-space: nowrap;
  margin-right: 6px;
}

#leContainer .tb-sub {
  font-size: .5rem;
  letter-spacing: 2px;
  color: #4a5260;
  text-transform: uppercase;
}

#leContainer .tb-sep {
  width: 1px;
  height: 22px;
  background: #2e2e2e;
  flex-shrink: 0;
}

#leContainer .seg {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

#leContainer .sb {
  height: 26px;
  padding: 0 10px;
  background: #222;
  border: 1px solid #2e2e2e;
  border-radius: 5px;
  color: #7a8494;
  font-size: .64rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}

#leContainer .sb:hover          { border-color: var(--brand); color: #e2e2e2; }
#leContainer .sb.on             { background: var(--bd); border-color: var(--brand); color: #c084fc; }
#leContainer .sb.pri            { background: var(--bd); border-color: var(--bb); color: #c084fc; }
#leContainer .sb.pri:hover      { background: rgba(91,45,142,.4); color: #fff; }

#leContainer .zv {
  font-size: .64rem;
  color: #4a5260;
  min-width: 36px;
  text-align: center;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────── */

#leContainer #main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── LEFT PANEL ──────────────────────────────────────────── */

#leContainer #lp {
  width: 248px;
  min-width: 248px;
  background: #111;
  border-right: 1px solid #2e2e2e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#leContainer .ph {
  padding: 7px 10px 5px;
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #4a5260;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
}

#leContainer #elList {
  padding: 5px;
  border-bottom: 1px solid #2e2e2e;
  flex-shrink: 0;
}

#leContainer .er {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s;
}

#leContainer .er:hover  { background: rgba(255,255,255,.04); }
#leContainer .er.sel    { background: var(--bd); outline: 1px solid rgba(91,45,142,.3); }

#leContainer .ed {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

#leContainer .en {
  flex: 1;
  font-size: .69rem;
  font-weight: 600;
  color: #c8c8c8;
}

#leContainer .eib {
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  color: #3a4050;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: color .12s;
}

#leContainer .eib:hover { color: #e2e2e2; }
#leContainer .eib.on    { color: #f59e0b; }
#leContainer .eib.dim   { color: #252535; }

#leContainer #ps {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

#leContainer #ps::-webkit-scrollbar       { width: 3px; }
#leContainer #ps::-webkit-scrollbar-thumb { background: rgba(91,45,142,.3); border-radius: 2px; }

/* ── PROPERTIES PANEL ────────────────────────────────────── */

#leContainer .psec { margin-bottom: 11px; }

#leContainer .pst {
  font-size: .53rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #4a5260;
  margin-bottom: 5px;
}

#leContainer .pr {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

#leContainer .pl {
  font-size: .61rem;
  color: #5a6474;
  width: 34px;
  flex-shrink: 0;
}

#leContainer .pl.w { width: 52px; }

#leContainer .pi {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: .69rem;
  color: #e2e2e2;
  font-family: 'Inter', sans-serif;
  outline: none;
  min-width: 0;
}

#leContainer .pi:focus                              { border-color: var(--bb); }
#leContainer .pi[type=number]                       { -moz-appearance: textfield; text-align: center; }
#leContainer .pi[type=number]::-webkit-inner-spin-button { display: none; }
#leContainer .pi[type=color]                        { padding: 1px 2px; height: 26px; cursor: pointer; }

#leContainer .pi-adj {
  width: 22px;
  height: 26px;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 4px;
  color: #e2e2e2;
  font-size: .85rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .12s;
}

#leContainer .pi-adj:hover { border-color: var(--bb); }

#leContainer .psel {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: .69rem;
  color: #e2e2e2;
  font-family: 'Inter', sans-serif;
  outline: none;
}

#leContainer .psel:focus { border-color: var(--bb); }

#leContainer .pta {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: .69rem;
  color: #e2e2e2;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 50px;
  line-height: 1.4;
}

#leContainer .pta:focus { border-color: var(--bb); }

#leContainer .cc {
  font-size: .57rem;
  color: #3a4050;
  text-align: right;
  margin-top: 1px;
}

#leContainer .cg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

#leContainer .cf {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#leContainer .cf label {
  font-size: .54rem;
  color: #3a4050;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#leContainer .cf input {
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: .69rem;
  color: #e2e2e2;
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 100%;
  text-align: center;
}

#leContainer .cf input:focus { border-color: var(--bb); }

#leContainer .pd {
  height: 1px;
  background: #1e1e1e;
  margin: 7px 0;
}

#leContainer .pchk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .69rem;
  color: #7a8494;
  cursor: pointer;
}

#leContainer .pchk input { cursor: pointer; accent-color: var(--brand); }

/* ── CANVAS AREA ─────────────────────────────────────────── */

#leContainer #ca {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  overflow: hidden;
  min-width: 0;
}

#leContainer #ct {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #0f0f0f;
  border-bottom: 1px solid #1e1e1e;
  flex-shrink: 0;
  font-size: .61rem;
  color: #4a5260;
}

#leContainer #cc {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#leContainer #cw { position: relative; }

#leContainer #mc {
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,.8);
}

#leContainer #oc {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── ZONE OVERLAYS ───────────────────────────────────────── */

#leContainer .zo {
  position: absolute;
  border: 1.5px dashed transparent;
  pointer-events: all;
  cursor: move;
}

#leContainer .zo.debug {
  border-color: red;
  border-style: solid;
  border-width: 1px;
}

#leContainer .zo.sel { border-style: solid; }
#leContainer .zo.hid { opacity: .15; pointer-events: none; }
#leContainer .zo.lkd { cursor: default; }

#leContainer .zof {
  position: absolute;
  inset: 0;
  opacity: .1;
}

#leContainer .zol {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 8px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: rgba(0,0,0,.65);
  padding: 1px 4px;
  border-radius: 2px;
  pointer-events: none;
  opacity: .75;
  white-space: nowrap;
}

#leContainer .zrh {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  pointer-events: all;
  z-index: 10;
}

#leContainer .zrh.br { bottom: -4px; right: -4px; cursor: se-resize; }
#leContainer .zrh.bl { bottom: -4px; left: -4px;  cursor: sw-resize; }
#leContainer .zrh.tr { top: -4px;    right: -4px; cursor: ne-resize; }
#leContainer .zrh.tl { top: -4px;    left: -4px;  cursor: nw-resize; }

#leContainer #gs {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

#leContainer .zo.preview .zof,
#leContainer .zo.preview .zrh,
#leContainer .zo.preview .zol {
  display: none;
}

#leContainer #gs.on { opacity: 1; }

/* ── RIGHT PANEL ─────────────────────────────────────────── */

#leContainer #rp {
  width: 248px;
  min-width: 248px;
  background: #111;
  border-left: 1px solid #2e2e2e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#leContainer #rs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

#leContainer #rs::-webkit-scrollbar       { width: 3px; }
#leContainer #rs::-webkit-scrollbar-thumb { background: rgba(91,45,142,.3); border-radius: 2px; }

#leContainer .abt {
  width: 100%;
  height: 30px;
  background: #1a1a1a;
  border: 1px dashed #2e2e2e;
  border-radius: 5px;
  color: #4a5260;
  font-size: .64rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all .12s;
  margin-bottom: 4px;
}

#leContainer .abt:hover { border-color: var(--brand); color: #c084fc; }
#leContainer .abt.ok    { border-style: solid; border-color: rgba(91,45,142,.4); color: #c084fc; background: rgba(91,45,142,.06); }

#leContainer .orow {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}

#leContainer .olbl {
  font-size: .61rem;
  color: #5a6474;
  width: 38px;
  flex-shrink: 0;
}

#leContainer .osl {
  flex: 1;
  height: 2px;
  accent-color: var(--brand);
  cursor: pointer;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

#leContainer .osl::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
}

#leContainer .ov {
  font-size: .61rem;
  color: #4a5260;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── CONFIG OUTPUT ───────────────────────────────────────── */

#leContainer #co {
  background: #0a0a0a;
  border-top: 1px solid #2e2e2e;
  padding: 8px 10px;
  flex-shrink: 0;
}

#leContainer #cot {
  width: 100%;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 5px;
  padding: 6px 8px;
  font-family: 'Courier New', monospace;
  font-size: .58rem;
  color: #888;
  outline: none;
  resize: none;
  height: 130px;
  line-height: 1.5;
}

#leContainer .ccb {
  width: 100%;
  height: 28px;
  background: var(--bd);
  border: 1px solid var(--bb);
  border-radius: 5px;
  color: #c084fc;
  font-size: .66rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-top: 5px;
  transition: all .15s;
}

#leContainer .ccb:hover { background: rgba(91,45,142,.35); color: #fff; }

/* ── TOAST ───────────────────────────────────────────────── */

#leContainer #toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(91,45,142,.95);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 9999;
  white-space: nowrap;
}