/* =============================================================================
   loadcases.css  —  Endeavos Online SOW
   Load Cases dialog, tag sprites, and related UI.
============================================================================= */

/* ── Top-tier panel: load case identity, nav, Save (persistent for Step 4) ── */
#lc-case-panel {
  position: absolute;
  top: 12px;   /* aligns with the top of the viewer-toolbar's first button (Add Tag) */
  right: 230px; /* aligned with #lc-dialog below it, both cleared of the snapshot panel */
  background: #fff;
  border: 1.5px solid rgba(232, 116, 30, 0.35);
  border-radius: 12px;
  padding: 16px;
  width: 310px;
  z-index: 800;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  font-family: var(--font-label);
}
#lc-case-panel.show { display: flex; }

.lc-save-btn {
  width: auto;
  min-width: 144px;
  align-self: center;
  height: 36px;
  padding: 0 18px;
  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;
  transition: background 0.15s;
}
.lc-save-btn:hover:not(:disabled) { background: #c9611a; }
.lc-save-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Dialog container (bottom tier — repeatable load/constraint entry) ──── */
#lc-dialog {
  position: absolute;
  top: 178px;
  right: 230px;
  background: #fff;
  border: 1.5px solid rgba(232, 116, 30, 0.35);
  border-radius: 12px;
  padding: 16px;
  width: 310px;
  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% - 198px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: var(--font-label);
}
#lc-dialog.show { display: flex; }

/* ── Header row: < Load Case N > navigation ─────────────────────────────── */
.lc-dlg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.lc-dlg-case-label {
  font-size: var(--t-label);
  font-weight: var(--w-label);
  color: var(--ink);
  flex: 1;
  text-align: center;
}

.lc-dlg-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.lc-dlg-nav-btn:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}
.lc-dlg-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ── Load case name input ────────────────────────────────────────────────── */
.lc-name-input {
  width: 100%;
  border: 1.5px solid var(--line, #d8dce2);
  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;
  font-weight: var(--w-body);
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.lc-name-input:focus { border-color: var(--orange); }
.lc-name-input::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }

/* ── Number of load steps stepper ────────────────────────────────────────── */
.lc-steps-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.lc-steps-label {
  font-family: var(--font-label);
  font-size: var(--t-body);
  font-weight: var(--w-label);
  color: var(--ink);
  white-space: nowrap;
}
.lc-steps-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line, #d8dce2);
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}
.lc-steps-btn {
  width: 24px;
  height: 28px;
  border: none;
  background: #f4f4f2;
  color: var(--ink);
  font-family: var(--font-label);
  font-size: var(--t-label);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.lc-steps-btn:hover { background: rgba(232, 116, 30, 0.12); color: var(--orange); }
.lc-steps-btn:first-child { border-right: 1.5px solid var(--line, #d8dce2); }
.lc-steps-btn:last-child  { border-left:  1.5px solid var(--line, #d8dce2); }
.lc-steps-input {
  width: 46px !important; /* beats forms.css's input[type=text] { width: 100% }; fits a 3-digit value */
  flex: 0 0 auto;
  height: 28px;
  text-align: center;
  border: none;
  outline: none;
  font-family: var(--font-entered) !important;
  font-size: var(--t-body) !important;
  font-weight: var(--w-label);
  color: var(--ink);
  padding: 0;
  box-sizing: border-box;
}

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

/* ── Optional-section divider — "— Optional —", matches Solution Outputs ── */
.lc-optional-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
  color: var(--ink-soft);
  font-size: var(--t-body);
}
.lc-optional-divider::before,
.lc-optional-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Hint text ───────────────────────────────────────────────────────────── */
.lc-dlg-hint {
  font-size: var(--t-hint);
  font-family: var(--font-hint);
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.5;
}
.lc-dlg-hint-plain {
  /* no border, no padding — plain hint with no divider */
}


/* ── Load type custom dropdown ───────────────────────────────────────────── */
.lc-type-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;
}
.lc-type-dd:hover { border-color: var(--orange); }
.lc-type-dd:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 116, 30, 0.15); }
.lc-type-dd.open {
  border-color: var(--orange);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.lc-type-dd-label { flex: 1; }
.lc-type-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;
}
.lc-type-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;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* ── Load type colour swatch (dropdown trigger + list items) ─────────────── */
.lc-type-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.18);
  display: inline-block;
}

/* ── Individual type items ───────────────────────────────────────────────── */
.lc-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: var(--t-label);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.lc-type-item:hover { background: var(--orange-soft); }
.lc-type-item.selected {
  background: rgba(232, 116, 30, 0.08);
}

/* ── Example text input ──────────────────────────────────────────────────── */
.lc-example-input {
  width: 100%;
  border: 1.5px solid var(--line, #d8dce2);
  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;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.lc-example-input::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }
.lc-example-input:focus { border-color: var(--orange); }
.lc-example-input:focus::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }

/* ── File upload box (orange dashed border) ──────────────────────────────── */
.lc-file-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1.5px dashed var(--orange);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: var(--t-body);
  font-style: normal;
  color: var(--ink-soft, #7a8390);
  cursor: pointer;
  transition: background 0.12s;
  box-sizing: border-box;
}
.lc-file-box:hover { background: rgba(232, 116, 30, 0.05); }
.lc-file-box:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 116, 30, 0.15); }
.lc-file-box input[type="file"] { display: none; }

/* ── Note label ──────────────────────────────────────────────────────────── */
.lc-note-label {
  font-size: var(--t-label);
  font-weight: var(--w-label);
  color: var(--ink);
  margin: 0;
}

/* ── Note input (orange border) ──────────────────────────────────────────── */
.lc-note-input {
  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;
  color: var(--ink);
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.lc-note-input::placeholder { color: var(--c-muted); font-style: italic; font-weight: var(--w-body); font-size: var(--t-body); }
.lc-note-input:focus { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 116, 30, 0.12); }

/* ── OK / Cancel buttons ─────────────────────────────────────────────────── */
.lc-dlg-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.lc-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;
}
.lc-dlg-ok:hover { background: #c9611a; }

.lc-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;
}
.lc-dlg-cancel:hover { border-color: var(--ink-soft, #7a8390); }

/* ── LC tag sprites (floating labels on 3D model) ────────────────────────── */
.lc-sprite {
  position: absolute;
  pointer-events: none;
  z-index: 7;
}
.lc-sprite .goal-bubble {
  pointer-events: all;
  cursor: grab;
  position: relative;
}
.lc-sprite .goal-bubble:active { cursor: grabbing; }
.lc-sprite:hover .jnt-edit-btn  { display: flex; }
.lc-sprite:hover .goal-delete-btn { display: flex; }

/* ── Load Cases Legend ───────────────────────────────────────────────────── */
#lc-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;
}
#lc-legend.show { display: block; }
