/* ===================================
   COVER.CSS - WD-006 Template
   Cover Overlay, Photo Animation, Preloader
   =================================== */

/* Cover Overlay - Fixed full screen */
#cover-overlay-main {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
    background-image: url('/templates/wd-006/assets/photo/bg-cover.webp');
    background-position: center;
    background-size: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#cover-overlay-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

#cover-overlay-main::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

#cover-overlay-main>div {
    position: relative;
    z-index: 10;
}

#cover-overlay-main.hidden,
#cover-overlay-main.slide-up {
    transform: translateY(-100%);
    pointer-events: none;
}

/* Performance optimization */
#cover-overlay-main,
.flower {
    will-change: transform;
    transform: translateZ(0);
}

/* Lock body scroll when cover is active */
body.cover-active {
    overflow: hidden;
    height: 100vh;
}

body.cover-active #main-content {
    pointer-events: none;
}

/* Music button container */
.music-button-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body:not(.cover-active) .music-button-container {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Photo Fan Animation ===== */
.photo-container-fan {
    position: relative;
    width: 300px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-frame {
    position: absolute;
    width: 130px;
    height: 160px;
    padding: 6px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform-origin: bottom center;
    border-radius: 4px;
    transition: none;
    top: 20px;
    will-change: transform;
    backface-visibility: hidden;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* Initial State: Stacked */
.photo-frame.groom {
    z-index: 1;
    transform: rotate(5deg);
}

.photo-frame.bride {
    z-index: 2;
    transform: rotate(-5deg);
}

/* Animation triggered by class */
.photo-container-fan.start-animation .photo-frame.groom {
    animation: fanOpenRight 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 500ms;
}

.photo-container-fan.start-animation .photo-frame.bride {
    animation: fanOpenLeft 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 500ms;
}

@keyframes fanOpenLeft {
    from {
        transform: rotate(-5deg) translateX(0);
    }

    to {
        transform: rotate(-15deg) translateX(-40px);
    }
}

@keyframes fanOpenRight {
    from {
        transform: rotate(5deg) translateX(0);
    }

    to {
        transform: rotate(15deg) translateX(40px);
    }
}

/* ===== Glass Button ===== */
.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0px rgba(255, 255, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
}

.btn-glass:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.4), transparent, transparent);
    opacity: 0.5;
    pointer-events: none;
}

.btn-glass span {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-family: 'Roboto', sans-serif;
}

/* ===== Preloader ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader {
    width: 48px;
    height: 86px;
    position: relative;
}

.loader::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, 50%);
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: bounce 1s ease-in infinite alternate;
}

.loader::after {
    content: '';
    left: 0;
    top: 0;
    position: absolute;
    width: 48px;
    height: 86px;
    box-sizing: border-box;
    border: 2px solid var(--color-primary);
    border-radius: 50% 50% 50% 50% / 25% 25% 25% 25%;
    animation: kick 1s ease-in infinite alternate;
}

@keyframes bounce {
    0% {
        top: 0%;
        opacity: 1;
    }

    100% {
        top: 75%;
        opacity: 0.2;
    }
}

@keyframes kick {

    0%,
    75% {
        height: 86px;
    }

    100% {
        height: 78px;
    }
}