/**
 * Yemen4Christ — i18n Modal + Floating Switcher Styles
 * Matches the site palette (brown / gold / olive / cream)
 */

/* ============================================================
   LANGUAGE SELECTION MODAL
   ============================================================ */

.y4c-i18n-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.y4c-i18n-modal.is-open {
	display: flex;
	opacity: 1;
}

.y4c-i18n-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(45, 26, 14, 0.78);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.y4c-i18n-modal__card {
	position: relative;
	background: #FDF8F0;
	border-radius: 24px;
	box-shadow: 0 24px 72px rgba(0, 0, 0, 0.35);
	width: 100%;
	max-width: 580px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(20px) scale(0.96);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	border: 1px solid rgba(201, 168, 76, 0.25);
	font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

.y4c-i18n-modal.is-open .y4c-i18n-modal__card {
	transform: translateY(0) scale(1);
}

/* Header */
.y4c-i18n-modal__header {
	padding: 32px 28px 22px;
	text-align: center;
	background: linear-gradient(135deg, #4A2C1A 0%, #6B3D25 50%, #4F5C37 100%);
	color: #fff;
	position: relative;
	overflow: hidden;
}

.y4c-i18n-modal__header::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(201, 168, 76, 0.18) 1px, transparent 1px);
	background-size: 26px 26px;
	opacity: 0.45;
	pointer-events: none;
}

.y4c-i18n-modal__icon {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(201, 168, 76, 0.2);
	border: 2px solid rgba(201, 168, 76, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
	color: #DFC06E;
	box-shadow: 0 0 28px rgba(201, 168, 76, 0.25);
}

.y4c-i18n-modal__icon svg {
	width: 32px;
	height: 32px;
}

.y4c-i18n-modal__title {
	position: relative;
	font-size: 22px;
	font-weight: 800;
	color: #fff;
	margin: 0 0 6px;
	line-height: 1.3;
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: center;
}

.y4c-i18n-modal__title-ar {
	color: #DFC06E;
	font-size: 19px;
}

.y4c-i18n-modal__title-en {
	font-size: 18px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.95);
}

.y4c-i18n-modal__subtitle {
	position: relative;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
	margin: 6px 0 0;
	line-height: 1.6;
}

/* Search */
.y4c-i18n-modal__search {
	position: relative;
	padding: 14px 22px 8px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid rgba(201, 168, 76, 0.12);
	background: #fff;
}

.y4c-i18n-modal__search svg {
	width: 18px;
	height: 18px;
	color: #6B5242;
	flex-shrink: 0;
	margin-inline-start: 4px;
}

.y4c-i18n-modal__search input {
	flex: 1;
	border: none;
	background: transparent;
	outline: none;
	font-family: inherit;
	font-size: 14px;
	color: #2D1A0E;
	padding: 8px 0;
	width: 100%;
}

.y4c-i18n-modal__search input::placeholder {
	color: #9A8270;
}

/* Grid */
.y4c-i18n-modal__grid {
	overflow-y: auto;
	padding: 12px 16px 16px;
	background: #FDF8F0;
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}

.y4c-i18n-modal__btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	background: #fff;
	border: 1.5px solid rgba(201, 168, 76, 0.18);
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.18s ease;
	font-family: inherit;
	text-align: start;
	width: 100%;
}

.y4c-i18n-modal__btn:hover,
.y4c-i18n-modal__btn:focus {
	border-color: #C9A84C;
	background: rgba(201, 168, 76, 0.05);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(201, 168, 76, 0.15);
	outline: none;
}

.y4c-i18n-modal__btn-flag {
	font-size: 22px;
	line-height: 1;
	flex-shrink: 0;
}

.y4c-i18n-modal__btn-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
	min-width: 0;
}

.y4c-i18n-modal__btn-native {
	font-size: 14px;
	font-weight: 700;
	color: #2D1A0E;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.y4c-i18n-modal__btn-name {
	font-size: 11px;
	color: #6B5242;
	font-weight: 500;
}

.y4c-i18n-modal__btn-arrow {
	width: 14px;
	height: 14px;
	color: #C9A84C;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.18s, transform 0.18s;
	flex-shrink: 0;
}

[dir="rtl"] .y4c-i18n-modal__btn-arrow,
.y4c-rtl .y4c-i18n-modal__btn-arrow {
	transform: scaleX(-1) translateX(-4px);
}

.y4c-i18n-modal__btn:hover .y4c-i18n-modal__btn-arrow {
	opacity: 1;
	transform: translateX(0);
}

[dir="rtl"] .y4c-i18n-modal__btn:hover .y4c-i18n-modal__btn-arrow,
.y4c-rtl .y4c-i18n-modal__btn:hover .y4c-i18n-modal__btn-arrow {
	transform: scaleX(-1) translateX(0);
}

/* Footer */
.y4c-i18n-modal__footer {
	padding: 12px 22px;
	background: #fff;
	border-top: 1px solid rgba(201, 168, 76, 0.12);
	text-align: center;
	font-size: 11.5px;
	color: #6B5242;
}

/* Body scroll lock when modal open */
body.y4c-i18n-modal-open {
	overflow: hidden;
}

/* Responsive */
@media (max-width: 600px) {
	.y4c-i18n-modal {
		padding: 12px;
	}
	.y4c-i18n-modal__card {
		max-height: 94vh;
		border-radius: 20px;
	}
	.y4c-i18n-modal__header {
		padding: 24px 20px 18px;
	}
	.y4c-i18n-modal__icon {
		width: 54px;
		height: 54px;
	}
	.y4c-i18n-modal__icon svg {
		width: 26px;
		height: 26px;
	}
	.y4c-i18n-modal__title-ar {
		font-size: 17px;
	}
	.y4c-i18n-modal__title-en {
		font-size: 16px;
	}
	.y4c-i18n-modal__grid {
		grid-template-columns: 1fr;
		gap: 6px;
		padding: 10px 12px 12px;
	}
	.y4c-i18n-modal__btn {
		padding: 12px 14px;
	}
}

/* ============================================================
   FLOATING LANGUAGE SWITCHER (FAB)
   ============================================================ */

.y4c-i18n-fab {
	position: fixed;
	bottom: 22px;
	inset-inline-start: 22px;
	z-index: 8000;
	font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

.y4c-i18n-fab__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #4A2C1A;
	color: #fff;
	border: 2px solid #C9A84C;
	border-radius: 999px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(74, 44, 26, 0.35);
	transition: all 0.2s;
	font-family: inherit;
}

.y4c-i18n-fab__trigger:hover {
	background: #6B3D25;
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(74, 44, 26, 0.45);
}

.y4c-i18n-fab__trigger svg {
	width: 18px;
	height: 18px;
	color: #DFC06E;
	flex-shrink: 0;
}

.y4c-i18n-fab__code {
	font-size: 12px;
	color: #DFC06E;
	font-weight: 800;
	letter-spacing: 0.5px;
}

.y4c-i18n-fab__menu {
	position: absolute;
	bottom: calc(100% + 10px);
	inset-inline-start: 0;
	min-width: 240px;
	max-height: 0;
	overflow: hidden;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
	border: 1px solid rgba(201, 168, 76, 0.25);
	opacity: 0;
	transition: max-height 0.25s ease, opacity 0.2s ease;
	pointer-events: none;
}

.y4c-i18n-fab__menu.is-open {
	max-height: 420px;
	overflow-y: auto;
	opacity: 1;
	pointer-events: auto;
}

.y4c-i18n-fab__item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: transparent;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	color: #2D1A0E;
	text-align: start;
	transition: background 0.15s;
}

.y4c-i18n-fab__item:hover {
	background: rgba(201, 168, 76, 0.08);
}

.y4c-i18n-fab__item.is-active {
	background: rgba(201, 168, 76, 0.12);
	font-weight: 700;
}

.y4c-i18n-fab__item-flag {
	font-size: 18px;
	flex-shrink: 0;
}

.y4c-i18n-fab__item-name {
	flex: 1;
	font-weight: 600;
}

.y4c-i18n-fab__item-code {
	font-size: 11px;
	color: #6B5242;
	font-weight: 700;
	background: rgba(201, 168, 76, 0.12);
	padding: 2px 7px;
	border-radius: 6px;
}

@media (max-width: 600px) {
	.y4c-i18n-fab {
		bottom: 16px;
		inset-inline-start: 16px;
	}
	.y4c-i18n-fab__trigger {
		padding: 8px 12px;
		font-size: 12px;
	}
	.y4c-i18n-fab__menu {
		min-width: 220px;
		max-height: 360px;
	}
}

/* Hide the floating switcher when chatbot is open or near it */
@media (max-width: 480px) {
	.y4c-i18n-fab {
		bottom: 80px; /* clear the WhatsApp FAB */
	}
}
