body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #FFD1D8;
}

.container {
    display: grid;
    place-items: center;
    height: 100vh;
    background-color: #FFD1D8;

}


.envelope-wrapper {
    height: absolute;
    position: relative;
}


#envelope {
    position: relative;
    width: 400px;
    height: 280px;
    background-color: rgb(245, 147, 163);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    
}



.front {
    content: '';
    position: absolute;
    border-top: 200px solid #f56e9f;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    transition: 0.7s;
    transform-origin: top;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 14; 
}

.open .front {
    transform: rotateX(180deg);
    transition: transform 0.4s ease, z-index 0.6;
    z-index: 1;
}

.left {
    position: absolute;
    content: '';
    border-right: 400px solid #fd96b3;
    border-top: 280px solid transparent;
    left: -0px; /* Adjust positioning to be inside the body */
    top: 0px; /* Adjust positioning to be inside the body */
    z-index: 12;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    transform: scaleX(-1);
}

.right {
    position: absolute;
    content: '';
    border-right: 280px solid #f585ae;
    border-top: 280px solid transparent;
    left: 120px; /* Adjust positioning to be inside the body */
    top: 0px; /* Adjust positioning to be inside the body */
    z-index: 13;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    transform: scaleX(1);
}

.open .card {
    animation: slideup 3s forwards;
    z-index: 10;

}

.card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 200px;
    background-color: rgb(243, 243, 76);
    border-radius: 6px;
    box-shadow: -5px -5px 30px rgba(0, 0, 0, 0.4);
    z-index: 3;
    transition: all 0.4s ease-in-out;
    
}

.card::before {
    content: '';
    position: absolute;
    border: 3px dashed rgb(115, 108, 108);
    width: calc(100% - 20px); 
    height: calc(100% - 20px); 
    top: 7px; 
    left: 7px;
    bottom: 10px; 
    right: 10px; 
    border-radius: 6px;
    background-color: rgba(248, 230, 90, 0.83);

}
.open .text {
    animation: slideup 3s forwards;
    z-index: 10;

}

.text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Great Vibes', cursive;
    font-size: 20px;
    font-weight: 600;
    color: palevioletred;
    text-align: center;
    z-index: 10;
}



.heart_button {
    content: '';
    position: absolute;
    top: 62%;
    left: 50%;
    width: 30px;
    height: 30px;
    background: #d62828;
    z-index: 15;
    transform: translate(-50%, -50%) rotate(-45deg);
    cursor: pointer;
    outline: black;
    animation: heart_button 0.8s ease-out infinite;
}

.heart_button::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #d62828;
    border-radius: 50%;
}

.heart_button::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #d62828;
    border-radius: 50%;
}

.heart_button::before {
    top: -17px;
}

.heart_button::after {
    right: -17px;
}


.hearts {
    position: absolute;
    top: 250px;
    
}

.heart1, .heart2, .heart3, .heart4, .heart5, .heart6 {
    top: 60%;
    left: 20%;
    width: 20px;
    height: 20px;
    background: red;
    display: inline-block;
    position: relative;
    margin: 0 12px;
    transform: translate rotate(-45deg); 
}

.heart1::before, .heart1::after,  .heart2::before, .heart2::after,  .heart3::before, .heart3::after,  .heart4::before, .heart4::after,  .heart5::before, .heart5::after,  .heart6::before, .heart6::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 60%;
}

.heart1::before, .heart2::before, .heart3::before, .heart4::before, .heart5::before, .heart6::before {
    top: -11px;
}

.heart1::after, .heart2::after, .heart3::after, .heart4::after, .heart5::after, .heart6::after {
    right: -11px;
}

.heart1 {
    left:25%;
    animation: hearts 2.8s ease-out infinite;
}

.heart2 {
    left: 35%;
    animation: hearts 1s ease-out infinite;
}

.heart3 {
    left: 40%;
    animation: hearts 2s ease-out infinite;
}

.heart4 {
    left: 50%;
    animation: hearts 1.5s ease-out infinite;
}
.heart5 {
    left: -85%;
    animation: hearts 2.5s ease-out infinite;
}
.heart6 {
    left: -80%;
    animation: hearts 0.8s ease-out infinite;
}



@keyframes slideup {
    0% {
        top: 100px; /* Initial position of the card when flap opens */
    }
    100% {
        top: 0; /* Final position of the card */
    }
} 

@keyframes hearts {
    0% {
        transform: translateY(0) rotate(-45deg) scale(0.3);
    }
    100% {
        transform: translateY(-150px) rotate(-45deg) scale(1.3);
        opacity: 0.5;
    }
    
}

@keyframes heart_button {
    0% {
        transform: translate(-50%, -50%) rotate(-45deg) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-45deg) scale(1.2);
    }
}
@keyframes up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-30px);
    }

    
}

@keyframes hearts {
    0% {
        transform: translateY(0) rotate(-45deg) scale(0.3);
        
    }
    100% {
        transform: translateY(-150px) rotate(-45deg) scale(1.3);
        opacity: 0.3;
    }
    
}




