/* 
=============================================
ANIMATIONS
=============================================
*/

/* Fade animations */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 1s ease-in-out;
}

.fade-in-down {
    animation: fadeInDown 1s ease-in-out;
}

.fade-in-left {
    animation: fadeInLeft 1s ease-in-out;
}

.fade-in-right {
    animation: fadeInRight 1s ease-in-out;
}

/* Typed text cursor animation */
.typed-cursor {
    opacity: 1;
    animation: typedCursorBlink 0.7s infinite;
}

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Custom particle animation for hero background */
.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation-name: particleAnimation;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Number counter animation */
.counter-value {
    animation: countUp 2s ease-out;
}

/* Progress bar animation */
.progress-animated .progress-bar {
    animation: progressAnimation 2s ease-in-out;
}

/* Glitch effect for tech theme */
.glitch {
    position: relative;
    animation: glitch 1s linear infinite;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--tech-blue);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--tech-purple);
    clip: rect(24px, 450px, 36px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

/* Floating element animation */
.float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse animation */
.pulse {
    animation: pulse 2s infinite;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes particleAnimation {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translate(var(--translateX), var(--translateY));
        opacity: 0;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressAnimation {
    from { width: 0; }
    to { width: var(--final-width); }
}

@keyframes glitch {
    2%, 64% { transform: translate(2px, 0) skew(0deg); }
    4%, 60% { transform: translate(-2px, 0) skew(0deg); }
    62% { transform: translate(0, 0) skew(5deg);  }
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    5% { clip: rect(70px, 9999px, 71px, 0); }
    10% { clip: rect(29px, 9999px, 83px, 0); }
    15% { clip: rect(38px, 9999px, 80px, 0); }
    20% { clip: rect(93px, 9999px, 61px, 0); }
    25% { clip: rect(7px, 9999px, 94px, 0); }
    30% { clip: rect(35px, 9999px, 85px, 0); }
    35% { clip: rect(28px, 9999px, 61px, 0); }
    40% { clip: rect(9px, 9999px, 29px, 0); }
    45% { clip: rect(49px, 9999px, 97px, 0); }
    50% { clip: rect(55px, 9999px, 52px, 0); }
    55% { clip: rect(89px, 9999px, 99px, 0); }
    60% { clip: rect(89px, 9999px, 13px, 0); }
    65% { clip: rect(84px, 9999px, 67px, 0); }
    70% { clip: rect(83px, 9999px, 64px, 0); }
    75% { clip: rect(15px, 9999px, 78px, 0); }
    80% { clip: rect(39px, 9999px, 44px, 0); }
    85% { clip: rect(56px, 9999px, 99px, 0); }
    90% { clip: rect(18px, 9999px, 19px, 0); }
    95% { clip: rect(56px, 9999px, 69px, 0); }
    100% { clip: rect(17px, 9999px, 75px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 17px, 0); }
    15% { clip: rect(20px, 9999px, 84px, 0); }
    20% { clip: rect(20px, 9999px, 14px, 0); }
    25% { clip: rect(67px, 9999px, 65px, 0); }
    30% { clip: rect(75px, 9999px, 5px, 0); }
    35% { clip: rect(54px, 9999px, 27px, 0); }
    40% { clip: rect(65px, 9999px, 34px, 0); }
    45% { clip: rect(94px, 9999px, 24px, 0); }
    50% { clip: rect(69px, 9999px, 23px, 0); }
    55% { clip: rect(99px, 9999px, 71px, 0); }
    60% { clip: rect(44px, 9999px, 49px, 0); }
    65% { clip: rect(9px, 9999px, 40px, 0); }
    70% { clip: rect(61px, 9999px, 13px, 0); }
    75% { clip: rect(45px, 9999px, 25px, 0); }
    80% { clip: rect(75px, 9999px, 83px, 0); }
    85% { clip: rect(90px, 9999px, 36px, 0); }
    90% { clip: rect(86px, 9999px, 2px, 0); }
    95% { clip: rect(20px, 9999px, 59px, 0); }
    100% { clip: rect(71px, 9999px, 58px, 0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
