* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Arial';
}

body {
    background-color: #c1ebf8;
    text-align: center;
}

/* Edit: */
header {
    padding: 30px 0;
    color: #0545a5; /* Header font color */
    text-align: center;
    font-size: clamp(15px, 4vw, 30px);
    border-bottom: #0545a5 dashed 10px; /*header border style */
}

.title {
    font-size: clamp(23px, 6vw, 34px);
}

p {
    font-size: clamp(20px, 5vw, 24px);
}

.signature {
    font-size: clamp(22px, 5vw, 24px);
}

/* Button base styles */
#letter, .previous, .next, #gift-open-button{
    background: none;
    border: none;
    cursor: pointer;
}

#letter img {
    width: clamp(100px, 15vw, 150px); 
}

#gift-open-button img {
    width: clamp(150px, 20vw, 400px);
}

/* Disabled button cursor */
button:disabled {
    cursor: default;
}

/* Main container */
main {
    position: relative;
    min-height: 100vh;
    padding: 20px;
}

/* Letter container - centered popup */
#contents {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    z-index: 100;
}

#contents.active {
    display: block;
}

/* Dark overlay background */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 90;
}

.overlay.active {
    display: block;
}

/* Letter text section */
/* EDIT: */
.text{
    display: none;
    text-align: left;
    background-color: white; /* 'paper' color */
    padding: 40px 90px;
    min-height: 400px;
    box-shadow: 15px 15px 5px rgb(29, 29, 29);
    transform: scale(0.1);
    opacity: 0;
    transition: transform 2s ease, opacity 0.8s ease;
}

.text.active {
    display: block;
}

.text.show {
    transform: scale(1);
    opacity: 1;
}

/* Images container */
.images {
    display: none;
    justify-content: center;
    align-items: center;
}

.images.active {
    display: flex;
}

/* Letter images */
.image {
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 15px 15px 5px rgb(29, 29, 29);
    transform: scale(0.2);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.image.show {
    transform: scale(1);
    opacity: 1;
}

/* Navigation arrows */
.content-nav {
    display: flex;
    margin: 20px;
    justify-content: space-between;
    min-height: 70px;
}

.previous, .next {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.previous.visible, .next.visible {
    opacity: 1;
}

.previous {
    transform: scaleX(-1);
}

.arrow {
    width: 70px;
}

/* ========== Gift Styles ========== */

/* Gift button - lower z-index so content appears on top */
#gift {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
}

#gift.active {
    display: block;
}

/* Gift content - appears on top of button */
#gift-content {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    z-index: 100;
}

#gift-content.active {
    display: flex;
}

/* Edit: */
#gift-inside {
    width: 500px; /* image size */
    transform: scale(0);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.1s ease;
}

#gift-inside.show {
    transform: scale(1);
    opacity: 1;
}

/* Download button */
#download-button {
    font-size: 20px;
    padding: 10px 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: 20px;
}

#download-button.visible {
    opacity: 1;
}

/* ========== Mobile Responsive Styles ========== */

@media (max-width: 600px) {

    #contents {
        width: 95%;
        max-width: 95%;
    }

    .text {
        padding: 30px 20px;
    }

    #gift-inside {
        width: 250px;
    }

    .image {
        max-width: 100%;
        max-height: 50vh;
    }

    .arrow {
        width: 50px;
    }
}