/* Custom styles */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #1a1a1a;
  color: #00d4ff;
}

/* Base layout styles */
#graph-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Improved toolbar styles with inline search and better dragging */
#graph-toolbar {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(43, 43, 43, 0.75);
  border-radius: 8px;
  z-index: 9999;
  display: flex;
  align-items: center;
  padding: 0 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  max-width: 98%;
  transition: all 0.3s ease;
  border: 1px solid rgba(80, 80, 80, 0.5);
  backdrop-filter: blur(5px);
  height: 50px;
  gap: 8px;
  user-select: none;
}

/* Improved handle for dragging */
.toolbar-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 12px;
  cursor: move;
  opacity: 0.2;
  transition: opacity 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}

.toolbar-handle:hover {
  opacity: 0.8;
}

.toolbar-handle i {
  font-size: 12px;
  color: #ccc;
}

/* Button styles */
.graph-toolbar-btn {
  width: 36px;
  height: 36px;
  background-color: transparent;
  border: none;
  border-radius: 6px;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  font-size: 16px;
  flex-shrink: 0;
}

.graph-toolbar-btn:hover {
  background-color: rgba(0, 123, 255, 0.3);
  color: #00d4ff;
  transform: translateY(-1px);
}

.graph-toolbar-btn.active {
  background-color: #007bff;
  color: white;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}

/* YouTube icon - fix the white line issue */
.youtube-icon {
  border-bottom: none !important;
  text-decoration: none !important;
  outline: none !important;
}

.youtube-icon i {
  color: #ff0000;
  font-size: 18px;
}

.youtube-icon:hover i {
  color: #ff6666;
}

/* Tooltip for buttons */
.tooltip-btn::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 10000;
}

.tooltip-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Summary statistics - make content fit */
.summary-stats {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  width: fit-content;
  margin: 0 10px;
}

.summary-stat-item {
  padding: 5px 12px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  white-space: nowrap;
}

.stat-label {
  font-weight: normal;
  color: #e0e0e0;
}

#layer1-sum .stat-value {
  color: #ff3333;
  font-weight: bold;
}

#hold-sum .stat-value {
  color: #33ff33;
  font-weight: bold;
}

/* Acknowledgement dropdown - directly visible */
.acknowledgement-container {
  margin: 0 5px;
}

.toolbar-dropdown {
  width: fit-content;
  min-width: 180px;
  max-width: 300px;
  padding: 8px;
  background-color: #3a3a3a;
  border: none;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  height: 32px;
}

.toolbar-dropdown option {
  background-color: #2b2b2b;
  color: #e0e0e0;
  padding: 8px;
}

/* Dropdowns */
.toolbar-dropdown-container {
  position: relative;
}

.toolbar-dropdown-box {
  position: absolute;
  top: 45px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  width: fit-content;
  max-width: 300px;
  max-height: 300px;
  background-color: #2b2b2b;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  padding: 12px;
  display: none;
  overflow-y: auto;
  border: 1px solid rgba(80, 80, 80, 0.5);
  backdrop-filter: blur(5px);
}

.toolbar-dropdown-box.active {
  display: block !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.toolbar-dropdown-box::-webkit-scrollbar {
  width: 0px;
  background: transparent; /* Make scrollbar transparent */
}

/* Hide scrollbar for IE, Edge and Firefox */
.toolbar-dropdown-box {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Layer filters dropdown */
.layer-filters-dropdown {
  max-height: 250px;
  overflow-y: auto;
  background-color: #2b2b2b;
  border-radius: 4px;
}

.layer-filters-dropdown label {
  display: block;
  padding: 6px 0;
  color: #e0e0e0;
  font-size: 14px;
}

.layer-filters-dropdown label:hover {
  color: #00d4ff;
}

/* Fixed collapsed toolbar state with visible expand button */
#graph-toolbar.collapsed {
  width: auto !important;
  padding: 0 10px;
}

#graph-toolbar.collapsed
  > *:not(#toolbar-toggle-btn):not(#toolbar-expand-btn):not(.toolbar-handle) {
  display: none !important;
}

#graph-toolbar.collapsed #toolbar-toggle-btn {
  display: none;
}

#graph-toolbar.collapsed #toolbar-expand-btn {
  display: flex !important;
}

#graph-toolbar:not(.collapsed) #toolbar-expand-btn {
  display: none !important;
}

/* Inline search box - new implementation */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-inline {
  display: none;
  align-items: center;
  background-color: #3a3a3a;
  border-radius: 4px;
  padding: 0 5px;
  width: 200px;
  height: 32px;
  margin-right: 5px;
  border: 1px solid #444;
}

.search-box-inline.active {
  display: flex;
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e0e0e0;
  padding: 6px 8px;
  outline: none;
  font-size: 13px;
}

#search-close {
  background: transparent;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 12px;
  padding: 0 5px;
}

#search-close:hover {
  color: #00d4ff;
}

/* Export dropdown specific styles */
.export-dropdown-box {
  min-width: 180px;
  right: 0;
  left: auto;
  transform: none;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  color: #e0e0e0;
  cursor: pointer;
  text-align: left;
  margin-bottom: 5px;
  transition: all 0.2s;
}

.export-option:hover {
  background-color: rgba(0, 123, 255, 0.2);
  color: #00d4ff;
}

.export-option i {
  width: 18px;
  text-align: center;
}

/* Make nodes and links dimmable during search */
.node,
.link-line {
  transition: opacity 0.3s ease;
}

.node.dimmed,
.link-line.dimmed {
  opacity: 0.15;
}

.node.highlighted,
.link-line.highlighted {
  opacity: 1;
}

/* Bank details dropdown styles */
#bank-details-dropdown-container {
  position: absolute;
  top: 45px;
  left: 0;
  background-color: #2b2b2b;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  padding: 12px;
  z-index: 10000;
  display: none;
  max-height: 400px;
  overflow-y: auto;
  min-width: 250px;
  border: 1px solid rgba(80, 80, 80, 0.5);
  width: fit-content;
}

#bank-details-dropdown-container.active {
  display: block;
}

.bank-columns-list {
  margin: 10px 0;
  max-height: 250px;
  overflow-y: auto;
}

.bank-column-item {
  padding: 5px 0;
  color: #e0e0e0;
}

.bank-column-item label {
  display: block;
  cursor: pointer;
}

.bank-column-item input[type="checkbox"] {
  margin-right: 8px;
}

.bank-action-btn {
  background-color: rgba(0, 123, 255, 0.3);
  border: none;
  border-radius: 4px;
  color: #e0e0e0;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.bank-action-btn:hover {
  background-color: rgba(0, 123, 255, 0.5);
  color: #ffffff;
}

/* Bank details in org chart nodes */
.bank-detail-label {
  font-size: 10px;
  font-weight: normal;
  pointer-events: none;
}

.bank-detail-value {
  font-size: 10px;
  font-weight: bold;
  pointer-events: none;
}

/* Fullscreen button styles */
.fullscreen-mode {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: #1a1a1a;
}

.fullscreen-mode #graph-svg {
  width: 100vw !important;
  height: 100vh !important;
}

/* Adjust toggle button icon */
.fa-compress {
  display: none;
}

.fullscreen-mode .fa-expand {
  display: none;
}

.fullscreen-mode .fa-compress {
  display: inline-block;
}

.add-account-button {
  margin-top: 15px;
}

/* Make draggable elements more accurate */
.draggable {
  cursor: default;
  position: fixed !important;
}

.dragging {
  cursor: move !important;
  opacity: 0.95;
}

/* Hide file input */
input[type="file"] {
  display: none;
}

/* Ensure graph takes full space */
#graph-svg {
  width: 100%;
  height: 100%;
}

/* Graph styles */
.link-line {
  stroke-width: 2px;
  cursor: pointer;
  fill: none;
}

.link-line.upward {
  stroke: #ff0000; /* Upward links are red */
}

.link-line.downward {
  stroke: #00d4ff; /* Downward links are blue */
}

/* Arrow marker styles */
#arrow-marker-down {
  fill: #00d4ff; /* Downward arrow blue */
}

#arrow-marker-up {
  fill: #ff0000; /* Upward arrow red */
}

.node text {
  font-size: 12px;
  pointer-events: none;
  fill: #fff; /* Text is white */
}

.org-node rect {
  fill: #cac7c7;
  stroke: #666;
  stroke-width: 1.5px;
}

.org-node text {
  font-size: 12px;
  pointer-events: none;
  fill: #e0e0e0;
}

.link-label-box {
  fill: #c0eef2;
  stroke: #00d4ff;
  stroke-width: 1px;
  cursor: pointer;
}

.link-label-text {
  font-size: 12px;
  pointer-events: none;
  text-anchor: middle;
  fill: #000000;
}

.node {
  cursor: pointer;
}

@keyframes dash {
  to {
    stroke-dashoffset: -20;
  }
}

.link-line.highlighted {
  stroke: #00d4ff;
  stroke-dasharray: 10 5;
  animation: dash 1s linear infinite, ease-in-out infinite;
}

/* Modal styles */
#modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.modal {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.7);
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.modal-content {
  background-color: #2b2b2b;
  padding: 20px;
  width: 400px;
  border-radius: 5px;
  position: relative;
  color: #e0e0e0;
}

.modal-close {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 18px;
  color: #e0e0e0;
}

.modal-body h3 {
  margin-top: 0;
  color: #00d4ff;
}

/* Add these form-specific styles for the modal forms */
.case-details-modal .modal-description {
  color: #ccc;
  margin-bottom: 20px;
  font-size: 14px;
}

.case-details-form {
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  color: #e0e0e0;
  margin-bottom: 5px;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 8px 10px;
  background-color: #3a3a3a;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  color: #e0e0e0;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #00d4ff;
}

.form-group input:read-only {
  background-color: #2a2a2a;
  cursor: not-allowed;
}

.form-group input.required {
  border-left: 3px solid #00d4ff;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.form-actions button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #00d4ff;
  color: #fff;
  font-weight: bold;
}

.form-actions button:hover {
  background-color: #00bfe6;
}

/* Responsive adjustments for smaller screens */
@media screen and (max-width: 1200px) {
  #graph-toolbar {
    max-width: 98%;
  }

  .graph-toolbar-btn {
    width: 32px;
    height: 32px;
  }

  .toolbar-dropdown {
    min-width: 150px;
  }
}

@media screen and (max-width: 900px) {
  .summary-stats {
    display: none;
  }

  .toolbar-dropdown {
    min-width: 120px;
    font-size: 12px;
  }
}
