* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.8) 0%, rgba(195, 207, 226, 0.8) 100%), url('flower-back.png') center/cover fixed;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('flower-back.png') center/cover;
    filter: blur(5px);
    z-index: -1;
    transform: scale(1.1);
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Gallery Link Styles */
.gallery-link {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 15;
}

.gallery-btn {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.gallery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(145deg, #b8941f, #d4af37);
}

/* Envelope Styles */
.envelope-container {
    position: relative;
    z-index: 10;
    transition: all 0.8s ease-in-out;
}

.envelope {
    width: 55vw;
    max-width: 400px;
    height: 85vh;
    max-height: 700px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.envelope:hover {
    transform: scale(1.05);
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #f8f4e6, #e8dcc0);
    border: 3px solid #d4af37;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.envelope-flap {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 50%;
    background: linear-gradient(145deg, #f0e6d2, #d4af37);
    border: 3px solid #d4af37;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    clip-path: polygon(2% 0, 98% 0, 85% 55%, 15% 55%);
    z-index: 2;
    transition: all 0.6s ease;
    transform-origin: top center;
}

.envelope.opening .envelope-flap {
    transform: rotateX(180deg);
}

.envelope-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 30px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.envelope:hover .envelope-logo {
    transform: scale(1.05);
}

.click-message {
    text-align: center;
    color: #8b4513;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.sparkle {
    font-size: 2rem;
    margin-top: 10px;
    animation: sparkle 2s infinite;
}

.click-button {
    margin-top: 15px;
    padding: 12px 24px;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    font-family: 'Georgia', serif;
}

.click-button:hover {
    background: linear-gradient(145deg, #b8941f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.click-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Card Styles */
.card-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 20;
}

.card-container.show {
    opacity: 1;
    visibility: visible;
}

.card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: all 0.5s ease;
}

.card-container.show .card-wrapper {
    transform: scale(1);
}

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('card-2.jpg') center/cover;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: 1;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    padding: 20px;
}

.card-image {
    max-width: 110%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Animations */
.envelope-container.hide {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .envelope {
        width: 65vw;
        height: 75vh;
        max-height: 600px;
    }

    .envelope-logo {
        max-width: 100px;
        max-height: 100px;
    }

    .envelope-content {
        gap: 25px;
    }

    .click-message {
        font-size: 1.2rem;
    }

    .click-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .card-wrapper {
        width: 100%;
        height: 100%;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-link {
        top: 20px;
        right: 20px;
    }

    .gallery-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .envelope {
        width: 75vw;
        height: 70vh;
        max-height: 500px;
    }

    .envelope-logo {
        max-width: 80px;
        max-height: 80px;
    }

    .envelope-content {
        gap: 20px;
    }

    .click-message {
        font-size: 1rem;
    }

    .click-button {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .sparkle {
        font-size: 1.5rem;
    }
}
