/**
 * AI-Powered Conversational Search widget.
 *
 * Plain, hand-authored CSS (no Tailwind @apply) — this is a child-theme-only
 * component and the parent theme's Tailwind/Parcel build only scans its own
 * templates/ directory, so utility classes used only here would never be
 * compiled. Written to be self-contained and buildless.
 */

.ai-search-trigger-wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ai-search-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #121212;
	color: white;
	border: none;
	cursor: pointer;
	transition: all .2s ease-in-out;
}

.ai-search-trigger:hover {
	background: #FCC717;
}

.ai-search-trigger svg {
	width: 24px;
	height: 24px;
	color: white;
	transition: all .2s ease-in-out;
}

.ai-search-trigger:hover svg {
	color: #121212;
}

.ai-search-backdrop {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: rgba(0, 0, 0, 0.4);
}

.ai-search-panel {
	position: fixed;
	top: 8vh;
	left: 50%;
	transform: translateX(-50%);
	z-index: 61;
	width: 92vw;
	max-width: 48rem;
	max-height: 80vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.ai-search-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.ai-search-panel__title {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	font-weight: 700;
	color: #121212;
}

.ai-search-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	border: none;
	background: transparent;
	color: #121212;
	cursor: pointer;
}

.ai-search-panel__close:hover {
	background: rgba(0, 0, 0, 0.05);
}

.ai-search-panel__close svg {
	width: 1rem;
	height: 1rem;
}

.ai-search-panel__body {
	padding: 1rem 1.25rem;
}

.ai-search-chat__input-row {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.ai-search-input {
	flex: 1;
	border: 2px solid #E2E2E2;
	border-radius: 4px;
	padding: 0.75rem;
	font-size: 16px;
	line-height: 24px;
	height: 3rem;
}

.ai-search-submit {
	border: none;
	border-radius: 4px;
	background: #121212;
	color: #fff;
	padding: 0.5rem 1.5rem;
	height: 3rem;
	font-size: 18px;
	line-height: 28px;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s ease-in-out;
}

.ai-search-submit:hover {
	background: #00479b;
}

.ai-search-submit:disabled {
	opacity: 0.5;
	cursor: default;
}

.ai-search-empty-state__text {
	margin: 0;
	font-size: 14px;
	color: rgba(0, 0, 0, 0.6);
}

.ai-search-chips {
	margin-top: 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ai-search-chip {
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background: transparent;
	padding: 0.25rem 0.75rem;
	font-size: 16px;
	color: #121212;
	cursor: pointer;
	transition: background .2s ease-in-out;
}

.ai-search-chip:hover {
	background: rgba(0, 0, 0, 0.05);
}

.ai-search-chat__messages {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 50vh;
	overflow-y: auto;
}

.ai-search-chat__bubble {
	max-width: 85%;
	border-radius: 4px;
	padding: 0.5rem 0.75rem;
	font-size: 16px;
	line-height: 24px;
}

.ai-search-chat__bubble--user {
	align-self: flex-end;
	background: #121212;
	color: white;
}

.ai-search-chat__bubble--assistant {
	align-self: flex-start;
	background: rgba(0, 0, 0, 0.05);
	color: #121212;
}

.ai-search-thinking {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 14px;
	font-style: italic;
	color: rgba(0, 0, 0, 0.5);
}

.ai-search-typing {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.ai-search-typing span {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.3;
	animation: ai-search-typing-bounce 1.2s ease-in-out infinite;
}

.ai-search-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.ai-search-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes ai-search-typing-bounce {
	0%, 60%, 100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.ai-search-chat__form {
	margin-top: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 0.5rem;
	padding: 0.75rem;
}

.ai-search-link {
	text-decoration: underline;
}

.ai-search-disclaimer {
	margin: 0.75rem 0 0;
	font-size: 13px;
	line-height: 18px;
	color: rgba(0, 0, 0, 0.6);
}

.ai-search-disclaimer a {
	color: inherit;
	text-decoration: underline;
}

@media (min-width: 768px) {
	.ai-search-panel {
		width: 100%;
	}
}

/* Toggled on <html> while the modal is open — prevents the page behind it from scrolling. */
html.ai-search-scroll-lock {
	overflow: hidden;
}
