/**
 * مبدّل اللغات — تنسيقات الواجهة.
 *
 * وتشمل حالات الترجمة، وإخفاء أي أثر بصري لمزوّد ترجمة خارجي إن حُمّل
 * من إضافة أخرى، حتى لا يظهر للزائر إلا مبدّلنا.
 */

/* ===== المبدّل ===== */

.aioatr-lang-switcher {
	--aioatr-lang-bg: #ffffff;
	--aioatr-lang-color: #1f2937;
	--aioatr-lang-active-bg: #8b5e34;
	--aioatr-lang-active-color: #ffffff;
	--aioatr-lang-flag-size: 22px;

	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	padding: 5px;
	background: var(--aioatr-lang-bg);
	color: var(--aioatr-lang-color);
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
	direction: rtl;
	font-size: 13px;
	line-height: 1;
	box-sizing: border-box;
}

.aioatr-lang-switcher * {
	box-sizing: border-box;
}

.aioatr-lang-switcher__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 4px 9px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aioatr-lang-switcher__item:hover,
.aioatr-lang-switcher__item:focus-visible {
	background: rgba(15, 23, 42, 0.06);
	outline: none;
}

.aioatr-lang-switcher__item.is-active {
	background: var(--aioatr-lang-active-bg);
	border-color: transparent;
	color: var(--aioatr-lang-active-color);
}

.aioatr-lang-switcher__flag {
	display: block;
	width: var(--aioatr-lang-flag-size);
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
	flex: none;
}

.aioatr-lang-switcher__name {
	display: inline-block;
}

/* ===== القائمة المنسدلة ===== */

.aioatr-lang-switcher--dropdown {
	padding: 4px 8px;
	gap: 8px;
}

.aioatr-lang-switcher__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	color: inherit;
}

.aioatr-lang-switcher__select {
	margin: 0;
	padding: 5px 10px;
	border: 1px solid rgba(15, 23, 42, 0.15);
	border-radius: 999px;
	background: var(--aioatr-lang-bg);
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1.4;
	cursor: pointer;
	max-width: 220px;
}

.aioatr-lang-switcher__select:focus-visible {
	outline: 2px solid var(--aioatr-lang-active-bg);
	outline-offset: 1px;
}

/* ===== الزر العائم ===== */

.aioatr-lang-switcher--floating {
	position: fixed;
	bottom: 18px;
	z-index: 99990;
	padding: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 999px;
}

.aioatr-lang-switcher--floating.aioatr-lang-switcher--bottom-right {
	right: 18px;
	left: auto;
}

.aioatr-lang-switcher--floating.aioatr-lang-switcher--bottom-left {
	left: 18px;
	right: auto;
}

.aioatr-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: none;
	border-radius: 999px;
	background: var(--aioatr-lang-active-bg);
	color: var(--aioatr-lang-active-color);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}

.aioatr-lang-switcher__toggle:focus-visible {
	outline: 2px solid var(--aioatr-lang-bg);
	outline-offset: 2px;
}

.aioatr-lang-switcher__globe {
	display: inline-block;
	width: 16px;
	height: 16px;
	flex: none;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 100 20 10 10 0 000-20zm6.93 6h-2.95a15.6 15.6 0 00-1.4-3.56A8.03 8.03 0 0118.93 8zM12 4.04c.83 1.2 1.48 2.53 1.87 3.96h-3.74A13.6 13.6 0 0112 4.04zM4.26 14a8.12 8.12 0 010-4h3.38a16.4 16.4 0 000 4H4.26zm.81 2h2.95c.34 1.27.8 2.47 1.4 3.56A8.03 8.03 0 015.07 16zm2.95-8H5.07a8.03 8.03 0 014.35-3.56A15.6 15.6 0 008.02 8zM12 19.96a13.6 13.6 0 01-1.87-3.96h3.74A13.6 13.6 0 0112 19.96zM14.34 14H9.66a14.1 14.1 0 010-4h4.68a14.1 14.1 0 010 4zm.65 5.56c.6-1.09 1.06-2.29 1.4-3.56h2.95a8.03 8.03 0 01-4.35 3.56zM16.36 14a16.4 16.4 0 000-4h3.38a8.12 8.12 0 010 4h-3.38z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 100 20 10 10 0 000-20zm6.93 6h-2.95a15.6 15.6 0 00-1.4-3.56A8.03 8.03 0 0118.93 8zM12 4.04c.83 1.2 1.48 2.53 1.87 3.96h-3.74A13.6 13.6 0 0112 4.04zM4.26 14a8.12 8.12 0 010-4h3.38a16.4 16.4 0 000 4H4.26zm.81 2h2.95c.34 1.27.8 2.47 1.4 3.56A8.03 8.03 0 015.07 16zm2.95-8H5.07a8.03 8.03 0 014.35-3.56A15.6 15.6 0 008.02 8zM12 19.96a13.6 13.6 0 01-1.87-3.96h3.74A13.6 13.6 0 0112 19.96zM14.34 14H9.66a14.1 14.1 0 010-4h4.68a14.1 14.1 0 010 4zm.65 5.56c.6-1.09 1.06-2.29 1.4-3.56h2.95a8.03 8.03 0 01-4.35 3.56zM16.36 14a16.4 16.4 0 000-4h3.38a8.12 8.12 0 010 4h-3.38z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.aioatr-lang-switcher__panel {
	position: absolute;
	bottom: calc(100% + 10px);
	right: 0;
	display: none;
	flex-direction: column;
	gap: 4px;
	min-width: 170px;
	padding: 6px;
	background: var(--aioatr-lang-bg);
	color: var(--aioatr-lang-color);
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
	direction: rtl;
}

.aioatr-lang-switcher--bottom-left .aioatr-lang-switcher__panel {
	right: auto;
	left: 0;
}

.aioatr-lang-switcher.is-open .aioatr-lang-switcher__panel {
	display: flex;
}

.aioatr-lang-switcher__panel .aioatr-lang-switcher__item {
	border-color: transparent;
	justify-content: flex-start;
	padding: 8px 10px;
	border-radius: 10px;
}

/* ===== إخفاء أي أثر بصري لمزوّد ترجمة خارجي (دفاع احتياطي) ===== */

iframe.skiptranslate,
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-gadget-icon,
.goog-logo-link,
.goog-te-balloon-frame,
#google_translate_element,
.goog-te-spinner-pos {
	display: none !important;
	visibility: hidden !important;
}

.goog-tooltip,
.goog-tooltip:hover {
	display: none !important;
}

.goog-text-highlight {
	background: none !important;
	box-shadow: none !important;
}

/* ===== حالات الترجمة ===== */

.aioatr-lang-switcher.is-translating .aioatr-lang-switcher__item.is-active::after {
	content: '';
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-inline-start: 5px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: aioatr-lang-spin 0.7s linear infinite;
}

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

.aioatr-lang-switcher.is-error {
	box-shadow: 0 0 0 2px #d63638, 0 2px 10px rgba(15, 23, 42, 0.08);
}

.aioatr-lang-switcher__retry {
	margin: 0;
	padding: 4px 10px;
	border: 1px solid #d63638;
	border-radius: 999px;
	background: #ffffff;
	color: #b32d2e;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
}

.aioatr-lang-switcher__retry:hover,
.aioatr-lang-switcher__retry:focus-visible {
	background: #fcf0f1;
	outline: none;
}

/* ===== استجابة الشاشات الصغيرة ===== */

@media (max-width: 600px) {
	.aioatr-lang-switcher {
		gap: 4px;
		padding: 4px;
	}

	.aioatr-lang-switcher__item {
		padding: 4px 7px;
		font-size: 12px;
	}

	.aioatr-lang-switcher__name {
		display: none;
	}

	.aioatr-lang-switcher__panel .aioatr-lang-switcher__name {
		display: inline-block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aioatr-lang-switcher__item,
	.aioatr-lang-switcher__toggle {
		transition: none;
	}
}

/* ===== حالة المبدّل ومعاينته في لوحة التحكم ===== */

.aioatr-translation-status {
	margin: 0 0 18px;
	padding: 12px 16px;
	border-radius: 10px;
	background: #f6f7f7;
	border-inline-start: 4px solid #c3c4c7;
}

.aioatr-translation-status p {
	margin: 4px 0;
	font-size: 13px;
}

.aioatr-translation-status.is-good {
	background: #f0f6f0;
	border-inline-start-color: #46b450;
}

.aioatr-translation-status.is-warn {
	background: #fff8e5;
	border-inline-start-color: #dba617;
}

.aioatr-translation-status.is-bad {
	background: #fcf0f1;
	border-inline-start-color: #d63638;
}

.aioatr-translation-preview {
	padding: 18px;
	background: #f6f7f7;
	border-radius: 10px;
}
/* ===== حاوية العرض التلقائي ===== */

.aioatr-lang-switcher-auto {
	position: relative;
	z-index: 9990;
	display: flex;
	justify-content: center;
	padding: 10px 16px;
	direction: rtl;
	background: #ffffff;
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.aioatr-lang-switcher-auto--footer {
	border-bottom: 0;
	border-top: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
}

@media (max-width: 600px) {
	.aioatr-lang-switcher-auto {
		padding: 8px 10px;
	}
}