/* ============================================================
   PRAYOGSETU UNIVERSAL SEARCH OVERLAY STYLES
   Robust, Theme-Adaptive Search Modal (Light & Dark)
   ============================================================ */

.search-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px 16px !important;
  background: rgba(4, 8, 16, 0.78) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease !important;
}

[data-theme="light"] .search-overlay,
html:not(.dark):not([data-theme="dark"]) .search-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
}

.search-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.search-panel {
  width: 100% !important;
  max-width: 660px !important;
  border-radius: 18px !important;
  background: #0f1523 !important; /* Default dark */
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, border-color 0.2s !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.search-overlay.active .search-panel {
  transform: translateY(0) scale(1) !important;
}

/* Light Theme Panel */
[data-theme="light"] .search-panel,
html:not(.dark):not([data-theme="dark"]) .search-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

/* Top Bar */
.search-panel-top {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 16px 20px !important;
  background: #0f1523 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="light"] .search-panel-top,
html:not(.dark):not([data-theme="dark"]) .search-panel-top {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Input Box */
.search-input-box {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #0b111a !important;
  border: 2px solid #0099ff !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  box-shadow: 0 0 12px rgba(0, 153, 255, 0.18) !important;
}

[data-theme="light"] .search-input-box,
html:not(.dark):not([data-theme="dark"]) .search-input-box {
  background: #f8fafc !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.15) !important;
}

.search-input-box .search-icon {
  width: 20px !important;
  height: 20px !important;
  color: #38bdf8 !important;
  flex: none !important;
}

[data-theme="light"] .search-input-box .search-icon,
html:not(.dark):not([data-theme="dark"]) .search-input-box .search-icon {
  color: #0284c7 !important;
}

.search-input-box input {
  flex: 1 !important;
  min-width: 0 !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #ffffff !important;
}

[data-theme="light"] .search-input-box input,
html:not(.dark):not([data-theme="dark"]) .search-input-box input {
  color: #0f172a !important;
}

.search-input-box input::placeholder {
  color: #64748b !important;
}

.search-clear-btn {
  background: none !important;
  border: 0 !important;
  padding: 2px !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  display: grid !important;
  place-items: center !important;
  flex: none !important;
}

.search-clear-btn:hover {
  color: #ffffff !important;
}

[data-theme="light"] .search-clear-btn:hover,
html:not(.dark):not([data-theme="dark"]) .search-clear-btn:hover {
  color: #0f172a !important;
}

.search-clear-btn svg {
  width: 15px !important;
  height: 15px !important;
}

/* Close Button */
.search-close-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  background: #182030 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  flex: none !important;
  transition: background 0.18s, color 0.18s, border-color 0.18s !important;
}

.search-close-btn:hover {
  background: #222d42 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="light"] .search-close-btn,
html:not(.dark):not([data-theme="dark"]) .search-close-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .search-close-btn:hover,
html:not(.dark):not([data-theme="dark"]) .search-close-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.search-close-btn svg {
  width: 17px !important;
  height: 17px !important;
}

/* Results Container */
.search-results-container {
  max-height: 420px !important;
  overflow-y: auto !important;
  padding: 14px 18px !important;
  background: #0f1523 !important;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

[data-theme="light"] .search-results-container,
html:not(.dark):not([data-theme="dark"]) .search-results-container {
  background: #f8fafc !important;
}

.search-results-container::-webkit-scrollbar {
  width: 8px;
}

.search-results-container::-webkit-scrollbar-thumb {
  background: #64748b !important;
  border-radius: 999px;
}

/* Results List */
.search-results-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.search-result-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 13px 18px !important;
  border-radius: 12px !important;
  background: #171f2d !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s !important;
  cursor: pointer !important;
  text-decoration: none !important;
  color: inherit !important;
}

.search-result-item:hover,
.search-result-item.selected {
  background: #1e283b !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  transform: translateX(2px) !important;
}

[data-theme="light"] .search-result-item,
html:not(.dark):not([data-theme="dark"]) .search-result-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .search-result-item:hover,
[data-theme="light"] .search-result-item.selected,
html:not(.dark):not([data-theme="dark"]) .search-result-item:hover,
html:not(.dark):not([data-theme="dark"]) .search-result-item.selected {
  background: #f0f9ff !important;
  border-color: #38bdf8 !important;
}

.search-item-left {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.search-item-ico {
  width: 22px !important;
  height: 22px !important;
  color: #38bdf8 !important;
  flex: none !important;
}

[data-theme="light"] .search-item-ico,
html:not(.dark):not([data-theme="dark"]) .search-item-ico {
  color: #0284c7 !important;
}

.search-result-main {
  min-width: 0 !important;
  flex: 1 !important;
}

.search-result-title {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.3 !important;
}

[data-theme="light"] .search-result-title,
html:not(.dark):not([data-theme="dark"]) .search-result-title {
  color: #0f172a !important;
}

.search-result-desc {
  font-size: 0.77rem !important;
  color: #7f8ea3 !important;
  font-weight: 500 !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="light"] .search-result-desc,
html:not(.dark):not([data-theme="dark"]) .search-result-desc {
  color: #64748b !important;
}

.search-item-right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: none !important;
}

.search-result-cat {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 5px 14px !important;
  border-radius: 999px !important;
  background: #1c2536 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  white-space: nowrap !important;
}

[data-theme="light"] .search-result-cat,
html:not(.dark):not([data-theme="dark"]) .search-result-cat {
  background: #e0f2fe !important;
  border: 1px solid #bae6fd !important;
  color: #0284c7 !important;
}

.search-result-arrow {
  width: 16px !important;
  height: 16px !important;
  color: #94a3b8 !important;
  flex: none !important;
  transition: transform 0.2s, color 0.2s !important;
}

.search-result-item:hover .search-result-arrow,
.search-result-item.selected .search-result-arrow {
  transform: translateX(3px) !important;
  color: #ffffff !important;
}

[data-theme="light"] .search-result-item:hover .search-result-arrow,
[data-theme="light"] .search-result-item.selected .search-result-arrow,
html:not(.dark):not([data-theme="dark"]) .search-result-item:hover .search-result-arrow,
html:not(.dark):not([data-theme="dark"]) .search-result-item.selected .search-result-arrow {
  color: #0284c7 !important;
}

/* Empty State */
.search-empty-state {
  padding: 44px 20px !important;
  text-align: center !important;
  color: #7f8ea3 !important;
}

.search-empty-state svg {
  width: 38px !important;
  height: 38px !important;
  margin: 0 auto 12px !important;
  opacity: 0.6 !important;
  color: #38bdf8 !important;
}

[data-theme="light"] .search-empty-state svg,
html:not(.dark):not([data-theme="dark"]) .search-empty-state svg {
  color: #0284c7 !important;
}

.empty-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 4px !important;
}

[data-theme="light"] .empty-title,
html:not(.dark):not([data-theme="dark"]) .empty-title {
  color: #0f172a !important;
}

.empty-sub {
  font-size: 0.82rem !important;
  color: #7f8ea3 !important;
}

[data-theme="light"] .empty-sub,
html:not(.dark):not([data-theme="dark"]) .empty-sub {
  color: #64748b !important;
}

/* Footer */
.search-panel-foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 20px !important;
  background: #0f1523 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.72rem !important;
  color: #7f8ea3 !important;
}

[data-theme="light"] .search-panel-foot,
html:not(.dark):not([data-theme="dark"]) .search-panel-foot {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}

.search-panel-foot .foot-left {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.search-panel-foot .foot-right {
  display: flex !important;
  align-items: center !important;
}

.search-panel-foot kbd {
  display: inline-block !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  background: #1a2333 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  font-size: 0.68rem !important;
  margin: 0 2px !important;
}

[data-theme="light"] .search-panel-foot kbd,
html:not(.dark):not([data-theme="dark"]) .search-panel-foot kbd {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
