body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e0cbef;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.header_text {
    font-family: 'Nunito';
    font-size: 50px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.gif_container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    min-height: 60px;
}

#noButton {
    position: absolute;
    left: calc(50% + 150px);
    transform: translateX(-50%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: none;
}

#yesButton {
    position: absolute;
    left: calc(50% - 150px); /* Center - offset */
    transform: translateX(-50%);
    z-index: 1000;
}

.btn {
    background-color: #d880d2;
    color: white;
    padding: 15px 32px;
    text-align: center;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid #ffffff;
    border-radius: 12px;
    transition: all 0.3s ease-in-out;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Only apply hover effect to yes button */
#yesButton.btn:hover {
    background-color: #FAF9F6;
    color: #d880d2;
    border-color: #d880d2;
}

/* Styles for the yes.html page */
.text {
    font-family: 'Nunito';
    font-size: 50px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Footer note styles */
.footer-note {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #777;
}

/* Envelope styles */
.envelope {
    width: 300px;
    height: 180px;
    background-color: #f5f5f5;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    margin: 20px auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border: 1px solid #d1d1d1;
    overflow: hidden;
}

.envelope:hover {
    transform: scale(1.02);
}

.envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 90px solid #e8e8e8;
    z-index: 2;
}

.envelope::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-bottom: 90px solid #e8e8e8;
    z-index: 0;
}

/* Replace text button with wax seal */
.envelope-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at center, #ff9eaa 30%, #d880d2);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito', cursive;
    color: #fff;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.envelope-content::before {
    content: '❤';
    position: absolute;
    font-size: 28px;
}

.envelope:hover .envelope-content {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Letter container overlay */
.letter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Letter styles */
.letter {
    display: none;
    background: linear-gradient(to bottom, #fff 29px, #e8e4c9 30px);
    background-size: 100% 30px;
    background-attachment: local;
    padding: 30px 30px 50px 30px;
    border-radius: 5px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    line-height: 30px;
    font-family: 'Nunito', cursive;
    transform-origin: top;
    transform-style: preserve-3d;
    perspective: 1000px;
    overflow-y: auto;
}

/* Margin line */
.letter::before {
    content: '';
    position: absolute;
    left: 40px;
    top: -30px;
    width: 2px;
    height: calc(100% + 60px);
    background-color: #ff9eaa;
    z-index: 1;
}

/* Remove unused styles */
.letter::after {
    display: none;
}

.letter-content::before {
    display: none;
}

/* Letter content container */
.letter-content {
    position: relative;
    min-height: calc(100% - 80px);
}

/* Letter sections */
.letter-section {
    position: relative;
    transform-origin: top;
    backface-visibility: hidden;
    margin-bottom: 30px;
}

.letter-section.bottom {
    margin-bottom: 0;
    padding-bottom: 30px;
}

/* Fold lines */
.fold-lines {
    position: absolute;
    left: 0;
    right: 0;
    top: 33.33%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 33.33% 0 rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Letter text */
.letter p {
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    text-align: left;
    margin: 0 0 15px 0;
    padding: 0 0 0 50px;
    position: relative;
}

/* Close button */
.close-letter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-letter:hover {
    color: #d880d2;
}

/* Animations */
.letter.show {
    display: block;
    animation: unfold 2s ease-out forwards;
}

.letter-section.middle {
    animation: unfoldMiddle 2s ease-out forwards;
}

.letter-section.bottom {
    animation: unfoldBottom 2s ease-out forwards;
}

/* Unfolding animation */
@keyframes unfold {
    0% {
        opacity: 0;
        transform: translateY(-10%) rotateX(-90deg);
    }
    33% {
        opacity: 1;
        transform: translateY(-5%) rotateX(-60deg);
    }
    66% {
        transform: translateY(-2%) rotateX(-30deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

@keyframes unfoldMiddle {
    0% {
        transform: rotateX(-180deg);
    }
    33% {
        transform: rotateX(-120deg);
    }
    66% {
        transform: rotateX(-60deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@keyframes unfoldBottom {
    0% {
        transform: rotateX(180deg);
    }
    33% {
        transform: rotateX(120deg);
    }
    66% {
        transform: rotateX(60deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

.letter-overlay.show {
    display: flex;
}
