/* FlowForge — UI styles. Nord-ish palette, clean & student-friendly. */
:root {
  --bg: #2e3440; --panel: #3b4252; --panel2: #434c5e; --ink: #2e3440;
  --line: #4c566a; --muted: #7b8494; --text: #eceff4; --accent: #5e81ac;
  --accent2: #88c0d0; --ok: #a3be8c; --warn: #ebcb8b; --err: #bf616a; --in: #b48ead;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--text); }

/* Header / toolbar */
header { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header h1 { font-size: 16px; margin: 0 12px 0 0; letter-spacing: .3px; }
header h1 span { color: var(--accent2); }
#doc-name { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; width: 180px; }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
button { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
button:hover { background: var(--line); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); }
button.danger { background: var(--err); border-color: var(--err); width: 100%; margin-top: 8px; }
select { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.status { padding: 3px 9px; border-radius: 99px; font-size: 12px; text-transform: capitalize;
  background: var(--panel2); border: 1px solid var(--line); }
.status.running { background: var(--accent); }
.status.ready { background: var(--accent2); color: var(--ink); }
.status.finished { background: var(--ok); color: var(--ink); }
.status.error { background: var(--err); }
.status.paused { background: var(--warn); color: var(--ink); }

/* Layout */
main { flex: 1; display: grid; grid-template-columns: 150px 1fr 320px; min-height: 0; }
.palette { background: var(--panel); border-right: 1px solid var(--line); padding: 10px; overflow: auto; }
.palette h2, aside h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin: 4px 0 8px; }
.palette button { width: 100%; text-align: left; margin-bottom: 6px;
  display: flex; align-items: center; gap: 9px; }
.sym { width: 28px; height: 18px; flex: 0 0 auto; pointer-events: none; }
.sym rect, .sym polygon, .sym .ar { fill: none; stroke: #cbd3e1; stroke-width: 1.6; }
.sym .ah { fill: #cbd3e1; stroke: none; }

.canvas-wrap { overflow: auto; background:
  radial-gradient(circle, #d4d8e0 1px, transparent 1px) 0 0 / 24px 24px, #ffffff; position: relative; }
#canvas { display: block; width: 100%; }

aside { background: var(--panel); border-left: 1px solid var(--line); display: flex;
  flex-direction: column; overflow: hidden; }
.pane { padding: 10px; border-bottom: 1px solid var(--line); }
.pane.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }

#inspector label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
#inspector input { width: 100%; margin-top: 3px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-family: ui-monospace, monospace; }
#inspector input.invalid { border-color: var(--err); }
#inspector h3 { margin: 0 0 10px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
#vars td { padding: 4px 6px; border-bottom: 1px solid var(--panel2); font-family: ui-monospace, monospace; }
#vars td:first-child { color: var(--accent2); }

#console { flex: 1; overflow: auto; background: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px; font-family: ui-monospace, monospace; font-size: 13px; }
#console .line { white-space: pre-wrap; padding: 1px 0; }
#console .out { color: var(--ok); }
#console .err { color: var(--err); }
#console .in { color: var(--in); }
#console .muted { color: var(--muted); }

/* terminal-style inline input: prompt + live caret printed in the console */
#console { cursor: text; }
.prompt-line { display: flex; align-items: baseline; flex-wrap: wrap; }
.prompt-label { color: var(--accent2); white-space: pre; }
.console-input { flex: 1; min-width: 6ch; background: transparent; border: none; outline: none;
  color: var(--in); font: inherit; padding: 0; margin: 0; caret-color: var(--in); }
.prompt-value { color: var(--in); }

.muted { color: var(--muted); }
.hint { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* SVG nodes — RAPTOR look: white fill, thin black outline, black text/arrows */
.ff-node { cursor: move; }
.ff-shape { fill: #ffffff; stroke: #111111; stroke-width: 1.6; }
.ff-start .ff-shape, .ff-end .ff-shape { fill: #ffffff; }
.ff-input .ff-shape, .ff-output .ff-shape { fill: #ffffff; }
.ff-selection .ff-shape { fill: #ffffff; }
/* clicked/selected node: blue marquee like RAPTOR's selection */
.ff-selected .ff-shape { stroke: #1f6feb; stroke-width: 2.4; stroke-dasharray: 6 3; }
/* currently executing node: RAPTOR highlights it green */
.ff-active .ff-shape { fill: #8ce68c; stroke: #111111; stroke-width: 2; }
.ff-node-title { font: 600 13px "Segoe UI", Arial, sans-serif; text-anchor: middle; fill: #111111; pointer-events: none; }
.ff-node-sub { font: 12px "Segoe UI", Arial, sans-serif; text-anchor: middle; fill: #111111; pointer-events: none; }
.ff-edge { stroke: #111111; stroke-width: 1.6; }
.ff-temp-edge { stroke: #1f6feb; stroke-width: 2; stroke-dasharray: 5 4; }
.ff-edge-label { font: 12px "Segoe UI", Arial, sans-serif; fill: #111111; }
.ff-arrow-head { fill: #111111; }
.ff-handle { fill: #1f6feb; stroke: #fff; stroke-width: 1.5; cursor: crosshair; opacity: .5; }
.ff-handle-g:hover .ff-handle { opacity: 1; r: 9; }
.ff-handle-label { font: 700 9px sans-serif; fill: #fff; text-anchor: middle; pointer-events: none; }
