:root {
  --orange: #ff6c00;
  --orange-60: #f89743;
  --orange-20: #fcdabe;
  --orange-dark: #510518;

  --blue: #242265;
  --blue-60: #666495;
  --blue-20: #c8c8d9;
  --blue-dark: #0c0c23;

  --cyan: #4ad8ff;
  --cyan-60: #85ebff;
  --cyan-20: #e8fcff;
  --cyan-dark: #1c4355;

  --green: #c5fb00;
  --green-60: #dffd79;
  --green-20: #faffe8;
  --green-dark: #27401b;

  --purple: #b786ff;
  --purple-60: #d8bcff;
  --purple-20: #f8f3ff;
  --purple-dark: #413148;

  --neutral-gray: #4e4e4e;

  --nato: #004990;
  --nato-light: #025fbb;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
}

#root {
  width: 100vw;
  height: 100vh;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  gap: 0;
}

.main-panel {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}

.splitter {
  flex: 0 0 10px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  position: relative;
}

.splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: #d9d9d9;
}

.splitter:hover::after,
.splitter:active::after {
  background: #999999;
}

.side-panel {
  flex: 0 0 auto;
  height: 100%;
  box-sizing: border-box;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: auto;
}

.graph-host {
  background-color: rgb(241, 241, 241);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 6px;
}
.properties-panel {
  padding: 5px 10px;
  background: #f1f1f1;
  border: 1px solid #cccccc;
  border-radius: 5px;
}
.properties-panel p {
  font-size: 14px;
}
h2 {
  font-size: 13px;
}
h3 {
  font-size: 14px;
}
ul {
  list-style-type: disc;
  padding: 0;
  margin: 15px;
  font-size: 14px;
}

.action-panel {
  margin-top: 5px;
  padding: 5px 10px;
  background: #f1f1f1;
  border: 1px solid #cccccc;
  border-radius: 5px;
}
.action-panel p {
  font-size: 14px;
}

.tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.tab-list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d9d9d9;
  padding-bottom: 4px;
}

.tab-button {
  flex: 1 1 auto;
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.tab-button.active {
  background: #f1f1f1;
  border-color: #cccccc;
  font-weight: 600;
}

.tab-content {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px;
}

.neighborhood-summary {
  font-size: 13px;
  color: #555555;
}

h4 {
  font-size: 13px;
  margin-top: 10px;
}

.neighborhood-list {
  list-style-type: disc;
  padding: 0;
  margin: 8px 0 8px 15px;
  font-size: 14px;
}

.neighborhood-panel {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.neighborhood-direction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
  font-size: 13px;
}

.neighborhood-direction select {
  min-width: 140px;
  padding: 3px 5px;
  font-size: 13px;
}

.neighborhood-depth {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 8px;
  font-size: 13px;
}

.neighborhood-depth input {
  flex: 1 1 auto;
  min-width: 0;
}

.neighborhood-panel p {
  font-size: 14px;
}

.neighborhood-host {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background-color: rgb(241, 241, 241);
  border-radius: 6px;
  box-sizing: border-box;
}

.settings-panel {
  padding: 5px 10px;
  background: #f1f1f1;
  border: 1px solid #cccccc;
  border-radius: 5px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}

.theme-toggle-button {
  padding: 4px 10px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  cursor: pointer;
}

.layout-panel {
  margin-top: 10px;
  padding: 5px 10px;
  background: #f1f1f1;
  border: 1px solid #cccccc;
  border-radius: 5px;
}

.layout-options {
  border-top: 1px solid #dddddd;
  margin-top: 4px;
  padding-top: 4px;
}

.setting-row select,
.setting-row input[type="number"] {
  padding: 4px 6px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  width: 110px;
}

body[data-theme="dark"] {
  background: #1e1e1e;
}

body[data-theme="dark"] .side-panel {
  background: #252526;
  border-color: #3c3c3c;
  color: #e0e0e0;
}

body[data-theme="dark"] .graph-host,
body[data-theme="dark"] .neighborhood-host {
  background-color: #2d2d30;
}

body[data-theme="dark"] .tab-list {
  border-bottom-color: #3c3c3c;
}

body[data-theme="dark"] .tab-button {
  background: #2d2d30;
  color: #cccccc;
  border-color: #3c3c3c;
}

body[data-theme="dark"] .tab-button.active {
  background: #3c3c3c;
  border-color: #555555;
  color: #ffffff;
}

body[data-theme="dark"] .properties-panel,
body[data-theme="dark"] .action-panel,
body[data-theme="dark"] .settings-panel,
body[data-theme="dark"] .search-panel,
body[data-theme="dark"] .layout-panel {
  background: #2d2d30;
  border-color: #3c3c3c;
  color: #e0e0e0;
}

body[data-theme="dark"] .layout-options {
  border-top-color: #3c3c3c;
}

body[data-theme="dark"] .neighborhood-summary {
  color: #aaaaaa;
}

body[data-theme="dark"] .theme-toggle-button {
  background: #3c3c3c;
  border-color: #555555;
  color: #e0e0e0;
}

body[data-theme="dark"] .setting-row select,
body[data-theme="dark"] .setting-row input[type="number"] {
  background: #3c3c3c;
  border-color: #555555;
  color: #e0e0e0;
}

.search-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-top: 5px;
  padding: 5px 10px;
  border: 1px solid #cccccc;
  border-radius: 5px;
  background: #f1f1f1;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  font-size: 13px;
}

.search-summary {
  margin: 8px 0 4px;
  font-size: 12px;
  color: #666666;
}

.search-results {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  max-height: 60vh;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  font-size: 13px;
}

.search-result:hover,
.search-result:focus {
  background: #eef3fb;
  outline: none;
}

.search-result.selected {
  background: var(--nato-light);
  color: white;
}

.search-result-meta {
  font-size: 11px;
}

body[data-theme="dark"] .search-input {
  background: #3c3c3c;
  border: 1px solid #555555;
  color: #e0e0e0;
}

body[data-theme="dark"] .search-summary,
body[data-theme="dark"] .search-result-meta {
  color: rgba(255, 255, 255, 0.72);
}

body[data-theme="dark"] .search-result {
  border-bottom-color: #3c3c3c;
}

body[data-theme="dark"] .search-result:hover,
body[data-theme="dark"] .search-result:focus {
  background: #37373d;
}

body[data-theme="dark"] .search-result.selected {
  background: var(--nato);
  color: white;
}
body[data-theme="dark"] .search-result-meta.selected {
  color: rgba(255, 255, 255, 0.72);
}

.events-panel {
  margin-top: 0;
}

.events-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.events-heading h2 {
  margin: 0 0 8px;
}

.clear-events-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  padding: 5px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #555555;
  cursor: pointer;
}

.clear-events-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.clear-events-button:hover:not(:disabled),
.clear-events-button:focus-visible {
  background: #eef3fb;
  outline: 2px solid #6c9bd2;
  outline-offset: 1px;
}

.clear-events-button:disabled {
  cursor: default;
  opacity: 0.5;
}

body[data-theme="dark"] .clear-events-button {
  background: #3c3c3c;
  border-color: #555555;
  color: #e0e0e0;
}

body[data-theme="dark"] .clear-events-button:hover:not(:disabled),
body[data-theme="dark"] .clear-events-button:focus-visible {
  background: #4a4a50;
}

.events-panel .search-results {
  max-height: none;
  overflow-anchor: none;
}

.events-panel .search-result {
  border-left: 3px solid transparent;
}

.events-panel .search-result-title {
  overflow-wrap: anywhere;
}

.events-panel .search-result[data-type="node-added"] {
  border-left-color: green;
}

.events-panel .search-result[data-type="node-updated"] {
  border-left-color: orange;
}

.events-panel .search-result[data-type="edge-updated"] {
  border-left-color: #6f42c1;
}

.events-panel .search-result[data-type="node-removed"] {
  border-left-color: red;
}

.toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px;
  background: var(--toolbar-background, #f5f5f5);
  border-bottom: 1px solid rgba(101, 101, 101, 0.3);
  height: 25px;
  width: 100%;
  z-index: 1000;
  border-radius: 5px 5px 0 0;
}
body[data-theme="dark"] .toolbar {
  background-color: #2d2d30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.icon-button {
  border: none;
  cursor: pointer;
  background: transparent;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  color: black;
}
.icon-button:hover {
  background: var(--nato-light);
  color: #fff;
}
body[data-theme="dark"] .icon-button {
  color: #fff;
}
body[data-theme="dark"] .icon-button:hover {
  background: var(--nato-light);
  color: #c1c1c1;
}
.max-button {
  margin-right: 15px;
}
/* Marquee Selection Rectangle */
.yfiles-marquee-rect-template {
  fill: var(--cyan-20);
  stroke: var(--cyan-60);
  stroke-width: 2px;
}

/* Selection */
.yfiles-selection-template {
  &.yfiles-node-selection-template,
  &.yfiles-edge-selection-template,
  &.yfiles-label-selection-template,
  &.yfiles-port-selection-template {
    stroke: var(--nato-light);
    stroke-width: 4px;
    stroke-linejoin: round;
    border-radius: 6px;
  }
}

/* Focus */
.yfiles-focus-template {
  &.yfiles-node-focus-template,
  &.yfiles-edge-focus-template,
  &.yfiles-label-focus-template,
  &.yfiles-port-focus-template {
    stroke: var(--purple);
    stroke-width: 2px;
    stroke-linejoin: round;
  }
}

/* Highlights */
.yfiles-highlight-template {
  &.yfiles-edge-highlight-template,
  &.yfiles-node-highlight-template,
  &.yfiles-label-highlight-template,
  &.yfiles-port-highlight-template {
    stroke: var(--cyan);
    stroke-linejoin: round;
  }
}
.group-label text {
  fill: #000;
}
body[data-theme="dark"] .group-label text {
  fill: #fff;
}

.group-rect {
  stroke-dasharray: 4, 2;
}

body[data-theme="dark"] .group-rect {
  stroke-dasharray: 4, 2;
  stroke: #fff;
}
.ip-label text {
  fill: black;
}
body[data-theme="dark"] .ip-label text {
  fill: #fff;
}
