// Theme toggling script for PyPost
function toggleTheme() {
	const darkStyles = document.getElementById('dark-styles');
	const lightStyles = document.getElementById('light-styles');
	const currentlyLight = !lightStyles.disabled;

	document.body.classList.add('theme-transitioning');

	if (currentlyLight) {
		// Switch to dark
		lightStyles.disabled = true;
		darkStyles.disabled = false;
	} else {
		// Switch to light
		lightStyles.disabled = false;
		darkStyles.disabled = true;
	}

	setTimeout(() => {
		document.body.classList.remove('theme-transitioning');
	}, 400);
}

document.addEventListener('DOMContentLoaded', function() {
	const darkStyles = document.getElementById('dark-styles');
	const lightStyles = document.getElementById('light-styles');

	// Always start in light mode
	lightStyles.disabled = false;
	darkStyles.disabled = true;
});
