/* 
 * Neon Voyages - Animations Stylesheet
 * A futuristic vaporwave-themed UK tourism website
 * 
 * This stylesheet contains animations and effects for the website
 */

/* ===== GLITCH TEXT EFFECT ===== */
.glitch-text {
    position: relative;
    display: inline-block;
    color: var(--text-color);
}

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

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--primary-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 2s linear infinite alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--secondary-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2s linear infinite alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(24px, 550px, 90px, 0);
    }
    20% {
        clip: rect(10px, 550px, 70px, 0);
    }
    40% {
        clip: rect(58px, 550px, 130px, 0);
    }
    60% {
        clip: rect(24px, 550px, 20px, 0);
    }
    80% {
        clip: rect(15px, 550px, 80px, 0);
    }
    100% {
        clip: rect(44px, 550px, 110px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(85px, 550px, 140px, 0);
    }
    20% {
        clip: rect(40px, 550px, 18px, 0);
    }
    40% {
        clip: rect(92px, 550px, 18px, 0);
    }
    60% {
        clip: rect(54px, 550px, 130px, 0);
    }
    80% {
        clip: rect(12px, 550px, 60px, 0);
    }
    100% {
        clip: rect(90px, 550px, 30px, 0);
    }
}

/* ===== FLOATING ANIMATION ===== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

/* ===== NEON PULSE ANIMATION ===== */
.neon-pulse {
    animation: neon-pulse 2s ease-in-out infinite alternate;
}

@keyframes neon-pulse {
    from {
        filter: drop-shadow(0 0 2px var(--primary-color)) drop-shadow(0 0 5px var(--primary-color));
    }
    to {
        filter: drop-shadow(0 0 10px var(--primary-color)) drop-shadow(0 0 20px var(--primary-color));
    }
}

/* ===== GRADIENT FLOW ANIMATION ===== */
.gradient-flow {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 200%;
    animation: gradient-flow 5s ease infinite;
}

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

/* ===== SLIDE IN ANIMATIONS ===== */
.slide-in-left {
    animation: slide-in-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.slide-in-right {
    animation: slide-in-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.slide-in-top {
    animation: slide-in-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.slide-in-bottom {
    animation: slide-in-bottom 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slide-in-left {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-in-top {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== FADE IN ANIMATION ===== */
.fade-in {
    animation: fade-in 0.8s ease both;
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ===== SCALE IN ANIMATION ===== */
.scale-in {
    animation: scale-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes scale-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== VIBRATION ANIMATION ===== */
.vibrate {
    animation: vibrate 0.3s linear infinite both;
}

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

/* ===== TEXT GRADIENT ANIMATION ===== */
.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-gradient 3s linear infinite;
}

@keyframes text-gradient {
    to {
        background-position: 200% center;
    }
}

/* ===== SHAKE ANIMATION ===== */
.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }

    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* ===== MEDIA QUERIES ===== */
@media (prefers-reduced-motion) {
    .glitch-text::before,
    .glitch-text::after,
    .floating,
    .neon-pulse,
    .gradient-flow,
    .slide-in-left,
    .slide-in-right,
    .slide-in-top,
    .slide-in-bottom,
    .fade-in,
    .scale-in,
    .vibrate,
    .text-gradient,
    .shake {
        animation: none;
    }
}