/*
 * Header search autocomplete: shared by every theme (abid-2026, abid-two) so the dropdown looks identical.
 * Styled with the abid-2026 design tokens (Inter, #111827 text, #e5e7eb borders, brand blue #0047B6,
 * pill tags as on the relationship cards). Selectors are anchored on #global-search-autocomplete so they win
 * over each theme's own header rules. Geometry assumes the dropdown's parent is the `.search-input` box.
 */
@font-face {
	font-family: "ArrowheadSearchInter";
	src: url("fonts/Inter-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

.search-input {
	position: relative;
}

/* Thin progress line under the input while the server request is in flight. */
.search-input.loading::before {
	content: "";
	position: absolute;
	bottom: -1px;
	left: 12px;
	right: 12px;
	height: 2px;
	border-radius: 2px;
	background-color: #0047b6;
	transform: scaleX(0);
	transform-origin: left;
	animation: arrowhead-search-flow 1.4s infinite ease-in-out;
	z-index: 99;
}

@keyframes arrowhead-search-flow {
	0% { transform: scaleX(0); transform-origin: left; }
	50% { transform: scaleX(1); transform-origin: left; }
	51% { transform-origin: right; }
	100% { transform: scaleX(0); transform-origin: right; }
}

/* Floating card */
#global-search-autocomplete.autocomplete-suggestions {
	position: absolute;
	top: calc(100% + 6px);
	/* left/width are set by global-search.js to span the content area; these are the no-JS fallback. */
	left: 0;
	right: 0;
	width: auto;
	/* The abid-2026 header caps this at 50% with a more specific rule, so this one must win. */
	max-width: none !important;
	min-width: 0 !important;
	max-height: min(75vh, 600px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
	box-sizing: border-box;
	margin: 0;
	padding: 8px 8px 0;
	scroll-padding-bottom: 56px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
	z-index: 1000;
	text-align: left !important;
	font-family: "Inter", "ArrowheadSearchInter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 22px;
	color: #111827;
}

/* Group headings */
#global-search-autocomplete.autocomplete-suggestions .ac-heading {
	margin: 0;
	padding: 12px 12px 6px;
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: left !important;
	color: #6b7280;
	background: none;
	border: 0;
}

#global-search-autocomplete.autocomplete-suggestions .ac-heading:first-child {
	padding-top: 6px;
}

/* Rows */
#global-search-autocomplete.autocomplete-suggestions > div {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	line-height: 22px;
	text-align: left;
	color: #111827;
	background: none;
	transition: background-color 0.12s ease;
}

#global-search-autocomplete.autocomplete-suggestions > div:hover,
#global-search-autocomplete.autocomplete-suggestions > div.is-active {
	background-color: #f3f4f6;
}

#global-search-autocomplete.autocomplete-suggestions a {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 11px 12px;
	color: #111827;
	text-decoration: none;
}

#global-search-autocomplete.autocomplete-suggestions .ac-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#global-search-autocomplete.autocomplete-suggestions strong {
	font-weight: 700;
	color: inherit;
}

/* Type pills (same palette as the relationship-card tags) */
#global-search-autocomplete.autocomplete-suggestions a > span[class^="result-type-"] {
	flex: 0 0 auto;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 1px 9px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 18px;
}

#global-search-autocomplete.autocomplete-suggestions span.result-type-company { background: #eef2ff; color: #1e40af; }
#global-search-autocomplete.autocomplete-suggestions span.result-type-activity { background: #f3f4f6; color: #4b5563; }

/* Secondary text: ticker, company count, company name */
#global-search-autocomplete.autocomplete-suggestions small {
	flex: 0 1 auto;
	max-width: 42%;
	margin: 0 0 0 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	color: #6b7280;
}

/* "See all results" footer row */
/* Pinned to the bottom of the panel so it stays visible however long the list is. */
#global-search-autocomplete.autocomplete-suggestions > div.ac-all {
	position: sticky;
	bottom: 0;
	z-index: 1;
	margin: 6px -8px 0;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	border-radius: 0 0 9px 9px;
}

#global-search-autocomplete.autocomplete-suggestions > div.ac-all:hover,
#global-search-autocomplete.autocomplete-suggestions > div.ac-all.is-active {
	background-color: #f3f4f6;
}

#global-search-autocomplete.autocomplete-suggestions > div.ac-all a {
	padding: 12px 20px;
	font-weight: 500;
	color: #0047b6;
}

#global-search-autocomplete.autocomplete-suggestions > div.ac-all .ac-title::after {
	content: " →";
}

@media (max-width: 767px) {
	#global-search-autocomplete.autocomplete-suggestions {
		right: 0;
		width: auto;
		min-width: 0;
		max-height: 65vh;
	}

	#global-search-autocomplete.autocomplete-suggestions small {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.search-input.loading::before { animation: none; transform: scaleX(1); }
	#global-search-autocomplete.autocomplete-suggestions > div { transition: none; }
}
