@import url('site-theme.css');

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    background-color: rgb(245, 245, 245);
    padding: 10px;
    box-sizing: border-box;
}

input {
    display: none;
}

#flip_book {
    position: relative;
    width: 90%;
    max-width: 27%;
    height: auto;
    aspect-ratio: 298 / 420;
    transition-duration: 1s;
    perspective: 2000px;
}

.front_cover,
.back_cover {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 2.5px 5px 5px 2.5px;
            color: var(--primary); /* replaced with theme primary */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgb(220, 20, 60);
    box-shadow: 0 0 5px 0 rgb(25, 25, 25, 0.25);
    opacity: 0px;
}

.front_cover {
    position: absolute;
    cursor: pointer;
    transform-origin: center left;
    transition: transform 0.5s;
    z-index: 99;
}

.front_cover label {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.page {
    position: absolute;
    /* top: 10px; */
    left: 1px;
    width: 288px;
    height: 400px;
    border-radius: 0 5px 5px 0;
    background-color: white;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
}

.front_page {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-color: white;
}

.front_page label {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 100;
}

.back_page {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    z-index: 100;
    background: rgb(220, 20, 60);
}

.back_page label {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 100;
}

.edge_shading {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 98;
    top: 0px;
}

.front_content {
    position: absolute;
    left: 13px;
    border-radius: 0 5px 5px 0;
    z-index: 97;
    padding-top: 35px !important;
    color: red ;
    font-weight: bold;

}

.back_content {
    /* position: absolute; */
    top: 1px;
    left: 1px;
    width: 100%;
    height: 100%;
    border-radius: 5px 0 0 5px;
}

.back_cover {
    position: relative;
    z-index: -1;
}

#page1 {
    z-index: 15;
}

#page2 {
    z-index: 14;
}

#page3 {
    z-index: 13;
}

#page4 {
    z-index: 12;
}


/* #cover_checkbox:not(:checked) ~ .audio-player {
    display: none;
} */
.audio-player {
    display: none;
}
           color: var(--primary); /* replaced with theme primary */
#cover_checkbox:checked~#flip_book {
    transform: translateX(45%)
}

#cover_checkbox:checked~#flip_book .front_cover {
    transform: rotateY(-180deg);
    transition: transform 1.5s, z-index 0.5s 0.5s;
    z-index: 1;

}

#cover_checkbox:checked~#flip_book #cover {
    position: absolute;
    width: 80%;
    height: 80%;
}

#cover_checkbox:checked~#flip_book .audio-player {
    display: block;
    position: absolute;
    z-index: 100;
    animation: fadeIn 3s ease-in forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

#p1CheckBox:checked~#flip_book #page1 {
    transform: rotateY(-180deg);
    z-index: 2;
}



#p2CheckBox:checked~#flip_book #page2 {
    transform: rotateY(-180deg);
    z-index: 3;
}

#p3CheckBox:checked~#flip_book #page3 {
    transform: rotateY(-180deg);
    z-index: 4;
}

#p4CheckBox:checked~#flip_book #page4 {
    transform: rotateY(-180deg);
    z-index: 5;
}

#hanuman_image {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 100;
}

#cover_text {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 38px;
    font-weight: bold;
    font-family: cursive;
    text-align: center;
    color: transparent;
    background-image: linear-gradient(45deg, #FFD700, #FFC300, #FFD700, #DAA520);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: blinkText 1s infinite alternate, goldShine 4s infinite linear;
    text-shadow: 2px 2px 5px rgba(255, 223, 0, 0.8);
    z-index: 100;
}

/* Blinking Effect */
/* @keyframes blinkText {
    0% { opacity: 1; }
    100% { opacity: 0; }
} */

/* Golden Shining Effect */
@keyframes goldShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}



#cover_checkbox:checked~#flip_book #cover_text {
    display: none;
}

.page-number {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 14px;
    font-weight: bold;
    color: red;
}

#firstpageText {
    padding-left: 9%;
    padding-right: 5%;
    font-size: 23px;
    font-weight: bold;
    color: red;
    text-align: justify;
    position: absolute;
    padding-top: 6%;
}

#secondpageText {
    padding-left: 5%;
    padding-right: 5%;
    font-size: 20px;
    font-weight: bold;
    color: red;
    text-align: justify;
    position: absolute;
    padding-top: 15%;
}

#lastPageText {
    padding-left: 9%;
    padding-right: 9%;
    font-size: 27px;
    font-weight: bold;
    color: red;
    text-align: justify;
    position: absolute;
    padding-top: 22%;
}

/*  */

.front_cover,
.back_cover {
    width: 100%;
    height: 100%;
}

.page {
    width: 100%;
    height: 100%;
}

.front_page,
.back_page {
    width: 100%;
    height: 100%;
}

.page-number {
    font-size: 1.5vw;
    bottom: 5%;
    right: 5%;
}

.front_content,
.back_content {
    font-size: 1.0rem;
    line-height: 1.6;
    text-align: justify;
    padding: 0px;
}

#firstpageText,
#secondpageText,
#lastPageText {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
    padding: 10px;
    color: #FF4500;
    /* Red-Orange */
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 1024px) {

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 1.8vw;
    }

    .page-number {
        font-size: 2vw;
    }

    .front_content,
    .back_content {
        font-size: 1rem;
        color: #FF4500;
        /* Maroon */
    }

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 1rem;
        padding: 8px;
        color: #FF4500;
        /* Red-Orange */
    }
}

@media (max-width: 768px) {
    #flip_book {
        width: 95%;
        max-width: 250px;
    }

    #cover_text {
        font-size: 4vw;
    }

    .page-number {
        font-size: 2.5vw;
    }

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 2.5vw;
    }

    #hanuman_image,
    .back_content {
        width: 100%;
        max-height: 100%;
    }

    .front_content,
    .back_content {
        font-size: 0.9rem;
        padding: 6px;
        color: #800000;
        /* Maroon */
    }

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 0.9rem;
        padding: 6px;
        color: #FF4500;
        /* Red-Orange */
    }
}

@media (max-width: 480px) {
    #flip_book {
        width: 100%;
        max-width: 53%;
    }

    #cover_text {
        font-size: 5vw;
    }

    .page-number {
        font-size: 3vw;
    }

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 2.5vw;
    }

    #hanuman_image,
    .back_content {
        width: 100%;
        max-height: 100%;
    }

    /* audio */
    .audio-player {
        align-items: center;
        border-radius: 10px;
    }

    button {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        margin: 0 5px;
        transition: 0.3s;
    }

    button:hover {
        color: #007BFF;
    }

    audio {
        width: 200px;
    }

    .front_content,
    .back_content {
        font-size: 0.7rem;
        padding: 5px;
        color: black;
        /* Maroon */
        padding: 0px;
        padding: 0px;
        text-shadow: 0 0 black;
    }

    #firstpageText,
    #secondpageText,
    #lastPageText {
        font-size: 0.7rem;
        padding: 5px;
        color: #FF4500;
        /* Red-Orange */
    }
}

.aartiBanner {
    background-color: red;
    color: white;
    border-radius: 7px;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    position: relative;
    /* Changed from absolute to relative for better responsiveness */
    margin: 10px auto;
    max-width: 80%;
    /* Ensures it doesn't stretch too much on large screens */
    width: fit-content;
    /* Adapts width to content */
    font-size: 1.2rem;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .aartiBanner {
        font-size: 1rem;
        padding: 8px;
        max-width: 90%;
    }
}

/* Further adjustments for very small screens */
@media (max-width: 480px) {
    .aartiBanner {
        font-size: 0.9rem;
        padding: 6px;
        max-width: 95%;
    }
}