/* ==========================================================================
   البحث الداخلي والخارجي — All In One Tools – Refsam
   ========================================================================== */

.aioatr-search-ui {
	--aioatr-search-border-radius: 8px;
	--aioatr-search-border-color: #e2e8f0;
	--aioatr-search-bg-input: #fff;
	--aioatr-search-bg-btn: linear-gradient(135deg, #2563eb, #1e40af);
	position: relative;
	direction: rtl;
	font-family: inherit;
}

.aioatr-search-ui .aioatr-search-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.aioatr-search-ui .aioatr-search-input,
.aioatr-search-ui .aioatr-search-btn {
	box-sizing: border-box;
	height: 34px;
	flex: 0 1 auto;
	min-width: 80px;
	border-radius: var(--aioatr-search-border-radius);
	font-size: 13px;
	transition: all .15s ease;
	text-align: center;
}

.aioatr-search-ui .aioatr-search-input {
	flex: 1;
	padding: 0 12px;
	border: 2px solid var(--aioatr-search-border-color);
	background: var(--aioatr-search-bg-input);
	color: #000;
	outline: none;
	line-height: 30px;
	min-width: 150px;
}

.aioatr-search-ui .aioatr-search-btn {
	padding: 3px 12px;
	font-weight: 600;
	background: var(--aioatr-search-bg-btn);
	color: #fff;
	border: none;
	cursor: pointer;
	white-space: nowrap;
}

.aioatr-search-ui .aioatr-search-btn:hover,
.aioatr-search-ui .aioatr-search-btn:focus {
	background: #8B0000 !important;
	transform: scale(.95);
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, .3);
}

/* نتائج البحث الداخلي */
.aioatr-search-wrapper .aioatr-search-popup {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: 400px;
	overflow-y: auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
	z-index: 999999;
	display: none;
	padding: 10px;
	box-sizing: border-box;
}

.aioatr-search-wrapper.aioatr-search-open .aioatr-search-popup {
	display: block;
}

.aioatr-search-wrapper .aioatr-search-results {
	position: static;
	max-height: none;
	overflow: visible;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	display: none;
}

.aioatr-search-result {
	padding: 16px 20px;
	border-radius: 16px;
	background: #fff;
	margin: 0 0 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
}

.aioatr-search-result h3 {
	margin: 0 0 8px;
	font-size: 1.1rem;
}

.aioatr-search-result h3 a {
	color: #1e293b;
	text-decoration: none;
}

.aioatr-search-type {
	display: inline-block;
	margin-right: 8px;
	padding: 2px 10px;
	background: #f1f5f9;
	color: #475569;
	border-radius: 30px;
	font-size: .65rem;
}

.aioatr-search-excerpt {
	color: #334155;
	font-size: .85rem;
	line-height: 1.5;
	margin: 6px 0;
}

.aioatr-search-highlight {
	background: #ffeb3b !important;
	color: #000 !important;
	padding: 1px 3px !important;
	border-radius: 3px !important;
	font-weight: bold !important;
}

.aioatr-search-stats,
.aioatr-search-pagination {
	margin-top: 10px;
	text-align: center;
	font-size: 13px;
}

.aioatr-search-page-btn {
	padding: 6px 12px;
	border: 1px solid #e2e8f0;
	background: #fff;
	border-radius: 30px;
	cursor: pointer;
	margin: 0 3px;
	font-size: 13px;
}

.aioatr-search-page-btn.active {
	background: linear-gradient(135deg, #2563eb, #1e40af);
	color: #fff;
}

.aioatr-search-error {
	padding: 16px;
	background: #fff5f5;
	border: 1px solid #fed7d7;
	border-radius: 16px;
	color: #dc2626;
	text-align: center;
	font-size: 14px;
}

.aioatr-search-loading {
	text-align: center;
	padding: 30px;
	color: #6b7280;
	font-size: 14px;
}

.aioatr-search-meta {
	color: #64748b;
	font-size: .75rem;
	margin-top: 6px;
}

.aioatr-search-overlay {
	display: none;
}

/* الموبايل */
@media (max-width: 768px) {
	.aioatr-search-ui .aioatr-search-row {
		gap: 6px;
	}

	.aioatr-search-ui .aioatr-search-input,
	.aioatr-search-ui .aioatr-search-btn {
		height: 34px;
		font-size: 13px;
	}

	.aioatr-search-ui .aioatr-search-input {
		padding: 0 10px;
		line-height: 30px;
		min-width: 120px;
		font-size: 16px;
	}

	.aioatr-search-ui .aioatr-search-btn {
		padding: 0 8px;
		min-width: 60px;
	}

	.aioatr-search-wrapper .aioatr-search-popup {
		left: 5% !important;
		right: 5% !important;
		width: auto !important;
		max-height: 70vh !important;
		z-index: 9999999 !important;
	}

	.aioatr-search-overlay {
		position: fixed !important;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, .3);
		z-index: 999999 !important;
		display: none;
	}
}
