/**
 * БІЗДІҢ ӘЛЕМІМІЗ / НАШ МИР (OUR WORLD)
 * Romantic Keyframe Animations & Micro-interactions
 */

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

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

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

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered block entrance */
.reader-block-card {
    opacity: 0;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message-card {
    animation: slideUpFade 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-fade-in {
    animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Envelope Flight Animation */
.envelope-flight-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 15, 24, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: opacity 0.4s ease;
}

.envelope-flight-overlay.fade-out {
    opacity: 0;
}

.flying-envelope {
    position: relative;
    font-size: 5rem;
    animation: envelopeFlight 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes envelopeFlight {
    0% {
        transform: scale(0.6) translateY(100px) rotate(-15deg);
        opacity: 0;
    }
    40% {
        transform: scale(1.2) translateY(-20px) rotate(5deg);
        opacity: 1;
    }
    70% {
        transform: scale(1.05) translateY(-50px) rotate(-5deg);
    }
    100% {
        transform: scale(1.6) translateY(-140px) rotate(15deg);
        opacity: 0;
    }
}

.flight-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 77, 121, 0.8);
    animation: gentlePulse 1.2s infinite ease-in-out;
}

/* Flying Heart Particles */
.flying-heart-particle {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 10001;
    animation: explodeParticle 1.1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes explodeParticle {
    0% {
        transform: translate(0, 0) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    70% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1.3) rotate(var(--rot));
        opacity: 0;
    }
}

/* Unlock reveal */
.unlocked-reveal {
    animation: unlockAnimation 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes unlockAnimation {
    0% {
        filter: blur(12px);
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        filter: blur(4px);
        transform: scale(1.02);
    }
    100% {
        filter: blur(0);
        transform: scale(1);
        opacity: 1;
    }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .flying-heart-particle {
        display: none !important;
    }
}
