/* ROOT VARIABLES & THEMES (VINTAGE PAPER AESTHETIC) */
:root {
    /* Light Theme - Textured Vintage Paper */
    --bg-primary: #fdfbf7;
    --bg-secondary: #f4efe6;
    --text-main: #3a352f;
    --text-muted: #6b6357;
    --accent: #b89152;
    --border-color: #e3d9c6;
    --card-bg: #ffffff;
    --shadow: 3px 4px 15px rgba(0,0,0,0.04), 0 0 40px rgba(184, 145, 82, 0.03) inset;
    --glass-bg: rgba(253, 251, 247, 0.85);
    --tape-bg: rgba(255, 255, 255, 0.6);
}

.dark-mode {
    /* Dark Theme - Charcoal Notebook */
    --bg-primary: #22201e;     
    --bg-secondary: #2c2926;
    --text-main: #ebe5d9;
    --text-muted: #aba396;
    --accent: #d4af37;
    --border-color: #3f3a34;
    --card-bg: #2a2724;
    --shadow: 3px 4px 15px rgba(0,0,0,0.3), 0 0 40px rgba(0,0,0,0.1) inset;
    --glass-bg: rgba(34, 32, 30, 0.85);
    --bg-gray: #2a2724; 
    --tape-bg: rgba(255, 255, 255, 0.1);
}

/* BASE & PAPER TEXTURE */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Caveat', cursive;
    font-size: 1.25rem;
    background-color: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3, .closing-names, .person h3, .couple-name-large, #guest-name { 
    font-family: 'Playfair Display', serif; 
    color: var(--accent); 
    font-weight: 600; 
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.hidden { display: none !important; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.pt-3 { padding-top: 1.5rem; }
.pb-0 { padding-bottom: 0 !important; }
.w-100 { width: 100%; }

/* CONTAINER */
.app-container { 
    max-width: 600px; 
    margin: 0 auto; 
    background-color: transparent; 
    min-height: 100vh; 
    position: relative; 
    box-shadow: 0 0 40px rgba(0,0,0,0.1); 
    z-index: 2; 
}

/* SECTION STRUCTURE */
.section { 
    padding: 5rem 1.5rem; 
    position: relative; 
    overflow: hidden; 
}

/* DOODLE SQUIGGLY UNDERLINE FOR TITLES */
.section-title { margin-bottom: 3rem; }
.section-title h2 { 
    font-size: 2.5rem; 
    position: relative; 
    display: inline-block; 
    padding-bottom: 15px; 
}
.section-title h2::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; left: 50%; 
    transform: translateX(-50%); 
    width: 80px; 
    height: 12px; 
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q15,0 30,10 T60,10 T90,10 T100,10' fill='none' stroke='%23b89152' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* BUTTONS */
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
.btn-primary { 
    background: var(--accent); 
    color: #fff; 
    padding: 12px 28px; 
    border-radius: 4px;
    font-family: 'Playfair Display', serif;
    font-weight: 600; 
    font-size: 1.1rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    box-shadow: 2px 4px 10px rgba(184, 145, 82, 0.3); 
}
.btn-primary:hover { 
    transform: translateY(-3px) rotate(-1deg); 
    box-shadow: 4px 8px 15px rgba(184, 145, 82, 0.4); 
}

/* ENVELOPE BUTTON STYLING FOR #btn-open */
#btn-open {
    padding: 16px 35px;
    font-size: 1.3rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #9e7a41 100%);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}
#btn-open i { font-size: 1.5rem; margin-right: 5px; }

.btn-secondary { 
    background: transparent; color: var(--accent); border: 2px dashed var(--accent); 
    padding: 10px 20px; border-radius: 4px; font-size: 1.1rem; text-decoration: none; 
    display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; transition: 0.3s; 
}
.btn-secondary:hover { background: var(--accent); color: #fff; border-style: solid; transform: translateY(-2px); }

.pulse-btn { animation: pulseBtn 2s infinite; }
@keyframes pulseBtn { 0% { box-shadow: 0 0 0 0 rgba(184, 145, 82, 0.6); } 70% { box-shadow: 0 0 0 15px rgba(184, 145, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(184, 145, 82, 0); } }

/* FLOATING CONTROLS */
.theme-toggle, .floating-music { 
    position: fixed; z-index: 1000; background: var(--glass-bg); backdrop-filter: blur(5px); 
    color: var(--accent); width: 45px; height: 45px; border-radius: 50%; 
    border: 1px dashed var(--accent); font-size: 1.2rem; box-shadow: var(--shadow); transition: 0.3s; 
}
.theme-toggle { top: 20px; right: 20px; }
.theme-toggle:hover { transform: rotate(180deg) scale(1.1); }
.floating-music { bottom: 90px; right: 20px; width: 50px; height: 50px; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.floating-music.playing i { animation: spinDisk 3s linear infinite; }
@keyframes spinDisk { 100% { transform: rotate(360deg); } }

/* OPENING & HERO */
#opening-screen { 
    position: fixed; inset: 0; z-index: 9999; 
    background: linear-gradient(rgba(20, 18, 16, 0.7), rgba(20, 18, 16, 0.9)), url(assets/img/ftbg.jpeg) center/cover no-repeat fixed; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; 
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s; 
}
#opening-screen.slide-up { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.opening-content { position: relative; z-index: 2; text-align: center; color: #fff; width: 100%; padding: 20px; }
.opening-title h1 { font-size: 4rem; color: #fdfbf7; margin-bottom: 20px; text-shadow: 2px 2px 10px rgba(0,0,0,0.6); }
.guest-info { 
    background: rgba(255,255,255,0.05); backdrop-filter: blur(10px); 
    padding: 30px 20px; border-radius: 8px; margin-bottom: 40px; 
    border: 1px dashed rgba(255,255,255,0.3); box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}
#guest-name { color: var(--accent); font-size: 2.5rem; margin-top: 5px; }

#hero { 
    height: 100vh; 
    background: linear-gradient(to bottom, rgba(20, 18, 16, 0.4) 0%, rgba(20, 18, 16, 0.9) 100%), url(assets/img/hero.jpeg) center/cover no-repeat fixed; 
    display: flex; align-items: center; justify-content: center; text-align: center; 
    padding: 0 20px; opacity: 0; transform: translateY(20px); transition: all 1.5s ease; 
}
.hero-content { position: relative; z-index: 2; max-width: 700px; color: #fdfbf7; }
.subtitle { font-family: 'Playfair Display', serif; font-size: 1.1rem; letter-spacing: 6px; text-transform: uppercase; margin-bottom: 20px; }
.couple-name-large { font-size: clamp(3.5rem, 10vw, 6rem); line-height: 1.1; color: var(--accent); margin-bottom: 1.5rem; text-shadow: 2px 4px 15px rgba(0,0,0,0.8); }
.date { font-family: 'Playfair Display', serif; font-size: 1.5rem; letter-spacing: 10px; }
#hero.hero-active { opacity: 1; transform: translateY(0); }

/* QURAN */
.bismillah-img { width: 180px; filter: invert(var(--invert-img, 0)); margin-bottom: 25px; opacity: 0.8; }
.dark-mode .bismillah-img { filter: invert(1); opacity: 0.7; }
.arabic { font-family: 'Amiri', serif; font-size: 2.2rem; line-height: 2.2; color: var(--accent); margin-bottom: 20px; }

/* COUPLE POLAROID STYLE */
.couple-wrapper { display: flex; flex-direction: column; gap: 50px; align-items: center; text-align: center; margin-top: 2rem;}
.person {
    background: var(--card-bg);
    padding: 15px 15px 25px 15px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    position: relative;
    border: 1px solid var(--border-color);
    width: 85%;
    transform: rotate(-2deg);
    transition: transform 0.4s ease;
}
.person:nth-child(3) { transform: rotate(2deg); }
.person:hover { transform: scale(1.02) rotate(0deg); z-index: 10;}

/* Washi Tape Effect */
.person::before, .event-card::before, .story-card::before, .atm-card::before {
    content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg);
    width: 80px; height: 25px; background: var(--tape-bg);
    border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px); z-index: 10; opacity: 0.8;
}

.person-img { width: 100%; aspect-ratio: 1; overflow: hidden; margin: 0 auto 15px; border: 1px solid var(--border-color); }
.person-img img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.2) contrast(1.1); transition: 0.5s; }
.person:hover .person-img img { transform: scale(1.05); filter: sepia(0); }
.person h3 { font-size: 2rem; margin-bottom: 5px; font-family: 'Caveat', cursive; font-size: 2.5rem;}
.ig-link { font-family: sans-serif; font-size: 0.9rem; color: var(--accent); text-decoration: none; display: inline-flex; gap: 5px; margin-top: 10px; padding-bottom: 2px; border-bottom: 1px dashed var(--accent);}
.and-symbol { font-size: 5rem; font-family: 'Caveat', cursive; color: var(--accent); opacity: 0.6; }

/* EVENT CARDS - SCRAPBOOK STYLE */
.event-card { 
    background: var(--card-bg); padding: 40px 25px; border-radius: 4px; 
    text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border-color); 
    margin-bottom: 35px; position: relative; transition: 0.3s; 
}
.event-card::after { 
    content: ''; position: absolute; inset: 6px; 
    border: 1px dashed var(--border-color); pointer-events: none; 
}
.event-card h3 { font-size: 2.2rem; margin-bottom: 20px; font-family: 'Caveat', cursive; font-size: 2.8rem;}
.event-card p { font-size: 1.3rem; margin-bottom: 12px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 10px; }

/* SAVE THE DATE */
.save-date-container { 
    background: transparent; border: 2px dashed var(--accent); 
    padding: 40px 20px; border-radius: 8px; position: relative; 
}
.big-date { font-size: 3.5rem; font-family: 'Playfair Display', serif; color: var(--accent); margin: 15px 0; }
.countdown { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.time-box { 
    background: var(--card-bg); padding: 15px 10px; border-radius: 4px; 
    min-width: 70px; box-shadow: var(--shadow); border: 1px solid var(--border-color); 
    position: relative;
}
.time-box span { display: block; font-size: 2.2rem; font-family: 'Playfair Display', serif; color: var(--text-main); }
.time-box small { font-size: 1rem; font-family: 'Caveat', cursive; color: var(--accent); }

.cal-buttons { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn-cal { font-family: sans-serif; background: var(--card-bg); color: var(--text-muted); border: 1px solid var(--border-color); padding: 10px 20px; border-radius: 30px; text-decoration: none; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; transition: 0.3s; }
.btn-cal:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }

/* GALLERY - POLAROID SCATTER */
.swiper { width: 100%; padding-bottom: 60px; padding-top: 20px;}
.swiper-slide { width: 260px; }
.swiper-slide img { 
    width: 100%; height: 320px; object-fit: cover; 
    background: #fff; padding: 10px 10px 40px 10px; 
    border-radius: 2px; box-shadow: 2px 4px 15px rgba(0,0,0,0.15); 
    transition: 0.4s ease; border: 1px solid #ddd;
}
.swiper-slide-active img { transform: scale(1.08) rotate(-1deg); z-index: 10; }
.dark-mode .swiper-slide img { background: #dedede; border-color: #aaa;}
.swiper-pagination-bullet { background: var(--border-color); opacity: 1; }
.swiper-pagination-bullet-active { background: var(--accent); transform: scale(1.3); }

/* STORY */
.story-card { background: var(--card-bg); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-color); position: relative; padding: 15px; }
.story-img { width: 100%; height: 300px; object-fit: cover; border-radius: 2px; filter: sepia(0.3); }
.timeline-container { position: relative; padding-left: 25px; margin-bottom: 30px; margin-top: 20px;}
.timeline-container::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: dashed 1px var(--accent); border-left: 2px dashed var(--accent); }
.timeline-item { position: relative; margin-bottom: 30px; }
.timeline-dot { position: absolute; left: -26px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card-bg); border: 3px solid var(--accent); }
.timeline-item h4 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 5px; }
.timeline-item p { font-size: 1.25rem; color: var(--text-muted); text-align: justify; }

/* GIFT SECTION */
.gift-container { transition: 0.5s ease; }
.gift-container.hidden-anim { opacity: 0; transform: translateY(20px); position: absolute; visibility: hidden; }
.atm-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 4px; padding: 25px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: 0.3s; }
.gift-header { display: flex; justify-content: space-between; align-items: center; }
.gift-icon-box { font-size: 1.8rem; color: var(--accent); }
.gift-title-text h4 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 2px; }
.gift-title-text p { font-family: sans-serif; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;}
.btn-info { font-family: sans-serif; background: transparent; border: 1px solid var(--accent); color: var(--accent); padding: 5px 15px; border-radius: 30px; font-size: 0.8rem; font-weight: 600; transition: 0.3s; }
.btn-info:hover, .atm-card.expanded .btn-info { background: var(--accent); color: #fff; }
.gift-details { max-height: 0; opacity: 0; overflow: hidden; transition: 0.4s ease; }
.atm-card.expanded .gift-details { max-height: 300px; opacity: 1; margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border-color); }
.atm-number { font-family: 'Courier New', monospace; font-size: 2rem; font-weight: 700; color: var(--text-main); letter-spacing: 3px; }
.btn-copy-atm { font-family: sans-serif; width: 100%; background: var(--bg-secondary); border: 1px dashed var(--border-color); color: var(--text-main); padding: 12px; border-radius: 4px; font-size: 0.9rem; transition: 0.3s; margin-top: 15px;}
.btn-copy-atm:hover { border-color: var(--accent); color: var(--accent); }

/* RSVP & CHAT BUBBLE */
.rsvp-form { background: var(--card-bg); padding: 30px 20px; border-radius: 4px; border: 1px solid var(--border-color); box-shadow: var(--shadow); position: relative;}
.rsvp-form::before { content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(2deg); width: 60px; height: 20px; background: var(--tape-bg); border: 1px solid rgba(0,0,0,0.05); }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea { width: 100%; padding: 15px; margin-bottom: 15px; border: 1px dashed var(--border-color); border-radius: 4px; background: var(--bg-secondary); color: var(--text-main); font-family: sans-serif; font-size: 0.95rem; transition: 0.3s; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { outline: none; border-style: solid; border-color: var(--accent); background: var(--card-bg); }

.chat-bubble { background: var(--card-bg); padding: 20px; border-radius: 4px; margin-bottom: 15px; border: 1px solid var(--border-color); border-left: 4px solid var(--accent); box-shadow: var(--shadow); animation: slideIn 0.5s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.chat-name { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 1.2rem; }
.chat-time { font-family: sans-serif; font-size: 0.75rem; color: var(--text-muted); display: block;}
.chat-text { font-size: 1.3rem; color: var(--text-main); margin-top: 10px; }
.badge-hadir { font-family: sans-serif; font-size: 0.7rem; background: rgba(46, 204, 113, 0.1); color: #27ae60; padding: 3px 8px; border-radius: 4px; border: 1px solid #27ae60;}
.badge-absen { font-family: sans-serif; font-size: 0.7rem; background: rgba(231, 76, 60, 0.1); color: #c0392b; padding: 3px 8px; border-radius: 4px; border: 1px solid #c0392b;}

/* FOOTER */
.site-footer { background: var(--bg-secondary); text-align: center; padding: 4rem 1.5rem 6rem; border-top: 1px dashed var(--border-color); }
.site-footer h3 { font-size: 2.5rem; font-family: 'Caveat', cursive; color: var(--text-main); }
.footer-msg { font-size: 1.4rem; color: var(--accent); margin-top: 10px; }

/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom: 15px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 400px; background: var(--glass-bg); backdrop-filter: blur(10px); display: flex; justify-content: space-around; padding: 12px 20px; border: 1px solid var(--border-color); z-index: 999; box-shadow: var(--shadow); border-radius: 30px; transition: 0.4s cubic-bezier(0.3, 0, 0.2, 1); }
.bottom-nav.nav-hidden { transform: translate(-50%, 150%); }
.nav-item { font-family: sans-serif; display: flex; flex-direction: column; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.65rem; gap: 4px; font-weight: 600; transition: 0.3s; }
.nav-item i { font-size: 1.2rem; }
.nav-item:hover { color: var(--accent); transform: translateY(-2px); }

/* TOAST */
.toast { font-family: sans-serif; position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-main); color: var(--bg-primary); padding: 12px 25px; border-radius: 30px; font-size: 0.9rem; opacity: 0; visibility: hidden; transition: 0.4s; z-index: 1000; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.toast i { color: var(--accent); }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ANIMATIONS (SMOOTH & LIGHT) */
.reveal { opacity: 0; will-change: transform, opacity; transition: all 1s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal.active { opacity: 1; transform: translate(0, 0); }
.fade-up { transform: translateY(30px); }
.slide-right { transform: translateX(-30px); }
.slide-left { transform: translateX(30px); }
.delay-1 { transition-delay: 0.2s; }

/* MAGIC DUST & CONFETTI (TWEAKED TO GOLDEN VINTAGE) */
#particles-container { position: fixed; inset: 0; z-index: 997; pointer-events: none; overflow: hidden; }
.magic-dust { position: absolute; top: -10%; border-radius: 50%; background: var(--accent); opacity: 0.6; animation: fallDust linear forwards; }
@keyframes fallDust { 0% { transform: translate3d(0, -5vh, 0); opacity: 0; } 20% { opacity: 0.6; } 80% { opacity: 0.6; } 100% { transform: translate3d(var(--sway-x), 105vh, 0); opacity: 0; } }
#confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 10000; overflow: hidden;}
.gold-burst { position: absolute; background: var(--accent); animation: burstAnim 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
@keyframes burstAnim { 0% { transform: translate(0,0) scale(1) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(180deg); opacity: 0; } }