/* All styling for the Animator app. The .gleam files only attach class names. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }

/* ── Layout: two columns ─────────────────────────────────────────────────── */

.app {
  display: flex;
  width: 100vw;
  height: 100vh;
  background: #1a1a2e;
  color: #d4c5a0;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

/* Left column: the code editor. */
.code-col {
  width: 42%;
  min-width: 320px;
  max-width: 720px;
  flex-shrink: 0;
  display: flex;
  border-right: 1px solid #3a3a5e;
  background: #0f0f1e;
}

/* The code column stays in the DOM when collapsed, so CodeMirror keeps its
   state; hiding it gives the right column the full width. */
.app.code-hidden .code-col { display: none; }

/* A small emoji button (the code pane's collapse toggle, and the playback
   controls once they exist). */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2a2a4a;
  color: #d4c5a0;
  border: 1px solid #4a4a8a;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 5px 8px;
}
.icon-btn:hover { background: #3a3a5e; }

/* ── Code panel (left column) ───────────────────────────────────────────── */

.code-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1a1a3e;
  border-bottom: 1px solid #3a3a5e;
}
.code-title {
  color: #e8d8b0;
  font-family: 'Georgia', serif;
  font-size: 16px;
  letter-spacing: 1px;
}

/* Wrapper holding the editor. */
.code-editor-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}
/* CodeMirror mount node: grows to fill the panel. */
.code-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: #0d0d1a;
}
.code-editor .cm-editor { width: 100%; height: 100%; }

/* Collapsible reference of the built-ins available to draw functions. */
.reference {
  margin: 8px 14px 0;
  border: 1px solid #3a3a5e;
  border-radius: 4px;
  background: #0d0d1a;
  overflow: hidden;
}
.reference-summary {
  padding: 6px 12px;
  cursor: pointer;
  color: #b8a888;
  font-family: monospace;
  font-size: 12px;
  user-select: none;
}
.reference-summary:hover { color: #e8d8b0; }
.reference-body {
  padding: 4px 12px 10px;
  border-top: 1px solid #3a3a5e;
}
.reference-group { margin-top: 8px; }
.reference-group-title {
  color: #8a8aca;
  font-family: monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.reference-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 1px 0;
}
.reference-sig {
  color: #89ddff;
  font-family: monospace;
  font-size: 12px;
  white-space: pre;
}
.reference-desc { color: #6a7a8a; font-size: 11px; }

/* ── Animation area (right column) ──────────────────────────────────────── */

.canvas-area {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a14;
  container-type: size;
}

/* The interpreter's List(Path) (or its error), shown as text before the
   animation pane is built. */
.output {
  align-self: stretch;
  margin: 0;
  padding: 16px;
  overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #cfe3ff;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Leave room for the reveal button, which only overlays this pane while the
   code column is hidden. */
.app.code-hidden .output { padding-top: 48px; }

/* Button that reveals the code column again when it is hidden. */
.reveal-code {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

/* A centred square that fits the (possibly non-square) animation area. Give your
   <canvas> this class, so that drawings aren't stretched. */
.canvas {
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
}

