.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5dc; /* Cream background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #f5f5f5;
    border-top: 6px solid #ff69b4; /* Pink color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

body {
    font-family: 'Garamond', serif;
    background-color: #f7f1e1; /* Cream background color */
    margin: 0;
    padding: 0;
    color: #333;
    text-align: center;
    overflow-x: hidden; /* Prevent horizontal scroll due to animation */
    cursor: url("featherpen.jpg"), auto;
}

/* Prevent scrolling on the welcome screen */
body.no-scroll {
    overflow-y: hidden;
}

html.no-scroll {
    height: 100%;
}

/* Smooth transitions for fade effects */
.welcome-container,
.poem-container,
.poem-section {
    opacity: 1;
    transition: opacity 1s ease-in-out, display 1s ease-in-out;
}

.welcome-container.hidden,
.poem-section.hidden {
    opacity: 0;
    display: none;
}

/* Welcome screen styles */
.welcome-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    background-color: #f7f1e1; /* Match cream background */
    background-image: url('title.avif'); /* Background image for the welcome screen */
    background-size: cover; /* Make sure the image covers the whole container */
    background-position: center; /* Center the image */
    color: #000;
}

h1 {
    font-family: 'Great Vibes';
    font-size: 2rem;
}

#continueButton {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1.5rem;
    background-color: transparent;
    color: #ff66b2;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-family: 'Kingsman', cursive;
    transition: all 0.3s ease-in-out;
}

#continueButton:hover {
    background-color: #ff66b2;
    color: white;
}

/* Poem container styling */
.poem-container {
    display: block;
    flex-direction: column;
    align-items: center;
    background-color: #f7f1e1;
    padding: 40px;
    text-align: center;
    border: 1px solid #e0c0a1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-image: url('paper5.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    overflow-y: scroll; /* Ensure scrolling */
    animation: fadeInPaper 1s ease-in-out;
    min-height: 100vh;
}

/* Paper texture animation to fade in */
@keyframes fadeInPaper {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Add a vintage/aged look to the background */
.poem-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2); /* Light white overlay for aged paper effect */
    border-radius: 10px;
    z-index: -1; /* Place this behind the content */
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1); /* Slight shadow for depth */
}

/* Text styling inside the poem page */
.poem-container h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

.poem-container p {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    color: #3a3a3a;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Make the scrollbar transparent */
.poem-container::-webkit-scrollbar {
    width: 8px; /* thinner scrollbar */
}

.poem-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3); /* Light transparent thumb */
    border-radius: 10px;
}

.poem-container::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0); /* Fully transparent track */
}


/* Back Button */
.back-button {
    margin-top: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    background-color: transparent;  /* Transparent background */
    color: #ff66b2;  /* Pink text */
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    font-family: 'Georgia', serif;
    font-weight: bold;
    border: none;
}

.back-button:hover {
    background-color: #ff66b2;
    color: white;  /* Text color when hovered */
}

/* Butterfly styling */
.butterfly {
    position: fixed;
    bottom: 0; /* Start from the bottom */
    left: 0; /* Start from the left */
    width: 50px;
    height: 50px;
    background-image: url('butterfly2.png'); /* Butterfly image */
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1000;
    animation: flyDiagonal 3s ease-in-out forwards; /* Diagonal movement with acceleration */
}

/* Butterfly diagonal path animation */
@keyframes flyDiagonal {
    0% {
        transform: translateX(0) translateY(100%); /* Start from bottom-left corner */
    }
    100% {
        transform: translateX(100vw) translateY(-1000%); /* End at top-right corner */
    }
}

/* Pink glow effect for the butterfly background */
.butterfly::before {
    content: "";
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 105, 180, 0.6); /* Semi-transparent pink */
    border-radius: 50%;
    filter: blur(15px);
    top: -5px;
    left: -5px;
    z-index: -1;
}

/* Flower Image Styling */
.flowers.top-left,
.flowers.bottom-right {
    position: fixed;  /* Make sure flowers stay in place while scrolling */
    width: 200px; /* Double the size */
    height: auto;
    z-index: 10; /* Ensure it's above other content */
    pointer-events: none;  /* Prevent interference with clicks */
}

/* Apply flowers only on the Table of Contents and individual poem pages */
.poem-container .flowers.top-left {
    top: 10px;
    left: 10px;
}

.poem-container .flowers.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Additional styles for Table of Contents */
ul {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
}

li {
    margin-bottom: 10px;
}

a {
    text-decoration: none;
    font-size: 1.5rem;
    color: black;
    transition: color 0.3s ease;
}

a:hover {
    color: #ff66b2; /* Change the text color to pink */
    transition: all 0.5s ease; /* Smooth transition */
}


.cursor {
    cursor: url("featherpen.jpg");
}