/**
 * Feed search — icon trigger + modal (ReadyLaunch).
 */

/* Hide legacy inline search bars */
.bbat-header-has-feed-search .bb-rl-header-search,
.bbat-header-has-feed-search .bp-search,
.bbat-header-has-feed-search .activity-search,
.bbat-header-has-feed-search .dir-search,
.bbat-header-has-feed-search .members-search,
.bbat-header-has-feed-search .groups-search,
.bbat-header-has-feed-search #bb-rl-network-search-modal,
.bb-readylaunch-mobile-menu__wrap > form.search-form,
.bb-readylaunch-mobile-menu__wrap > form#mobile-search-form,
#subnav-filters .subnav-search,
.bbat-sidebar-feed-search + .bbat-mobile-component-search {
	display: none !important;
}

/* Icon trigger */
.bbat-feed-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
	border-radius: 50%;
	background: var(--bb-rl-background-color, #fff);
	color: var(--bb-rl-text-color, #0c0c0d);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.bbat-feed-search-trigger:hover,
.bbat-feed-search-trigger:focus-visible {
	background: var(--bb-rl-background-hover-color, #f8f8f8);
	border-color: var(--bb-rl-border-tertiary-color, #cececf);
	outline: none;
}

.bbat-feed-search-trigger i {
	font-size: 18px;
	line-height: 1;
}

.header-aside-inner .bbat-feed-search-trigger {
	margin-right: var(--bb-rl-space-100, 8px);
}

.bbat-sidebar-feed-search {
	padding: 0 var(--bb-rl-space-200, 16px) var(--bb-rl-space-200, 16px);
	margin-bottom: var(--bb-rl-space-100, 8px);
	border-bottom: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
}

@media screen and (min-width: 993px) {
	.bb-rl-left-panel > .bbat-sidebar-feed-search {
		display: none;
	}
}

.bbat-sidebar-feed-search .bbat-feed-search-trigger {
	width: 100%;
	height: 44px;
	border-radius: 999px;
}

/* Mobile drawer: search lives in header icon — hide duplicate in hamburger panel */
@media screen and (max-width: 992px) {
	.bbat-mobile-menu-wrap .bbat-sidebar-feed-search,
	.bbat-mobile-menu-wrap .bbat-mobile-component-search,
	.bb-readylaunch-mobile-menu__wrap .bbat-sidebar-feed-search,
	.bb-readylaunch-mobile-menu__wrap .bbat-mobile-component-search {
		display: none !important;
	}
}

/* Modal */
body.bbat-feed-search-open {
	overflow: hidden;
}

.bbat-feed-search-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(12px, 4vw, 32px);
	box-sizing: border-box;
	pointer-events: none;
}

.bbat-feed-search-modal.is-open {
	pointer-events: auto;
}

.bbat-feed-search-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 12, 13, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bbat-feed-search-modal.is-open .bbat-feed-search-modal__backdrop {
	opacity: 1;
}

.bbat-feed-search-modal__panel {
	position: relative;
	width: min(720px, 100%);
	max-height: min(88vh, 900px);
	display: flex;
	flex-direction: column;
	background: var(--bb-rl-background-color, #fff);
	border-radius: 16px;
	box-shadow: 0 24px 48px rgba(12, 12, 13, 0.18);
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.22s ease, opacity 0.22s ease;
	overflow: hidden;
}

.bbat-feed-search-modal.is-open .bbat-feed-search-modal__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.bbat-feed-search-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
	flex-shrink: 0;
}

.bbat-feed-search-modal__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
}

.bbat-feed-search-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: var(--bb-rl-background-secondary-color, #f6f6f6);
	color: inherit;
	cursor: pointer;
}

.bbat-feed-search-modal__close:hover {
	background: var(--bb-rl-background-secondary-hover-color, #f3f3f3);
}

.bbat-feed-search-modal__toolbar {
	display: block;
	padding: 16px 20px 12px;
	flex-shrink: 0;
}

.bbat-feed-search-modal__field {
	width: 100%;
	min-width: 0;
}

.bbat-feed-search-modal__input-wrap {
	display: flex;
	align-items: stretch;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
	border-radius: 12px;
	background: var(--bb-rl-background-color, #fff);
	box-sizing: border-box;
	padding: 0;
}

.bbat-feed-search-modal__input-wrap:focus-within {
	outline: 2px solid var(--bb-rl-primary-color, #4946fe);
	outline-offset: 1px;
	border-color: transparent;
}

.bbat-feed-search-modal__field-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	padding: 0 10px 0 var(--bb-rl-space-500, 20px);
	box-sizing: border-box;
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
	pointer-events: none;
}

.bbat-feed-search-modal__field-icon i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 18px;
	line-height: 1;
}

.bbat-feed-search-modal__field-icon i::before {
	display: block;
	line-height: 1;
}

.bbat-feed-search-modal__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	align-self: center;
	min-height: 44px;
	margin: 0;
	padding: 5px var(--bb-rl-space-500, 20px) 5px 0;
	border: none;
	border-radius: 0;
	font-size: 1rem;
	line-height: 1.4;
	background: transparent;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	box-shadow: none;
}

.bbat-feed-search-modal__input::-webkit-search-decoration,
.bbat-feed-search-modal__input::-webkit-search-cancel-button,
.bbat-feed-search-modal__input::-webkit-search-results-button {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.bbat-feed-search-modal__input:focus {
	outline: none;
	border: none;
	box-shadow: none;
}

.bbat-feed-search-modal__clear {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: 32px;
	height: 32px;
	margin: 0 var(--bb-rl-space-100, 8px) 0 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}

.bbat-feed-search-modal__clear:hover {
	background: var(--bb-rl-background-secondary-hover-color, #f3f3f3);
}

.bbat-feed-search-modal__status {
	margin: 10px 0 0;
	padding: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}

.bbat-feed-search-modal__status.is-loading::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 6px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -2px;
	animation: bbat-feed-search-spin 0.7s linear infinite;
}

@keyframes bbat-feed-search-spin {
	to {
		transform: rotate(360deg);
	}
}

.bbat-feed-search-modal__results-wrap {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bbat-feed-search-modal__results {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 20px 12px;
	-webkit-overflow-scrolling: touch;
}

.bbat-feed-search-modal__footer {
	padding: 12px 20px 20px;
	border-top: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
	flex-shrink: 0;
	text-align: center;
}

.bbat-feed-search-modal__load-more {
	min-width: 160px;
	height: 42px;
	padding: 0 24px;
	border: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
	border-radius: 999px;
	background: var(--bb-rl-background-color, #fff);
	font-weight: 600;
	cursor: pointer;
}

.bbat-feed-search-modal__load-more:hover:not(:disabled) {
	background: var(--bb-rl-background-hover-color, #f8f8f8);
}

.bbat-feed-search-modal__load-more:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Result cards */
.bbat-feed-search__card {
	padding: 14px 0;
	border-bottom: 1px solid var(--bb-rl-border-secondary-color, #e7e7e9);
}

.bbat-feed-search__card:last-child {
	border-bottom: none;
}

.bbat-feed-search__card-head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.bbat-feed-search__avatar img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: block;
}

.bbat-feed-search__meta {
	min-width: 0;
}

.bbat-feed-search__author {
	display: block;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--bb-rl-text-color, #0c0c0d);
	text-decoration: none;
}

.bbat-feed-search__time {
	display: block;
	font-size: 0.8125rem;
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}

.bbat-feed-search__content {
	margin: 10px 0 0 52px;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--bb-rl-text-color, #0c0c0d);
	word-break: break-word;
}

.bbat-feed-search__content.bbat-composer-rtl {
	direction: rtl;
	text-align: right;
}

.bbat-feed-search__content.bbat-composer-ltr {
	direction: ltr;
	text-align: left;
}

.bbat-feed-search__card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 10px 0 0 52px;
	flex-wrap: wrap;
}

.bbat-feed-search__comments {
	font-size: 0.8125rem;
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}

.bbat-feed-search__details {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--bb-rl-background-brand-primary-color, #4946fe);
	text-decoration: none;
}

.bbat-feed-search__details:hover {
	text-decoration: underline;
}

@media screen and (max-width: 600px) {
	.bbat-feed-search-modal {
		padding: 0;
		align-items: stretch;
	}

	.bbat-feed-search-modal__panel {
		width: 100%;
		max-height: 100vh;
		border-radius: 0;
	}

	.bbat-feed-search-modal__toolbar {
		padding: 16px 16px 12px;
	}

	.bbat-feed-search__content,
	.bbat-feed-search__card-foot {
		margin-left: 0;
	}
}

@media screen and (max-width: 992px) {
	.header-aside .bbat-feed-search-trigger {
		display: inline-flex !important;
		min-width: 44px;
		min-height: 44px;
	}

	.bbat-feed-search-modal__input-wrap {
		min-height: 48px;
	}

	.bbat-feed-search-modal__input {
		min-height: 48px;
		padding: 5px var(--bb-rl-space-500, 20px) 5px 0;
		font-size: 16px;
	}
}

.bbat-feed-search-modal__status.is-error {
	color: var(--bb-rl-text-danger-color, #c62828);
}

.bbat-feed-search-modal__status.is-empty {
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}

.bbat-feed-search-modal__status.is-ok {
	color: var(--bb-rl-text-secondary-color, #6b6b6f);
}
