.search-box {
  position: relative;
}

.search-live-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--modal-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 1200;
  padding: 8px;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: var(--colorofdetails) var(--border-color);
}

.search-live-panel::-webkit-scrollbar {
  width: 6px;
}
.search-live-panel::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 10px;
}
.search-live-panel::-webkit-scrollbar-thumb {
  background: var(--colorofdetails);
  border-radius: 10px;
}

.search-live-panel.open {
  display: block;
  animation: searchPanelIn 0.15s ease-out;
}

@keyframes searchPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-group-label {
  padding: 8px 12px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: right;
  color: var(--text-color);
  font-family: inherit;
  transition: background 0.15s;
}

.search-result-row:hover,
.search-result-row.active {
  background: var(--hover-overlay);
}

.search-result-icon {
  flex-shrink: 0;
  color: var(--colorofdetails);
}

.search-result-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.search-result-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.search-result-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-highlight {
  background: none;
  color: var(--colorofdetails);
  font-weight: 700;
}

.search-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-secondary);
  font-style: italic;
}

@media (max-width: 600px) {
  .search-live-panel {
    max-height: 300px;
    left: 4px;
    right: 4px;
  }
}
