/* Language toggle button styles - exactly matching TOC button from theme */
#language-floating-container {
	position: relative;
}

#language-button {
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2;
	cursor: pointer;
	border: none;
	border-radius: 50%;
	background-color: var(--bg-1);
	padding: 0.4rem;
	width: 1rem;
	height: 1rem;
	text-align: center;
}

#language-button:hover {
	background-color: var(--bg-3);
}

#language-button:hover .language-code {
	color: var(--primary-color);
}

#language-button:hover::before {
	background-color: transparent;
}

#language-button .language-code {
	color: var(--text-color);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
}

/* Language content popup - matching TOC content styling */
.language-content {
	display: none;
	position: absolute;
	right: 0;
	bottom: 100%;
	z-index: 2;
	margin-block-end: 0.7rem;
	box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
	border: 1px solid var(--divider-color);
	border-radius: 5px;
	background-color: var(--background-color);
	padding: 0.7rem 1rem;
	font-size: 0.8rem;
	text-align: start;
	white-space: nowrap;
}

.language-switch-link {
	display: block;
	color: var(--text-color);
	text-decoration: none;
	padding: 0.25rem 0;
	border-radius: 0.25rem;
	transition: all 0.2s ease;
}

.language-switch-link:hover {
	background-color: var(--primary-color);
	color: var(--hover-color);
}

/* Toggle functionality - exactly matching TOC behavior */
#language-toggle {
	display: none;
}

#language-toggle:checked+.overlay,
#language-toggle:checked+.overlay+#language-button+.language-content {
	display: block;
}

#language-toggle:checked+.overlay+#language-button .language-code {
	color: var(--primary-color);
}

.overlay {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	opacity: 40%;
	z-index: 1;
	background: var(--background-color);
}

/* Mobile responsiveness - matching theme's media query */
@media (max-width: 700px) {
	#language-floating-container {
		display: none !important;
	}
}

@media print {
	#language-floating-container {
		display: none;
	}
}