/* Smooth fade and rise for sections */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header slide-down on page load */
@keyframes headerSlideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Staggered entrance for movie cards */
@keyframes cardPop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Subtle pulse for active elements */
@keyframes softPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Zoom and Fade for the Modal */
@keyframes modalReveal {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Smooth Fade and Blur for the Backdrop */
@keyframes backdropReveal {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Header entrance */
#header {
    animation: headerSlideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Section & Search entrance */
.body-header-title,
.search-container {
    animation: fadeInUp 0.8s ease-out both;
}

/* Movie Grid entrance */
#movie-grid {
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Trending Badge pulse */
.trending-badge {
    animation: softPulse 2s infinite ease-in-out;
}


.movie-card {
    animation: cardPop 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

/* Staggered delays for cards */
.movie-card:nth-child(1) {
    animation-delay: 0.1s;
}

.movie-card:nth-child(2) {
    animation-delay: 0.15s;
}

.movie-card:nth-child(3) {
    animation-delay: 0.2s;
}

.movie-card:nth-child(4) {
    animation-delay: 0.25s;
}

.movie-card:nth-child(n+5) {
    animation-delay: 0.3s;
}



/* Search bar focus scale */
.search-input:focus {
    transform: scale(1.01);
}

/* Modal Reveal */
#mydialog[open] {
    animation: modalReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Modal Backdrop */
#mydialog[open]::backdrop {
    animation: backdropReveal 0.5s ease-out forwards;
}

/* Modal Content stagger */
#mydialog[open] .modal-body {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}