/* ============================================
   Animated Text Widget - Base Styles
   ============================================ */

.elementor-widget-unlockafe-animated-text,
.elementor-widget-unlockafe-animated-text .elementor-widget-container {
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
}

.unlockafe-animated-text-wrapper {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    line-height: 1.5;
    white-space: nowrap !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

.unlockafe-animated-text-prefix,
.unlockafe-animated-text-suffix {
    display: inline-block !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: none !important;
}

.unlockafe-animated-text-animated {
    display: inline-block !important;
    position: relative;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* Cursor */
.unlockafe-animated-text-cursor {
    display: inline-block !important;
    border-right: 2px solid #667eea;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: baseline;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ============================================
   Typewriter Animation
   ============================================ */

.unlockafe-animated-typewriter .unlockafe-typewriter-text {
    display: inline-block !important;
    white-space: nowrap !important;
}

/* ============================================
   Rotating Words Animation
   ============================================ */

.unlockafe-animated-rotating .unlockafe-rotating-word {
    display: inline-block !important;
    position: relative;
    white-space: nowrap !important;
}

.unlockafe-animated-word {
    display: inline-block !important;
    white-space: nowrap !important;
}

.unlockafe-animated-rotating .unlockafe-rotating-word::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
}

/* Rotating animation */
.unlockafe-rotating-word {
    animation: rotateIn 0.5s ease-in-out;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg);
    }
}

/* ============================================
   Fade In/Out Animation
   ============================================ */

.unlockafe-animated-fade .unlockafe-animated-text-animated {
    animation: fadeInOut 3s infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   Slide Up Animation
   ============================================ */

.unlockafe-animated-slide .unlockafe-animated-text-animated {
    animation: slideUp 2s infinite;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    50% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================
   Blur In Animation
   ============================================ */

.unlockafe-animated-blur .unlockafe-animated-text-animated {
    animation: blurIn 2s infinite;
}

@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
    }
}

/* ============================================
   Glitch Effect
   ============================================ */

.unlockafe-animated-glitch .unlockafe-animated-text-animated {
    position: relative;
    animation: glitch 2s infinite;
}

.unlockafe-animated-glitch .unlockafe-animated-text-animated::before,
.unlockafe-animated-glitch .unlockafe-animated-text-animated::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.unlockafe-animated-glitch .unlockafe-animated-text-animated::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.unlockafe-animated-glitch .unlockafe-animated-text-animated::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
        transform: skew(0.5deg);
    }
    5% {
        clip: rect(12px, 9999px, 77px, 0);
        transform: skew(0.5deg);
    }
    10% {
        clip: rect(98px, 9999px, 2px, 0);
        transform: skew(0.5deg);
    }
    15% {
        clip: rect(54px, 9999px, 99px, 0);
        transform: skew(0.5deg);
    }
    20% {
        clip: rect(2px, 9999px, 85px, 0);
        transform: skew(0.5deg);
    }
    25% {
        clip: rect(23px, 9999px, 67px, 0);
        transform: skew(0.5deg);
    }
    30% {
        clip: rect(76px, 9999px, 99px, 0);
        transform: skew(0.5deg);
    }
    35% {
        clip: rect(62px, 9999px, 4px, 0);
        transform: skew(0.5deg);
    }
    40% {
        clip: rect(28px, 9999px, 14px, 0);
        transform: skew(0.5deg);
    }
    45% {
        clip: rect(75px, 9999px, 53px, 0);
        transform: skew(0.5deg);
    }
    50% {
        clip: rect(1px, 9999px, 83px, 0);
        transform: skew(0.5deg);
    }
    55% {
        clip: rect(79px, 9999px, 3px, 0);
        transform: skew(0.5deg);
    }
    60% {
        clip: rect(33px, 9999px, 99px, 0);
        transform: skew(0.5deg);
    }
    65% {
        clip: rect(11px, 9999px, 13px, 0);
        transform: skew(0.5deg);
    }
    70% {
        clip: rect(65px, 9999px, 91px, 0);
        transform: skew(0.5deg);
    }
    75% {
        clip: rect(36px, 9999px, 65px, 0);
        transform: skew(0.5deg);
    }
    80% {
        clip: rect(2px, 9999px, 14px, 0);
        transform: skew(0.5deg);
    }
    85% {
        clip: rect(54px, 9999px, 8px, 0);
        transform: skew(0.5deg);
    }
    90% {
        clip: rect(88px, 9999px, 45px, 0);
        transform: skew(0.5deg);
    }
    95% {
        clip: rect(3px, 9999px, 24px, 0);
        transform: skew(0.5deg);
    }
    100% {
        clip: rect(58px, 9999px, 84px, 0);
        transform: skew(0.5deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
        transform: skew(0.5deg);
    }
    5% {
        clip: rect(96px, 9999px, 9px, 0);
        transform: skew(0.5deg);
    }
    10% {
        clip: rect(28px, 9999px, 84px, 0);
        transform: skew(0.5deg);
    }
    15% {
        clip: rect(90px, 9999px, 2px, 0);
        transform: skew(0.5deg);
    }
    20% {
        clip: rect(60px, 9999px, 99px, 0);
        transform: skew(0.5deg);
    }
    25% {
        clip: rect(10px, 9999px, 2px, 0);
        transform: skew(0.5deg);
    }
    30% {
        clip: rect(31px, 9999px, 67px, 0);
        transform: skew(0.5deg);
    }
    35% {
        clip: rect(86px, 9999px, 98px, 0);
        transform: skew(0.5deg);
    }
    40% {
        clip: rect(5px, 9999px, 34px, 0);
        transform: skew(0.5deg);
    }
    45% {
        clip: rect(66px, 9999px, 88px, 0);
        transform: skew(0.5deg);
    }
    50% {
        clip: rect(24px, 9999px, 15px, 0);
        transform: skew(0.5deg);
    }
    55% {
        clip: rect(76px, 9999px, 53px, 0);
        transform: skew(0.5deg);
    }
    60% {
        clip: rect(2px, 9999px, 23px, 0);
        transform: skew(0.5deg);
    }
    65% {
        clip: rect(13px, 9999px, 8px, 0);
        transform: skew(0.5deg);
    }
    70% {
        clip: rect(55px, 9999px, 99px, 0);
        transform: skew(0.5deg);
    }
    75% {
        clip: rect(17px, 9999px, 79px, 0);
        transform: skew(0.5deg);
    }
    80% {
        clip: rect(40px, 9999px, 92px, 0);
        transform: skew(0.5deg);
    }
    85% {
        clip: rect(26px, 9999px, 43px, 0);
        transform: skew(0.5deg);
    }
    90% {
        clip: rect(99px, 9999px, 12px, 0);
        transform: skew(0.5deg);
    }
    95% {
        clip: rect(38px, 9999px, 65px, 0);
        transform: skew(0.5deg);
    }
    100% {
        clip: rect(61px, 9999px, 48px, 0);
        transform: skew(0.5deg);
    }
}

/* ============================================
   Gradient Animation
   ============================================ */

.unlockafe-animated-gradient .unlockafe-animated-text-animated {
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s linear infinite;
    /* Default gradient if none is set */
    background-image: linear-gradient(90deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #667eea 100%);
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* ============================================
   Wave Animation
   ============================================ */

.unlockafe-animated-wave .unlockafe-animated-text-animated {
    display: inline-block;
}

.unlockafe-animated-wave .unlockafe-animated-text-animated span {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
}

.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(1) { animation-delay: 0s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(2) { animation-delay: 0.1s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(3) { animation-delay: 0.2s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(4) { animation-delay: 0.3s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(5) { animation-delay: 0.4s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(6) { animation-delay: 0.5s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(7) { animation-delay: 0.6s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(8) { animation-delay: 0.7s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(9) { animation-delay: 0.8s; }
.unlockafe-animated-wave .unlockafe-animated-text-animated span:nth-child(10) { animation-delay: 0.9s; }

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ============================================
   Scroll Animation States
   ============================================ */

.unlockafe-animated-text-wrapper.not-visible {
    opacity: 0;
}

.unlockafe-animated-text-wrapper.visible {
    opacity: 1;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .unlockafe-animated-text-wrapper {
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .unlockafe-animated-text-wrapper {
        font-size: 0.8em;
    }
}


