/* ========================================
   Advanced Interactive Effects
   ======================================== */

/* 3D Card Flip Effect */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
}

/* Neon Glow Effect */
.neon-glow {
    text-shadow: 
        0 0 5px rgba(127, 19, 236, 0.5),
        0 0 10px rgba(127, 19, 236, 0.5),
        0 0 20px rgba(127, 19, 236, 0.5),
        0 0 40px rgba(127, 19, 236, 0.3);
    animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(127, 19, 236, 0.5),
            0 0 10px rgba(127, 19, 236, 0.5),
            0 0 20px rgba(127, 19, 236, 0.5),
            0 0 40px rgba(127, 19, 236, 0.3);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(127, 19, 236, 0.8),
            0 0 20px rgba(127, 19, 236, 0.8),
            0 0 30px rgba(127, 19, 236, 0.8),
            0 0 60px rgba(127, 19, 236, 0.5);
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

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

.glitch:hover::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: #7f13ec;
    z-index: -1;
}

.glitch:hover::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
    color: #ec13d8;
    z-index: -2;
}

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

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

/* Particle Background Effect */
.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(127, 19, 236, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(185, 28, 236, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 19, 216, 0.1) 0%, transparent 50%);
    animation: particle-float 20s ease-in-out infinite;
}

@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Liquid Button Effect */
.liquid-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.liquid-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.liquid-button:hover::before {
    width: 300px;
    height: 300px;
}

/* Morphing Border */
.morphing-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(#0a0a0f, #0a0a0f) padding-box,
                linear-gradient(135deg, #7f13ec, #b91cec, #ec13d8) border-box;
    animation: border-morph 3s ease-in-out infinite;
}

@keyframes border-morph {
    0%, 100% {
        border-radius: 24px;
    }
    25% {
        border-radius: 32px 24px 32px 24px;
    }
    50% {
        border-radius: 24px 32px 24px 32px;
    }
    75% {
        border-radius: 32px 24px 32px 24px;
    }
}

/* Spotlight Effect */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.spotlight:hover::after {
    opacity: 1;
    animation: spotlight-move 2s ease-in-out infinite;
}

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

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-left: 3px solid #7f13ec;
    white-space: nowrap;
    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: #7f13ec;
    }
}

/* Wave Animation */
.wave {
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
    display: inline-block;
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

/* Tilt Effect */
.tilt-effect {
    transition: transform 0.3s ease;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg) scale(1.05);
}

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

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.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);
    }
}

/* Flip Animation */
.flip {
    animation: flip 1s ease-in-out;
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Zoom In/Out */
.zoom-in {
    animation: zoom-in 0.5s ease-out;
}

@keyframes zoom-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Elastic Animation */
.elastic {
    animation: elastic 1s ease-out;
}

@keyframes elastic {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    75% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    background: linear-gradient(#0a0a0f, #0a0a0f) padding-box,
                linear-gradient(135deg, #7f13ec, #b91cec, #ec13d8) border-box;
    border: 2px solid transparent;
    background-size: 200% 200%;
    animation: gradient-border-flow 3s ease infinite;
}

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

/* Floating Labels */
.floating-label {
    position: relative;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    transform: translateY(-25px) scale(0.85);
    color: #7f13ec;
}

.floating-label label {
    position: absolute;
    top: 12px;
    right: 12px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Progress Bar Animation */
.progress-bar {
    position: relative;
    height: 4px;
    background: rgba(127, 19, 236, 0.2);
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #7f13ec, #b91cec, #ec13d8);
    animation: progress 2s ease-in-out forwards;
}

@keyframes progress {
    to {
        width: 100%;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(127, 19, 236, 0.1) 25%,
        rgba(127, 19, 236, 0.2) 50%,
        rgba(127, 19, 236, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
