/**
 * ThemeFlex Theme - Reduced Motion Support
 *
 * @package Starter_Flavor
 * @since 1.0.0
 * @description Respects user's prefers-reduced-motion preference
 */

/* ==============================================
   DISABLE ANIMATIONS FOR USERS WITH MOTION SENSITIVITY
   ============================================== */

@media (prefers-reduced-motion: reduce) {
	/* Disable all animations and transitions */
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	/* Disable smooth scroll */
	html {
		scroll-behavior: auto;
	}

	body {
		scroll-behavior: auto;
	}

	/* Remove animation from specific elements */
	.fade,
	.fade-in,
	.fade-out,
	.slide-in,
	.slide-out,
	.bounce,
	.pulse,
	.spin,
	.wobble {
		animation: none !important;
		transition: none !important;
	}

	/* Remove transitions from hover states */
	a,
	button,
	input,
	select,
	textarea,
	.btn,
	.button {
		transition: none !important;
	}

	a:hover,
	a:focus,
	button:hover,
	button:focus,
	input:hover,
	input:focus,
	select:hover,
	select:focus,
	textarea:hover,
	textarea:focus,
	.btn:hover,
	.btn:focus,
	.button:hover,
	.button:focus {
		transition: none !important;
	}

	/* Disable carousel animations */
	.carousel,
	.slider,
	.swiper {
		animation: none !important;
	}

	.carousel-slide,
	.slider-item,
	.swiper-slide {
		animation: none !important;
		transition: none !important;
	}

	/* Disable parallax effects */
	.parallax,
	[data-parallax] {
		background-attachment: scroll;
		transition: none !important;
	}

	/* Disable menu animations */
	.menu-toggle,
	.nav-toggle {
		animation: none !important;
		transition: none !important;
	}

	.mobile-menu,
	.mobile-nav,
	.sidebar-menu {
		animation: none !important;
		transition: none !important;
	}

	/* Disable modal animations */
	.modal,
	.dialog,
	[role="dialog"] {
		animation: none !important;
		transition: none !important;
	}

	.modal.open,
	.dialog.open {
		animation: none !important;
		transition: none !important;
	}

	/* Disable loading animations */
	.loader,
	.spinner,
	.loading {
		animation: none !important;
	}

	/* Disable skeleton screen animations */
	.skeleton {
		animation: none !important;
		background: #e0e0e0;
	}

	/* Disable scroll-triggered animations */
	.scroll-animate,
	.fade-on-scroll,
	.slide-on-scroll,
	[data-aos] {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}

	/* Disable typography animations */
	.text-animate,
	.letter-animate,
	.word-animate {
		animation: none !important;
	}

	/* Disable hover zoom effects */
	.hover-zoom:hover,
	.image-zoom:hover,
	.zoom-on-hover:hover {
		transform: none !important;
		transition: none !important;
	}

	/* Keep focus visible but without animation */
	:focus {
		outline: 2px solid #4A90E2;
		outline-offset: 2px;
		animation: none !important;
		transition: none !important;
	}

	/* Disable auto-play for videos */
	video {
		animation: none !important;
	}

	/* Disable gradient animations */
	.gradient-animate,
	.animated-gradient {
		animation: none !important;
		background-size: 100% 100%;
		background-position: 0% 0%;
	}

	/* Disable marquee animations */
	.marquee,
	[behavior="scroll"] {
		animation: none !important;
	}

	/* Disable rotate animations */
	.rotate-animate,
	.spin {
		animation: none !important;
		transform: none !important;
	}

	/* Disable scale animations */
	.scale-animate,
	.grow,
	.shrink {
		animation: none !important;
		transform: scale(1);
	}

	/* Disable flip animations */
	.flip-animate,
	.flip {
		animation: none !important;
		transform: none !important;
	}
}

/* ==============================================
   ENSURE ESSENTIAL INTERACTIONS STILL WORK
   ============================================== */

@media (prefers-reduced-motion: reduce) {
	/* Keep focus outlines visible */
	*:focus {
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}

	/* Keep color changes for interactive elements */
	a:hover {
		color: var(--sf-color-link-hover, #ED4C1C);
	}

	button:hover,
	.btn:hover {
		background-color: var(--sf-color-link-hover, #ED4C1C);
		color: white;
	}

	/* Keep cursor changes */
	a,
	button,
	.btn,
	[role="button"],
	[role="menuitem"] {
		cursor: pointer;
	}

	/* Maintain visibility of state changes */
	.active,
	.current,
	.selected {
		opacity: 1;
	}

	/* Show expanded/collapsed states */
	[aria-expanded="true"],
	[aria-expanded="false"] {
		opacity: 1;
	}

	/* Keep tooltips readable */
	.tooltip,
	[role="tooltip"] {
		opacity: 1;
		visibility: visible;
	}

	/* Maintain dropdown visibility */
	.dropdown-menu,
	.submenu {
		opacity: 1;
		visibility: visible;
	}
}

/* ==============================================
   PRINT STYLES - NO ANIMATIONS
   ============================================== */

@media print {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	body {
		scroll-behavior: auto;
	}
}
