/* ============================================ */
/* VECTOR SEARCH PAGE                          */
/* ============================================ */

.vector-search-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 0 43px 0;
  gap: 16px;
  overflow: hidden;
  width: 100%;
  margin: 0;
}

.vector-search-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
  min-height: 0;
  position: relative;
}

.vector-search-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--padding-xs) 0 14px;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  position: relative;
}

.vector-search-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  position: relative;
}

.vector-search-title {
  margin: 0 auto;
  text-align: center;
}

.vector-search-status {
  position: absolute;
  right: 0;
  bottom: 0;
}

.vector-search-title h2 {
  font-family: 'Instrument Serif' !important;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text);
}

.vector-search-title p {
  color: var(--muted);
  font-size: 14px;
}

.vector-search-title h2 span,
.vector-search-title h2 .branding-logo {
  transform: translateY(2px);
}

.vector-search-title h2 .branding-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin-top: 3px;
}

@media (max-width: 768px) {
  .vector-search-title h2 {
    font-size: 1.5rem;
  }

  .vector-search-title h2 .branding-logo {
    width: 28px;
    height: 28px;
  }
}

.vector-search-status {
  font-size: 12px;
  color: var(--muted);
}

.vector-search-view .composer {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  top: auto;
}

.vector-search-view .composer.selector-open {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
}

.sidebar-collapsed .vector-search-view .composer {
  left: var(--sidebar-collapsed);
}

.sidebar-collapsed .vector-search-view .composer.selector-open {
  left: var(--sidebar-collapsed);
}

.vector-search-composer.is-loading .composer-box {
}

.vector-search-composer-placeholder {
  flex: 0 0 auto;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 768px) {
  .vector-search-view .composer {
    left: 0;
    right: 0;
  }

  .vector-search-view .composer.selector-open {
    left: 0;
    right: 0;
  }
}

.vector-search-results {
  display: flex;
  flex-direction: column;
  padding-bottom: 200px;
}

.vector-search-results .vector-search-result:nth-child(even) {
  background: #f4faff;
}

.vector-search-overview {
  background: var(--surface);
  border: 1px solid rgba(11, 59, 115, 0.2);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 8px auto;
  max-width: min(100%, var(--content-max-width));
  width: 100%;
}

.vector-search-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.vector-search-overview-title {
  font-family: 'Instrument Serif';
  font-size: 20px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.vector-search-overview-status {
  font-size: 12px;
  color: var(--muted);
}

.vector-search-overview-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.vector-search-overview.is-loading .vector-search-overview-body {
  color: var(--muted);
}

.vector-search-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin: 2px auto;
  max-width: min(100%, var(--content-max-width));
  width: 100%;
}

.vector-search-result:hover {
  border-color: rgba(11, 59, 115, 0.35);
}

.vector-search-result:active {
  transform: none;
}

.vector-search-result-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vector-search-result-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-surface-80);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.vector-search-result-text .vector-search-highlight {
  background: #ffe58a;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.vector-search-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.vector-search-result-doc {
  font-weight: 500;
}

.vector-search-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 6px var(--padding-xs);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
}
