/* The demo's frame: a small AE-like window around the real panel. Nullify's own dark palette,
   suggestive of AE's timeline without copying Adobe's UI. */
:root {
  --bg: #0b0c0f;
  --win: #1e1e20;
  --well: #151517;
  --raised: #2a2a2d;
  --line: #3a3a3e;
  --line-soft: #2a2a2d;
  --text: #f2f2f4;
  --dim: #98989d;
  --faint: #6e6e73;
  --sel: rgba(255, 255, 255, 0.09);
  --accent: #ff7a59;
  --accent-2: #ffc15e;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }

.demo { position: relative; max-width: 980px; margin: 0 auto; padding: 16px; }

.win { background: var(--win); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.win-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--well); border-bottom: 1px solid var(--line-soft); }
.tab { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); background: var(--win); border: 1px solid var(--line-soft); border-radius: 6px; padding: 3px 10px; }
.tab .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.tc { font-family: var(--mono); font-size: 12px; color: var(--accent-2); letter-spacing: 0.02em; }

/* The panel docks wide above the timeline: 44px tall is its natural height in AE. */
.dock { display: block; width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--win); }

.tl { padding-bottom: 6px; min-height: 120px; }
.tl-head, .row {
  display: grid;
  grid-template-columns: 20px 24px 18px minmax(150px, 1.35fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}
.tl-head { height: 30px; font-size: 11px; color: var(--faint); border-bottom: 1px solid var(--line-soft); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { height: 34px; border-bottom: 1px solid var(--line-soft); cursor: default; user-select: none; transition: background 0.12s; }
.row:hover { background: rgba(255, 255, 255, 0.03); }
/* Selected is just a lighter row, like AE. No accent color. */
.row.sel { background: var(--sel); }
.row.sel:hover { background: rgba(255, 255, 255, 0.11); }
.row.locked { cursor: not-allowed; }
.row.locked .c-name, .row.locked .c-fx, .row.locked .c-matte, .row.locked .c-label, .row.locked .c-num { opacity: 0.55; }

.c-lock { display: grid; place-items: center; overflow: visible !important; }
.tl-head .c-lock svg { width: 12px; height: 12px; color: var(--faint); }
/* Like AE: locked is just a light grey lock in the same box. The box itself never changes. */
.lockbox { width: 16px; height: 16px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; background: var(--well); color: #c9c9ce; cursor: pointer; }
.lockbox svg { width: 11px; height: 11px; }
.row > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.c-num { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }
.c-label i { display: block; width: 11px; height: 11px; border-radius: 2px; background: var(--label, #777); }
.t-null { --label: #d9a86c; }
.t-adjustment { --label: #9d86d8; }
.t-shape { --label: #5fb3d9; }
.t-footage { --label: #8fbf6a; }
.t-text { --label: #e36b6b; }
.t-camera { --label: #d98cc1; }
.t-solid { --label: #8c8c94; }

.c-name { display: flex; align-items: center; gap: 8px; }
.c-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.rename { min-width: 0; flex: 1; font: inherit; font-weight: 500; color: var(--text); background: var(--well); border: 1px solid var(--accent); border-radius: 4px; padding: 3px 6px; outline: none; }
.type { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; line-height: 16px; flex: none; min-width: 26px; text-align: center; }

.fx { display: inline-block; font-size: 11px; color: var(--dim); background: var(--raised); border-radius: 4px; padding: 1px 6px; margin-right: 4px; }
.c-matte, .c-parent { font-size: 12px; color: var(--dim); }
.matte-type { font-family: var(--mono); font-size: 10px; color: var(--accent-2); }
.c-parent { display: flex; align-items: center; gap: 4px; }

/* AE's pick whip: press, drag the line onto a layer, let go. */
.whip { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--dim); cursor: grab; touch-action: none; }
.whip svg { width: 15px; height: 15px; }
.whip:hover:not(.off) { color: var(--accent-2); background: rgba(255, 193, 94, 0.1); }
.whip.off { opacity: 0.35; cursor: not-allowed; }
.parent-menu { min-width: 0; max-width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; color: var(--dim); background: none; border: 1px solid transparent; border-radius: 5px; padding: 2px 6px; text-overflow: ellipsis; cursor: pointer; }
.parent-menu:hover:not(:disabled) { border-color: var(--line); color: var(--text); }
.parent-menu:disabled { cursor: not-allowed; }
.parent-menu option { background: var(--win); color: var(--text); }

.tl { position: relative; }
.tl.whipping, .tl.whipping * { cursor: grabbing !important; }
.whip-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.whip-line[hidden] { display: none; }
.whip-line line { stroke: var(--accent-2); stroke-width: 1.5; }
.whip-line circle { fill: var(--accent-2); }
.row.drop-ok { background: rgba(255, 193, 94, 0.13); box-shadow: inset 0 0 0 1px rgba(255, 193, 94, 0.6); }
.row.drop-bad { background: rgba(229, 72, 77, 0.12); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.5); }
.row.reparented .parent-menu { animation: renamed 1.4s ease-out; }
.dim { color: var(--faint); }

/* A renamed layer glows once, so you see what the click did. */
.row.changed .c-name b { animation: renamed 1.4s ease-out; }
@keyframes renamed {
  0% { color: var(--accent-2); text-shadow: 0 0 12px rgba(255, 193, 94, 0.55); }
  100% { color: var(--text); text-shadow: none; }
}

.under { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.hint { margin: 0; color: var(--dim); font-size: 13px; }
.actions { display: flex; gap: 8px; }
.actions button { background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.actions button:hover:not(:disabled) { border-color: var(--faint); }
.actions button:disabled { opacity: 0.4; cursor: default; }
kbd { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 4px; }
.note { margin: 10px 0 0; color: var(--faint); font-size: 12px; }

.prefs { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(11, 12, 15, 0.72); backdrop-filter: blur(2px); z-index: 5; padding: 16px; }
.prefs[hidden] { display: none; }
.prefs iframe { width: min(740px, 100%); height: min(560px, 100%); border: 1px solid var(--line); border-radius: 10px; background: var(--win); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }

/* Narrow screens: keep name and parent, drop the columns that don't fit. */
@media (max-width: 720px) {
  .tl-head, .row { grid-template-columns: 20px 18px 14px minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; padding: 0 8px; }
  .c-fx, .c-matte { display: none; }
  .demo { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .row.changed .c-name b, .row.reparented .parent-menu { animation: none; }
}
