/* view-graph.css */

/* ── Base font override — ensure system sans-serif, never Times New Roman ── */
*, *::before, *::after {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  box-sizing: border-box;
}

/* ── Graph page header ── */
.graph-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 48px 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.graph-workspace { font-size: 13px; color: #555; display: block; margin-bottom: 4px; }
.graph-workspace a { color: #0b3a5c; text-decoration: none; }
.graph-workspace a:hover { text-decoration: underline; }
.graph-topic { font-size: 22px; font-weight: 700; color: #0b3a5c; margin: 0; }

.btn-transfer-link {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; font-size: 14px; font-weight: 600;
  color: #0b3a5c; cursor: pointer; padding: 6px 0;
}
.btn-transfer-link:hover { text-decoration: underline; }

/* ── Toolbar ── */
.graph-toolbar {
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
  border-top: 1px solid #d8e2ea; border-bottom: 1px solid #d8e2ea;
  padding: 10px 48px; font-size: 14px; color: #444; background: #fff;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; }
.toolbar-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: #0b3a5c; padding: 2px 5px; font-weight: 600;
}
.toolbar-btn:hover { text-decoration: underline; }

/* ── Graph canvas ── */
.graph-canvas {
  margin: 28px 48px 48px;
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  min-height: 520px;
}

/* ── graph-inner: MUST have explicit px width + height set by JS ── */
.graph-inner {
  position: relative;
  /* JS sets width & height — do NOT set min-height here or nodes won't render */
}

/* SVG lives behind all nodes */
.connector-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── Node card ── */
.node {
  position: absolute;
  display: flex;
  align-items: stretch;
  width: 230px;
  min-height: 76px;
  background: #fff;
  border: 1px solid #d0dbe6;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.node:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.node-strip {
  width: 44px;
  min-height: 76px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.strip-blue  { background: #1f3b57; }
.strip-green { background: #2e7d4f; }
.strip-red   { background: #b93025; }

.node-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin: auto 8px;
  flex-shrink: 0;
  background: #ccc;
}

.node-body {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.node-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1a2a3a;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-meta { font-size: 11px; color: #999; }

.node-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px 7px 6px 2px;
  flex-shrink: 0;
}
.node-actions button {
  background: none; border: none; cursor: pointer;
  color: #1a6fa8; font-size: 16px; padding: 3px;
  border-radius: 3px; line-height: 1;
}
.node-actions button:hover { background: #eef3f8; }


/* ══════════════════
   MODALS
══════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: #fff; border-radius: 8px; padding: 36px 40px 32px;
  width: 100%; max-width: 560px; position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  max-height: 90vh; overflow-y: auto;
}
.modal-box--sm { max-width: 460px; }

.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #666; line-height: 1;
}
.modal-close:hover { color: #000; }

.modal-title { font-size: 20px; font-weight: 700; color: #0b3a5c; text-align: center; margin-bottom: 6px; }
.modal-subtitle { font-size: 14px; text-align: center; color: #444; margin-bottom: 22px; }
.modal-desc { font-size: 14px; color: #555; text-align: center; margin-bottom: 20px; }

.form-label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-row { margin-bottom: 18px; }

.modal-input {
  width: 100%; border: none; border-bottom: 2px solid #0b3a5c;
  outline: none; padding: 7px 0; font-size: 14px; color: #222;
  background: transparent; margin-bottom: 4px; display: block;
}
.modal-input:focus { border-bottom-color: #1a6fa8; }

/* Radios */
.radio-group { display: flex; gap: 16px; margin-top: 8px; }
.radio-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-opt input { display: none; }
.radio-pill {
  padding: 5px 22px; border-radius: 20px; font-size: 13px; font-weight: 700;
  border: 2px solid transparent; cursor: pointer; transition: 0.15s;
}
.radio-pill.support { border-color: #2e7d4f; color: #2e7d4f; }
.radio-pill.refute  { border-color: #b93025; color: #b93025; }
.radio-opt input:checked + .radio-pill.support { background: #2e7d4f; color: #fff; }
.radio-opt input:checked + .radio-pill.refute  { background: #b93025; color: #fff; }

/* Rich editor */
.rich-toolbar {
  display: flex; gap: 2px; border: 1px solid #ccc; border-bottom: none;
  padding: 4px 6px; border-radius: 4px 4px 0 0; background: #f5f7f9;
}
.rich-toolbar button {
  background: none; border: none; cursor: pointer;
  padding: 2px 7px; font-size: 13px; color: #444; border-radius: 3px;
}
.rich-toolbar button:hover { background: #e0e6ed; }
.rich-body {
  border: 1px solid #ccc; border-radius: 0 0 4px 4px;
  min-height: 140px; padding: 10px; font-size: 14px; color: #333; outline: none;
}

/* File upload */
.file-upload-area { margin: 18px 0 4px; font-size: 14px; color: #333; }
.file-label {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 13px; color: #0b3a5c; font-weight: 600; margin-top: 6px;
}
.file-label:hover { text-decoration: underline; }

/* Buttons */
.btn-primary-action {
  display: block; background: #0b3a5c; color: #fff; border: none;
  border-radius: 4px; padding: 11px 24px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.15s; margin-top: 20px;
}
.btn-primary-action:hover { background: #072d49; }
.btn-primary-action.btn-inline { margin-top: 0; white-space: nowrap; }

.btn-secondary-action {
  display: inline-block; background: #0b3a5c; color: #fff; border: none;
  border-radius: 4px; padding: 10px 28px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary-action:hover { background: #072d49; }

/* Score */
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid #eee; font-size: 14px; color: #333;
}
.score-select {
  border: 1px solid #ccc; border-radius: 4px;
  padding: 5px 10px; font-size: 14px; min-width: 80px; cursor: pointer;
}

.score-btn-row {
  display: flex; justify-content: center; gap: 12px; margin-top: 22px;
}

/* Transfer ownership */
.transfer-search-row { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-end; }
.transfer-input { flex: 1; }
.transfer-hint { font-size: 13px; color: #aaa; text-align: center; margin: 16px 0 4px; }

.transfer-results { border: 1px solid #dde3ea; border-radius: 6px; overflow: hidden; }
.transfer-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid #eee; font-size: 14px;
}
.transfer-user:last-child { border-bottom: none; }
.transfer-avatar { font-size: 30px; color: #bbb; flex-shrink: 0; }
.transfer-name { font-weight: 600; color: #222; }
.transfer-email { font-size: 12px; color: #888; }
.btn-select {
  margin-left: auto; background: none; border: none;
  font-size: 13px; font-weight: 700; color: #0b3a5c; cursor: pointer;
}
.btn-select:hover { text-decoration: underline; }