/* ============================================
   Animations - Wedding Invitation
   ============================================ */

/* ---- Entrance Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ---- Cover Animations ---- */
.cover-page .walimatul-urs {
    animation: fadeInDown 1s ease 0.3s both;
}

.cover-page .cover-ornament-top {
    animation: fadeInDown 1s ease 0.1s both;
}

.cover-page .cover-floral-frame {
    animation: scaleIn 1.2s ease 0.6s both;
}

.cover-page .cover-names .groom-name {
    animation: fadeInLeft 1s ease 0.9s both;
}

.cover-page .cover-names .ampersand {
    animation: scaleIn 0.8s ease 1.1s both;
}

.cover-page .cover-names .bride-name {
    animation: fadeInRight 1s ease 1.3s both;
}

.cover-page .cover-guest-box {
    animation: fadeInUp 1s ease 1.5s both;
}

.cover-page .btn-open-invitation {
    animation: fadeInUp 1s ease 1.8s both;
}

.cover-page .cover-footer-text {
    animation: fadeIn 1s ease 2s both;
}

/* ---- Floating Animation ---- */
@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-12px) rotate(1deg); }
}

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

/* ---- Sparkle/Shimmer ---- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer-text {
    background: linear-gradient(
        90deg, 
        var(--brown-dark) 0%, 
        var(--gold) 25%, 
        var(--brown-dark) 50%, 
        var(--gold) 75%, 
        var(--brown-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
}

/* ---- Heart Beat ---- */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
    60% { transform: scale(1); }
}

.heart-beat {
    animation: heartBeat 2s ease-in-out infinite;
    display: inline-block;
}

/* ---- Staggered Animations for Lists ---- */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

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

/* ---- Petal Fall (CSS-only fallback) ---- */
@keyframes petalFall {
    0% {
        transform: translateY(-10vh) translateX(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(30px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(-20px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(25px) rotate(270deg);
        opacity: 0.7;
    }
    100% {
        transform: translateY(105vh) translateX(-10px) rotate(360deg);
        opacity: 0;
    }
}

.css-petal {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    font-size: 16px;
    opacity: 0;
    animation: petalFall linear infinite;
}

.css-petal:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.css-petal:nth-child(2) { left: 25%; animation-duration: 10s; animation-delay: 2s; }
.css-petal:nth-child(3) { left: 45%; animation-duration: 9s; animation-delay: 4s; }
.css-petal:nth-child(4) { left: 65%; animation-duration: 11s; animation-delay: 1s; }
.css-petal:nth-child(5) { left: 80%; animation-duration: 8.5s; animation-delay: 3s; }
.css-petal:nth-child(6) { left: 15%; animation-duration: 10.5s; animation-delay: 5s; }
.css-petal:nth-child(7) { left: 55%; animation-duration: 9.5s; animation-delay: 6s; }
.css-petal:nth-child(8) { left: 35%; animation-duration: 7.5s; animation-delay: 7s; }

/* ---- Ripple Effect for buttons ---- */
@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

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

.ripple-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
}

.ripple-container:active::after {
    animation: ripple 0.6s ease-out;
}

/* ---- Typing Effect ---- */
@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: var(--gold); }
}

/* ---- Parallax sections ---- */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ---- Scale on Scroll ---- */
.scale-on-scroll {
    transition: transform 0.5s ease;
}

.scale-on-scroll.visible {
    transform: scale(1);
}

/* ---- Gentle Swing ---- */
@keyframes gentleSwing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.gentle-swing {
    animation: gentleSwing 3s ease-in-out infinite;
    transform-origin: top center;
}
