/* ================================================
   SEARCH MODAL — RACLAB Professional Search UI
   Ctrl+K to open | Esc to close | ↑↓ to navigate
   ================================================ */

/* ── Topbar search button hint ── */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  color: var(--text-muted, #aaa);
  font-size: 0.85rem;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
}

.search-trigger:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent, #00bcd4);
  box-shadow: 0 0 10px rgba(0,188,212,0.15);
  color: #fff;
}

.search-trigger i {
  font-size: 0.9rem;
  color: var(--accent, #00bcd4);
}

.search-trigger .search-hint {
  font-size: 0.7rem;
  letter-spacing: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4);
  font-family: monospace;
}

/* ── Overlay backdrop ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal box ── */
.search-modal {
  width: 100%;
  max-width: 660px;
  background: rgba(14, 18, 26, 0.95);
  border: 1px solid rgba(0,188,212,0.2);
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,188,212,0.05),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.search-overlay.open .search-modal {
  transform: translateY(0);
}

/* ── Input row ── */
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.search-input-row i.search-icon {
  color: var(--accent, #00bcd4);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1.05rem;
  font-family: 'Roboto Mono', monospace;
  caret-color: var(--accent, #00bcd4);
}

.search-input-row input::placeholder {
  color: rgba(255,255,255,0.25);
}

.search-close-btn {
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: monospace;
  font-size: 0.75rem;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.search-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── Results container ── */
.search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,188,212,0.3) transparent;
}

.search-results::-webkit-scrollbar {
  width: 4px;
}
.search-results::-webkit-scrollbar-track {
  background: transparent;
}
.search-results::-webkit-scrollbar-thumb {
  background: rgba(0,188,212,0.3);
  border-radius: 4px;
}

/* ── Empty / hint state ── */
.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 0.9rem;
}

.search-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.3;
}

/* ── Category label ── */
.search-category-label {
  padding: 10px 20px 4px;
  font-size: 0.68rem;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
}

/* ── Single result item ── */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(0,188,212,0.07);
  border-left-color: var(--accent, #00bcd4);
}

.search-result-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* category colors */
.search-result-icon.cat-blog     { background: rgba(139,92,246,0.15); color: #a78bfa; }
.search-result-icon.cat-vehicle  { background: rgba(0,188,212,0.12);  color: #22d3ee; }
.search-result-icon.cat-team     { background: rgba(34,197,94,0.12);  color: #4ade80; }
.search-result-icon.cat-page     { background: rgba(251,146,60,0.12); color: #fb923c; }

.search-result-text {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  display: block;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-title mark {
  background: transparent;
  color: var(--accent, #00bcd4);
  font-weight: 700;
}

.search-result-desc {
  display: block;
  color: rgba(255,255,255,0.35);
  font-size: 0.75rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.search-result-badge.cat-blog    { background: rgba(139,92,246,0.2); color: #a78bfa; }
.search-result-badge.cat-vehicle { background: rgba(0,188,212,0.15); color: #22d3ee; }
.search-result-badge.cat-team    { background: rgba(34,197,94,0.15); color: #4ade80; }
.search-result-badge.cat-page    { background: rgba(251,146,60,0.15); color: #fb923c; }

/* ── Footer bar ── */
.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.22);
}

.search-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  font-family: monospace;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  min-width: 20px;
}

.search-footer .sf-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .search-overlay {
    padding-top: 20px;
    align-items: flex-start;
    padding-left: 10px;
    padding-right: 10px;
  }
  .search-modal {
    border-radius: 12px;
  }
  .search-hint {
    display: none;
  }
}
