/**
 * Animated Button Widget Styles
 * Custom CSS for the animated hover effect button
 */

/* Ensure typography control wins over global typography */
.elementor-element.elementor-widget-animated_button .animated-button,
.elementor-element.elementor-widget-animated_button .animated-button .button-text {
	font-size: unset !important; /* Reset to allow typography control to work */
}

.animated-button-wrapper {
	display: inline-block;
}

.animated-button {
	position: relative;
	display: inline-block;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	overflow: hidden;
	z-index: 1;
	transition: color 0.3s ease;
	border: none;
	outline: none;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Pseudo-element for the animated background */
.animated-button::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #005a87; /* Default hover color, will be overridden by Elementor */
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	z-index: -1;
}

/* Animation states controlled by JavaScript */
.animated-button.slide-in::before {
	transform: translateX(0); /* Slide in from left to right */
}

.animated-button.slide-out::before {
	transform: translateX(100%); /* Slide out to the right */
}

/* Temporarily disable transitions for smooth reset */
.animated-button.no-transition::before {
	transition: none !important;
}

/* Size variations */
.animated-button.size-small {
	padding: 8px 16px;
	/* Font size now controlled by Typography control */
}

.animated-button.size-medium {
	padding: 12px 24px;
	/* Font size now controlled by Typography control */
}

.animated-button.size-large {
	padding: 16px 32px;
	/* Font size now controlled by Typography control */
}

.animated-button.size-xl {
	padding: 20px 40px;
	/* Font size now controlled by Typography control */
}

/* Ensure text stays above the animated background */
.animated-button span,
.animated-button,
.animated-button i,
.animated-button svg {
	position: relative;
	z-index: 2;
}

/* Icon styling */
.animated-button i,
.animated-button svg {
	display: inline-block;
	vertical-align: middle;
	transition: color 0.3s ease, fill 0.3s ease;
}

/* Icon spacing */
.animated-button .icon-left {
	margin-right: 8px;
}

.animated-button .icon-right {
	margin-left: 8px;
}

/* Button text and icon container */
.animated-button .button-text {
	display: inline-block;
	vertical-align: middle;
}

/* Ensure icons work properly with flexbox if needed */
.animated-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* SVG specific styles */
.animated-button svg {
	fill: currentColor;
	transition: fill 0.3s ease;
}

/* Icon size adjustments for different button sizes */
.animated-button.size-small i,
.animated-button.size-small svg {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

.animated-button.size-medium i,
.animated-button.size-medium svg {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.animated-button.size-large i,
.animated-button.size-large svg {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.animated-button.size-xl i,
.animated-button.size-xl svg {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Focus states for accessibility */
.animated-button:focus {
	outline: 2px solid rgba(0, 123, 255, 0.5);
	outline-offset: 2px;
}

/* Active state */
.animated-button:active {
	transform: translateY(1px);
}

/* Smooth transitions for all states */
.animated-button,
.animated-button::before {
	transition-property: all;
	transition-timing-function: ease;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
	.animated-button.size-small {
		padding: 6px 12px;
		font-size: 11px;
	}

	.animated-button.size-medium {
		padding: 10px 20px;
		font-size: 13px;
	}

	.animated-button.size-large {
		padding: 14px 28px;
		font-size: 15px;
	}

	.animated-button.size-xl {
		padding: 18px 36px;
		font-size: 17px;
	}

	/* Adjust icon spacing on mobile */
	.animated-button .icon-left {
		margin-right: 6px;
	}

	.animated-button .icon-right {
		margin-left: 6px;
	}

	/* Mobile icon sizes */
	.animated-button.size-small i,
	.animated-button.size-small svg {
		font-size: 11px;
		width: 11px;
		height: 11px;
	}

	.animated-button.size-medium i,
	.animated-button.size-medium svg {
		font-size: 13px;
		width: 13px;
		height: 13px;
	}

	.animated-button.size-large i,
	.animated-button.size-large svg {
		font-size: 15px;
		width: 15px;
		height: 15px;
	}

	.animated-button.size-xl i,
	.animated-button.size-xl svg {
		font-size: 17px;
		width: 17px;
		height: 17px;
	}
}

/* RTL Support */
[dir="rtl"] .animated-button::before {
	left: auto;
	right: -100%;
	transition: right 0.3s ease;
}

[dir="rtl"] .animated-button:hover::before {
	right: 0;
}

[dir="rtl"] .animated-button:not(:hover)::before {
	right: 100%;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.animated-button {
		border: 2px solid currentColor;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.animated-button::before {
		transition: none;
	}
	
	.animated-button:hover::before {
		opacity: 0.8;
		width: 100%;
	}
}


.darkmode .animated-button {
    color: #333 !important;
    border-color: #333 !important;
}

.darkmode .animated-button i{
    color: #333 !important;
}