:root {
    --primary-color: #5d4037; /* Coklat Tua Elegan */
    --accent-color: #d4af37; /* Emas */
    --bg-color: #f9f7f2;     /* Cream lembut */
    --text-color: #333;
    --font-main: 'Cormorant Garamond', serif;
    --font-body: 'Work Sans', sans-serif;
    /* Cover palette mengikuti tema utama */
    --cover-primary: var(--primary-color);
    --cover-secondary: #8a715f;
    --cover-bg: var(--bg-color);
    --cover-text: var(--text-color);
    --cover-gold: var(--accent-color);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow: hidden; /* Prevent body scroll, let mobile-container handle scrolling */
    height: 100vh;
}

/* Main Layout Container */
.main-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Desktop Background (Left Side - Only visible on desktop) */
.desktop-background {
    display: none; /* Hidden on mobile by default */
    flex: 1;
    background-image: url('https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Mobile Container (Right Side on Desktop, Full Width on Mobile) */
.mobile-container {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-color);
    position: relative;
}

/* Desktop Layout (min-width: 768px) */
@media (min-width: 768px) {
    .desktop-background {
        display: block; /* Show background on desktop */
    }
    
    .mobile-container {
        width: 480px;
        max-width: 500px;
        flex-shrink: 0;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    }
}

/* Kunci scroll saat cover aktif */
body.no-scroll {
    overflow: hidden;
}

body.no-scroll .mobile-container {
    overflow: hidden;
}

/* TYPOGRAPHY */
h1, h2, h3 { font-family: var(--font-main); font-weight: 600; }
.fancy-font { font-family: var(--font-main); font-style: italic; }

/* UTILS */
.container { 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px; 
    text-align: center;
    width: 100%; 
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    margin-top: 20px;
    transition: 0.3s;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 1px;
    border: 1px solid var(--primary-color);
}
.btn:hover { background-color: transparent; color: var(--primary-color); }

/* --- PERBAIKAN: SETIAP SECTION 100VH --- */
section { 
    padding: 40px 20px; 
    position: relative;
    
    /* Logic 100vh & Center */
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
    justify-content: center; /* Tengah Vertikal */
    align-items: center;     /* Tengah Horizontal */
}

/* SECTION 1: COVER (FULL SCREEN) */
#cover {
    position: absolute;
    top: 0; left: 0; right: 0;
    width: 100%; 
    min-height: 100vh;
    overflow: hidden;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Background layer to keep image visible (works better on mobile) */
#cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(93,64,55,0.55), rgba(93,64,55,0.65)), url('https://images.unsplash.com/photo-1606800052052-a08af7148866?q=80&w=1000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.cover-content {
    padding: 20px;
    animation: fadeInUp 1.2s ease;
}

.wedding-title {
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    display: inline-block;
    padding-bottom: 8px;
    font-family: var(--font-main);
    line-height: 1.4;
}

.main-names {
    font-size: 3.5rem;
    margin: 20px 0 30px 0;
    line-height: 1.2;
    font-family: var(--font-main);
    letter-spacing: 1px;
}

.guest-wrapper p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
}
.guest-wrapper .guest-meta { opacity: 0.8; }
.guest-wrapper .guest-name { font-size: 2rem; }

.guest-wrapper {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 20px 30px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-open {
    background-color: var(--cover-primary);
    color: white;
    padding: 12px 30px;
    border: 1px solid var(--cover-primary);
    border-radius: 50px;
    margin-top: 20px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
}
.btn-open:hover { background-color: transparent; color: var(--cover-primary); }

/* Saat dibuka, jadikan cover section biasa (tidak hilang) */
#cover.cover-open {
    position: relative;
    transform: none;
    height: auto;
    min-height: 100vh;
    z-index: 1;
}

/* ANIMATION ON SCROLL */
.reveal { opacity: 0; transform: translateY(30px); transition: all 1s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* SECTION 2: OPENING (AYAT) */
.quote-img { width: 100px; margin-bottom: 20px; }
.ayat { font-size: 1.1rem; line-height: 1.8; color: #666; font-style: italic; }

/* SECTION 3: COUPLE */
.couple-grid {
    display: flex;
    flex-direction: column; /* Selalu tampilan vertikal (3 baris) */
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
}
.couple-card { 
    width: 100%;
    max-width: 350px;
    text-align: center; 
}
.and-symbol {
    font-size: 3rem;
    font-family: var(--font-main);
}
.couple-img {
    width: 200px; height: 200px;
    border-radius: 50% 50% 0 0; /* Bentuk Arch */
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 20px;
}
.couple-name { 
    font-size: 1.8rem; 
    color: var(--primary-color); 
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
}
.couple-card > p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 5px;
}
.parents { 
    font-size: 0.9rem; 
    color: #888;
    line-height: 1.5;
    margin-bottom: 12px;
}
.couple-card a {
    font-size: 0.95rem;
    line-height: 1.6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.couple-card a i {
    font-size: 1.1rem;
}

/* Card animations (triggered when parent .reveal becomes active) */
.reveal .couple-card,
.reveal .event-box {
    opacity: 0;
    transform: translateY(16px);
}

.reveal.active .couple-card,
.reveal.active .event-box {
    animation: floatUp 0.9s ease forwards;
}

@keyframes floatUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SECTION 4: EVENT */
.event-box {
    --bg-img: none;
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid #ddd;
    padding: 30px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.event-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    filter: grayscale(20%);
    mix-blend-mode: multiply;
    pointer-events: none;
}

.event-box > * { position: relative; z-index: 1; }

.event-box.akad-bg { --bg-img: url('pamekasan.jpg'); }
.event-box.resepsi-bg { --bg-img: url('pasuruan.jpg'); }
.event-title { 
    font-size: 1.8rem; 
    color: var(--primary-color); 
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.event-date { 
    font-weight: 600; 
    margin-bottom: 15px; 
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
}
.event-box p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 8px 0;
}
.event-box strong {
    color: var(--primary-color);
    font-weight: 600;
}

.section-lead {
    margin: 8px 0 24px 0;
    line-height: 1.65;
    color: #555;
}

/* Event Box Locked State */
.event-box.locked {
    pointer-events: none;
    position: relative;
}

.event-box.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 1;
}

.locked-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    margin-top: 20px;
    font-size: 14px;
    letter-spacing: 1px;
    border: 1px solid var(--primary-color);
    position: relative;
    z-index: 2;
    cursor: default;
}

.locked-badge i {
    font-size: 0.9rem;
}

/* SECTION 5: GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Selalu 2 kolom */
    gap: 10px;
    margin-top: 30px;
    width: 100%;
}
.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    transition: 0.3s;
}
.gallery-img:hover { transform: scale(1.02); }

/* SECTION 6: GIFT */
.gift-container { background: white; padding: 40px; border-radius: 10px; width: 100%; }
.bank-card {
    border: 1px dashed var(--primary-color);
    padding: 20px;
    margin: 20px auto;
    max-width: 300px;
    position: relative;
}
.copy-btn {
    background: #eee; border: none; padding: 5px 10px;
    font-size: 12px; cursor: pointer; border-radius: 4px;
}

/* ========================================== */
/* LUCKY TICKET SECTION (Wishes & Win) */
/* ========================================== */
.lucky-ticket {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.12);
    position: relative;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Dashed border effect with pseudo-elements for ticket cutouts */
.lucky-ticket::before,
.lucky-ticket::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: #f0ebe5;
    border-radius: 50%;
    z-index: 10;
    border: 1px solid rgba(212, 175, 55, 0.15);
    display: none; /* Hide by default to prevent misalignment */
}
.lucky-ticket::before { left: -12px; }
.lucky-ticket::after { right: -12px; }

/* Prize Image at Top */
.ticket-header-img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 2px dashed rgba(138, 113, 95, 0.25);
    background: linear-gradient(to bottom, #faf8f3 0%, #ffffff 100%);
    padding: 15px;
}

/* Ticket Body */
.ticket-body {
    padding: 35px 30px;
    background: linear-gradient(to bottom, #ffffff 0%, #faf8f3 100%);
}

/* Form Groups */
.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-family: var(--font-body);
    letter-spacing: 0.3px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Radio Pill Buttons */
.radio-pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-pill-group input[type="radio"] {
    display: none;
}

.radio-pill {
    flex: 1;
    min-width: 120px;
    padding: 12px 18px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    background: #ffffff;
}

.radio-pill i {
    margin-right: 6px;
    font-size: 0.9rem;
}

.radio-pill:hover {
    border-color: var(--primary-color);
    background: #fafafa;
}

.radio-pill-group input[type="radio"]:checked + .radio-pill {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Slide down animation for pax field */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

#paxGroup {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid rgba(138, 113, 95, 0.25);
    border-radius: 6px;
    font-size: 0.98rem;
    font-family: var(--font-body);
    background: #ffffff;
    color: var(--text-color);
    transition: all 0.3s ease;
}

textarea.form-input {
    resize: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
    background: #fffef9;
}

.form-input::placeholder {
    color: #a99585;
    font-size: 0.92rem;
}

/* Locked Input (Read-only Name) */
.locked-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid rgba(138, 113, 95, 0.2);
    border-radius: 6px;
    font-size: 0.98rem;
    font-family: var(--font-body);
    background: #f5f2ee;
    color: #8a715f;
    cursor: not-allowed;
    font-weight: 500;
}

/* Submit Button */
.ticket-submit-btn {
    width: 100%;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-body);
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 15px;
}

.ticket-submit-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.ticket-submit-btn:active {
    transform: scale(0.98);
}

.ticket-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ticket-submit-btn i {
    margin-right: 8px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ticket-body {
        padding: 28px 22px;
    }
    
    .ticket-header-img {
        padding: 12px;
    }
}

/* ========================================== */
/* WISHES FEED SECTION (Daftar Ucapan) */
/* ========================================== */
.wishes-feed-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.wishes-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

/* Custom Scrollbar */
.wishes-container::-webkit-scrollbar {
    width: 8px;
}

.wishes-container::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
}

.wishes-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.wishes-container::-webkit-scrollbar-thumb:hover {
    background: #c9a635;
}

/* Individual Wish Card */
.wish-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(93, 64, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wish-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(93, 64, 55, 0.12);
}

/* Wish Header */
.wish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.wish-name {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.wish-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.status-hadir {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.status-berhalangan {
    background: rgba(158, 158, 158, 0.15);
    color: #616161;
}

/* Pax Badge */
.pax-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary-color);
}

.pax-badge i {
    margin-right: 4px;
    font-size: 0.7rem;
}

/* Wish Body */
.wish-body {
    margin: 15px 0;
}

.wish-body p {
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-color);
    font-style: italic;
    margin: 0;
}

/* Wish Footer */
.wish-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(138, 113, 95, 0.15);
}

.wish-time {
    font-size: 0.8rem;
    color: #8a715f;
    font-family: var(--font-body);
}

/* No Wishes Message */
.no-wishes {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .wishes-container {
        max-height: 400px;
        padding: 5px;
    }
    
    .wish-card {
        padding: 16px;
    }
    
    .wish-name {
        font-size: 1.1rem;
    }
    
    .wish-body p {
        font-size: 0.92rem;
    }
}

/* FOOTER */
footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    footer {
        min-height: 50vh;
    }
}

/* MUSIC CONTROL */
#music-control {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 50px; height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none; /* Muncul setelah cover dibuka */
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    border: 2px solid white;
}
#music-control.music-dance {
    animation: dance 1.4s ease-in-out infinite;
}
.fa-spin { animation: fa-spin 2s infinite linear; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dance {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    20% { transform: translateY(-3px) rotate(-4deg) scale(1.05); }
    40% { transform: translateY(0) rotate(4deg) scale(1.02); }
    60% { transform: translateY(-2px) rotate(-3deg) scale(1.05); }
    80% { transform: translateY(0) rotate(3deg) scale(1.02); }
    100% { transform: translateY(0) rotate(0deg) scale(1); }
}

/* RESPONSIVE TEXT */
@media (max-width: 768px) {
    .couple-hero { font-size: 3rem; }
    .couple-grid { flex-direction: column; } /* Mempelai jadi atas bawah di HP */
}
