/**
 * CLAADSS Language Switcher & Multilingual Styles
 * Rich pill design with gradient code badge, elegant flyout menu, and night mode support.
 */

.claadss-lang {
	position: relative;
	z-index: 100020;
	flex: 0 0 auto;
}

/* Header Pill Button */
.claadss-lang__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #ffffff;
	color: #0f172a;
	font-size: 0.8rem;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
	outline: none;
}

.claadss-lang__btn:hover,
.claadss-lang.is-open .claadss-lang__btn {
	background: linear-gradient(135deg, #eef2ff, #fdf2f8);
	border-color: #c7d2fe;
	box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
}

.claadss-lang__btn .fa-globe {
	color: #4f46e5;
	font-size: 0.95rem;
}

/* Language Code Badge */
.claadss-lang__code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	padding: 2px 6px;
	border-radius: 6px;
	background: linear-gradient(135deg, #6366f1, #a855f7);
	color: #ffffff;
	font-size: 0.68rem;
	font-weight: 900;
	letter-spacing: 0.04em;
	line-height: 1.2;
}

.claadss-lang__cur {
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.claadss-lang__caret {
	font-size: 0.65rem;
	opacity: 0.55;
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.claadss-lang.is-open .claadss-lang__caret {
	transform: rotate(180deg);
}

/* Dropdown Menu Card */
.claadss-lang__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 290px;
	max-height: min(75vh, 460px);
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
	padding: 8px;
	z-index: 100030;
	animation: claadssMenuPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes claadssMenuPop {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.claadss-lang__menu[hidden] {
	display: none !important;
}

/* Search input inside dropdown */
.claadss-lang__search-wrap {
	position: relative;
	padding: 4px 4px 8px;
	border-bottom: 1px solid #f1f5f9;
	margin-bottom: 6px;
	flex-shrink: 0;
}

.claadss-lang__search-ico {
	position: absolute;
	left: 14px;
	top: 14px;
	font-size: 12px;
	color: #94a3b8;
	pointer-events: none;
}

.claadss-lang__search-input {
	width: 100%;
	height: 36px;
	padding: 0 12px 0 32px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	font-size: 12.5px;
	font-weight: 600;
	color: #0f172a;
	outline: none;
	transition: all 0.15s ease;
}

.claadss-lang__search-input:focus {
	border-color: #6366f1;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Scrollable list */
.claadss-lang__list {
	flex: 1 1 auto;
	overflow-y: auto;
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 360px;
}

.claadss-lang__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.claadss-lang__item[hidden] {
	display: none !important;
}

.claadss-lang__opt {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 7px 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: #0f172a;
	transition: background 0.12s ease;
	outline: none;
}

.claadss-lang__opt:hover {
	background: #f1f5f9;
}

.claadss-lang__item.is-active .claadss-lang__opt {
	background: linear-gradient(90deg, #eef2ff, #fdf2f8);
	font-weight: 800;
}

.claadss-lang__opt-code {
	flex: 0 0 auto;
	width: 30px;
	height: 26px;
	border-radius: 7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.65rem;
	font-weight: 900;
	color: #4338ca;
	background: #e0e7ff;
}

.claadss-lang__opt-name {
	flex: 1 1 auto;
	font-weight: 700;
	font-size: 0.86rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.claadss-lang__opt-en {
	flex: 0 0 auto;
	font-size: 0.7rem;
	font-weight: 600;
	color: #94a3b8;
}

/* Custom Scrollbar for Language Menu */
.claadss-lang__list::-webkit-scrollbar {
	width: 6px;
}
.claadss-lang__list::-webkit-scrollbar-track {
	background: transparent;
}
.claadss-lang__list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}
.claadss-lang__list::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Dark Mode / Night Mode */
html.king-night .claadss-lang__btn {
	background: #1e293b;
	border-color: #334155;
	color: #f1f5f9;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html.king-night .claadss-lang__btn:hover,
html.king-night .claadss-lang.is-open .claadss-lang__btn {
	background: #283347;
	border-color: #6366f1;
	box-shadow: 0 6px 16px rgba(99, 102, 241, 0.2);
}

html.king-night .claadss-lang__btn .fa-globe {
	color: #818cf8;
}

html.king-night .claadss-lang__menu {
	background: #1e293b;
	border-color: #334155;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

html.king-night .claadss-lang__search-wrap {
	border-color: #334155;
}

html.king-night .claadss-lang__search-input {
	background: #0f172a;
	border-color: #334155;
	color: #f1f5f9;
}

html.king-night .claadss-lang__search-input:focus {
	border-color: #818cf8;
	background: #1e293b;
}

html.king-night .claadss-lang__opt {
	color: #f1f5f9;
}

html.king-night .claadss-lang__opt:hover {
	background: #283347;
}

html.king-night .claadss-lang__item.is-active .claadss-lang__opt {
	background: #312e81;
}

html.king-night .claadss-lang__opt-code {
	background: #312e81;
	color: #a5b4fc;
}

html.king-night .claadss-lang__opt-en {
	color: #94a3b8;
}

html.king-night .claadss-lang__list::-webkit-scrollbar-thumb {
	background: #475569;
}

/* Mobile Drawer Placement */
.cm-dir-nav-mobile .claadss-lang {
	margin: 8px 12px 12px;
}
.cm-dir-nav-mobile .claadss-lang__btn {
	width: 100%;
	justify-content: flex-start;
	min-height: 48px;
	border-radius: 14px;
}
.cm-dir-nav-mobile .claadss-lang__cur {
	max-width: none;
	flex: 1 1 auto;
	text-align: left;
}
.cm-dir-nav-mobile .claadss-lang__caret {
	margin-left: auto;
}
.cm-dir-nav-mobile .claadss-lang__menu {
	position: static;
	width: 100%;
	max-height: 340px;
	box-shadow: none;
	border: 1px solid #e2e8f0;
	margin-top: 8px;
}
html.king-night .cm-dir-nav-mobile .claadss-lang__menu {
	border-color: #334155;
}

/*
 * Keep Google Translate host alive in DOM so select.goog-te-combo exists.
 * DO NOT use display: none (breaks Google Translate).
 * Instead clip off-screen with 0 opacity.
 */
.claadss-gt-host,
#google_translate_element {
	position: absolute !important;
	left: -9999px !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	z-index: -1 !important;
	pointer-events: none !important;
}

#google_translate_element select.goog-te-combo,
select.goog-te-combo {
	min-width: 1px !important;
	min-height: 1px !important;
}

/* Hide Google Translate top banner frame & balloon tooltip */
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	max-height: 0 !important;
}

body {
	top: 0px !important;
	position: static !important;
}

#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-te-balloon-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-l4eHX-hSRGPd {
	display: none !important;
	visibility: hidden !important;
}

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

/* RTL layout adjustments when translated to Arabic, Urdu, Persian, Hebrew */
html[dir="rtl"] .king-header,
body.claadss-lang-rtl .king-header {
	direction: rtl;
}
body.claadss-lang-rtl .claadss-lang__menu {
	right: auto;
	left: 0;
}

@media (max-width: 782px) {
	.claadss-lang__cur {
		display: none;
	}
	.claadss-lang__btn {
		padding: 0 10px;
		min-width: 40px;
		justify-content: center;
	}
}
