/* ==========================================================================
   KAREM & REEM WEDDING INVITATION - STYLESHEET
   Aesthetics: Luxury Vintage Linen Paper, Gold Accents, Elegant Cursive Typography
   ========================================================================== */

:root {
    --bg-paper: #F6F3EC;
    --paper-card: #FAF8F5;
    --paper-texture: #F1ECE1;
    --text-primary: #2B2A29;
    --text-muted: #6B655D;
    --gold-primary: #B8975A;
    --gold-light: #D4AF37;
    --gold-dark: #8C6F36;
    --gold-glow: rgba(184, 151, 90, 0.25);
    --border-gold: #D8C6A3;
    
    --font-script: 'Great Vibes', 'Alex Brush', cursive;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', sans-serif;
    --font-arabic: 'Cairo', sans-serif;
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: #EFECE6;
    background-image: 
        radial-gradient(#D6CEBF 1px, transparent 1px),
        linear-gradient(to bottom, rgba(246, 243, 236, 0.8), rgba(239, 236, 230, 0.95));
    background-size: 20px 20px, 100% 100%;
    font-family: var(--font-serif);
    color: var(--text-primary);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

/* Main Container & Phone Frame */
.main-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.phone-frame {
    width: 100%;
    min-height: 90vh;
    background: var(--bg-paper);
    background-image: 
        radial-gradient(rgba(184, 151, 90, 0.05) 1px, transparent 0),
        linear-gradient(to bottom, #FAF7F2, #F3EEE5);
    background-size: 24px 24px, 100% 100%;
    border-radius: 28px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.12),
        0 4px 15px rgba(184, 151, 90, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

/* Floating Music Toggle Button */
.music-toggle-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--paper-card);
    border: 2px solid var(--gold-primary);
   /* Typewriter Cursor & Animation */
.typewriting {
    border-left: 2px solid var(--gold-primary);
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--gold-primary); }
}    color: var(--gold-dark);
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-toggle-btn:hover {
    transform: scale(1.1);
    background: var(--gold-primary);
    color: white;
}

.music-toggle-btn.playing {
    animation: rotateMusic 8s linear infinite;
    border-color: var(--gold-light);
    box-shadow: 0 0 15px var(--gold-glow);
}

@keyframes rotateMusic {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* STAGE 1: ENVELOPE SCREEN ANIMATIONS */
.envelope-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding: 20px 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.envelope-header {
    text-align: center;
    margin-top: 15px;
    animation: fadeInSlideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInSlideDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vintage-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    letter-spacing: 4px;
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    margin: 10px 0;
    position: relative;
    display: inline-block;
    animation: goldShimmerText 3s ease-in-out infinite;
}

@keyframes goldShimmerText {
    0%, 100% { color: var(--text-primary); text-shadow: 0 0 0 transparent; }
    50% { color: var(--gold-dark); text-shadow: 0 0 12px rgba(184, 151, 90, 0.4); }
}

.floral-svg {
    width: 120px;
    height: 20px;
    transition: transform 0.6s ease;
}

.envelope-header:hover .floral-svg {
    transform: scaleX(1.1);
}

/* 3D Interactive Envelope with Gentle Floating Animation */
.envelope-wrapper {
    perspective: 1000px;
    width: 300px;
    height: 260px;
    margin: 40px 0;
    cursor: pointer;
    animation: floatEnvelope 4s ease-in-out infinite;
}

@keyframes floatEnvelope {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.12));
    }
    50% {
        transform: translateY(-10px) rotate(0.8deg);
        filter: drop-shadow(0 20px 35px rgba(184, 151, 90, 0.22));
    }
}

.envelope {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #F8F5EE;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wax Seal with Slow Rotation */
.wax-seal-container {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    z-index: 4;
    cursor: pointer;
    box-shadow: none !important;
    transition: transform 0.4s ease, opacity 0.4s ease;
    animation: rotateSealSlow 18s linear infinite;
}

@keyframes rotateSealSlow {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

/* Tap Hint with Floating Hand Pointer */
.tap-hint-container {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-arabic);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    animation: tapPulse 1.8s ease-in-out infinite;
    margin-top: 25px;
}

.tap-icon {
    margin-top: 10px;
    font-size: 2.2rem;
    color: var(--gold-primary);
    display: inline-block;
    animation: handTap 1.2s ease-in-out infinite;
}

@keyframes tapPulse {
    0%, 100% { opacity: 0.75; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); color: var(--gold-dark); }
}

@keyframes handTap {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.15) rotate(-5deg); }
}

.envelope-inside {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #EFECE4;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.pocket-bride-groom {
    width: 140px;
    height: auto;
    margin-bottom: 20px;
    mix-blend-mode: multiply;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.6s ease;
}

/* Envelope Flap */
.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 140px solid #EDE8DE;
    transform-origin: top;
    transition: transform 0.7s ease-in-out, z-index 0.7s;
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.envelope-pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid #FAF7F0;
    border-right: 150px solid #FAF7F0;
    border-bottom: 150px solid #F3EDE2;
    z-index: 2;
    border-radius: 0 0 6px 6px;
}

/* Wax Seal */
.wax-seal-container {
    position: absolute;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 65px;
    height: 65px;
    z-index: 4;
    cursor: pointer;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.wax-seal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.wax-seal-container:hover {
    transform: translateX(-50%) scale(1.08);
}

/* Tap Hint */
.tap-hint-container {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 2px;
    animation: bouncePulse 2s infinite;
}

.tap-icon {
    margin-top: 6px;
    font-size: 1.1rem;
    color: var(--gold-primary);
}

@keyframes bouncePulse {
    0%, 100% { transform: translateY(0); opacity: 0.8; }
    50% { transform: translateY(-6px); opacity: 1; }
}

/* STAGE 2: UNFOLDED INVITATION CONTENT */
.invitation-content {
    width: 100%;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease-out;
}

.invitation-content.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(40px);
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Nav Top Back Button */
.nav-top {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.back-btn {
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--gold-dark);
}

/* Card Hero Section */
.card-hero {
    background: #FAF8F4;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(184, 151, 90, 0.08);
    position: relative;
    margin-bottom: 25px;
}

.illustration-box {
    width: 160px;
    height: 160px;
    margin: 0 auto 15px;
}

.hero-couple-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.couple-names {
    font-family: var(--font-script);
    font-size: 3.4rem;
    color: #1F1E1D;
    line-height: 1.1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.ampersand {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--gold-primary);
    font-weight: 300;
}

.gold-divider {
    width: 160px;
    margin: 15px auto;
}

.divider-svg {
    width: 100%;
    height: 20px;
}

.event-details {
    margin: 20px 0 10px;
}

.date-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    letter-spacing: 3px;
    font-weight: 600;
    color: var(--text-primary);
}

.year-text {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    letter-spacing: 4px;
    color: var(--gold-dark);
    margin: 4px 0 12px;
}

.time-text {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 500;
}

.venue-box {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-gold);
}

.venue-name {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 700;
}

.venue-sub {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 4px;
}

.venue-arabic {
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    color: var(--gold-dark);
    margin-top: 6px;
    font-weight: 600;
}

/* Banner Card */
.banner-card {
    background: #FAF7F2;
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(184, 151, 90, 0.05);
}

.quran-verse {
    font-family: var(--font-arabic);
    font-size: 1.15rem;
    color: var(--gold-dark);
    line-height: 1.9;
    font-weight: 700;
}

.banner-text {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.banner-arabic {
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    color: var(--gold-dark);
    margin-top: 6px;
}

/* Section Common Styling */
.countdown-section,
.location-section,
.rsvp-section,
.guestbook-section {
    text-align: center;
    margin-bottom: 35px;
}

.section-title {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: #1A1918;
    margin-bottom: 4px;
}

.section-subtitle, .location-sub {
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.section-ornament, .section-ornament-bottom {
    color: var(--gold-primary);
    font-size: 0.8rem;
    letter-spacing: 6px;
    margin: 5px 0;
}

/* Timer Display Frame */
.timer-frame {
    background: #FAF7F2;
    border: 2px solid var(--border-gold);
    border-radius: 20px;
    padding: 20px 15px;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.04),
        inset 0 0 0 4px #F6F3EC;
    max-width: 360px;
    margin: 0 auto;
}

.timer-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-val {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: #1F1E1D;
    line-height: 1;
}

.timer-lbl {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

.timer-sep {
    font-size: 1.8rem;
    color: var(--gold-primary);
    font-weight: 300;
    margin-bottom: 12px;
}

/* Map Location Section */
.map-card {
    background: #FAF8F4;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 16px;
    text-align: right;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.map-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.map-pin-icon {
    font-size: 1.8rem;
    color: var(--gold-primary);
}

.map-venue-title {
    font-family: var(--font-arabic);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.map-address {
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.map-preview-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 140px;
    background: #EDE7DB;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.map-bg-icon {
    font-size: 2.5rem;
    color: var(--gold-primary);
    opacity: 0.7;
    margin-bottom: 6px;
}

.map-placeholder-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.map-placeholder-sub {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.map-overlay {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
}

.map-direct-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--gold-primary);
    color: white;
    text-decoration: none;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(184, 151, 90, 0.4);
    transition: all 0.3s ease;
}

.map-direct-btn:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
}

/* Vintage Form Styling */
.vintage-form {
    background: #FAF8F4;
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: right;

}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    background: #FFFDF9;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px var(--gold-glow);
}

/* Radio Options Cards */
.radio-options {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: #FFFDF9;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card:has(input:checked) {
    background: #F4EEDF;
    border-color: var(--gold-primary);
    font-weight: bold;
    color: var(--gold-dark);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--gold-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(184, 151, 90, 0.35);
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--gold-dark);
}

.submit-btn.secondary-btn {
    background: #4A4640;
}
.submit-btn.secondary-btn:hover {
    background: #2D2A26;
}

.success-alert {
    margin-top: 12px;
    padding: 10px;
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
    color: #2E7D32;
    border-radius: 8px;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    text-align: center;
}

/* Guestbook Messages Feed */
.messages-feed {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wisher-card {
    background: #FAF8F4;
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 14px;
    text-align: right;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
}

.wisher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.wisher-name {
    font-family: var(--font-arabic);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold-dark);
}

.wisher-time {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.wisher-text {
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Footer */
.card-footer {
    text-align: center;
    padding: 25px 0 10px;
    border-top: 1px solid var(--border-gold);
    margin-top: 20px;
}

.footer-blessing {
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    color: var(--gold-dark);
    margin-bottom: 6px;
}

.footer-names {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-muted);
}

/* ==========================================================================
   ENTRANCE & SCROLL REVEAL ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes typingGlow {
    0% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 15px rgba(212, 175, 55, 0.5); }
    100% { text-shadow: 0 0 0 transparent; }
}

@keyframes shimmerGold {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Staggered Scroll Reveal Utility */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-element.active {
    opacity: 1;
    transform: translateY(0);
}

/* Specific Stagger Delays */
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }
.delay-4 { transition-delay: 0.6s; }
.delay-5 { transition-delay: 0.75s; }

/* Animated Hero Elements */
.card-hero .illustration-box {
    animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.groom-name, .bride-name {
    display: inline-block;
    background: linear-gradient(135deg, #1F1E1D 0%, #4A4031 50%, #1F1E1D 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transition: all 0.5s ease;
}

.groom-name.animated, .bride-name.animated {
    animation: typingGlow 2.5s ease-in-out infinite;
}

.ampersand {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ampersand.animated {
    transform: scale(1.2) rotate(5deg);
}

/* Timer Unit Pulse on Change */
.timer-val {
    transition: transform 0.2s ease;
}

.timer-val.pulse {
    transform: scale(1.15);
    color: var(--gold-dark);
}

.success-alert {
    margin-top: 16px;
    padding: 14px 16px;
    background: #F8F4EA;
    border: 2px solid var(--gold-primary);
    color: var(--gold-dark);
    border-radius: 12px;
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 6px 18px rgba(184, 151, 90, 0.2);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-alert.hidden {
    display: none !important;
}

