* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@media (max-width: 600px) {
    body {
        overflow: auto;
        overflow-x: hidden;
    }
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

@media (max-width: 600px) {
    .container {
        min-height: 100vh;
        height: auto;
        padding: 20px 0;
        align-items: center;
        justify-content: center;
    }
}

/* Phong bì */
.envelope {
    position: absolute;
    width: 400px;
    height: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.envelope:hover {
    transform: scale(1.05) translateY(-3px);
}

.envelope-front {
    position: relative;
    width: 100%;
    height: 100%;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-top: 150px solid #f8d4da;
    transform-origin: top;
    transition: transform 0.8s ease;
    z-index: 3;
    filter: drop-shadow(0 -2px 8px rgba(0, 0, 0, 0.2));
}

.envelope-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffe4e9;
    border-radius: 4px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    z-index: 1;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(255, 255, 255, 0.2) 1px,
        rgba(255, 255, 255, 0.2) 2px
    );
    overflow: hidden;
}

.envelope-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.05) 100%
    );
    pointer-events: none;
}

.envelope-back {
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    background: #fff0f5;
    border-radius: 3px;
    z-index: 0;
}

/* Text trên phong bì */
.envelope-text {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 2;
    color: rgba(139, 69, 19, 0.8);
    font-size: 12px;
    font-family: 'Georgia', serif;
    font-style: italic;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.envelope.opened .envelope-flap {
    transform: rotateX(-180deg);
    z-index: 0;
}

.envelope.opened {
    pointer-events: none;
    z-index: 1;
}

/* Thiệp mời */
.card {
    position: absolute;
    width: 500px;
    height: 700px;
    transform: scale(0) rotateY(180deg);
    opacity: 0;
    transition: all 0.8s ease;
    z-index: 2;
}

.card.opened {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
    z-index: 5;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.card-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: #faf8f3;
    border-radius: 12px;
    padding: 45px 35px;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.012) 1px,
            rgba(0, 0, 0, 0.012) 2px
        ),
        radial-gradient(circle at 30% 20%, rgba(255, 240, 245, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 240, 245, 0.3) 0%, transparent 50%);
}

.card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 20%,
        transparent 80%,
        rgba(0, 0, 0, 0.02) 100%
    );
    pointer-events: none;
}

/* Decorative hearts */
.rose-decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
}

.rose-decoration svg {
    width: 100%;
    height: 100%;
    fill: #d4a574;
}

.rose-decoration.top-left {
    top: 20px;
    left: 20px;
    transform: rotate(-20deg);
}

.rose-decoration.top-right {
    top: 20px;
    right: 20px;
    transform: rotate(20deg);
}

.rose-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
    transform: rotate(15deg);
}

/* Title Section */
.title-section {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
    z-index: 2;
}

.invitation-label {
    font-size: 14px;
    color: #8b6f47;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.main-title {
    font-size: 32px;
    color: #8b1538;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.2;
}

.graduate-name {
    font-size: 15px;
    color: #5a5a5a;
    font-style: italic;
    margin-top: 5px;
}

/* Photo Section */
.photo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    position: relative;
    z-index: 2;
}

.graduation-cap {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-70px) rotate(-15deg);
    z-index: 3;
    opacity: 0.6;
}

.graduation-cap svg {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.diploma {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(50px) rotate(15deg);
    z-index: 3;
    opacity: 0.6;
}

.diploma svg {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.photo-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 3px rgba(212, 165, 116, 0.2);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Details Section */
.details-section {
    text-align: center;
    position: relative;
    z-index: 2;
}

.sincerely {
    font-size: 16px;
    color: #5a5a5a;
    margin-bottom: 8px;
    font-family: 'Georgia', serif;
}

.invitees {
    font-size: 22px;
    color: #8b1538;
    font-weight: 600;
    margin-bottom: 30px;
    font-style: italic;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.event-info {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin: 25px 0;
    padding: 0 20px;
}

.info-column {
    flex: 1;
    text-align: center;
}

.info-column p {
    font-size: 15px;
    color: #5a5a5a;
    margin-bottom: 6px;
    line-height: 1.7;
}

.info-column .date {
    font-size: 22px;
    font-weight: 700;
    color: #8b1538;
    margin: 12px 0;
    letter-spacing: 0.5px;
}

.info-divider {
    width: 1px;
    height: 70px;
    background: linear-gradient(180deg, transparent, #d4a574, transparent);
    margin-top: 10px;
}

.party-info {
    font-size: 13px;
    color: #6a6a6a;
    margin-top: 30px;
    line-height: 1.7;
    padding: 0 10px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    .envelope {
        width: 300px;
        height: 225px;
    }

    .envelope-flap {
        border-left: 150px solid transparent;
        border-right: 150px solid transparent;
        border-top: 112px solid #f8d4da;
    }

    .envelope-text {
        bottom: 20px;
        right: 20px;
        font-size: 10px;
    }

    .card {
        width: 90%;
        max-width: 400px;
        height: auto;
        min-height: 600px;
        position: relative;
        margin: 20px auto;
    }

    .card.opened {
        position: relative;
        margin: 20px auto 40px;
    }

    .card-front {
        padding: 30px 20px;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .card-inner {
        height: auto;
    }

    .main-title {
        font-size: 24px;
    }

    .photo-circle {
        width: 150px;
        height: 150px;
    }

    .event-info {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .info-divider {
        width: 80px;
        height: 2px;
        margin: 0 auto;
        background: linear-gradient(90deg, transparent, #c41e3a, transparent);
    }

    .info-column {
        text-align: center !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .info-column p {
        text-align: center !important;
        margin-left: auto;
        margin-right: auto;
    }

    .time-column,
    .location-column {
        text-align: center !important;
    }
}

