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

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 212, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Matrix Rain Effect */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
}

.matrix-char {
    position: absolute;
    color: #00d4ff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrix-fall linear infinite;
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: #00d4ff;
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

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

.glitch::before {
    animation: glitch-anim 2s infinite linear alternate-reverse;
    color: #ff0040;
    z-index: -1;
}

.glitch::after {
    animation: glitch-anim2 1s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
        transform: skew(0.85deg);
    }
    5% {
        clip: rect(12px, 9999px, 59px, 0);
        transform: skew(0.4deg);
    }
    10% {
        clip: rect(48px, 9999px, 29px, 0);
        transform: skew(0.7deg);
    }
    15% {
        clip: rect(42px, 9999px, 73px, 0);
        transform: skew(0.1deg);
    }
    20% {
        clip: rect(63px, 9999px, 27px, 0);
        transform: skew(0.2deg);
    }
    25% {
        clip: rect(34px, 9999px, 55px, 0);
        transform: skew(1.1deg);
    }
    30% {
        clip: rect(86px, 9999px, 73px, 0);
        transform: skew(0.8deg);
    }
    35% {
        clip: rect(20px, 9999px, 20px, 0);
        transform: skew(1deg);
    }
    40% {
        clip: rect(26px, 9999px, 60px, 0);
        transform: skew(0.5deg);
    }
    45% {
        clip: rect(25px, 9999px, 66px, 0);
        transform: skew(0.2deg);
    }
    50% {
        clip: rect(57px, 9999px, 98px, 0);
        transform: skew(0.7deg);
    }
    55% {
        clip: rect(5px, 9999px, 46px, 0);
        transform: skew(0.3deg);
    }
    60% {
        clip: rect(82px, 9999px, 31px, 0);
        transform: skew(0.9deg);
    }
    65% {
        clip: rect(54px, 9999px, 27px, 0);
        transform: skew(0.2deg);
    }
    70% {
        clip: rect(28px, 9999px, 99px, 0);
        transform: skew(0.6deg);
    }
    75% {
        clip: rect(45px, 9999px, 69px, 0);
        transform: skew(0.1deg);
    }
    80% {
        clip: rect(23px, 9999px, 85px, 0);
        transform: skew(0.8deg);
    }
    85% {
        clip: rect(54px, 9999px, 84px, 0);
        transform: skew(0.5deg);
    }
    90% {
        clip: rect(45px, 9999px, 47px, 0);
        transform: skew(0.3deg);
    }
    95% {
        clip: rect(37px, 9999px, 20px, 0);
        transform: skew(0.4deg);
    }
    100% {
        clip: rect(4px, 9999px, 91px, 0);
        transform: skew(0.2deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
        transform: skew(0.2deg);
    }
    5% {
        clip: rect(52px, 9999px, 74px, 0);
        transform: skew(0.9deg);
    }
    10% {
        clip: rect(79px, 9999px, 85px, 0);
        transform: skew(0.5deg);
    }
    15% {
        clip: rect(75px, 9999px, 5px, 0);
        transform: skew(0.1deg);
    }
    20% {
        clip: rect(67px, 9999px, 61px, 0);
        transform: skew(0.3deg);
    }
    25% {
        clip: rect(14px, 9999px, 79px, 0);
        transform: skew(0.7deg);
    }
    30% {
        clip: rect(1px, 9999px, 66px, 0);
        transform: skew(0.4deg);
    }
    35% {
        clip: rect(86px, 9999px, 30px, 0);
        transform: skew(0.6deg);
    }
    40% {
        clip: rect(23px, 9999px, 98px, 0);
        transform: skew(0.8deg);
    }
    45% {
        clip: rect(85px, 9999px, 72px, 0);
        transform: skew(0.2deg);
    }
    50% {
        clip: rect(39px, 9999px, 49px, 0);
        transform: skew(0.5deg);
    }
    55% {
        clip: rect(54px, 9999px, 75px, 0);
        transform: skew(0.3deg);
    }
    60% {
        clip: rect(17px, 9999px, 99px, 0);
        transform: skew(0.1deg);
    }
    65% {
        clip: rect(34px, 9999px, 15px, 0);
        transform: skew(0.9deg);
    }
    70% {
        clip: rect(6px, 9999px, 87px, 0);
        transform: skew(0.4deg);
    }
    75% {
        clip: rect(68px, 9999px, 56px, 0);
        transform: skew(0.7deg);
    }
    80% {
        clip: rect(95px, 9999px, 78px, 0);
        transform: skew(0.6deg);
    }
    85% {
        clip: rect(12px, 9999px, 64px, 0);
        transform: skew(0.2deg);
    }
    90% {
        clip: rect(45px, 9999px, 81px, 0);
        transform: skew(0.8deg);
    }
    95% {
        clip: rect(33px, 9999px, 92px, 0);
        transform: skew(0.3deg);
    }
    100% {
        clip: rect(76px, 9999px, 48px, 0);
        transform: skew(0.5deg);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }
    10% {
        transform: skew(-2deg);
    }
    20% {
        transform: skew(1deg);
    }
    30% {
        transform: skew(-1deg);
    }
    40% {
        transform: skew(2deg);
    }
    50% {
        transform: skew(-1deg);
    }
    60% {
        transform: skew(0deg);
    }
    70% {
        transform: skew(1deg);
    }
    80% {
        transform: skew(-2deg);
    }
    90% {
        transform: skew(1deg);
    }
    100% {
        transform: skew(0deg);
    }
}

/* Neon Glow Effect */
.neon {
    color: #00d4ff;
    text-shadow: 
        0 0 5px #00d4ff,
        0 0 10px #00d4ff,
        0 0 15px #00d4ff,
        0 0 20px #00d4ff,
        0 0 35px #00d4ff,
        0 0 40px #00d4ff;
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px #00d4ff,
            0 0 10px #00d4ff,
            0 0 15px #00d4ff,
            0 0 20px #00d4ff,
            0 0 35px #00d4ff,
            0 0 40px #00d4ff;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff, #06ffa5, #ffbe0b, #fb5607);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographic-shift 3s ease-in-out infinite;
}

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

/* 3D Flip Card Effect */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.flip-card-front {
    background: var(--gradient-dark);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.flip-card-back {
    background: var(--gradient-primary);
    color: white;
    transform: rotateY(180deg);
}

/* Morphing Shapes */
.morphing-shape {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: morph 4s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 0%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 50% 0%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 0% 50%;
        transform: rotate(270deg);
    }
}

/* Particle Trail Effect */
.particle-trail {
    position: relative;
    overflow: hidden;
}

.particle-trail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
    animation: particle-sweep 2s infinite;
}

@keyframes particle-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Liquid Animation */
.liquid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #00d4ff, #0099cc, #ff6b35);
    background-size: 400% 400%;
    animation: liquid-flow 8s ease-in-out infinite;
    opacity: 0.1;
    z-index: -1;
}

@keyframes liquid-flow {
    0%, 100% {
        background-position: 0% 50%;
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        background-position: 100% 50%;
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        background-position: 100% 100%;
        border-radius: 50% 60% 30% 40% / 30% 40% 60% 70%;
    }
    75% {
        background-position: 0% 100%;
        border-radius: 40% 30% 60% 70% / 40% 70% 60% 30%;
    }
}

/* Cyberpunk Grid */
.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
    z-index: -1;
}

@keyframes grid-move {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Scan Line Effect */
.scan-lines {
    position: relative;
    overflow: hidden;
}

.scan-lines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 212, 255, 0.03) 2px,
        rgba(0, 212, 255, 0.03) 4px
    );
    pointer-events: none;
    animation: scan-line-move 0.1s linear infinite;
}

@keyframes scan-line-move {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

/* Loading Spinner */
.cyber-loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 212, 255, 0.3);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: cyber-spin 1s linear infinite;
}

@keyframes cyber-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

.text-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    animation: text-reveal-anim 2s ease-out forwards;
}

@keyframes text-reveal-anim {
    0% {
        left: 0;
    }
    50% {
        left: 0;
        right: 0;
    }
    100% {
        left: 100%;
    }
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s ease;
}

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

/* Parallax Layers */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.parallax-layer-1 {
    transform: translateZ(-1px) scale(2);
}

.parallax-layer-2 {
    transform: translateZ(-2px) scale(3);
}

.parallax-layer-3 {
    transform: translateZ(-3px) scale(4);
}

/* Responsive Animations */
@media (max-width: 768px) {
    .glitch {
        font-size: 2.5rem;
    }
    
    .morphing-shape {
        width: 60px;
        height: 60px;
    }
    
    .flip-card {
        height: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
