/* Knowledge base search — results, loader, typeahead */

.kb-search {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.inner-page .kb-search {
  max-width: 575px;
}

.kb-search .hero-search {
  position: relative;
  overflow: visible;
  width: 100%;
  margin-inline: auto;
}

.kb-search.is-loading .hero-search {
  opacity: 0.88;
}

@keyframes kb-search-spin {
  to { transform: rotate(360deg); }
}

.kb-search-suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(22, 12, 48, 0.18);
  border: 1px solid #e8ebf2;
  max-height: 340px;
  overflow-y: auto;
  text-align: left;
}

.kb-search-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: #1c1a24;
  text-decoration: none;
  border-bottom: 1px solid #f0f2f7;
  transition: background 0.15s ease;
}

.kb-search-suggestion:last-child {
  border-bottom: 0;
}

.kb-search-suggestion:hover,
.kb-search-suggestion.is-active {
  background: #f6f4fb;
  color: #1c1a24;
}

.kb-search-suggestion-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #ede8f7;
  color: #280669;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.kb-search-suggestion-body {
  min-width: 0;
  flex: 1;
}

.kb-search-suggestion-type {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.kb-search-suggestion-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.kb-search-suggestion-snippet {
  display: block;
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-search-suggestion-status {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #6c757d;
  text-align: center;
}

.kb-search-suggestion-footer {
  display: block;
  padding: 0.7rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #280669;
  text-decoration: none;
  background: #faf9fc;
  border-top: 1px solid #f0f2f7;
}

.kb-search-suggestion-footer:hover {
  background: #f3effa;
  color: #280669;
}

/* Search results page */
.search-page .search-hero-form-wrap {
  max-width: 575px;
}

.search-results-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(22, 12, 48, 0.07);
  padding: 1.25rem 1rem 1rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.search-results-head {
  padding: 0 0.5rem 1rem;
  border-bottom: 1px solid #e8ebf2;
  margin-bottom: 0.5rem;
  color: #5c5a68;
}

.search-results-list {
  display: flex;
  flex-direction: column;
}

.kb-search-result {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f2f7;
  transition: background 0.15s ease, transform 0.15s ease;
}

.kb-search-result:last-child {
  border-bottom: 0;
}

.kb-search-result:hover {
  background: #f8f9fc;
  color: inherit;
  transform: translateX(2px);
}

.kb-search-result-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #ede8f7, #f6f4fb);
  color: #280669;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kb-search-result-body {
  flex: 1;
  min-width: 0;
}

.kb-search-result-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 0.2rem;
}

.kb-search-result-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #280669;
}

.kb-search-result-meta {
  font-size: 0.78rem;
  color: #6c757d;
}

.kb-search-result-title {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #16151e;
  line-height: 1.35;
}

.kb-search-result-snippet {
  display: block;
  font-size: 0.9rem;
  color: #5c5a68;
  margin-top: 0.35rem;
  line-height: 1.5;
}

.kb-search-result-arrow {
  flex-shrink: 0;
  color: #280669;
  font-size: 1.25rem;
  margin-top: 0.35rem;
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.kb-search-result:hover .kb-search-result-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.search-empty {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.search-empty-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #f3effa;
  color: #280669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.search-empty h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.search-empty p {
  color: #6c757d;
  max-width: 28rem;
  margin: 0 auto;
}

/* Full-page overlay loader on submit */
.kb-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(19, 0, 65, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.kb-search-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.kb-search-overlay-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  min-width: 220px;
}

.kb-search-overlay-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  border: 3px solid #e8ebf2;
  border-top-color: #280669;
  border-radius: 50%;
  animation: kb-search-spin 0.75s linear infinite;
}

.kb-search-overlay-card p {
  margin: 0;
  font-weight: 600;
  color: #280669;
}

