/* ========================================================================= */
/*  FEEDOMETER 2.1 — SPOTLIGHT, TYPE-AHEAD & WEIGHTED GLOBAL SEARCH CSS      */
/* ========================================================================= */

.feedo-search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 99995;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.feedo-search-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.feedo-search-modal {
  width: 100%;
  max-width: 640px;
  background: var(--bg-primary, #ffffff);
  border-radius: 18px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(-10px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedo-search-backdrop.open .feedo-search-modal {
  transform: scale(1) translateY(0);
}

/* Search Input Bar with Type-Ahead Ghost Overlay */
.feedo-search-input-box {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  position: relative;
}

.feedo-search-icon {
  font-size: 1.15rem;
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.feedo-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.feedo-search-ghost {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  pointer-events: none;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: inherit;
  color: #94a3b8;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  z-index: 1;
  line-height: 1.4;
}

.feedo-search-ghost .ghost-typed {
  visibility: hidden;
}

.feedo-search-ghost .ghost-suggestion {
  color: #94a3b8;
  opacity: 0.85;
}

.feedo-search-ghost .ghost-tab-hint {
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.45rem;
  color: #64748b;
  vertical-align: middle;
}

.feedo-search-input {
  position: relative;
  z-index: 2;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  outline: none;
  font-family: inherit;
  line-height: 1.4;
}

.feedo-search-kbd {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  background: #f8fafc;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 4px;
  color: var(--text-muted, #64748b);
  font-family: monospace;
  flex-shrink: 0;
}

/* Scopes Bar (All, Menu, Articles, Saved) */
.feedo-search-scopes {
  display: flex;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  background: #fafafa;
}

.feedo-search-scope-pill {
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color, #e2e8f0);
  background: #ffffff;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.feedo-search-scope-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.feedo-search-scope-pill.active {
  background: var(--text-primary, #0f172a);
  color: #ffffff;
  border-color: var(--text-primary, #0f172a);
}

/* Substring Highlight */
.search-highlight {
  font-weight: 750;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
  border-radius: 2px;
  padding: 0 1px;
}

/* Results Area */
.feedo-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.4rem 0.5rem;
}

.feedo-search-section-label {
  padding: 0.55rem 0.85rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #94a3b8);
}

.feedo-recent-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem 0.75rem;
}

.feedo-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.feedo-recent-chip:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
}

.feedo-search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
  margin-bottom: 2px;
}

.feedo-search-result-item:hover,
.feedo-search-result-item.selected {
  background: #f1f5f9;
}

.result-item-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.result-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.result-item-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.result-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.result-item-sub {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.result-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.result-item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  text-transform: uppercase;
}

.result-item-badge.badge-menu { background: #e0f2fe; color: #0369a1; }
.result-item-badge.badge-articles { background: #fef3c7; color: #92400e; }
.result-item-badge.badge-saved { background: #fce7f3; color: #9d174d; }
.result-item-badge.badge-folders { background: #dcfce7; color: #166534; }

/* Footer Guide */
.feedo-search-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card-hover, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.feedo-search-footer kbd {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-family: monospace;
}
