#d3-graph-container {
  height: 85%
}

.circular-node {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.circular-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.graph-table {
  margin: 0 !important;
  color: #cccccc;
  width: 100%;
}

/* Icon column: remove cell padding so the image fills the row height naturally */
.graph-table th.graph-type-icon-col,
.graph-table td.graph-type-icon {
  padding: 0 2px;
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.graph-table td.graph-type-icon img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin: 0 auto;
}

/* Hide all tab sections by default; only show the active one */
section.tab {
  display: none;
}

section.tab.active {
  display: flex;
  flex-direction: column;
}

section.tab.listGraph.active {
  overflow: hidden;
  height: 100%;
}

.listGraph-details {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.listGraph-details thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg, #1a1a1a);
  z-index: 1;
}

.creationGraph-details {
  color: #cccccc;
}

svg image {
  cursor: move;
  pointer-events: all;
  user-select: none;
}

#d3-graph {
  border: 1px solid #888;
  display: block;
  max-width: 100%;
  overflow: auto;
}

.creationGraph-details .form-fields {
  margin-top: 1em;
}


.graph-btn.active {
  background-color: #4CAF50;
  /* green */
  color: white;
  border: 1px solid #3e8e41;
}

.graph-btn {
  background-color: #f0f0f0;
  color: black;
  border: 1px solid #ccc;
  cursor: pointer;
}

.person {
  stroke: steelblue;
  stroke-width: 3px;
}

.extendable {
  fill: lightsteelblue;
}

.non-extendable {
  fill: #fff;
}

.node-label {
  font: 12px sans-serif;
}

.link {
  fill: none;
  stroke: #ccc;
  stroke-width: 2px;
}

.svg-container .tooltip {
  position: absolute;
  font: 12px sans-serif;
  padding: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 5px;
}


.graph-relations .relations-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 5px;
  border-bottom: 1px solid #888;
  margin-bottom: 5px;
}

.graph-relations .relation-row fieldset {
  border: 1px solid #555;
  border-radius: 3px;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
}

.graph-relations .relation-row legend {
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.graph-relations .relation-row legend button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  line-height: 1;
  padding: 0;
  margin-left: 10px;
  color: #f00;
}

.graph-relations .form-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.graph-relations .form-group.slim {
  align-items: center;
}

.graph-relations .form-group.slim label {
  margin-right: 0;
  margin-bottom: 2px;
  font-size: 12px;
}

.graph-relations .form-group label {
  flex: 0 0 50px;
  margin-right: 5px;
  text-align: right;
}

.graph-relations .form-group input[type="text"] {
  flex: 1;
}

.graph-relations .form-group input[type="color"] {
  min-width: 40px;
  height: 24px;
  padding: 0 2px;
}

.graph-relations .form-group input[type="number"] {
  width: 50px;
}

.graph-relations .form-group input[type="checkbox"] {
  width: 24px;
  height: 24px;
}

.help-icon {
  position: absolute;
  bottom: 15px;
  left: 15px;

  font-size: 24px;
  /* Big enough to click/hover easily */
  color: var(--color-text-light-2);
  /* Foundry generic light gray */
  background: rgba(0, 0, 0, 0.5);
  /* Semi-transparent background */
  border-radius: 50%;
  /* Make the background a circle */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);

  /* Center the 'i' visually if it has a background */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: help;
  z-index: 100;
  transition: color 0.2s, background 0.2s;
}

.help-icon:hover {
  color: var(--color-text-light-1);
  /* Brighter white on hover */
  background: rgba(0, 0, 0, 0.8);
  text-shadow: 0 0 8px var(--color-shadow-primary);
}

/* -------------------------------------------------------------------------- */
/* Map Renderer (Leaflet)                                                     */
/* -------------------------------------------------------------------------- */

.fg-map-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.fg-leaflet-search {
  background: rgba(20, 20, 20, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 6px;
  width: 320px;
  color: #fff;
}

.fg-leaflet-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fg-leaflet-search-input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
}

.fg-leaflet-search-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fg-leaflet-search-results {
  margin-top: 6px;
  max-height: 180px;
  overflow: auto;
}

.fg-leaflet-search-item {
  padding: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 12px;
}

.fg-leaflet-search-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.fg-leaflet-search-empty {
  padding: 6px;
  font-size: 12px;
  opacity: 0.9;
}

/* -------------------------------------------------------------------------- */
/* JournalEntryPage: Foundry Graph flags editor                                */
/* -------------------------------------------------------------------------- */

.fgraph-page-config .fgraph-page-icon-preview {
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  object-fit: cover;
}


.fg-dtp-row {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.fg-dtp-display[readonly] {
  cursor: default;
}

.fg-dtp-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
}

.fg-dtp-popover[hidden] {
  display: none !important;
}

.fg-dtp-popover {
  background: var(--color-cool-5);
  border: 1px solid var(--color-border-light-2);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  padding: 8px;
}

.fg-dtp-popover-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg-dtp-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px 10px;
  align-items: center;
}

.fg-dtp-time {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fg-dtp-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fg-dtp-small {
  padding: 4px 10px;
}

.fg-dtp-lbl {
  font-size: 12px;
  opacity: 0.9;
}

.foundry-graph-tooltip .timeline-tooltip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
}

.foundry-graph-tooltip .timeline-tooltip img {
  border: 1px solid #7a7971;
  border-radius: 4px;
  object-fit: cover;
}

.foundry-graph-tooltip .dates {
  font-size: 0.85em;
  color: #bbb;
}


/* This allows the timeline to scroll horizontally within the Foundry Tab/Window */
.foundry-graph-timeline-container {
  overflow-x: auto !important;
  overflow-y: hidden;
  width: 100%;
}

/* Apply this to the div/section wrapping your SVG */
.timeline-scroll-wrapper {
  width: 100%;
  height: 100%;
  overflow: auto !important;
  display: block;
  /* Enables both horizontal and vertical scrollbars */
  /*position: relative;
  background: #111;*/
}

/* Ensure the SVG doesn't try to shrink back down */
.timeline-scroll-wrapper svg {
  display: block;
  min-width: 100%;
}
/* ── vis-timeline renderer: transparent panels so background image shows ── */
#fg-vis-timeline .vis-panel,
#fg-vis-timeline .vis-content,
#fg-vis-timeline .vis-background,
#fg-vis-timeline .vis-center,
#fg-vis-timeline .vis-left,
#fg-vis-timeline .vis-right,
#fg-vis-timeline .vis-bottom,
#fg-vis-timeline .vis-top {
  background: transparent !important;
}

/* Keep axis and group label areas semi-transparent so the bg image remains visible */
#fg-vis-timeline .vis-time-axis,
#fg-vis-timeline .vis-labelset {
  background: rgba(20, 20, 30, 0.65) !important;
}

#fg-vis-timeline .vis-background .vis-group {
  background: transparent !important;
}

/* Rich icon tooltip */
.fg-type-icon-tooltip {
  text-align: center;
  padding: 6px;
  min-width: 110px;
}