:root {
  --graph-bg: transparent;
  --graph-panel: #ffffff;
  --graph-surface: #f8fafc;
  --graph-border: rgba(15, 23, 42, 0.12);
  --graph-accent: #06b6d4;
  --graph-text: #0f172a;
}

* {
  box-sizing: border-box;
}

circle {
  stroke: rgb(31, 119, 180);
  stroke-width: 1px;
}

.visible-node {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.visible-node.visible {
  opacity: 1;
}

#graph {
  width: 100%;
  height: 100%;
  background: transparent;
}

.mindmap-container {
  display: flex;
  min-height: 70vh;
  width: 100%;
  overflow: hidden;
  color: var(--graph-text);
}

.graph-area {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.graph-area #graph-container {
  height: 100%;
  width: 100%;
  position: relative;
}

.graph-area #link-tooltip {
  position: absolute;
  visibility: hidden;
  background-color: var(--graph-panel);
  border: 1px solid var(--graph-border);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--graph-text);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

#settings-overlay,
#menu-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 10;
}

#graph-buttons {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.graph-button {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: var(--graph-text);
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1),
    0 10px 30px rgba(34, 211, 238, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.graph-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.6),
    0 16px 40px rgba(34, 211, 238, 0.2);
  background: linear-gradient(135deg, #38bdf8, #06b6d4);
}

.graph-button i {
  pointer-events: none;
}

#gear-btn i {
  transition: transform 0.8s ease;
}

#gear-btn:hover > i {
  transform: rotate(180deg);
}

#graph-search {
  padding: 20px;
}

#graph-search h4 {
  margin: 0;
  text-align: left;
}

#searchbar {
  width: 100%;
}

#autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--graph-panel);
  border: 1px solid var(--graph-border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}

#autocomplete-list div {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--graph-text);
}

#autocomplete-list div:hover {
  background-color: rgba(34, 211, 238, 0.1);
}

.autocomplete-active {
  background-color: var(--graph-accent);
  color: #0b1220;
}

#graph-help,
#graph-settings,
#graph-search {
  border: 1px solid var(--graph-border);
  background: var(--graph-panel);
  border-radius: 16px;
  position: absolute;
  align-self: center;
  z-index: 40;
  display: none;
  transition: opacity 0.5s;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  color: var(--graph-text);
}

#graph-settings div {
  padding: 6px 0;
}

#help-section {
  padding: 6px 0;
}

#help-section h3 {
  margin: 0 0 6px;
}

.filters-container fieldset {
  display: grid;
}

.filters-container fieldset legend {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--graph-text);
}

.filters-container fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-size-selector fieldset {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  font: inherit;
  color: #333;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  position: relative;
  background: #ffffff;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
  border-color: transparent;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.25);
}

input[type="checkbox"]:hover {
  filter: brightness(110%);
}

#node-details {
  display: none;
  position: absolute;
  background: var(--graph-panel);
  border: 1px solid var(--graph-border);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 240px;
  max-width: 320px;
  color: var(--graph-text);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  z-index: 60;
}

#node-details h5 {
  margin: 0 0 4px;
}

#node-links div {
  cursor: pointer;
  padding: 2px 0;
}

#node-links div:hover {
  color: var(--graph-accent);
}

.light-mode {
  background-color: #ffffff;
  color: #0b1220;
}

.dark-mode {
  background-color: #130f40;
  color: #fafafa;
}

/* Compact mindmap interface container */
#fileTreeContainer {
  width: 25%;
  border-right: 1px solid #334155;
  padding: 8px;
  overflow-y: auto;
}

#fileTreeContainer .file_tree_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#fileTreeContainer #fileTree {
  height: calc(100% - 40px);
}

/* Side panel for node info and filters */
#side-panel-new {
  position: fixed;
  right: 8px;
  top: 8px;
  width: 260px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 1000;
  max-height: calc(100% - 16px);
  overflow-y: auto;
  font-size: 0.9rem;
}

#side-panel-new h4,
#side-panel-new h5 {
  font-size: 1.5rem;
  align-self: center;
  margin: 0 auto;
}

/* Floating action buttons (Save, Cancel) */
.action-buttons {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 101;
}

#reset-button {
  visibility: hidden;
}

#copy-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #0b1220;
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  transform: translateY(20px);
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.25);
}

#copy-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
