/* =============================================================================
   outputs.css  —  Endeavos Online SOW
   Solution Outputs dialog, tag sprites, and legend (Step 5).
============================================================================= */

/* ── Dialog container ────────────────────────────────────────────────────── */
#out-dialog {
  position: absolute;
  top: 50%;
  right: 230px;
  transform: translateY(-50%);
  background: #fff;
  border: 1.5px solid rgba(232, 116, 30, 0.35);
  border-radius: 12px;
  padding: 16px;
  width: 320px;
  z-index: 800;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-height: calc(100% - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: var(--font-label);
}
#out-dialog.show { display: flex; }

/* ── Section label ───────────────────────────────────────────────────────── */
.out-dlg-label {
  font-size: var(--t-label);
  font-weight: var(--w-label);
  color: var(--ink);
}

/* ── Hint text ───────────────────────────────────────────────────────────── */
.out-dlg-hint {
  font-size: var(--t-hint);
  font-family: var(--font-hint);
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.5;
}

/* ── Load case multi-select dropdown ─────────────────────────────────────── */
.out-lc-dd {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font-label);
  font-size: var(--t-label);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  min-height: 38px;
}
.out-lc-dd:hover { border-color: var(--orange); }
.out-lc-dd.open {
  border-color: var(--orange);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.out-lc-dd-label { flex: 1; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out-lc-dd-label.has-val { color: var(--ink); }
.out-lc-dd-arrow {
  flex-shrink: 0;
  width: 10px; height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b626c' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
.out-lc-dd-menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--orange);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.out-lc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: var(--t-label);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.out-lc-item:hover { background: var(--orange-soft); }
.out-lc-item.selected { background: rgba(232, 116, 30, 0.08); font-weight: var(--w-option); }
.out-lc-item input[type="checkbox"] { accent-color: var(--orange); flex-shrink: 0; }

/* ── Assembly / separate-figures checkboxes ──────────────────────────────── */
.out-asm-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.out-asm-row input[type="checkbox"] { accent-color: var(--orange); cursor: pointer; flex-shrink: 0; }
/* aria-disabled, not disabled — a disabled control fires no click event and so
   can't explain why it's unavailable (see INTERACTION_STANDARD.html → User
   Messaging). The click guard in _outOnSepFigToggle toasts instead. */
.out-asm-row input[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.out-asm-row input[aria-disabled="true"] + label { opacity: 0.4; }

/* ── Part name + Body/Face — read-only, auto-populated from the model pick ── */
.out-part-info {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font-label);
  font-size: var(--t-label);
  font-weight: var(--w-label);
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
  min-height: 38px;
  display: flex;
  align-items: center;
}
.out-part-info-empty { color: var(--ink-soft); font-weight: var(--w-body); font-style: italic; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.out-dlg-divider {
  width: 100%;
  height: 1px;
  background: var(--line, #d8dce2);
  border: none;
  margin: 0;
}

/* ── Solution Outputs listbox ────────────────────────────────────────────── */
.out-outputs-box {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  max-height: 220px;
  overflow-y: auto;
}
.out-outputs-label {
  font-size: var(--t-hint);
  font-family: var(--font-hint);
  color: var(--ink-soft);
  font-style: italic;
  padding: 6px 11px 4px;
  border-bottom: 1px solid var(--line);
}
.out-output-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 12px;
  font-size: var(--t-label);
  color: var(--ink);
  user-select: none;
  transition: background 0.1s;
}
.out-output-item:hover { background: var(--orange-soft); }
.out-output-item input[type="checkbox"] { accent-color: var(--orange); flex-shrink: 0; cursor: pointer; }
.out-output-item label { cursor: pointer; flex: 1; }
/* "User Defined:" label sizes to its own text (not flex:1) so the input
   right after it sits on the same row instead of wrapping below. */
.out-output-item label.out-userdef-label { flex: 0 0 auto; }
.out-userdef-input {
  flex: 1;
  min-width: 60px;
  border: none;
  border-bottom: 1.5px dashed var(--orange);
  border-radius: 0;
  padding: 2px 2px;
  font-family: var(--font-entered);
  font-size: var(--t-body) !important;
  color: var(--ink);
  background: transparent;
  outline: none;
  box-sizing: border-box;
}
.out-userdef-input:focus { border-bottom-style: solid; }
.out-userdef-input::placeholder { color: var(--c-muted); font-style: italic; }
.out-output-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

/* ── Result-quantity groups (Stress, Displacement, …) ──────────────────────
   Collapsible: 30 component rows in a 220px box showed seven at a time, so
   every group is a disclosure. Collapsed, the whole list fits without
   scrolling. The heading is a control (caret + hover + focus ring), not a
   passive label — it must look like something you can click.
   The children carry the short leaf label ("Von Mises"), which is what keeps
   every row on one line; repeating the group name on each row is what made
   them wrap. */
.out-output-group {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-family: var(--font-label);
  font-size: var(--t-hint);
  font-weight: var(--w-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  user-select: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.out-output-group:hover { background: var(--orange-soft); color: var(--ink); }
.out-output-group:focus-visible {
  outline: none;
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1.5px var(--orange);
}
.out-group-caret {
  display: inline-block;
  width: 9px;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.12s;
}
.out-output-group.is-open .out-group-caret { transform: rotate(90deg); }
.out-group-name { flex: 1; }
/* Indented past the caret, so the nesting is readable at a glance. */
.out-output-child { padding-left: 28px; }

/* ── Optional section ────────────────────────────────────────────────────── */
.out-optional-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* #out-dialog's own flex gap already gives 10px above this section — add
     16px more so the gap above the Optional divider (26px) matches the gap
     below it (divider's own 8px margin-bottom + the 18px section gap = 26px). */
  margin-top: 16px;
}
.out-optional-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: var(--t-body);
}
.out-optional-divider::before,
.out-optional-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Textarea (charts) ───────────────────────────────────────────────────── */
.out-dlg-textarea {
  width: 100%;
  border: 1.5px solid var(--line, #d8dce2);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-entered);
  font-size: var(--t-body) !important;
  color: var(--ink);
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.out-dlg-textarea::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }
.out-dlg-textarea:focus { border-color: var(--orange); }

/* ── Add Chart (structured, countable list) ──────────────────────────────── */
.out-chart-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: fit-content;
}
.out-chart-toggle-row input[type="checkbox"] { accent-color: var(--orange); cursor: pointer; }
.out-add-chart-label {
  font-family: var(--font-label);
  font-weight: var(--w-label);
  font-size: var(--t-label);
  color: var(--ink);
  cursor: pointer;
}
.out-chart-textarea { margin-top: 8px; }

/* ── Note input ──────────────────────────────────────────────────────────── */
/* Was a single-line <input>, now a <textarea> — a one-line box could only
   ever show a scrolled sliver of a longer note, never the whole thing at
   once. resize/min-height/line-height added to match .lc-note-input, its
   equivalent in the Load Cases dialog. */
.out-dlg-note {
  width: 100%;
  border: 1.5px solid var(--orange);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-entered) !important; /* beats forms.css's input[type=text] specificity */
  font-size: var(--t-body) !important;
  line-height: 1.4;
  color: var(--ink);
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.out-dlg-note::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }
.out-dlg-note:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 116, 30, 0.12); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.out-dlg-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.out-dlg-ok {
  padding: 0 18px;
  height: 32px;
  min-width: 80px;
  background: var(--orange);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-family: var(--font-btn);
  font-weight: var(--w-option);
  font-size: var(--t-label);
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s;
}
.out-dlg-ok:hover { background: #c9611a; }
.out-dlg-cancel {
  padding: 0 18px;
  height: 32px;
  min-width: 80px;
  background: #fff;
  border: 1px solid var(--line, #d8dce2);
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--font-btn);
  font-weight: var(--w-option);
  font-size: var(--t-label);
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.out-dlg-cancel:hover { border-color: var(--ink-soft, #7a8390); }

/* ── Tag sprites ─────────────────────────────────────────────────────────── */
.out-sprite {
  position: absolute;
  pointer-events: none;
  z-index: 7;
}
.out-sprite .goal-bubble {
  pointer-events: all;
  cursor: grab;
  position: relative;
}
.out-sprite .goal-bubble:active { cursor: grabbing; }
.out-sprite .goal-bubble:hover .jnt-edit-btn    { display: flex; }
.out-sprite .goal-bubble:hover .goal-delete-btn { display: flex; }

/* ── Bubble content ──────────────────────────────────────────────────────── */
.out-bubble-lc {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  margin-bottom: 2px;
}
.out-bubble-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  color: var(--ink);
}
.out-bubble-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  margin: 4px 0 2px;
}

/* ── Legend ──────────────────────────────────────────────────────────────── */
#out-legend {
  position: absolute;
  top: 12px; left: 248px;
  z-index: 8;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232,116,30,0.25);
  border-radius: 10px;
  padding: 10px 18px 14px;
  display: none;
  min-width: 240px;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  pointer-events: none;
}
#out-legend.show { display: block; }
.out-leg-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-family: var(--font-label);
}
