/* Page Transition Animation */
body {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ECDDD1 0%, #D4B5A0 50%, #ECDDD1 100%);
    font-family: 'Playfair Display', Georgia, serif;
    perspective: 1000px;
}

.container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Invitation Card */
.invitation {
    position: absolute;
    width: 290px;
    background-color: #FAF6F1;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(92, 10, 10, 0.2);
    opacity: 0;
    transform: translateY(0);
    transition: all 0.7s ease;
    z-index: 10;
    cursor: pointer;
    pointer-events: none;
}

.invitation.show {
    opacity: 1;
    transform: translateY(-220px);
    pointer-events: auto;
}

.invitation.show:hover {
    transform: translateY(-220px) scale(1.03);
}

.invitation-inner {
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 20px;
}

.invitation-subtitle {
    color: #8B4513;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    font-family: 'Playfair Display', serif;
}

.invitation-names {
    color: #5C0A0A;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Great Vibes', cursive;
}

.invitation-text {
    color: #D4A29C;
    font-size: 16px;
    margin-bottom: 16px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
}

.invitation-divider {
    width: 60px;
    height: 1px;
    background-color: #8B4513;
    margin: 0 auto 16px;
}

.invitation-date {
    color: #5C0A0A;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.invitation-hint {
    color: #D4A29C;
    font-size: 12px;
    margin-top: 16px;
    opacity: 0.7;
    font-family: 'Playfair Display', serif;
    font-style: italic;
}

/* Envelope */
.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    cursor: pointer;
    transition: transform 0.3s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.envelope:hover {
    transform: scale(1.03);
}

.envelope.open:hover {
    transform: scale(1);
}

.envelope-body {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #F8F4F0 0%, #ECDDD1 100%);
    border-radius: 10px;
    box-shadow: 0 25px 50px rgba(92, 10, 10, 0.2);
}

.envelope-inner-border {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 1px solid #D4A29C;
    border-radius: 6px;
    opacity: 0.3;
}

.envelope-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #ECDDD1 0%, #F8F4F0 100%);
    clip-path: polygon(0 100%, 50% 12%, 100% 100%);
    border-radius: 0 0 10px 10px;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, #ECDDD1 0%, #F8F4F0 100%);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    border-radius: 10px 10px 0 0;
    transform-origin: top;
    transition: transform 0.6s ease;
    z-index: 20;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

/* Wax Seal - Same size everywhere, just adjust font */
.wax-seal {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5C0A0A 0%, #3D0707 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(92, 10, 10, 0.4);
    z-index: 30;
    transition: opacity 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.envelope.open .wax-seal {
    opacity: 0;
}

.wax-seal span {
    color: #8B4513;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Great Vibes', cursive;
}

/* Tap Hint */
.tap-hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #8B4513;
    font-size: 14px;
    animation: pulse 2s infinite;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    pointer-events: none;
}

.envelope.open .tap-hint {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hidden {
    display: none;
}

/* Music Toggle Button */
.music-toggle {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5C0A0A, #3D0707);
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(92, 10, 10, 0.3);
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(92, 10, 10, 0.5);
}

.music-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.music-toggle:hover .music-icon {
    transform: scale(1.1);
}

.music-toggle.muted .music-icon {
    opacity: 0.5;
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
    .envelope {
        width: 280px;
        height: 190px;
    }

    .envelope-flap {
        height: 100px;
    }

    .envelope-bottom {
        height: 100px;
    }

    /* Keep seal same size, just smaller font */
    .wax-seal {
        top: 50px;
        width: 60px;
        height: 60px;
    }

    .wax-seal span {
        font-size: 14px;
    }

    .invitation {
        width: 250px;
        padding: 16px;
    }

    .invitation.show {
        transform: translateY(-200px);
    }

    .invitation.show:hover {
        transform: translateY(-200px) scale(1.03);
    }

    .invitation-inner {
        padding: 16px;
    }

    .invitation-names {
        font-size: 26px;
    }

    .invitation-subtitle {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .invitation-text {
        font-size: 14px;
    }

    .invitation-date {
        font-size: 14px;
    }

    .tap-hint {
        font-size: 12px;
        bottom: -35px;
    }
}

@media screen and (max-width: 360px) {
    .envelope {
        width: 250px;
        height: 170px;
    }

    .envelope-flap {
        height: 90px;
    }

    .envelope-bottom {
        height: 90px;
    }

    .wax-seal {
        top: 45px;
        width: 60px;
        height: 60px;
    }

    .wax-seal span {
        font-size: 12px;
    }

    .invitation {
        width: 220px;
        padding: 12px;
    }

    .invitation.show {
        transform: translateY(-180px);
    }

    .invitation.show:hover {
        transform: translateY(-180px) scale(1.03);
    }

    .invitation-names {
        font-size: 22px;
    }
}
/* ═══════════════════════════════════════════════════════════════
   ENVELOPE PAGE - TABLET/iPAD FIX
   Add this to styles.css (envelope page)
   ═══════════════════════════════════════════════════════════════ */

/* Tablet/iPad Responsive (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    /* Envelope Size Adjustment */
    .envelope {
        width: 350px;
        height: 240px;
    }
    
    .envelope-flap {
        height: 130px;
    }
    
    .envelope-bottom {
        height: 130px;
    }
    
    /* Wax Seal - Keep visible and properly sized */
    .wax-seal {
        top: 65px;
        width: 70px;
        height: 70px;
    }
    
    .wax-seal span {
        font-size: 20px;
    }
    
    /* Invitation Card */
    .invitation {
        width: 320px;
        padding: 28px;
    }
    
    .invitation.show {
        transform: translateY(-250px);
    }
    
    .invitation.show:hover {
        transform: translateY(-250px) scale(1.03);
    }
    
    .invitation-inner {
        padding: 24px;
    }
    
    .invitation-names {
        font-size: 36px;
    }
    
    .invitation-subtitle {
        font-size: 11px;
        letter-spacing: 2.5px;
    }
    
    .invitation-text {
        font-size: 17px;
    }
    
    .invitation-date {
        font-size: 17px;
    }
    
    .tap-hint {
        font-size: 14px;
        bottom: -45px;
    }
    
    /* Music Toggle Button - if present */
    .music-toggle {
        bottom: 50px;
        right: 50px;
        width: 55px;
        height: 55px;
    }
    
    .music-icon {
        font-size: 22px;
    }
}

/* Large Tablets/Small Desktop (1025px - 1366px) */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    
    .envelope {
        width: 380px;
        height: 260px;
    }
    
    .envelope-flap {
        height: 140px;
    }
    
    .envelope-bottom {
        height: 140px;
    }
    
    .wax-seal {
        top: 70px;
        width: 75px;
        height: 75px;
    }
    
    .wax-seal span {
        font-size: 22px;
    }
    
    .invitation {
        width: 340px;
    }
    
    .invitation.show {
        transform: translateY(-260px);
    }
    
    .invitation.show:hover {
        transform: translateY(-260px) scale(1.03);
    }
}

/* iPad Pro Portrait (1024px width) - Specific Fix */
@media screen and (width: 1024px) and (orientation: portrait) {
    
    .envelope {
        width: 360px;
        height: 245px;
    }
    
    .wax-seal {
        width: 72px;
        height: 72px;
    }
    
    .wax-seal span {
        font-size: 21px;
    }
}

/* iPad Pro Landscape (1366px width) - Specific Fix */
@media screen and (width: 1366px) and (orientation: landscape) {
    
    .envelope {
        width: 400px;
        height: 275px;
    }
    
    .envelope-flap {
        height: 150px;
    }
    
    .envelope-bottom {
        height: 150px;
    }
    
    .wax-seal {
        top: 75px;
        width: 80px;
        height: 80px;
    }
    
    .wax-seal span {
        font-size: 24px;
    }
}
