/* Search Modal overlay */
.search-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.search-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-white, #fff);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}
.search-overlay.active .search-modal {
  transform: translateY(0);
}
.search-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.search-header svg {
  color: #64748b;
  margin-right: 12px;
}
.search-header input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  background: transparent;
  color: var(--text-dark, #1e293b);
}
.search-header .close-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  transition: background 0.15s;
}
.search-header .close-btn:hover {
  background: #e2e8f0;
}
.search-results-container {
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px 20px;
}
.search-section {
  margin-bottom: 24px;
}
.search-section:last-child {
  margin-bottom: 0;
}
.search-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.search-result-item {
  display: block;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark, #1e293b);
  transition: background 0.15s;
  margin-bottom: 4px;
}
.search-result-item:hover, .search-result-item.selected {
  background: #f8fafc;
}
.search-result-item mark {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
}
.search-result-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 1rem;
}
.search-result-excerpt {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-empty {
  text-align: center;
  padding: 32px 0;
  color: #64748b;
  font-size: 0.95rem;
}
/* Header search button */
.btn-search {
  background: var(--bg-white, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-search svg {
  width: 18px;
  height: 18px;
}
.btn-search:hover {
  border-color: var(--accent-blue, #2563EB);
  color: var(--accent-blue, #2563EB);
  background: #f8fafc;
}

/* Search Pill for Desktop */
.btn-search-pill {
  background: #F7F8FA;
  border: 1px solid #E5E7EB;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0 15px; /* Matches horizontal padding */
  height: 38px; /* Explicit height to match .btn exactly */
  box-sizing: border-box;
  border-radius: 6px; /* Matches .btn */
  transition: all 0.2s ease;
  width: 260px;
  font-family: inherit;
  margin-right: 4px; /* Pull it slightly closer to the first button */
}
.btn-search-pill svg {
  color: #64748B;
  flex-shrink: 0;
  transition: color 0.2s;
  width: 15px;
  height: 15px;
}
.btn-search-pill span {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-left: 8px;
  flex: 1;
  text-align: left;
  transition: color 0.2s;
}
.btn-search-pill kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 2px 6px;
  color: #94a3b8;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  transition: all 0.2s;
}
.btn-search-pill:hover, .btn-search-pill:focus {
  border-color: var(--accent-blue, #2563EB);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
  outline: none;
}
.btn-search-pill:hover svg, .btn-search-pill:hover span, .btn-search-pill:hover kbd,
.btn-search-pill:focus svg, .btn-search-pill:focus span, .btn-search-pill:focus kbd {
  color: var(--accent-blue, #2563EB);
}
.btn-search-pill:hover kbd, .btn-search-pill:focus kbd {
  border-color: var(--accent-blue, #2563EB);
}

/* Mobile Search Bar in Menu */
.mobile-search-container {
  padding: 5px 0 15px 0;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 5px;
}
.btn-search-mobile {
  width: 100%;
  background: #F7F8FA;
  border: 1px solid #E5E7EB;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 15px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: text;
}
.btn-search-mobile svg {
  margin-right: 12px;
  color: #94A3B8;
}

@media (max-width: 768px) {
  .search-modal {
    width: 95%;
  }
}
