/* Animations and Effects */

/* Text Reveal Animation */
.text-reveal {
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    animation: revealText 1.5s cubic-bezier(0.77, 0, 0.18, 1) forwards;
}

@keyframes revealText {
    0% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

/* Glitch Effect */
.glitch-effect {
    position: relative;
    animation: glitch 5s infinite;
}

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

.glitch-effect::before {
    animation: glitch-effect 3s infinite;
    color: #0ff;
    z-index: -1;
}

.glitch-effect::after {
    animation: glitch-effect 2s infinite;
    color: #f0f;
    z-index: -2;
}

/* Override for titlesite to remove green effect */
.titlesite.glitch-effect::before,
.titlesite.glitch-effect::after {
    color: rgba(0, 0, 0, 0.5); /* Dark transparent color instead of colorful glitch */
}

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

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Reveal Animations */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal-down {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.8s ease;
}

.reveal-left.active,
.reveal-right.active,
.reveal-up.active,
.reveal-down.active {
    opacity: 1;
    transform: translate(0);
}

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

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

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

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

/* Rotating Animation */
.rotate {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 0.15em solid var(--accent-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent-color);
    }
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Button Animations */
.btn-pulse {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 204, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 204, 0);
    }
}

/* Animated Background */
.animated-background {
    position: relative;
    overflow: hidden;
}

.animated-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a, #3a3a3a, #2a2a2a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    transform: rotate(45deg);
    z-index: -1;
}

/* Particle Animation */
.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
    }
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animated Underline */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.animated-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Animated Icons */
.animated-icon {
    transition: all 0.3s ease;
}

.animated-icon:hover {
    transform: translateY(-5px) rotate(10deg);
    color: var(--accent-color);
}

/* Form Focus Animation */
.form-focus-animation input:focus,
.form-focus-animation textarea:focus {
    animation: formFocus 0.3s ease-in-out;
}

@keyframes formFocus {
    0% {
        transform: scale(0.98);
    }
    70% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
    }
}

/* Custom Cursor Animation */
@keyframes cursorAnim {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.cursor.expand {
    animation: cursorAnim 0.5s forwards;
}

/* Hide cursor animations on mobile devices */
@media screen and (max-width: 768px) {
    .cursor, .cursor-follower {
        display: none;
    }
}
