/**
 * LightTranslate AI — dil değiştirici.
 * Renkler CSS değişkenleriyle tema tarafından kolayca ezilebilir:
 *   .lt-switcher { --lt-bg: #111; --lt-fg: #fff; }
 */

.lt-switcher {
	--lt-bg: #ffffff;
	--lt-fg: #1d2327;
	--lt-muted: #646970;
	--lt-border: rgba(0, 0, 0, 0.12);
	--lt-hover: rgba(0, 0, 0, 0.05);
	--lt-accent: #2271b1;
	--lt-radius: 10px;
	--lt-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);

	position: relative;
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	color: var(--lt-fg);
	direction: ltr;
	text-align: left;
}

@media (prefers-color-scheme: dark) {
	.lt-switcher--floating {
		--lt-bg: #1e1f22;
		--lt-fg: #f0f0f1;
		--lt-muted: #a7aaad;
		--lt-border: rgba(255, 255, 255, 0.14);
		--lt-hover: rgba(255, 255, 255, 0.07);
		--lt-accent: #72aee6;
	}
}

.lt-switcher *,
.lt-switcher *::before,
.lt-switcher *::after {
	box-sizing: border-box;
}

/* Liste */
.lt-switcher__list {
	list-style: none;
	margin: 0;
	padding: 4px;
}

.lt-switcher__item {
	margin: 0;
	padding: 0;
}

.lt-switcher__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: calc(var(--lt-radius) - 4px);
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

.lt-switcher__link:hover,
.lt-switcher__link:focus-visible {
	background: var(--lt-hover);
	color: inherit;
	text-decoration: none;
}

.lt-switcher__link:focus-visible,
.lt-switcher__toggle:focus-visible {
	outline: 2px solid var(--lt-accent);
	outline-offset: 2px;
}

.lt-switcher__item.is-current .lt-switcher__link {
	font-weight: 600;
	color: var(--lt-accent);
}

.lt-switcher__code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	padding: 2px 5px;
	border: 1px solid var(--lt-border);
	border-radius: 5px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--lt-muted);
}

.lt-switcher__item.is-current .lt-switcher__code {
	border-color: currentColor;
	color: var(--lt-accent);
}

/* Açılır menü (details/summary — JS gerektirmez) */
.lt-switcher__details {
	position: relative;
}

.lt-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid var(--lt-border);
	border-radius: 999px;
	background: var(--lt-bg);
	color: var(--lt-fg);
	cursor: pointer;
	list-style: none;
	user-select: none;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.lt-switcher__toggle::-webkit-details-marker {
	display: none;
}

.lt-switcher__toggle::marker {
	content: "";
}

.lt-switcher__caret {
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.lt-switcher__details[open] .lt-switcher__caret {
	transform: rotate(180deg);
}

.lt-switcher--dropdown .lt-switcher__list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000;
	min-width: 190px;
	max-height: 60vh;
	overflow-y: auto;
	background: var(--lt-bg);
	border: 1px solid var(--lt-border);
	border-radius: var(--lt-radius);
	box-shadow: var(--lt-shadow);
	animation: lt-switcher-in 0.14s ease-out;
}

@keyframes lt-switcher-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Satır içi liste stili: [light_translate_switcher style="list"] */
.lt-switcher--list .lt-switcher__list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 0;
}

.lt-switcher--list .lt-switcher__link {
	padding: 6px 10px;
}

/* Yüzen buton */
.lt-switcher--floating {
	position: fixed;
	bottom: 20px;
	z-index: 99990;
}

.lt-switcher--floating.lt-switcher--right {
	right: 20px;
}

.lt-switcher--floating.lt-switcher--left {
	left: 20px;
}

.lt-switcher--floating .lt-switcher__toggle {
	box-shadow: var(--lt-shadow);
	font-weight: 500;
}

.lt-switcher--floating .lt-switcher__toggle:hover {
	transform: translateY(-1px);
}

/* Yüzen menü yukarı doğru açılır */
.lt-switcher--floating .lt-switcher__list {
	top: auto;
	bottom: calc(100% + 8px);
	animation-name: lt-switcher-up;
}

.lt-switcher--floating.lt-switcher--right .lt-switcher__list {
	left: auto;
	right: 0;
}

@keyframes lt-switcher-up {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Sağdan sola diller: dil adları kendi yönünde, bileşen yerleşimi sabit */
.lt-switcher__name[dir="rtl"] {
	unicode-bidi: isolate;
}

@media (max-width: 600px) {
	.lt-switcher--floating {
		bottom: 14px;
	}

	.lt-switcher--floating.lt-switcher--right {
		right: 14px;
	}

	.lt-switcher--floating.lt-switcher--left {
		left: 14px;
	}

	.lt-switcher--floating .lt-switcher__toggle {
		padding: 9px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lt-switcher__list,
	.lt-switcher__caret,
	.lt-switcher__toggle {
		animation: none !important;
		transition: none !important;
	}
}

@media print {
	.lt-switcher--floating {
		display: none !important;
	}
}
