/* Advanced Animations and Effects */

/* Scroll-triggered animations - Now handled by GSAP */
/* Removed conflicting CSS styles to allow GSAP animations to work properly */

/* Parallax effects */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-element {
    will-change: transform;
    transform: translateZ(0);
}

/* Morphing animations */
@keyframes morph {
    0%, 100% {
        border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    }
    25% {
        border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    }
    50% {
        border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%;
    }
    75% {
        border-radius: 60% 40% 40% 60% / 50% 50% 50% 50%;
    }
}

.morphing-element {
    animation: morph 8s ease-in-out infinite;
}

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

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

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

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

/* Gradient animations */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--success-color));
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

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

.glitch {
    animation: glitch 0.3s ease-in-out infinite;
}

/* Neon glow effect */
@keyframes neon-glow {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px var(--primary-color),
            0 0 35px var(--primary-color),
            0 0 40px var(--primary-color),
            0 0 50px var(--primary-color),
            0 0 75px var(--primary-color);
    }
    50% {
        text-shadow: 
            0 0 2px currentColor,
            0 0 5px currentColor,
            0 0 8px currentColor,
            0 0 10px var(--primary-color),
            0 0 17px var(--primary-color),
            0 0 20px var(--primary-color),
            0 0 25px var(--primary-color),
            0 0 37px var(--primary-color);
    }
}

.neon-text {
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

/* Card flip animation */
.card-flip {
    perspective: 1000px;
}

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

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 600ms linear;
    background-color: rgba(255, 255, 255, 0.7);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--primary-color);
    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: var(--primary-color);
    }
}

/* Pulse border animation */
@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.pulse-border {
    animation: pulse-border 2s infinite;
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

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

.shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Slide animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-down {
    animation: slideInDown 0.5s ease-out;
}

/* Rotate animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

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

.rotate-reverse {
    animation: rotate-reverse 2s linear infinite;
}

/* Zoom animations */
@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

.zoom-out {
    animation: zoomOut 0.5s ease-out;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Stagger animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-container .stagger-item {
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-container .stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-container .stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-container .stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-container .stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-container .stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-container .stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Hover 3D effect */
.hover-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.hover-3d:hover {
    transform: perspective(1000px) rotateY(15deg) rotateX(10deg) scale(1.05);
}

/* Glow effect */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-effect:hover::before {
    opacity: 1;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    }
    to {
        box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

/* Text gradient animation */
@keyframes text-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-text-gradient {
    background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--success-color));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient 3s ease infinite;
}

/* Magnetic cursor effect */
.magnetic {
    transition: transform 0.2s ease;
}

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

/* Liquid fill animation */
@keyframes liquid-fill {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.liquid-fill {
    position: relative;
    overflow: hidden;
}

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

/* Particle trail effect */
.particle-trail {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fade 1s ease-out forwards;
}

@keyframes particle-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-20px);
    }
}

/* Confetti animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateZ(360deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-in-out forwards;
}

/* SVG path animation */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

.animated-svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 2s ease-in-out forwards;
}

/* Hover tilt effect */
.tilt-effect {
    transition: transform 0.2s ease;
}

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

/* Marquee animation */
@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.marquee {
    animation: marquee 20s linear infinite;
}

/* Blur in animation */
@keyframes blur-in {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blur-in 0.8s ease-out;
}

/* Elastic animation */
@keyframes elastic {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25);
    }
    40% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    60% {
        transform: scale(0.98);
    }
    70% {
        transform: scale(1.02);
    }
    80% {
        transform: scale(1);
    }
}

.elastic {
    animation: elastic 0.8s ease-out;
}

/* Flip animation */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    40% {
        transform: perspective(400px) rotateY(-180deg);
    }
    100% {
        transform: perspective(400px) rotateY(-360deg);
    }
}

.flip {
    animation: flip 1s ease-in-out;
}

/* Swing animation */
@keyframes swing {
    20% {
        transform: rotate3d(0, 0, 1, 15deg);
    }
    40% {
        transform: rotate3d(0, 0, 1, -10deg);
    }
    60% {
        transform: rotate3d(0, 0, 1, 5deg);
    }
    80% {
        transform: rotate3d(0, 0, 1, -5deg);
    }
    100% {
        transform: rotate3d(0, 0, 1, 0deg);
    }
}

.swing {
    animation: swing 1s ease-in-out;
}

/* Heartbeat animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* Rubber band animation */
@keyframes rubberBand {
    0% {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.25, 0.75, 1);
    }
    40% {
        transform: scale3d(0.75, 1.25, 1);
    }
    50% {
        transform: scale3d(1.15, 0.85, 1);
    }
    65% {
        transform: scale3d(0.95, 1.05, 1);
    }
    75% {
        transform: scale3d(1.05, 0.95, 1);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

.rubber-band {
    animation: rubberBand 1s ease-in-out;
}

/* Wobble animation */
@keyframes wobble {
    0% {
        transform: translate3d(0, 0, 0);
    }
    15% {
        transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }
    30% {
        transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
    }
    45% {
        transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
    }
    60% {
        transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
    }
    75% {
        transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

.wobble {
    animation: wobble 1s ease-in-out;
}

/* Tada animation */
@keyframes tada {
    0% {
        transform: scale3d(1, 1, 1);
    }
    10%, 20% {
        transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    }
    40%, 60%, 80% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

.tada {
    animation: tada 1s ease-in-out;
}

/* Hinge animation */
@keyframes hinge {
    0% {
        transform-origin: top left;
        animation-timing-function: ease-in-out;
    }
    20%, 60% {
        transform: rotate3d(0, 0, 1, 80deg);
        transform-origin: top left;
        animation-timing-function: ease-in-out;
    }
    40%, 80% {
        transform: rotate3d(0, 0, 1, 60deg);
        transform-origin: top left;
        animation-timing-function: ease-in-out;
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 700px, 0);
        opacity: 0;
    }
}

.hinge {
    animation: hinge 2s ease-in-out;
}

/* Roll in animation */
@keyframes rollIn {
    0% {
        opacity: 0;
        transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

.roll-in {
    animation: rollIn 1s ease-out;
}

/* Roll out animation */
@keyframes rollOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
    }
}

.roll-out {
    animation: rollOut 1s ease-in;
}

/* Light speed animation */
@keyframes lightSpeedIn {
    0% {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    60% {
        transform: translateX(-20%) skewX(30deg);
        opacity: 1;
    }
    80% {
        transform: translateX(0%) skewX(-15deg);
        opacity: 1;
    }
    100% {
        transform: translateX(0%) skewX(0deg);
        opacity: 1;
    }
}

.light-speed-in {
    animation: lightSpeedIn 1s ease-out;
}

/* Media queries for animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive animations */
@media (max-width: 768px) {
    .scroll-reveal {
        transform: none !important;
    }
    
    .scroll-reveal.revealed {
        transform: none !important;
    }
}

/* Animation utilities */
.animation-delay-1 { animation-delay: 0.1s; }
.animation-delay-2 { animation-delay: 0.2s; }
.animation-delay-3 { animation-delay: 0.3s; }
.animation-delay-4 { animation-delay: 0.4s; }
.animation-delay-5 { animation-delay: 0.5s; }
.animation-delay-6 { animation-delay: 0.6s; }
.animation-delay-7 { animation-delay: 0.7s; }
.animation-delay-8 { animation-delay: 0.8s; }
.animation-delay-9 { animation-delay: 0.9s; }
.animation-delay-10 { animation-delay: 1s; }
