/* ============================================================================
 * beecore-global-search.css — Search trigger + Modal for BeeCore
 * ----------------------------------------------------------------------------
 * All selectors are either #bc-search-modal or #bc-global-header scoped.
 * No globals. BeeCore visual language: white / #181818 / #737373 / #EAEAEA / #F5B800
 * ========================================================================== */

/* ============================================================
 * SEARCH TRIGGER (inside #bc-global-header)
 * ========================================================== */
#bc-global-header .bc-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  width: 210px;
  padding: 0 10px 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: border-color .12s ease, background-color .12s ease;
  box-sizing: border-box;
  position: relative;
  left: -16px;
  z-index: 0;
}
#bc-global-header .bc-search-trigger:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
#bc-global-header .bc-search-trigger:active {
  transform: none;
}
#bc-global-header .bc-search-trigger:focus-visible {
  outline: 2px solid #F5B800;
  outline-offset: 1px;
}

/* Search icon wrap + SVG */
#bc-global-header .bc-search-trigger .bc-search-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
#bc-global-header .bc-search-trigger .bc-search-icon {
  display: block;
  stroke: #181818;
  flex-shrink: 0;
}

/* Label text */
#bc-global-header .bc-search-trigger .bc-search-label {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  line-height: 1;
  white-space: nowrap;
}

/* Single Ctrl K shortcut keycap */
#bc-global-header .bc-search-trigger .bc-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #525252;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;

  margin-left: auto;
}

/* ============================================================
 * SEARCH MODAL
 * ========================================================== */
.bc-sm-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.bc-sm-root.is-open {
  display: flex;
}

/* Overlay */
.bc-sm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

/* Box */
.bc-sm-box {
  position: relative;
  width: 58%;
  max-width: 720px;
  min-width: 420px;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header row */
.bc-sm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.bc-sm-icon {
  flex-shrink: 0;
  stroke: #737373;
}
.bc-sm-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 15px;
  color: #181818;
  background: transparent;
  font-family: inherit;
  line-height: 1.4;
}
.bc-sm-input::placeholder {
  color: #a3a3a3;
  font-weight: 400;
}
.bc-sm-esc-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #737373;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  height: 20px;
  line-height: 1;
}
.bc-sm-esc-btn:hover {
  background: #eaeaea;
}

/* Body */
.bc-sm-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.bc-sm-group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a3a3a3;
  padding: 12px 10px 6px;
}
.bc-sm-group:first-child {
  padding-top: 4px;
}

/* Result item */
.bc-sm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .08s ease;
}
.bc-sm-item:hover,
.bc-sm-item.is-active {
  background: #faf7ed;  /* subtle BeeCore yellow tint */
}
.bc-sm-item .bc-sm-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.bc-sm-result-icon-model {
  background: #fff7e6;
  color: #b45309;
}
.bc-sm-result-icon-page {
  background: #f1f5f9;
  color: #475569;
}
.bc-sm-result-body {
  min-width: 0;
  flex: 1;
}
.bc-sm-result-label {
  font-size: 14px;
  font-weight: 500;
  color: #181818;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.bc-sm-result-sub {
  font-size: 12px;
  color: #737373;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-top: 2px;
}

/* Empty / Loading / Error states */
.bc-sm-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 14px;
  color: #a3a3a3;
}
.bc-sm-loading {
  padding: 20px 12px;
  text-align: center;
  font-size: 13px;
  color: #a3a3a3;
}
.bc-sm-error {
  padding: 10px 12px;
  font-size: 12px;
  color: #b45309;
  background: #fff7e6;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* Footer */
.bc-sm-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  color: #a3a3a3;
  flex-shrink: 0;
}
.bc-sm-khint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bc-sm-khint kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #525252;
  background: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.2;
}

/* Body scroll lock while open */
.bc-sm-open {
  overflow: hidden;
}

/* ============================================================
 * RESPONSIVE
 * ========================================================== */
@media (max-width: 900px) {
  .bc-sm-box {
    width: 92%;
    min-width: 0;
  }
}
@media (max-width: 640px) {
  #bc-global-header .bc-search-trigger .bc-search-shortcut {
    display: none;
  }
  #bc-global-header .bc-search-trigger {
    padding: 0 10px;
  }
}