/**
 * Text Stroke Title Frontend Styles
 *
 * @package Templines_Image_Text_Stroke
 * @since 1.0.0
 */

/* ================================
   Main Container
   ================================ */
.tits-stroke-title-wrapper {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100px;
}

/* Alignment variations */
.tits-stroke-title-wrapper[style*="text-align: left"] {
	justify-content: flex-start;
}

.tits-stroke-title-wrapper[style*="text-align: center"] {
	justify-content: center;
}

.tits-stroke-title-wrapper[style*="text-align: right"] {
	justify-content: flex-end;
}

/* ================================
   SVG Text
   ================================ */
.tits-stroke-title-svg {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 100px;
	overflow: visible;
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* SVG width adjustments for alignment */
.tits-stroke-title-wrapper[style*="text-align: left"] .tits-stroke-title-svg,
.tits-stroke-title-wrapper[style*="text-align: right"] .tits-stroke-title-svg {
	width: auto;
	min-width: 100%;
}

.tits-stroke-title-svg.tits-visible {
	opacity: 1;
}

.tits-stroke-title-svg text {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: normal;
	font-style: normal;
}

/* ================================
   Animation States
   ================================ */
.tits-stroke-title-svg.tits-animating text {
	stroke-dasharray: 1000;
	stroke-dashoffset: 1000;
	fill-opacity: 0;
}

.tits-stroke-title-svg.tits-animate-stroke text {
	animation-name: tits-stroke-draw;
	animation-timing-function: linear;
	animation-fill-mode: forwards;
}

.tits-stroke-title-svg.tits-animate-fill text {
	animation-name: tits-stroke-draw, tits-stroke-fill;
	animation-timing-function: linear, ease-in;
	animation-fill-mode: forwards;
}

/* Loop animation */
.tits-stroke-title-svg.tits-animate-loop text {
	animation-iteration-count: infinite;
}

/* ================================
   Keyframe Animations
   ================================ */
@keyframes tits-stroke-draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes tits-stroke-fill {
	0% {
		fill-opacity: 0;
	}
	/* Fill delay handled dynamically */
	100% {
		fill-opacity: 1;
	}
}

/* ================================
   Additional Effect Animations
   ================================ */

/* Blink Effect */
@keyframes tits-effect-blink {
	0%, 49% {
		opacity: 1;
	}
	50%, 99% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

/* Pulse Effect */
@keyframes tits-effect-pulse {
	0%, 100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.8;
	}
}

/* Shake Effect */
@keyframes tits-effect-shake {
	0%, 100% {
		transform: translateX(0);
	}
	10%, 30%, 50%, 70%, 90% {
		transform: translateX(-10px);
	}
	20%, 40%, 60%, 80% {
		transform: translateX(10px);
	}
}

/* Bounce Effect */
@keyframes tits-effect-bounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-30px);
	}
	60% {
		transform: translateY(-15px);
	}
}

/* Slide In from Left */
@keyframes tits-effect-slide-left {
	0% {
		transform: translateX(-100%);
		opacity: 0;
	}
	100% {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Slide In from Right */
@keyframes tits-effect-slide-right {
	0% {
		transform: translateX(100%);
		opacity: 0;
	}
	100% {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Slide In from Top */
@keyframes tits-effect-slide-top {
	0% {
		transform: translateY(-100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Slide In from Bottom */
@keyframes tits-effect-slide-bottom {
	0% {
		transform: translateY(100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Rotate Effect - dynamic rotation handled via inline style */
@keyframes tits-effect-rotate {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(var(--rotate-degrees, 360deg));
	}
}

/* Scale Effect */
@keyframes tits-effect-scale {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	50% {
		transform: scale(1.1);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Wave Effect */
@keyframes tits-effect-wave {
	0%, 100% {
		transform: translateY(0) rotate(0deg);
	}
	25% {
		transform: translateY(-10px) rotate(5deg);
	}
	50% {
		transform: translateY(0) rotate(0deg);
	}
	75% {
		transform: translateY(10px) rotate(-5deg);
	}
}

/* Glitch Effect */
@keyframes tits-effect-glitch {
	0%, 100% {
		transform: translate(0);
		opacity: 1;
	}
	20% {
		transform: translate(-5px, 5px);
		opacity: 0.8;
	}
	40% {
		transform: translate(5px, -5px);
		opacity: 0.9;
	}
	60% {
		transform: translate(-5px, -5px);
		opacity: 0.7;
	}
	80% {
		transform: translate(5px, 5px);
		opacity: 0.9;
	}
}

/* ================================
   Accessibility
   ================================ */
@media (prefers-reduced-motion: reduce) {
	.tits-stroke-title-svg {
		opacity: 1 !important;
	}
	
	.tits-stroke-title-svg text {
		animation: none !important;
		stroke-dasharray: none !important;
		stroke-dashoffset: 0 !important;
		fill-opacity: 1 !important;
	}
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 768px) {
	.tits-stroke-title-wrapper {
		min-height: 80px;
	}
	
	.tits-stroke-title-svg {
		height: 80px;
	}
}

@media (max-width: 480px) {
	.tits-stroke-title-wrapper {
		min-height: 60px;
	}
	
	.tits-stroke-title-svg {
		height: 60px;
	}
}
