/* ═══════════════════════════════════════════════════════════════════════════ */
/* BR Search Engine — Network Search Modal (Spotlight style)                   */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Modal overlay ─── */
.brse-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 12vh;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s;
}

.brse-modal.is-open {
	opacity: 1;
	visibility: visible;
}

/* Backdrop */
.brse-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* ─── Dialog ─── */
.brse-modal__dialog {
	position: relative;
	width: 680px;
	max-width: calc(100vw - 32px);
	max-height: 70vh;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 2147483647;
	transform: translateY(8px) scale(0.98);
	transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
	            opacity 0.28s ease;
}

.brse-modal.is-open .brse-modal__dialog {
	transform: translateY(0) scale(1);
}

/* ─── Header ─── */
.brse-modal__header {
	width: 100%;
	position: relative;
	background-color: #e5f5fb;
	padding: 16px 24px;
	border-bottom: 2px solid #009dd9;
	display: flex;
	align-items: center;
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
	flex-shrink: 0;
}

.brse-modal__header-inner {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.brse-modal__header-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: #1a1a1a;
}

.brse-modal__header-desc {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: #4a4a4a;
}

.brse-modal__close {
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 24px;
	font-weight: bold;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease;
	color: #1a1a1a;
	padding: 0;
	line-height: 1;
}

.brse-modal__close:hover {
	opacity: 1;
}

/* ─── Input ─── */
.brse-modal__input-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 24px;
	border-bottom: 1px solid #f0f0f0;
	flex-shrink: 0;
}

.brse-modal__input-wrap svg {
	flex-shrink: 0;
	color: #b0b0b0;
}

.brse-modal__input {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	font-size: 1.05rem;
	color: #1a1a1a;
	background: none;
	font-weight: 400;
}

.brse-modal__input::placeholder {
	color: #b0b0b0;
}

.brse-modal__kbd {
	flex-shrink: 0;
	font-family: inherit;
	font-size: 0.65rem;
	font-weight: 600;
	color: #bbb;
	background: #f5f5f5;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	padding: 2px 7px;
	line-height: 1.4;
}

/* ─── Site filter pills ─── */
.brse-modal__filters {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	padding: 12px 24px;
	border-bottom: 1px solid #f0f0f0;
	flex-shrink: 0;
}

.brse-modal__filters:empty {
	display: none;
}

/* Forces a wrap so "All" + main site stay on the first row. */
.brse-modal__filter-break {
	flex-basis: 100%;
	width: 100%;
	height: 0;
}

.brse-modal__filter {
	background: none;
	border: 1.5px solid #e0e0e0;
	color: #777;
	font-size: 0.72rem;
	font-weight: 600;
	padding: 4px 14px;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
	letter-spacing: 0.02em;
}

.brse-modal__filter:hover {
	border-color: #009cd6;
	color: #fff;
	background: #009cd6;
}

.brse-modal__filter.is-active {
	background: #009cd6;
	border-color: #009cd6;
	color: #fff;
}

/* ─── Results ─── */
.brse-modal__results {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

.brse-modal__results:empty {
	display: none;
}

.brse-modal__loading,
.brse-modal__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 36px 24px;
	color: #aaa;
	font-size: 0.88rem;
}

.brse-modal__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #e0e0e0;
	border-top-color: #0e73b9;
	border-radius: 50%;
	animation: brse-spin 0.6s linear infinite;
}

@keyframes brse-spin {
	to { transform: rotate(360deg); }
}

/* ─── Group header (site separator) ─── */
.brse-modal__group-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 24px 8px;
	background: #f8f9fa;
	border-bottom: 1px solid #eee;
	position: sticky;
	top: 0;
	z-index: 1;
}

.brse-modal__group-label {
	font-size: 0.68rem;
	font-weight: 600;
	color: #fff;
	background: #009cd6;
	padding: 2px 8px;
	border-radius: 8px;
	letter-spacing: 0.01em;
}

/* ─── Result item ─── */
.brse-modal__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 24px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f5f5f5;
	transition: background 0.1s;
}

.brse-modal__item:last-child {
	border-bottom: none;
}

.brse-modal__item:hover,
.brse-modal__item.is-focused {
	background: #f5f8fc;
}

.brse-modal__item-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.brse-modal__item-title {
	font-size: 0.88rem;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.brse-modal__item:hover .brse-modal__item-title,
.brse-modal__item.is-focused .brse-modal__item-title {
	color: #0e73b9;
}

.brse-modal__item-breadcrumb {
	font-size: 0.72rem;
	color: #999;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.brse-modal__item-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ─── Site badge (color assigned inline by JS via hash) ─── */
.brse-modal__badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 8px;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
	background: #e5f5fb;
	color: #009cd6;
}

.brse-modal__type {
	font-size: 0.75rem;
	color: #999;
	white-space: nowrap;
}

.brse-modal__date {
	font-size: 0.75rem;
	color: #bbb;
	white-space: nowrap;
}

/* ─── Footer (keyboard hints) ─── */
.brse-modal__footer {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 24px;
	border-top: 1px solid #f0f0f0;
	background: #fafafa;
	font-size: 0.7rem;
	color: #bbb;
	flex-shrink: 0;
}

.brse-modal__footer kbd {
	display: inline-block;
	font-family: inherit;
	font-size: 0.62rem;
	font-weight: 600;
	color: #aaa;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1px 5px;
	margin-right: 2px;
	line-height: 1.4;
}

/* ─── Query highlight on landing page ─── */
mark.brse-hl {
	background: #e5f5fb;
	color: inherit;
	padding: 0 1px;
	border-radius: 8px;
	box-shadow: 0 0 0 1px rgba(0, 157, 217, 0.35);
}

/* ─── Responsive ─── */
@media (max-width: 720px) {
	.brse-modal {
		padding-top: 5vh;
	}

	.brse-modal__dialog {
		max-height: 85vh;
		border-radius: 8px;
	}

	.brse-modal__header {
		padding: 12px 16px;
	}

	.brse-modal__close {
		font-size: 18px;
	}

	.brse-modal__item {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.brse-modal__item-title,
	.brse-modal__item-breadcrumb {
		white-space: normal;
	}

	.brse-modal__footer {
		display: none;
	}
}
