/* ============================================================
   niqVID — style.css
   Tema dark profesional + layout utama.
   ============================================================ */
:root {
  --bg: #0c1016;
  --bg-panel: #141a22;
  --bg-soft: #1a222c;
  --bg-hover: #232d39;
  --text: #e8eef4;
  --text-dim: #8b97a5;
  --border: #2a3441;
  --accent: #4c8dff;
  --accent-2: #6ea3ff;
  --danger: #f85149;
  --ok: #3fb950;
  --warn: #d29922;
  --shadow: 0 10px 34px rgba(0,0,0,.5);
  --radius: 12px;
  --glow: 0 4px 18px rgba(76,141,255,.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--text);
  overflow: hidden; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); }
code { background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.muted { color: var(--text-dim); }
.small { font-size: 11.5px; }
.sep { flex: 0 0 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 14px; flex: 0 0 auto;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-ring {
  width: 38px; height: 38px; padding: 2px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow);
}
.logo { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; background: var(--bg-panel); }
.brand-text strong { display: block; font-size: 16px; line-height: 1.1; }
.brand-text small { color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.file-chip {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 13px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; color: var(--text-dim);
}
.topbar-actions { display: flex; gap: 7px; margin-left: auto; }
.hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-panel); font-size: 13px; font-weight: 500;
  transition: background .15s, transform .07s;
}
.hbtn:hover { background: var(--bg-hover); }
.hbtn:active { transform: scale(.96); }
.hbtn.icon { padding: 7px 9px; }
.hbtn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0c1016; border-color: transparent; font-weight: 600; box-shadow: var(--glow);
}

/* ---------- layout ---------- */
.layout { display: flex; flex: 1 1 auto; min-height: 0; }

/* ---------- media bin / creative dock ---------- */
#mediabin {
  width: 250px; flex: 0 0 auto;
  background: var(--bg-panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.dock-tabs { display: flex; gap: 4px; padding: 10px 12px 6px; }
.dock-tab { flex: 1; padding: 7px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.dock-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.dock-tab.active { color: var(--accent); background: rgba(77,163,255,.12); border-color: rgba(77,163,255,.35); }
.dock-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.hidden { display: none !important; }
.viz-controls { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.viz-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.viz-controls .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.viz-controls select, .viz-controls input[type="color"] { width: 100%; }
.viz-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: rgba(255,255,255,.015); }
.viz-group-title { font-size: 12px; font-weight: 700; color: var(--text); }
.viz-colors { display: flex; gap: 8px; }
.viz-colors label { flex: 1; }
.viz-colors input[type="color"] { height: 32px; padding: 2px; cursor: pointer; }
.val { color: var(--accent); font-weight: 700; }
#vizGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- inspector (kanan) ---------- */
#inspector {
  width: 260px; flex: 0 0 auto;
  background: var(--bg-panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}
.insp-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.insp-head h2 { font-size: 14px; }
.insp-section { border-bottom: 1px solid var(--border); }
.insp-section summary { padding: 11px 14px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.insp-section summary::-webkit-details-marker { display: none; }
.insp-section summary::before { content: '▸ '; color: var(--muted); }
.insp-section[open] summary::before { content: '▾ '; }
.insp-section summary:hover { background: rgba(255,255,255,.03); }
.insp-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.insp-body label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.insp-body .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.insp-body input[type="range"] { width: 100%; }
.insp-body select { width: 100%; }
.bin-head { display: flex; align-items: center; justify-content: space-between; padding: 12px; }
.bin-head h2 { font-size: 14px; }
#binGrid {
  flex: 1; overflow-y: auto; padding: 0 12px 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start;
}
.bin-item {
  border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
  background: var(--bg-soft); cursor: grab; position: relative;
  transition: border-color .13s, transform .1s;
}
.bin-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.bin-item img.thumb { width: 100%; height: 64px; object-fit: cover; display: block; background: #000; }
.bin-item .nm {
  font-size: 10px; padding: 4px 6px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--text-dim);
}
.bin-item .dur {
  position: absolute; right: 4px; bottom: 24px;
  background: rgba(0,0,0,.7); color: #fff; font-size: 9px;
  padding: 1px 5px; border-radius: 4px;
}
.bin-item .del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; display: none;
}
.bin-item:hover .del { display: block; }
.bin-item .ext {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; display: none;
}
.bin-item:hover .ext { display: block; }
.bin-foot { padding: 10px 12px; border-top: 1px solid var(--border); line-height: 1.5; }

/* ---------- preview ---------- */
#centerCol { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
#previewWrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 0; padding: 14px;
  background: radial-gradient(900px 400px at 50% 0%, rgba(76,141,255,.06), transparent 60%);
}
#stageBox { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
#stage {
  max-width: 100%; max-height: 100%;
  border-radius: 8px; box-shadow: var(--shadow); background: #000;
}
#safeOverlay { position: absolute; inset: 0; pointer-events: none; display: none; }
#safeOverlay.on { display: block; }
#safeOverlay::before {
  content: ''; position: absolute; inset: 5%;
  border: 2px dashed rgba(255,255,255,.55); border-radius: 4px;
}
#safeOverlay::after {
  content: ''; position: absolute; inset: 10%;
  border: 2px dashed rgba(255,220,0,.65); border-radius: 4px;
}
#previewEmpty {
  position: absolute; text-align: center; color: var(--text-dim);
  font-size: 15px; line-height: 2; pointer-events: none;
}
#transport {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--bg-panel); border-top: 1px solid var(--border);
}
.tbtn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-soft);
  font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
}
.tbtn:hover { background: var(--bg-hover); }
#timecode { font-family: monospace; font-size: 14px; color: var(--text-dim); min-width: 130px; }
#transport select {
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 8px; font-size: 12px;
}

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-panel); font-size: 12.5px; transition: background .15s;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0c1016; border-color: transparent; font-weight: 600;
}
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; display: none; z-index: 200;
  align-items: center; justify-content: center;
  background: rgba(4,7,12,.65); backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-box {
  position: relative; width: min(460px, 93vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.modal-wide { width: min(620px, 94vw); }
.modal-box h2 { font-size: 17px; margin-bottom: 14px; }
.modal-box h3 { font-size: 12px; margin: 14px 0 8px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .8px; }
.modal-box p { font-size: 13px; margin-bottom: 10px; line-height: 1.55; }
.modal-box label { display: block; font-size: 12px; margin-bottom: 11px; color: var(--text-dim); }
.modal-box input[type="text"], .modal-box input[type="number"],
.modal-box select, .modal-box textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); color: var(--text); font-size: 13px;
}
.modal-box input[type="color"] { width: 100%; height: 32px; margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); }
.modal-box label.check { display: flex; align-items: center; gap: 8px; }
.modal-box label.check input[type="checkbox"] { width: auto; margin-top: 0; accent-color: var(--accent); }
.modal-box .btn-primary { width: 100%; padding: 10px; margin-top: 6px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: none; border-radius: 50%; background: var(--bg-hover); font-size: 14px;
}
.modal-close:hover { background: var(--danger); color: #fff; }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; }
.prog { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.prog-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 300px; left: 50%; transform: translate(-50%, 14px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 400; max-width: 80vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- misc ---------- */
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.keys td:first-child { width: 140px; }
.about-head { display: flex; gap: 13px; align-items: center; margin-bottom: 12px; }
.about-logo { width: 58px; height: 58px; border-radius: 13px; }
.ver { font-size: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0c1016; padding: 2px 9px; border-radius: 99px; font-weight: 700; }
.feat { list-style: none; font-size: 13px; line-height: 1.7; }
.cap-seg { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.cap-seg input[type="text"] { flex: 1; }
.cap-seg input[type="number"] { width: 70px; }
#fxGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.viz-item { border: 2px solid var(--border); border-radius: 9px; padding: 10px 6px; text-align: center; font-size: 12px; cursor: pointer; background: var(--bg-soft); }
.viz-item.sel { border-color: var(--accent); box-shadow: var(--glow); }
.viz-item .viz-ico { font-size: 22px; display: block; margin-bottom: 4px; }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.qbtn { padding: 10px; border: 2px solid var(--border); border-radius: 9px; background: var(--bg-soft); font-weight: 700; font-size: 13px; }
.qbtn.sel { border-color: var(--accent); box-shadow: var(--glow); }
.fx-item { border: 2px solid var(--border); border-radius: 9px; padding: 10px 6px; text-align: center; font-size: 12px; cursor: pointer; background: var(--bg-soft); }
.fx-item.sel { border-color: var(--accent); box-shadow: var(--glow); }
.fx-swatch { height: 44px; border-radius: 6px; margin-bottom: 6px;
  background: linear-gradient(135deg, #f6d365, #fda085, #a18cd1, #4c8dff); }
