/* Тройной Toggle переключатель для трех опций */

.three-way-toggle-container {
	--_switch-bg-clr: var(--bg-tertiary);
	--_switch-padding: 4px;
	--_slider-bg-clr: var(--bg-purple);
	--_slider-bg-clr-on: var(--bg-purple-hover);
	--_slider-txt-clr: var(--text-primary);
	--_label-padding: 0.6rem 1.2rem;
	--_switch-easing: cubic-bezier(0.47, 1.64, 0.41, 0.8);

	display: flex;
	align-items: center;
	gap: 0;
	border-radius: 9999px;
	border: 1px solid var(--border-color);
	background: var(--_switch-bg-clr);
	padding: var(--_switch-padding);
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: all 0.2s ease;
	min-width: 300px;
}

/* Слайдер (анимированный фон) */
.three-way-toggle-container::before {
	content: '';
	position: absolute;
	background-color: var(--_slider-bg-clr);
	border-radius: 9999px;
	top: var(--_switch-padding);
	bottom: var(--_switch-padding);
	left: var(--slider-left, var(--_switch-padding));
	width: var(--slider-width, calc(33.333% - var(--_switch-padding) * 2));
	transition: left 500ms var(--_switch-easing),
		width 500ms var(--_switch-easing), background-color 500ms ease-in-out;
	z-index: 1;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
	pointer-events: none;
}

.three-way-toggle-btn {
	flex: 1;
	padding: var(--_label-padding);
	font-size: 14px;
	font-weight: 500;
	border: none;
	background: transparent;
	color: var(--text-primary);
	cursor: pointer;
	transition: opacity 300ms ease-in-out 150ms, color 200ms ease;
	position: relative;
	z-index: 2;
	white-space: nowrap;
	user-select: none;
	border-radius: 9999px;
	opacity: 0.7;
}

.three-way-toggle-btn:hover {
	opacity: 0.9;
	transition-delay: 0ms;
	transition-duration: 100ms;
}

.three-way-toggle-btn.active {
	opacity: 1;
	font-weight: 600;
	color: var(--text-primary);
	transition-delay: 0ms;
	background: transparent;
}

/* Адаптивность */
@media (max-width: 768px) {
	.three-way-toggle-btn {
		padding: 0.5rem 1rem;
		font-size: 13px;
	}

	.three-way-toggle-container {
		min-width: 240px;
	}
}

@media (max-width: 480px) {
	.three-way-toggle-btn {
		padding: 0.4rem 0.8rem;
		font-size: 12px;
	}

	.three-way-toggle-container {
		min-width: 200px;
	}
}

/* Темная тема */
[data-theme='dark'] .three-way-toggle-container {
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
