/* ═══════════════════════════════════════════════════════════
   Learnovate Qatar — Autocomplete Search  v1.0.0
   ═══════════════════════════════════════════════════════════ */

/* ── Dropdown (appended to <body>, position:absolute) ───────── */
.lnq-ac-dropdown {
	position: absolute;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .13);
	z-index: 99999;
	overflow: hidden;
	min-width: 300px;
	font-family: inherit;
}

/* ── Filter tabs ─────────────────────────────────────────────── */
.lnq-ac-filters {
	display: flex;
	gap: 6px;
	padding: 12px 14px 10px;
	border-bottom: 1px solid #f0f0f0;
	background: #fafafa;
}
.lnq-ac-filter {
	padding: 5px 14px;
	border-radius: 20px;
	border: 1.5px solid #ddd;
	background: #fff;
	font-size: .78rem;
	font-weight: 600;
	cursor: pointer;
	color: #555;
	line-height: 1;
	transition: background .15s, border-color .15s, color .15s;
}
.lnq-ac-filter:hover {
	border-color: #d0202e;
	color: #d0202e;
}
.lnq-ac-filter.is-active {
	background: #d0202e;
	border-color: #d0202e;
	color: #fff;
}

/* ── Scrollable body ─────────────────────────────────────────── */
.lnq-ac-body {
	max-height: 380px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* ── Loading state ───────────────────────────────────────────── */
.lnq-ac-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 16px;
	font-size: .88rem;
	color: #999;
}
.lnq-ac-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #eee;
	border-top-color: #d0202e;
	border-radius: 50%;
	animation: lnq-spin .7s linear infinite;
	flex-shrink: 0;
}
@keyframes lnq-spin { to { transform: rotate(360deg); } }

/* ── Results list ────────────────────────────────────────────── */
.lnq-ac-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}
.lnq-ac-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	transition: background .1s;
	border-bottom: 1px solid #f8f8f8;
}
.lnq-ac-item:last-child {
	border-bottom: none;
}
.lnq-ac-item:hover,
.lnq-ac-item.is-focused {
	background: #fef4f4;
}

/* Thumbnail */
.lnq-ac-thumb {
	width: 52px;
	height: 52px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f2f2f2;
	display: flex;
	align-items: center;
	justify-content: center;
}
.lnq-ac-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.lnq-ac-thumb--empty {
	background: #f5f5f5;
}

/* Info block */
.lnq-ac-info {
	flex: 1;
	min-width: 0;
}

/* Type badge */
.lnq-ac-badge {
	display: inline-block;
	font-size: .68rem;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 10px;
	margin-bottom: 4px;
	letter-spacing: .03em;
	text-transform: uppercase;
}
.lnq-ac-badge--lp_course { background: #fde8e8; color: #b01a26; }
.lnq-ac-badge--post       { background: #e8f4fd; color: #1a5f9e; }
.lnq-ac-badge--page       { background: #eaf7ee; color: #1e7a3e; }

/* Title */
.lnq-ac-title {
	display: block;
	font-size: .88rem;
	font-weight: 600;
	color: #1a1a2e;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.lnq-ac-title mark {
	background: transparent;
	color: #d0202e;
	font-weight: 700;
}

/* Excerpt */
.lnq-ac-excerpt {
	font-size: .78rem;
	color: #999;
	margin: 3px 0 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
}

/* ── Empty state ─────────────────────────────────────────────── */
.lnq-ac-empty {
	padding: 20px 16px;
	text-align: center;
	font-size: .88rem;
	color: #bbb;
	margin: 0;
}

/* ── "View all results" footer link ──────────────────────────── */
.lnq-ac-view-all {
	display: block;
	padding: 11px 16px;
	font-size: .84rem;
	font-weight: 600;
	color: #d0202e;
	text-decoration: none;
	border-top: 1px solid #f0f0f0;
	background: #fafafa;
	text-align: center;
	transition: background .15s, color .15s;
}
.lnq-ac-view-all:hover {
	background: #d0202e;
	color: #fff;
	text-decoration: none;
}

/* ── Scrollbar in body ───────────────────────────────────────── */
.lnq-ac-body::-webkit-scrollbar       { width: 4px; }
.lnq-ac-body::-webkit-scrollbar-track { background: #f9f9f9; }
.lnq-ac-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════
   SEARCH RESULTS PAGE — Filter Bar
   ═══════════════════════════════════════════════════════════ */
.lnq-search-bar {
	margin-bottom: 28px;
	padding: 14px 20px;
	background: #fff;
	border: 1px solid #e4e4e4;
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.lnq-sf-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}
.lnq-sf-tabs {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.lnq-sf-label {
	font-size: .82rem;
	font-weight: 600;
	color: #888;
	margin-right: 4px;
}
.lnq-sf-tab {
	padding: 7px 18px;
	border-radius: 20px;
	border: 1.5px solid #ddd;
	background: #fff;
	font-size: .84rem;
	font-weight: 600;
	color: #555;
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s;
	line-height: 1;
}
.lnq-sf-tab:hover {
	border-color: #d0202e;
	color: #d0202e;
	text-decoration: none;
}
.lnq-sf-tab.is-active {
	background: #d0202e;
	border-color: #d0202e;
	color: #fff;
}
.lnq-sf-meta {
	font-size: .84rem;
	color: #999;
	margin: 0;
}
.lnq-sf-meta strong {
	color: #333;
	font-weight: 600;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.lnq-ac-dropdown { min-width: 0; border-radius: 10px; }
	.lnq-ac-thumb    { width: 42px; height: 42px; }
	.lnq-ac-title    { font-size: .82rem; }
	.lnq-ac-excerpt  { display: none; }

	.lnq-sf-row      { flex-direction: column; align-items: flex-start; }
	.lnq-sf-meta     { font-size: .8rem; }
}
