/* Language Switcher Styling & Animation Definitions */
.teknotok-ait-switcher-container {
	--teknotok-switcher-bg: rgba(255, 255, 255, 0.96);
	--teknotok-switcher-bg-solid: #ffffff;
	--teknotok-switcher-text: #1e293b;
	--teknotok-switcher-border: rgba(37, 99, 235, 0.28);
	--teknotok-switcher-accent: #6366f1;
	--teknotok-switcher-radius: 999px;
	--teknotok-switcher-border-width: 1px;
	position: relative;
	display: inline-block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	user-select: none;
	z-index: 99999;
	max-width: calc(100vw - 32px);
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 0 !important;
}

.teknotok-ait-selected-lang {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	max-width: 100%;
	background: var(--teknotok-switcher-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: var(--teknotok-switcher-border-width) solid var(--teknotok-switcher-border);
	padding: 8px 14px;
	border-radius: var(--teknotok-switcher-radius);
	cursor: pointer;
	box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.35), inset 0 0 0 1px color-mix(in srgb, var(--teknotok-switcher-accent) 10%, transparent);
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	color: var(--teknotok-switcher-text) !important;
	box-sizing: border-box;
}

.teknotok-ait-selected-lang:hover,
.teknotok-ait-selected-lang:focus {
	background: var(--teknotok-switcher-bg-solid);
	border-color: var(--teknotok-switcher-accent);
	transform: translateY(-1px);
	box-shadow: 0 16px 28px -18px rgba(15, 23, 42, 0.45), inset 0 0 0 1px color-mix(in srgb, var(--teknotok-switcher-accent) 18%, transparent);
	outline: none;
}

.teknotok-ait-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.teknotok-ait-arrow {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-left: 4px;
	transition: transform 0.2s ease;
}

.teknotok-ait-switcher-container.open .teknotok-ait-arrow {
	transform: rotate(-135deg);
}

.teknotok-ait-languages-dropdown {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: var(--teknotok-switcher-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: var(--teknotok-switcher-border-width) solid var(--teknotok-switcher-border);
	border-radius: min(var(--teknotok-switcher-radius), 14px);
	padding: 0;
	margin: 0;
	list-style: none;
	min-width: 220px;
	width: max-content;
	max-width: min(340px, calc(100vw - 32px));
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	display: none;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	max-height: min(320px, calc(100vh - 120px));
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--teknotok-switcher-accent) 40%, transparent) transparent;
	box-sizing: border-box;
	overscroll-behavior: contain;
	text-align: start;
	z-index: 1000000;
}

.teknotok-ait-position-header .teknotok-ait-languages-dropdown,
.teknotok-ait-position-shortcode .teknotok-ait-languages-dropdown {
	top: calc(100% + 8px);
	bottom: auto;
	transform: translateY(-10px);
}

.teknotok-ait-switcher-container.open .teknotok-ait-languages-dropdown {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

/* Custom Scrollbar Styles */
.teknotok-ait-languages-dropdown::-webkit-scrollbar {
	width: 6px;
}
.teknotok-ait-languages-dropdown::-webkit-scrollbar-track {
	background: transparent;
}
.teknotok-ait-languages-dropdown::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.3);
	border-radius: 10px;
}
.teknotok-ait-languages-dropdown::-webkit-scrollbar-thumb:hover {
	background: rgba(99, 102, 241, 0.5);
}

.teknotok-ait-languages-dropdown li {
	border-radius: 8px;
	cursor: pointer;
	color: var(--teknotok-switcher-text);
	transition: all 0.15s ease;
}

.teknotok-ait-languages-dropdown li:not(.teknotok-ait-search-item):not(.teknotok-ait-referral-item) {
	display: block;
	padding: 0;
	margin: 4px 6px;
}

.teknotok-ait-languages-dropdown li:not(.teknotok-ait-search-item):not(.teknotok-ait-referral-item) a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	color: inherit;
	text-decoration: none;
	width: 100%;
	box-sizing: border-box;
	min-width: 0;
}

.teknotok-ait-languages-dropdown li:not(.teknotok-ait-search-item):not(.teknotok-ait-referral-item):hover {
	background: color-mix(in srgb, var(--teknotok-switcher-accent) 10%, transparent);
	color: var(--teknotok-switcher-accent);
}

.teknotok-ait-languages-dropdown li.active {
	background: color-mix(in srgb, var(--teknotok-switcher-accent) 16%, transparent);
	color: var(--teknotok-switcher-accent);
	font-weight: 600;
}

/* Search Box Styling */
.teknotok-ait-languages-dropdown li.teknotok-ait-search-item {
	position: sticky;
	top: 0;
	background: var(--teknotok-switcher-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 10;
	padding: 8px 10px;
	border-bottom: 1px solid rgba(226, 232, 240, 0.8);
	border-top-left-radius: 12px;
	border-top-right-radius: 12px;
	cursor: default;
}
.teknotok-ait-languages-dropdown li.teknotok-ait-search-item:hover {
	background: var(--teknotok-switcher-bg) !important;
}
.teknotok-ait-search-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid rgba(203, 213, 225, 0.8);
	border-radius: 6px;
	font-size: 12px;
	background: rgba(248, 250, 252, 0.8);
	color: #334155;
	outline: none;
	transition: all 0.15s ease;
	box-sizing: border-box;
	text-align: start;
}
.teknotok-ait-search-input:focus {
	border-color: var(--teknotok-switcher-accent);
	background: #ffffff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--teknotok-switcher-accent) 18%, transparent);
}

/* Flag Icons */
.teknotok-ait-flag {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(0, 0, 0, 0.08);
	display: inline-block;
	flex-shrink: 0;
}

/* Referral Link Styling */
.teknotok-ait-languages-dropdown li.teknotok-ait-referral-item {
	position: sticky;
	bottom: 0;
	background: var(--teknotok-switcher-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 10;
	border-top: 1px solid rgba(226, 232, 240, 0.86);
	padding: 4px 8px 6px;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	cursor: default;
}

.teknotok-ait-design-water .teknotok-ait-selected-lang,
.teknotok-ait-design-water .teknotok-ait-languages-dropdown {
	box-shadow: 0 16px 30px -20px rgba(8, 145, 178, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.teknotok-ait-design-glass .teknotok-ait-selected-lang,
.teknotok-ait-design-glass .teknotok-ait-languages-dropdown {
	box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.35), inset 0 0 0 1px color-mix(in srgb, var(--teknotok-switcher-accent) 10%, transparent);
}

.teknotok-ait-design-clean .teknotok-ait-selected-lang,
.teknotok-ait-design-clean .teknotok-ait-languages-dropdown {
	box-shadow: 0 8px 18px -18px rgba(15, 23, 42, 0.28);
}

.teknotok-ait-design-dark .teknotok-ait-selected-lang,
.teknotok-ait-design-dark .teknotok-ait-languages-dropdown {
	box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.6), inset 0 0 0 1px color-mix(in srgb, var(--teknotok-switcher-accent) 16%, transparent);
}

.teknotok-ait-design-dark .teknotok-ait-search-input {
	background: rgba(255, 255, 255, 0.08);
	color: var(--teknotok-switcher-text);
	border-color: color-mix(in srgb, var(--teknotok-switcher-border) 80%, #ffffff);
}

.teknotok-ait-no-flags .teknotok-ait-flag {
	display: none !important;
}

.teknotok-ait-languages-dropdown li.teknotok-ait-referral-item:hover {
	background: rgba(248, 250, 252, 0.96) !important;
}

.teknotok-ait-languages-dropdown li.teknotok-ait-referral-item a {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	text-decoration: none;
	width: 100%;
	min-width: 0;
	padding: 2px 4px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-sizing: border-box;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.teknotok-ait-languages-dropdown li.teknotok-ait-referral-item a:hover,
.teknotok-ait-languages-dropdown li.teknotok-ait-referral-item a:focus {
	background: rgba(241, 245, 249, 0.9);
	color: #64748b;
	outline: none;
}

.teknotok-ait-referral-title {
	font-size: 10px;
	font-weight: 600;
	line-height: 1.2;
	color: inherit;
	white-space: nowrap;
}

/* Floating alignments */
.teknotok-ait-floating-wrapper {
	position: fixed;
	bottom: max(18px, env(safe-area-inset-bottom));
	z-index: 999999;
	max-width: calc(100vw - 32px);
}
.teknotok-ait-floating-floating-bottom-right {
	right: max(18px, env(safe-area-inset-right));
}
.teknotok-ait-floating-floating-bottom-left {
	left: max(18px, env(safe-area-inset-left));
}
.teknotok-ait-floating-header {
	top: max(18px, env(safe-area-inset-top));
	right: max(18px, env(safe-area-inset-right));
	bottom: auto;
}
.teknotok-ait-floating-footer {
	left: 50%;
	transform: translateX(-50%);
}

@media (max-width: 480px) {
	.teknotok-ait-floating-wrapper {
		bottom: max(14px, env(safe-area-inset-bottom));
		max-width: calc(100vw - 24px);
	}

	.teknotok-ait-floating-floating-bottom-right {
		right: max(12px, env(safe-area-inset-right));
	}

	.teknotok-ait-floating-floating-bottom-left {
		left: max(12px, env(safe-area-inset-left));
	}

	.teknotok-ait-floating-header {
		top: max(12px, env(safe-area-inset-top));
		right: max(12px, env(safe-area-inset-right));
	}

	.teknotok-ait-selected-lang {
		min-height: 38px;
		padding: 7px 12px;
		font-size: 13px;
	}

	.teknotok-ait-languages-dropdown {
		min-width: 210px;
		max-width: calc(100vw - 24px);
		max-height: min(300px, calc(100vh - 96px));
	}
}

/* Redirection Banner styles */
.teknotok-ait-banner {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(15, 23, 42, 0.95);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 16px;
	padding: 16px 24px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
	z-index: 9999999;
	color: #fff;
	max-width: 500px;
	width: 90%;
	animation: slideUp 0.3s ease;
}

.teknotok-ait-banner-content {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	text-align: center;
}

.teknotok-ait-banner-text {
	font-weight: 500;
	font-size: 14px;
	line-height: 1.5;
}

.teknotok-ait-banner-actions {
	display: flex;
	gap: 10px;
}

.teknotok-ait-banner-actions button {
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
}

.teknotok-ait-banner-actions .button-primary {
	background: #6366f1;
	color: #fff;
}
.teknotok-ait-banner-actions .button-primary:hover {
	background: #4f46e5;
}

.teknotok-ait-banner-actions .button-secondary {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}
.teknotok-ait-banner-actions .button-secondary:hover {
	background: rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
	from { transform: translate(-50%, 100px); opacity: 0; }
	to { transform: translate(-50%, 0); opacity: 1; }
}
