@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@400;600;700&display=swap');

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #1a2a4d; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
    overflow-x: hidden;
    user-select: none;
    color: white;
}

#tsparticles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
} */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* This will vertically center the direct children */
    width: 100%;
    min-height: 100vh; /* Ensure the container takes at least the full screen height */
    padding: 20px 0; /* Add some padding at the top and bottom */
    position: relative;
    z-index: 1;
    box-sizing: border-box; /* Include padding in the element's total width and height */
}
/* --- The Book Container --- */
.book {
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    position: relative;
    perspective: 2000px;
    cursor: pointer;
    align-items: center;
}

/* --- Individual Pages --- */
.page {
    width: 50%;
    height: 100%;
    position: absolute;
    top: 0;
    right: 0;
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-content {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    background-color: #fdfaf3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- Image Styling --- */

/* Default for inner page images: fill the entire space */
.page-content img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image fill the container */
    image-rendering: -webkit-optimize-contrast;
}

/* Specific override for cover images: center them */
.page-content.cover img {
    max-width: 90%; /* Control max size of the cover image */
    max-height: 70%;/* Control max size of the cover image */
    width: auto;
    height: auto;
    object-fit: contain; /* This centers the image without stretching */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Optional shadow for the photo */
}


/* --- Styles for a distinct album cover --- */
.page-content.cover {
    background: #38322f url('https://www.transparenttextures.com/patterns/leather.png');
    /* UPDATED: Use flexbox to arrange text and image */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* NEW: Styling for the text on the covers */
.cover-text {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #f0e68c;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    text-align: center;
}


.back {
    transform: rotateY(180deg);
}

.page.flipped {
    transform: rotateY(-180deg);
}

/* --- Music Toggle Button Styles --- */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000; 
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: background-color 0.3s ease; 
}

.music-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.music-btn svg {
    width: 24px;
    height: 24px;
}

/* --- Header and Footer Content --- */
.header-content {
    text-align: center;
    margin-bottom: 30px;
}

.couple-names {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    font-weight: normal;
    margin: 10px 0;
    color: #f0e68c;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.invitation-text {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 5px 0;
    letter-spacing: 1px;
    opacity: 0.9;
}

.footer-content {
    text-align: center;
    margin-top: 30px;
}

.wedding-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.info-item .icon {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    stroke: #f0e68c;
}

.venue-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}
/* --- Header and Footer Content --- */
.header-content {
    text-align: center;
    margin-bottom: 20px; /* Reduced margin */
}

/* --- The Book Container --- */
.book {
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    position: relative;
    perspective: 2000px;
    cursor: pointer;
    align-items: center;
    margin-top: 20px;    /* Added margin */
    margin-bottom: 20px; /* Added margin */
}

.footer-content {
    text-align: center;
    margin-top: 20px; /* Reduced margin */
}
/* In your existing .book rule, add a transition for the transform property */
.book {
    /* ... keep all existing styles ... */
    cursor: pointer;
    transition: transform 0.8s ease-in-out; /* Animates the sliding motion */
}

/* This is a new class that we will add with JavaScript */
.book.book-opened {
    transform: translateX(-25%); /* Slides the book left by half a page's width */
}

/* To improve the 3D effect when the book is off-center, adjust the perspective-origin */
.container {
    /* ... keep all existing styles ... */
    perspective: 2000px;
}

/* ======================================================= */
/* ===== Text Animations ================================= */
/* ======================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-load {
    opacity: 0; 
    animation: fadeInUp 0.8s ease-out forwards;
}

.anim-delay-1 { animation-delay: 0.3s; }
.anim-delay-2 { animation-delay: 0.6s; }
.anim-delay-3 { animation-delay: 0.9s; }
.anim-delay-4 { animation-delay: 1.2s; }
.anim-delay-5 { animation-delay: 1.5s; }

/* --- Image Styling --- */

/* Default for inner page images: fill the entire space */
.page-content img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image fill the container */
    image-rendering: -webkit-optimize-contrast; /* For Safari */
    image-rendering: crisp-edges; /* For other browsers */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .couple-names {
        font-size: 3rem;
    }
    .invitation-text, .info-item, .venue-text {
        font-size: 1rem;
    }
    .wedding-details {
        flex-direction: column;
        gap: 15px;
    }
    .page-content {
        padding: 10px; /* Less padding on small screens */
    }
    .cover-text {
        font-size: 1.8rem;
    }
    /* --- Image Styling --- */

/* Default for inner page images: fill the entire space */
.page-content img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image fill the container */
    image-rendering: -webkit-optimize-contrast; /* For Safari */
    image-rendering: crisp-edges; /* For other browsers */
}
}