/* kai-search.css: loaded after kai.css. Header live-search dropdown (matches the reference site
   .suggestion / .aitem-wrapper.mini.sugg / .sfoot) + /browse search-as-you-type state. */

#search .inner #search-suggest {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 9999;
	width: 100%;
	max-height: min(78vh, 640px);
	margin-top: 7px;
	padding: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: left;
	background-color: #1c2228;
	border: 0;
	border-radius: 16.8px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
	scrollbar-width: thin;
}
#search .inner #search-suggest .result { padding: 0; }

/* Items */
#search-suggest .aitem-wrapper.mini.sugg { display: flex; flex-direction: column; gap: 0; }
#search-suggest .aitem-wrapper.mini.sugg .aitem {
	display: flex;
	align-items: center;
	padding: 14px 19.6px;
	color: #fff;
	border-radius: 0;
	background: transparent;
	text-decoration: none;
	transition: background-color .15s;
}
#search-suggest .aitem-wrapper.mini.sugg .aitem:nth-child(2n) { background-color: rgba(0, 0, 0, .1); }
#search-suggest .aitem-wrapper.mini.sugg .aitem:hover,
#search-suggest .aitem-wrapper.mini.sugg .aitem.active { background-color: #20272e !important; }
#search-suggest .aitem-wrapper.mini.sugg .aitem.active { box-shadow: inset 3px 0 0 #e45f3a; }
#search-suggest .aitem-wrapper.mini.sugg .poster {
	flex: 0 0 60.2px;
	width: 60.2px;
	height: 60.2px;
	margin-right: 11.2px;
	overflow: hidden;
	border-radius: 8.4px;
	background: #181d22;
}
#search-suggest .aitem-wrapper.mini.sugg .poster > div { position: relative; width: 100%; height: 100%; padding: 0; }
#search-suggest .aitem-wrapper.mini.sugg .poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#search-suggest .aitem-wrapper.mini.sugg .detail { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; }
#search-suggest .aitem-wrapper.mini.sugg .title {
	margin: 0 0 2.8px;
	overflow: hidden;
	color: #fff;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	white-space: nowrap;
	text-overflow: ellipsis;
}
#search-suggest .aitem-wrapper.mini.sugg .alt {
	margin: -1px 0 2px;
	overflow: hidden;
	color: rgba(255, 255, 255, .5);
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}
#search-suggest .aitem-wrapper.mini.sugg .info { margin-top: 4px; flex-wrap: nowrap; overflow: hidden; }
#search-suggest .aitem-wrapper.mini.sugg .info > span { white-space: nowrap; }
#search-suggest .aitem-wrapper.mini.sugg .info > span + span { margin-left: 11px; }
#search-suggest .aitem-wrapper.mini.sugg .info > span:not(.sub):not(.dub) { color: rgba(255, 255, 255, .7); font-size: 12.6px; }
#search-suggest .aitem-wrapper.mini.sugg .info .ep { color: #36cb68; }
#search-suggest .aitem-wrapper.mini.sugg .info .ep i { margin-right: 3px; font-size: 10px; }
#search-suggest mark {
	padding: 0;
	color: #e45f3a;
	background: none;
	font-weight: 500;
}

/* "View all results" footer */
#search-suggest .sfoot { padding: 14px; text-align: center; }
#search-suggest .sfoot .more-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 8px;
	color: #fff;
	font-size: 14px;
	opacity: .5;
	border-radius: 8.4px;
	text-decoration: none;
	transition: opacity .15s;
}
#search-suggest .sfoot .more-btn:hover,
#search-suggest .sfoot .more-btn.active { opacity: 1; }
#search-suggest .sfoot .more-btn.active { box-shadow: 0 0 0 1px rgba(228, 95, 58, .7); }

/* Loading / empty states */
#search-suggest .kai-sugg-loading {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 16px 19.6px;
	color: rgba(255, 255, 255, .55);
	font-size: 13px;
}
#search-suggest .kai-sugg-loading[style*="none"] { display: none !important; }
#search-suggest .kai-spinner {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .15);
	border-top-color: #e45f3a;
	border-radius: 50%;
	animation: kai-search-spin .7s linear infinite;
}
#search .inner #search-suggest.is-loading::before {
	content: "";
	position: sticky;
	top: 0;
	z-index: 1;
	display: block;
	width: 35%;
	height: 2px;
	margin-bottom: -2px;
	background: #e45f3a;
	animation: kai-search-bar 1s ease-in-out infinite;
}
#search-suggest .kai-sugg-empty {
	padding: 18px 19.6px;
	color: rgba(255, 255, 255, .55);
	font-size: 13px;
	text-align: center;
}
#search-suggest .kai-sugg-empty i { margin-right: 6px; opacity: .7; }

@keyframes kai-search-spin { to { transform: rotate(360deg); } }
@keyframes kai-search-bar {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(290%); }
}
@media (prefers-reduced-motion: reduce) {
	#search-suggest .kai-spinner,
	#search .inner #search-suggest.is-loading::before { animation-duration: 2.5s; }
}

/* Tablet / mobile: the search panel opens from the icon (header agent owns the panel). */
@media (max-width: 1059.9px) {
	#search .inner #search-suggest { max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); }
}
@media (max-width: 639.9px) {
	#search-suggest .aitem-wrapper.mini.sugg .aitem { padding: 10px 14px; }
	#search-suggest .aitem-wrapper.mini.sugg .poster { flex-basis: 50px; width: 50px; height: 50px; margin-right: 10px; }
	#search-suggest .aitem-wrapper.mini.sugg .title { font-size: 13.5px; }
}

/* /browse search-as-you-type (Theme Panel > Search) */
.kai-results-loading .browse-list,
.kai-results-loading .anime-empty-state { opacity: .45; transition: opacity .15s; pointer-events: none; }
