.theme-toggle {
	position: relative;
	width: 60px;
	height: var(--theme-button-height);
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.3s ease;
	border: none;
	outline: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

:root[data-theme="light"] .theme-toggle,
:root:not([data-theme]) .theme-toggle {
	background: #f2f2f7;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.15);
}

:root[data-theme="dark"] .theme-toggle {
	background: #2c2c2e;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.6);
}

.theme-toggle::before {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	z-index: 2;
}

.theme-toggle::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 24px;
	height: 24px;
	line-height: 24px;
	text-align: center;
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 10px;
	transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	z-index: 3;
	pointer-events: none;
}

:root[data-theme="light"] .theme-toggle::before,
:root:not([data-theme]) .theme-toggle::before {
	background: linear-gradient(145deg, #ffffff, #f0f0f0);
	box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}

:root[data-theme="dark"] .theme-toggle::before {
	background: linear-gradient(145deg, #1a1a1a, #000000);
	box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
}

.theme-toggle.state-light::before { transform: translateX(0); }
.theme-toggle.state-light::after { content: '\f185'; transform: translateX(0); color: #FF9500; }

.theme-toggle.state-dark::before { transform: translateX(34px); }
.theme-toggle.state-dark::after { content: '\f186'; transform: translateX(34px); color: #6B9FFF; }

.theme-toggle.state-auto::before { transform: translateX(18px); opacity: 0.3; }
.theme-toggle.state-auto::after { content: '\f042'; transform: translateX(18px); color: #007AFF; }

:root[data-theme="dark"] .theme-toggle.state-auto::after { color: #0A84FF; }

.theme-toggle:hover { transform: translateY(-1px); }

/* Mobile: compact circle button */
@media (max-width: 640px) {
	.theme-toggle {
		width: 32px;
		height: 32px;
		border-radius: 50%;
		min-width: 32px;
	}
	.theme-toggle::before {
		display: none;
	}
	.theme-toggle::after {
		position: static;
		transform: none !important;
		width: 100%;
		height: 100%;
		line-height: 32px;
		font-size: 13px;
	}
	.theme-toggle.state-light::after { content: '\f185'; color: #FF9500; }
	.theme-toggle.state-dark::after { content: '\f186'; color: #6B9FFF; }
	.theme-toggle.state-auto::after { content: '\f042'; color: #007AFF; opacity: 1; }
}
