/**
 * Border & border-shadow animations for stsitebuilder Group_Control_Border
 * Variables are set per-element by Elementor selectors.
 */

/* ─── Angle property for rotating conic-gradient border ─── */
@property --stsb-ba-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

@keyframes stsb-ba-color-pulse {
	0%, 100% { border-color: var(--stsb-ba-c1, currentColor); }
	50% { border-color: var(--stsb-ba-c2, transparent); }
}

@keyframes stsb-ba-color-shift {
	0% { border-color: var(--stsb-ba-c1, currentColor); }
	33% { border-color: var(--stsb-ba-c2, #ff6b6b); }
	66% { border-color: var(--stsb-ba-c3, #4ecdc4); }
	100% { border-color: var(--stsb-ba-c1, currentColor); }
}

@keyframes stsb-ba-glow-pulse {
	0%, 100% {
		box-shadow: 0 0 var(--stsb-ba-glow-min, 4px) 0 var(--stsb-ba-glow-c, rgba(0, 0, 0, 0.25));
	}
	50% {
		box-shadow: 0 0 var(--stsb-ba-glow-max, 18px) 2px var(--stsb-ba-glow-c, rgba(0, 0, 0, 0.4));
	}
}

@keyframes stsb-ba-glow-breathe {
	0%, 100% {
		box-shadow:
			0 0 var(--stsb-ba-glow-min, 2px) 0 var(--stsb-ba-glow-c, rgba(255, 255, 255, 0.35)),
			0 0 calc(var(--stsb-ba-glow-min, 2px) * 2) 0 var(--stsb-ba-glow-c2, rgba(0, 0, 0, 0.08));
	}
	50% {
		box-shadow:
			0 0 var(--stsb-ba-glow-max, 14px) 1px var(--stsb-ba-glow-c, rgba(255, 255, 255, 0.55)),
			0 0 calc(var(--stsb-ba-glow-max, 14px) * 1.6) 2px var(--stsb-ba-glow-c2, rgba(0, 0, 0, 0.12));
	}
}

@keyframes stsb-ba-neon-flicker {
	0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
		border-color: var(--stsb-ba-c1, currentColor);
		box-shadow: 0 0 var(--stsb-ba-glow-min, 4px) var(--stsb-ba-glow-c, rgba(0, 200, 255, 0.45));
	}
	20%, 24%, 55% {
		border-color: var(--stsb-ba-c2, transparent);
		box-shadow: 0 0 2px transparent;
	}
}

@keyframes stsb-ba-shadow-pulse {
	0%, 100% {
		box-shadow: var(--stsb-ba-sh-x, 0px) var(--stsb-ba-sh-y, 4px) var(--stsb-ba-sh-blur-min, 8px) var(--stsb-ba-sh-spread, 0px) var(--stsb-ba-sh-c, rgba(0, 0, 0, 0.2));
	}
	50% {
		box-shadow: var(--stsb-ba-sh-x, 0px) var(--stsb-ba-sh-y, 4px) var(--stsb-ba-sh-blur-max, 24px) var(--stsb-ba-sh-spread, 0px) var(--stsb-ba-sh-c, rgba(0, 0, 0, 0.35));
	}
}

@keyframes stsb-ba-shadow-color {
	0%, 100% {
		box-shadow: var(--stsb-ba-sh-x, 0px) var(--stsb-ba-sh-y, 6px) var(--stsb-ba-sh-blur-min, 16px) var(--stsb-ba-sh-spread, 0px) var(--stsb-ba-sh-c, rgba(0, 0, 0, 0.25));
	}
	50% {
		box-shadow: var(--stsb-ba-sh-x, 0px) var(--stsb-ba-sh-y, 6px) var(--stsb-ba-sh-blur-min, 16px) var(--stsb-ba-sh-spread, 0px) var(--stsb-ba-sh-c2, rgba(80, 120, 255, 0.35));
	}
}

@keyframes stsb-ba-dash-flow {
	0% { border-color: var(--stsb-ba-c1, currentColor); opacity: 1; }
	50% { border-color: var(--stsb-ba-c2, transparent); opacity: 0.65; }
	100% { border-color: var(--stsb-ba-c1, currentColor); opacity: 1; }
}

/**
 * Rotating conic-gradient border (Google AI Studio style).
 * The element must have a solid background — set via --stsb-ba-fill
 * (controlled by "Fill Color" in the Border Animation panel).
 * Technique: dual background layers — solid fill on padding-box,
 * animated conic-gradient on border-box.
 *
 * "Gradient Spin + Glow" additionally draws 4 coloured box-shadows (same colours as the border)
 * whose offsets are derived from the same --stsb-ba-angle, so the glow travels with the colours.
 * Rotation direction: animation-direction normal (clockwise) / reverse (counter-clockwise).
 */
@keyframes stsb-ba-gradient-spin {
	from { --stsb-ba-angle: 0deg; }
	to { --stsb-ba-angle: 360deg; }
}

/* Prefer reduced motion: neutralise the animation names set by the border controls */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		--stsb-ba-name: none !important;
		--stsb-ba-sh-name: none !important;
	}
}
