/* San Valentín - Animations */

/* Optimized animations using only transform and opacity for performance */

/* Keyframe Animations */
@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(1.5);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* Animation Classes */
.heart-float {
    animation: floatHeart 15s infinite;
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

.floating-heart {
    position: absolute;
    font-size: 30px;
    opacity: 0;
    animation: floatUp 2s ease-out forwards;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.newspaper-title {
    animation: fadeInDown 1s ease-out;
    will-change: transform, opacity;
}

.envelope-wrapper {
    animation: fadeInUp 1s ease-out 0.3s backwards;
    will-change: transform, opacity;
}

.open-button {
    animation: pulse 2s infinite;
    will-change: transform;
}

.open-instruction {
    animation: fadeIn 1s ease-out 1s backwards;
    will-change: opacity;
}

.main-content {
    animation: fadeInContent 1s ease-out forwards;
    will-change: transform, opacity;
}

.section {
    animation: fadeInUp 0.8s ease-out backwards;
    will-change: transform, opacity;
}

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

.modal {
    animation: fadeIn 0.3s ease;
    will-change: opacity;
}

.modal-content {
    animation: scaleIn 0.5s ease;
    will-change: transform, opacity;
}

.modal-hearts {
    animation: pulse 1s infinite;
    will-change: transform;
}

/* Performance optimizations */
.optimized-animation {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .heart-float,
    .floating-heart {
        animation: none;
    }
    
    .open-button {
        animation: none;
    }
}