.popup-menu {
  max-height: 90vh;
  display: none;
  padding: 0;
  background-color: #aaaaaa;
  position: absolute;
  z-index: 9000;
  border-radius: 16px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.15), 
    0 2px 6px rgba(0, 0, 0, 0.05);
}

.menu-scroll-container {
  padding: 20px;
  width: 88vw;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #6e8efb #f5f5ff;
  
  /* Use flexbox for horizontal layout */
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

/* Custom scrollbar for Webkit browsers */
.menu-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.menu-scroll-container::-webkit-scrollbar-track {
  background: #f5f5ff;
  border-radius: 0 12px 12px 0;
}

.menu-scroll-container::-webkit-scrollbar-thumb {
  background: #6e8efb;
  border-radius: 4px;
}

.menu-group-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

/* Major area sections */
.menu-area {
  padding: 15px 25px 15px 15px; /* top right bottom left */
  border-radius: 12px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.3s ease;
  display: inline-flex;
  flex-direction: column;
}

/* Area title (large headers) */
.area-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
}

/* Container for columns within an area */
.area-columns {
  display: flex;
  gap: 20px;
}

/* Individual column within an area */
.area-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 120px;
}

/* Subsections within areas */
.menu-group {
  margin-bottom: 10px;
}

.menu-group h3 {
  color: #222222;
  padding-top: 0px;
  margin-top: 0px;
}

/* Section titles (subsection headers) */
.section-title {
  color: #030303;
  text-align: center;
  width: 100%;
  padding: 3px;
  padding-top: 0px;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
}

.menu-section {
  margin-bottom: 8px;
}

/* Node selector buttons */
.nodeSelector {
  color: #ddd;
  padding: 3px;
  background: #040404;
  border: 2px solid #ccc;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
  margin-bottom: 3px;
  font-size:8pt;
}

.nodeSelector:hover {
  background: #09090a;
  border-color: #6e8efb;
  box-shadow: 0 0 10px rgba(110, 142, 251, 0.5);
  cursor: pointer;
  transform: scale(1.02);
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@media (max-width: 768px) {
  .popup-menu {
    width: 90vw;
    left: 5vw !important;
  }
  
  .menu-scroll-container {
    width: 90vw;
  }
  
  .menu-group-container {
    flex-direction: column;
  }
  
  .area-columns {
    flex-direction: column;
  }
  
  .area-column {
    width: 100%;
  }
  
  .area-title {
    font-size: 16px;
  }
}


.popup-doc-link {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.popup-doc-link:hover {
    color: white;
    text-decoration: underline;
}

/* Search Container */
.node-search-container {
    position: relative;
    padding: 16px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-bottom: 2px solid #0a2540;
}

/* Search Input */
.node-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.node-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.node-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Search Results Dropdown */
.node-search-results {
    position: absolute;
    top: calc(100% - 8px);
    left: 16px;
    right: 16px;
    max-height: 300px;
    overflow-y: auto;
    background: #2a2a3e;
    border: 2px solid #0f3460;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.node-search-results.hidden {
    display: none;
}

/* Search Result Item */
.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(15, 52, 96, 0.5);
}

/* Result Content */
.search-result-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.search-result-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-category {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

/* Highlight matched text */
.search-highlight {
    background: rgba(255, 206, 0, 0.3);
    color: #ffd700;
    font-weight: bold;
}

/* Empty State */
.search-empty {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Custom Scrollbar */
.node-search-results::-webkit-scrollbar {
    width: 8px;
}

.node-search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.node-search-results::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 4px;
}

.node-search-results::-webkit-scrollbar-thumb:hover {
    background: #16213e;
}

