/* Advanced Animations & Effects */

/* ============ TEXT REVEAL ANIMATIONS ============ */

.text-reveal {
    opacity: 0;
    animation: revealText 0.8s ease forwards;
}

@keyframes revealText {
    0% {
        opacity: 0;
        letter-spacing: 10px;
    }
    100% {
        opacity: 1;
        letter-spacing: 0;
    }
}

.word-reveal {
    display: inline-block;
    animation: wordPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

@keyframes wordPop {
    0% {
        opacity: 0;
        transform: scale(0) rotateZ(-45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateZ(0deg);
    }
}

/* ============ HOVER LIFT EFFECTS ============ */

.hover-lift {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ============ GRADIENT ANIMATIONS ============ */

.gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

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

/* ============ BORDER ANIMATIONS ============ */

.border-animate {
    position: relative;
    border: 2px solid transparent;
    animation: borderFlow 2s linear infinite;
}

@keyframes borderFlow {
    0% {
        border-color: rgba(63, 109, 228, 0);
    }
    25% {
        border-top-color: rgba(63, 109, 228, 1);
    }
    50% {
        border-color: rgba(63, 109, 228, 1);
    }
    75% {
        border-bottom-color: rgba(63, 109, 228, 1);
    }
    100% {
        border-color: rgba(63, 109, 228, 0);
    }
}

/* ============ SHADOW PULSE EFFECT ============ */

.shadow-pulse {
    animation: shadowPulse 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(63, 109, 228, 0.2);
    }
    50% {
        box-shadow: 0 5px 30px rgba(63, 109, 228, 0.4);
    }
}

/* ============ ICON SPIN & BOUNCE ============ */

.icon-spin-bounce {
    animation: spinBounce 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spinBounce {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* ============ TYPING EFFECT ============ */

.typing-effect {
    border-right: 3px solid var(--primary-color);
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
    overflow: hidden;
    white-space: nowrap;
}

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

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

/* ============ WAVE ANIMATION ============ */

.wave {
    animation: wave 2s ease-in-out infinite;
    transform-origin: center;
}

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

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

/* ============ BOUNCE IN ANIMATIONS ============ */

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

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

.bounce-in-delay-1 { animation-delay: 0.1s; }
.bounce-in-delay-2 { animation-delay: 0.2s; }
.bounce-in-delay-3 { animation-delay: 0.3s; }
.bounce-in-delay-4 { animation-delay: 0.4s; }
.bounce-in-delay-5 { animation-delay: 0.5s; }

/* ============ STAGGER ANIMATIONS ============ */

.stagger-animation {
    animation: stagger 0.8s ease forwards;
    opacity: 0;
}

@keyframes stagger {
    0% {
        opacity: 0;
        transform: translateX(-30px) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
}

/* ============ FLIP CARD ANIMATIONS ============ */

.flip-card {
    perspective: 1000px;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    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%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
}

.flip-card-front {
    background: linear-gradient(135deg, #3f6de4, #2563eb);
    color: white;
}

.flip-card-back {
    background: linear-gradient(135deg, #2d5aa4, #1e47a0);
    color: white;
    transform: rotateY(180deg);
}

/* ============ SKEW ANIMATIONS ============ */

.skew-effect {
    transition: all 0.3s ease;
}

.skew-effect:hover {
    transform: skewY(5deg);
}

/* ============ NEON GLOW EFFECT ============ */

.neon-glow {
    text-shadow: 0 0 10px rgba(63, 109, 228, 0.8),
                 0 0 20px rgba(63, 109, 228, 0.6),
                 0 0 30px rgba(63, 109, 228, 0.4);
    animation: neonFlicker 3s ease-in-out infinite;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 0 0 10px rgba(63, 109, 228, 0.8),
                     0 0 20px rgba(63, 109, 228, 0.6),
                     0 0 30px rgba(63, 109, 228, 0.4);
    }
    50% {
        text-shadow: 0 0 5px rgba(63, 109, 228, 0.4),
                     0 0 10px rgba(63, 109, 228, 0.3),
                     0 0 15px rgba(63, 109, 228, 0.2);
    }
}

/* ============ SPOTLIGHT EFFECT ============ */

.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: spotlight 3s ease-in-out infinite;
}

@keyframes spotlight {
    0% { transform: translate(-100%, -100%) scale(1); }
    50% { transform: translate(0, 0) scale(1.2); }
    100% { transform: translate(100%, 100%) scale(1); }
}

/* ============ RIPPLE EFFECT ============ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: rgba(63, 109, 228, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ============ SWIPE ANIMATIONS ============ */

.swipe-in-left {
    animation: swipeInLeft 0.6s ease forwards;
    opacity: 0;
}

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

.swipe-in-right {
    animation: swipeInRight 0.6s ease forwards;
    opacity: 0;
}

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

/* ============ ZOOM ANIMATIONS ============ */

.zoom-in {
    animation: zoomIn 0.6s ease forwards;
    opacity: 0;
}

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

.zoom-out {
    animation: zoomOut 0.6s ease forwards;
    opacity: 1;
}

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

/* ============ HEARTBEAT ANIMATION ============ */

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

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

/* ============ DIAGONAL SLIDE ============ */

.diagonal-slide {
    animation: diagonalSlide 0.8s ease forwards;
    opacity: 0;
}

@keyframes diagonalSlide {
    from {
        opacity: 0;
        transform: translate(-50px, -50px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}
