/* Relationship visualization styles */

#event-relationships-chart-holder-div {
  width: 100%;
  height: 600px;
  background-color: var(--bg-primary);
  position: relative;
  overflow: hidden;
  cursor: default !important;
}

#event-relationships-chart-holder-div.active {
  border: 1px solid var(--border-dashed);
}

.relationship-entity {
  cursor: pointer;
}

.relationship-entity-rect {
  fill: var(--bg-tertiary);
  transition: all 0.2s ease;
  opacity: 0.7;
}

.relationship-entity-rect.highlighted {
  fill: var(--text-primary);
  stroke: var(--text-secondary);
  stroke-width: 2px;
  opacity: 1;
}

.relationship-entity-rect.selected {
  fill: #4a90e2;
  stroke: #2c5aa0;
  stroke-width: 2px;
  opacity: 1;
}

.relationship-entity-rect.dimmed {
  opacity: 0.15;
}

.relationship-entity-text {
  font-size: 11px;
  font-weight: 500;
  fill: var(--text-primary);
  pointer-events: none;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.relationship-entity-text.highlighted {
  font-weight: 700;
  fill: var(--bg-primary);
  opacity: 1;
}

.relationship-entity-text.selected {
  font-weight: 700;
  fill: var(--bg-primary);
  opacity: 1;
}

.relationship-entity-text.dimmed {
  opacity: 0.15;
}

.relationship-line {
  stroke-width: 1px;
  opacity: 0.15;
  transition: all 0.2s ease;
  cursor: pointer;
}

.relationship-line.highlighted {
  opacity: 1;
  stroke-width: 3px;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

.relationship-line.selected {
  opacity: 1;
  stroke-width: 3px;
}

.relationship-line.hover-active {
  opacity: 1;
  stroke-width: 4px;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

.relationship-tooltip {
  position: absolute;
  padding: 10px;
  background: var(--tooltip-background-color);
  color: var(--tooltip-text-color);
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  max-width: 250px;
  line-height: 1.4;
}

.relationship-tooltip .sentiment {
  font-weight: bold;
  margin-top: 5px;
}

.relationship-tooltip .sentiment.positive {
  color: #4ade80;
}

.relationship-tooltip .sentiment.negative {
  color: #f87171;
}

.relationship-label {
  font-size: 8px;
  font-weight: 600;
  fill: var(--text-tertiary);
  opacity: 0.15;
  pointer-events: none;
  text-anchor: middle;
  transition: opacity 0.2s ease;
}

.relationship-label.highlighted {
  opacity: 0.6;
}

.relationship-label.selected {
  opacity: 0.5;
}

.relationship-label.hover-active {
  opacity: 0.8;
  font-size: 9px;
  font-weight: 700;
}

#relationships-entities-container::-webkit-scrollbar {
  height: 2px;
}

#relationships-entities-container::-webkit-scrollbar-track {
  background: transparent;
}

#relationships-entities-container::-webkit-scrollbar-thumb {
  background: var(--border-dashed);
}

#relationships-entities-container::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Relationship Map Styling */

/* Modal overlay styling */

.relationship-settings-modal-overlay, .relationship-filters-modal-overlay {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Modal content styling */

.relationship-settings-modal, .relationship-filters-modal {
  font-family: var(--font-family);
}

.relationship-settings-modal h3, .relationship-filters-modal h3 {
  font-family: var(--font-family);
  color: var(--text-color-primary);
}

.relationship-settings-modal h4, .relationship-filters-modal h4 {
  font-family: var(--font-family);
  color: var(--text-color-primary);
}

/* Button styling */

.relationship-settings-modal button, .relationship-filters-modal button {
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.relationship-settings-modal button:hover, .relationship-filters-modal button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Input styling */

.relationship-settings-modal input[type="checkbox"], .relationship-filters-modal input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.relationship-settings-modal input[type="number"], .relationship-filters-modal input[type="number"] {
  font-family: var(--font-family);
  transition: border-color 0.2s ease;
}

.relationship-settings-modal input[type="number"]:focus, .relationship-filters-modal input[type="number"]:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Select dropdown styling */

.relationship-settings-modal select, .relationship-filters-modal select {
  font-family: var(--font-family);
  background: var(--card-bg);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.relationship-settings-modal select:focus, .relationship-filters-modal select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}

/* Section styling */

.relationship-settings-modal > div, .relationship-filters-modal > div {
  position: relative;
}

/* Label styling */

.relationship-settings-modal label, .relationship-filters-modal label {
  font-family: var(--font-family);
  color: var(--text-color-primary);
  user-select: none;
}

.relationship-settings-modal label:hover, .relationship-filters-modal label:hover {
  background: var(--bg-hover);
  border-radius: 4px;
  margin-left: -4px;
  padding-left: 4px;
  margin-right: -4px;
  padding-right: 4px;
}

/* Entity type buttons */

.relationship-filters-modal button[style*="border-radius: 16px"] {
  font-weight: var(--normal-font-weight);
}

.relationship-filters-modal button[style*="border-radius: 16px"]:hover {
  transform: scale(1.02);
}

/* Apply button styling */

button[style*="background: rgba(0, 0, 0, 0.1)"] {
  font-weight: var(--semibold-font-weight);
}

button[style*="background: #4CAF50"] {
  font-weight: var(--semibold-font-weight);
  transition: background-color 0.2s ease;
}

button[style*="background: #4CAF50"]:hover {
  background-color: #45a049 !important;
}

/* Reset button styling */

button:contains("Reset to Defaults") {
  background: var(--bg-tertiary) !important;
}

/* Node styling */

.relationship-entity {
  cursor: pointer;
}

.relationship-entity-rect {
  transition: all 0.2s ease;
}

.relationship-entity-rect:hover {
  filter: brightness(0.95);
}

.relationship-entity-rect.selected {
  filter: none;
}

.relationship-entity-text {
  pointer-events: none;
  font-family: var(--font-family);
}

/* Edge styling */

.relationship-line {
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.relationship-hitbox {
  cursor: pointer;
}

/* Label styling */

.relationship-label {
  font-family: var(--font-family);
  user-select: none;
  pointer-events: none;
}

/* Control buttons styling */

#relationships-chart-holder-div button {
  font-family: var(--font-family);
  font-weight: var(--normal-font-weight);
  transition: all 0.2s ease;
}

#relationships-chart-holder-div button:hover {
  background: var(--card-bg) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

#relationships-chart-holder-div button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Info box styling */

.relationship-info-box {
  font-family: var(--font-family);
}

/* Scrollbar styling for modals and info boxes */

.relationship-settings-modal::-webkit-scrollbar, .relationship-filters-modal::-webkit-scrollbar, div[style*="overflow-y: auto"]::-webkit-scrollbar {
  width: 8px;
}

.relationship-settings-modal::-webkit-scrollbar-track, .relationship-filters-modal::-webkit-scrollbar-track, div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
  background: var(--bg-active);
  border-radius: 4px;
}

.relationship-settings-modal::-webkit-scrollbar-thumb, .relationship-filters-modal::-webkit-scrollbar-thumb, div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
  background: var(--border-dashed);
  border-radius: 4px;
}

.relationship-settings-modal::-webkit-scrollbar-thumb:hover, .relationship-filters-modal::-webkit-scrollbar-thumb:hover, div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Notification styling (if showNotification is used) */

.relationship-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  font-family: var(--font-family);
  font-size: var(--small-font-size);
  z-index: 3000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Focus mode styling */

.relationship-entity.focus-connected rect {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

.relationship-line.focus-active {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

/* Update selected pane styling */

.search-selector-container .search-selector-pane.selected {
  background-color: var(--bg-active);
  border-color: var(--border-strong);
  cursor: default;
  pointer-events: none;
}

.search-selector-container a.search-selector-pane {
  text-decoration: none;
  color: inherit;
}

.search-selector-container a.search-selector-pane:hover {
  background-color: var(--bg-hover);
}

/* Path result loading */

.pathfinding-results-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.pathfinding-results-loading .loading-text {
  font-size: var(--subtext-font-size);
}

/* Path result styling */

.pathfinding-result {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 10px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.pathfinding-result:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

.pathfinding-result.selected {
  background: rgba(74, 144, 226, 0.05);
  border-color: rgba(74, 144, 226, 0.3);
}

.pathfinding-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pathfinding-result-importance {
  font-size: var(--subtext-font-size);
  font-weight: var(--semibold-font-weight);
  color: var(--text-primary);
}

.pathfinding-result-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pathfinding-result-mapBtn,
.pathfinding-result-saveBtn,
.pathfinding-result-relPageBtn {
  padding: 6px 12px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: var(--small-font-size);
  font-weight: var(--semibold-font-weight);
  cursor: pointer;
  transition: all 0.2s;
}

.pathfinding-result-mapBtn:hover,
.pathfinding-result-saveBtn:hover,
.pathfinding-result-relPageBtn:hover {
  background: var(--bg-active);
  border-color: var(--border-strong);
}

.pathfinding-result-path {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
  white-space: nowrap;
}

/* Direct relationship badge */
.pathfinding-direct-relationship-badge {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: var(--small-font-size);
  font-weight: 500;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}

.pathfinding-arrow-container {
  display: flex;
  align-items: center;
  padding: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.pathfinding-arrow-container:hover .pathfinding-arrow {
  transform: scale(1.2);
}

.pathfinding-arrow {
  font-size: var(--small-font-size);
  transition: all 0.2s;
  pointer-events: none;
}

.pathfinding-arrow.link-icon {
  font-size: 0.9em;
}

.pathfinding-relationship-infobox {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 455px;
  max-width: 40vw;
  max-height: min(520px, 90vh);
  background: var(--card-bg);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-md);
  padding: 15px;
  z-index: 10000;
  overflow: hidden;
}

.pathfinding-infobox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  z-index: 1;
}

.pathfinding-infobox-close:hover {
  color: var(--text-primary);
}

.pathfinding-relationship-infobox .entityPage-saveButton {
  position: absolute;
  top: 8px;
  left: 12px;
  float: none;
  margin-right: 0;
}


