/**
 * Dashboard Spotlight search.
 */

body.evst-dashboard.evst-spotlight-open {
	overflow: hidden;
}

body.evst-dashboard .evst-spotlight {
	--evst-spotlight-blur: 16px;
	--evst-spotlight-enter-ms: 220ms;
	--evst-spotlight-exit-ms: 140ms;
	--evst-spotlight-ease: cubic-bezier(0.16, 1, 0.3, 1);
	position: fixed;
	inset: 0;
	z-index: 1090;
	display: grid;
	justify-items: center;
	align-items: start;
	padding: max(12vh, 5rem) 1rem 1rem;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity var(--evst-spotlight-exit-ms) ease,
		visibility var(--evst-spotlight-exit-ms) ease;
}

body.evst-dashboard .evst-spotlight[hidden] {
	display: none;
}

body.evst-dashboard .evst-spotlight.is-opening,
body.evst-dashboard .evst-spotlight.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

body.evst-dashboard .evst-spotlight__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: color-mix(in srgb, rgb(15 23 42) 48%, transparent);
	opacity: 0;
	backdrop-filter: blur(0);
	-webkit-backdrop-filter: blur(0);
	transition:
		opacity 180ms ease-out,
		backdrop-filter 180ms ease-out;
}

body.evst-dashboard .evst-spotlight.is-opening .evst-spotlight__backdrop,
body.evst-dashboard .evst-spotlight.is-open .evst-spotlight__backdrop {
	opacity: 1;
	backdrop-filter: blur(var(--evst-spotlight-blur));
	-webkit-backdrop-filter: blur(var(--evst-spotlight-blur));
}

body.evst-dashboard .evst-spotlight__panel {
	position: relative;
	z-index: 1091;
	width: min(40rem, calc(100vw - 2rem));
	max-height: min(70vh, 42rem);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	color: var(--tblr-body-color);
	background: color-mix(in srgb, var(--tblr-bg-surface, #fff) 92%, transparent);
	border: 1px solid color-mix(in srgb, var(--tblr-border-color) 72%, transparent);
	border-radius: 1rem;
	box-shadow: 0 2rem 5rem rgba(15, 23, 42, 0.32), 0 0.5rem 1.5rem rgba(15, 23, 42, 0.16);
	opacity: 0;
	transform: translateY(-12px) scale(0.96);
	transform-origin: center top;
	transition:
		opacity var(--evst-spotlight-exit-ms) ease,
		transform var(--evst-spotlight-exit-ms) ease;
}

body.evst-dashboard .evst-spotlight.is-opening .evst-spotlight__panel,
body.evst-dashboard .evst-spotlight.is-open .evst-spotlight__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	transition:
		opacity var(--evst-spotlight-enter-ms) var(--evst-spotlight-ease),
		transform var(--evst-spotlight-enter-ms) var(--evst-spotlight-ease);
}

body.evst-dashboard .evst-spotlight.is-closing .evst-spotlight__panel {
	transform: translateY(-8px) scale(0.98);
}

body.evst-dashboard .evst-spotlight__search {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 4rem;
	padding: 0 1rem;
	border-bottom: 1px solid var(--tblr-border-color);
}

body.evst-dashboard .evst-spotlight__search-icon {
	flex: 0 0 auto;
	font-size: 1.5rem;
	color: var(--tblr-secondary);
}

body.evst-dashboard .evst-spotlight__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 3.75rem;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	box-shadow: none;
}

body.evst-dashboard .evst-spotlight__input::-webkit-search-cancel-button {
	display: none;
}

body.evst-dashboard .evst-spotlight__escape {
	padding: 0.2rem 0.45rem;
	color: var(--tblr-secondary);
	background: var(--tblr-bg-surface-secondary, rgba(98, 105, 118, 0.08));
	border: 1px solid var(--tblr-border-color);
	border-radius: 0.35rem;
	font: inherit;
	font-size: 0.7rem;
}

body.evst-dashboard .evst-spotlight__results {
	min-height: 4.5rem;
	max-height: min(54vh, 33rem);
	overflow-y: auto;
	padding: 0.5rem;
	overscroll-behavior: contain;
}

body.evst-dashboard .evst-spotlight__group + .evst-spotlight__group {
	margin-top: 0.5rem;
}

body.evst-dashboard .evst-spotlight__group-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 1.8rem;
	padding: 0 0.65rem;
	color: var(--tblr-secondary);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

body.evst-dashboard .evst-spotlight__clear {
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--tblr-primary);
	font-size: 0.72rem;
	font-weight: 600;
}

body.evst-dashboard .evst-spotlight__item {
	display: grid;
	grid-template-columns: 2.25rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.7rem;
	width: 100%;
	min-height: 3.25rem;
	padding: 0.45rem 0.65rem;
	border: 0;
	border-radius: 0.65rem;
	background: transparent;
	color: inherit;
	text-align: left;
	text-decoration: none;
	opacity: 0;
	animation: evst-spotlight-item-enter 180ms var(--evst-spotlight-ease) forwards;
	animation-delay: min(calc(var(--evst-spotlight-index, 0) * 18ms), 180ms);
}

body.evst-dashboard .evst-spotlight__item:hover,
body.evst-dashboard .evst-spotlight__item.is-active {
	background: color-mix(in srgb, var(--tblr-primary) 12%, transparent);
	color: inherit;
}

body.evst-dashboard .evst-spotlight__item-icon {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.55rem;
	background: color-mix(in srgb, var(--tblr-primary) 10%, transparent);
	color: var(--tblr-primary);
	font-size: 1.1rem;
}

body.evst-dashboard .evst-spotlight__item-copy {
	min-width: 0;
}

body.evst-dashboard .evst-spotlight__item-label,
body.evst-dashboard .evst-spotlight__item-subtitle {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.evst-dashboard .evst-spotlight__item-label {
	font-weight: 600;
}

body.evst-dashboard .evst-spotlight__item-subtitle {
	margin-top: 0.1rem;
	color: var(--tblr-secondary);
	font-size: 0.78rem;
}

body.evst-dashboard .evst-spotlight__item-arrow {
	color: var(--tblr-secondary);
	font-size: 1rem;
}

body.evst-dashboard .evst-spotlight mark {
	padding: 0;
	background: transparent;
	color: var(--tblr-primary);
	font-weight: 700;
}

body.evst-dashboard .evst-spotlight__status {
	display: grid;
	place-items: center;
	min-height: 7rem;
	padding: 1rem;
	color: var(--tblr-secondary);
	text-align: center;
}

body.evst-dashboard .evst-spotlight__status--inline {
	min-height: 0;
	padding: 0.55rem 0.75rem 0.35rem;
	font-size: 0.78rem;
}

body.evst-dashboard .evst-spotlight__footer {
	display: flex;
	justify-content: center;
	padding: 0.55rem 1rem;
	border-top: 1px solid var(--tblr-border-color);
	color: var(--tblr-secondary);
	font-size: 0.72rem;
}

@keyframes evst-spotlight-item-enter {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 575.98px) {
	body.evst-dashboard .evst-spotlight {
		padding: 0;
	}

	body.evst-dashboard .evst-spotlight__panel {
		width: 100%;
		max-height: 100dvh;
		height: 100dvh;
		border: 0;
		border-radius: 0;
		transform: translateY(-8px);
	}

	body.evst-dashboard .evst-spotlight__search {
		padding-top: env(safe-area-inset-top, 0);
		min-height: calc(4rem + env(safe-area-inset-top, 0px));
	}

	body.evst-dashboard .evst-spotlight__results {
		flex: 1 1 auto;
		max-height: none;
	}

	body.evst-dashboard .evst-spotlight__footer {
		padding-bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	body.evst-dashboard .evst-spotlight,
	body.evst-dashboard .evst-spotlight__backdrop,
	body.evst-dashboard .evst-spotlight__panel {
		transition-duration: 1ms;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	body.evst-dashboard .evst-spotlight__panel,
	body.evst-dashboard .evst-spotlight.is-opening .evst-spotlight__panel,
	body.evst-dashboard .evst-spotlight.is-open .evst-spotlight__panel,
	body.evst-dashboard .evst-spotlight.is-closing .evst-spotlight__panel {
		transform: none;
	}

	body.evst-dashboard .evst-spotlight__item {
		animation: none;
		opacity: 1;
	}
}
