/* ===================================
   ENVELOPE ANIMATION STYLES
   =================================== */

.envelope-container {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
}

.envelope-wrapper {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.envelope {
    width: 300px;
    height: 200px;
    position: relative;
    perspective: 1000px;
}

/* Envelope Body */
.envelope-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #c9a961 0%, #b8934d 100%);
    border: 3px solid #a67c3c;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.envelope-text {
    text-align: center;
    color: #ffffff;
}

.envelope-text p:first-child {
    font-size: 3rem;
    margin: 0;
}

.envelope-text p:last-child {
    font-size: 1rem;
    margin: 0.5rem 0 0;
    font-weight: 600;
}

/* Envelope Flap */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: top center;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 10;
}

.envelope-flap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #c9a961;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.envelope-flap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #b8934d;
    transform: scaleY(0.5);
}

/* Opened State */
.envelope-wrapper.opened .envelope-flap {
    transform: rotateX(-180deg);
}

.envelope-wrapper.opened {
    animation: envelopeSlideUp 0.6s ease forwards;
}

@keyframes envelopeSlideUp {
    to {
        transform: translateY(-250px) scale(0.8);
        opacity: 0;
        pointer-events: none;
    }
}

/* QRIS Card Popup */
.qris-card-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
    width: 90%;
    z-index: 100;
}

.qris-card-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.qris-card-popup h3 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.qris-image-wrapper {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qris-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.qris-card-popup p {
    color: #e0e0e0;
    text-align: center;
    font-size: 1rem;
    margin: 0;
}

.close-qris {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-qris:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Pulse Animation for Envelope */
@keyframes envelopePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.envelope-wrapper {
    animation: envelopePulse 2s ease-in-out infinite;
}

.envelope-wrapper.opened {
    animation: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .envelope {
        width: 250px;
        height: 166px;
    }

    .envelope-flap::before {
        border-left: 125px solid transparent;
        border-right: 125px solid transparent;
        border-top: 83px solid #c9a961;
    }

    .envelope-flap::after {
        border-left: 125px solid transparent;
        border-right: 125px solid transparent;
        border-top: 83px solid #b8934d;
    }

    .envelope-text p:first-child {
        font-size: 2.5rem;
    }

    .envelope-text p:last-child {
        font-size: 0.9rem;
    }

    .qris-card-popup {
        width: 85%;
        padding: 1.5rem;
    }

    .qris-card-popup h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .envelope-container {
        min-height: 400px;
    }

    .envelope {
        width: 200px;
        height: 133px;
    }

    .envelope-flap::before {
        border-left: 100px solid transparent;
        border-right: 100px solid transparent;
        border-top: 66px solid #c9a961;
    }

    .envelope-flap::after {
        border-left: 100px solid transparent;
        border-right: 100px solid transparent;
        border-top: 66px solid #b8934d;
    }
}
