/* =========================================
   GENERAL SETUP
   ========================================= */
html {
    overflow-x: hidden;
    width: 100%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background-color: #f4f4f4; 
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* Base Container & Structural Lock */
.page-container, .page-section {
    max-width: 480px; 
    margin: 0 auto;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: #fff;
    text-align: center;
    overflow-x: hidden; /* Mencegah elemen keluar dari kontainer utama */
}

main#main-content {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    overflow-x: hidden;
    position: relative;
}

.page-section { padding: 40px 20px; }

/* Helper Classes */
.flex-center { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.flex-bottom { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hidden { display: none; }
.text-left { text-align: left; }
.mt-15 { margin-top: 5px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px !important; }

/* Fonts */
.txt-montserrat { font-family: 'Montserrat', sans-serif; }
.txt-pinyon { font-family: 'Pinyon Script', cursive; }
.white-text { color: white !important; }
.black-text { color: #000 !important; }
.bold { font-weight: bold; }
.italic { font-style: italic; }

/* Font Sizes */
.sz-14 { font-size: 14px !important; }
.sz-18 { font-size: 18px !important; }
.sz-20 { font-size: 20px !important; }
.sz-40 { font-size: 40px !important; } 

/* =========================================
   HALAMAN PEMBUKA (WELCOME PAGE)
   ========================================= */
#welcome-page {
    background: url('file/sambutan.webp') center/cover no-repeat;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    z-index: 999;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    padding-bottom: 80px; 
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.overlay-content { 
    width: 100%; 
    text-align: center;
    padding: 0 20px;
}

.guest-box { margin: 20px 0; }

#btn-open {
    margin-top: 10px;
    padding: 12px 25px;
    background: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

/* =========================================
   HALAMAN HOME
   ========================================= */
.section-bg-home { 
    background: url('file/home_bg.webp') center/cover no-repeat; 
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.white-block {
    background: white;
    width: 100%;
    padding: 40px 20px 60px 20px; 
    border-top-left-radius: 50% 80px; 
    border-top-right-radius: 50% 80px;
    position: relative;
    z-index: 2;
}

.img-hero-small { 
    width: 130px;
    height: auto;
    border-radius: 10px; 
    margin-bottom: 15px; 
}

.countdown-home-wrapper {
    margin-top: 15px;
    padding: 10px;
    display: inline-block;
    color: #000 !important;
}

.countdown-home-wrapper span {
    font-weight: bold !important; 
    color: #000 !important;
}

/* =========================================
   FRAME & PROFILE
   ========================================= */
.frame-container {
    position: relative;
    width: 200px; 
    height: 200px;
    margin: 30px auto 15px auto;
}

.frame-img, .profile-img { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}

.frame-img { width: 100%; z-index: 2; }
.profile-img { 
    width: 85%; 
    height: 85%; 
    object-fit: cover; 
    border-radius: 50%; 
    z-index: 1; 
}

/* =========================================
   ORNAMENTS SYSTEM
   ========================================= */
.orn-top-right, .orn-bottom-right, .orn-bridge { 
    position: absolute; 
    pointer-events: none; 
}
.orn-top-right { top: 0; right: 0; width: 100px; }
.orn-bottom-right { bottom: 0; right: 0; width: 100px; }
.orn-bridge {
    width: 95px !important;
    left: 0; 
    top: 48%;
    transform: translateY(-50%);
    z-index: 0 !important; 
}

#bride-content, #groom-content, #gallery-section { position: relative; z-index: 5; }
#groom-content { margin-top: 80px !important; }
#gallery-section { margin-top: 60px !important; }

/* =========================================
   GALLERY PORTRAIT (3:4)
   ========================================= */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 25px; }
.gallery-item { aspect-ratio: 3/4; overflow: hidden; border-radius: 8px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.3s ease; }
.gallery-item img:hover { transform: scale(1.05); }

/* =========================================
   HALAMAN ACARA (EVENT)
   ========================================= */
.section-bg-event { padding: 0 !important; background: none !important; }

.event-top {
    position: relative;
    background: url('file/waktu.webp') center/cover no-repeat;
    min-height: 60vh;
    padding: 60px 20px;
    overflow: hidden; /* Proteksi dari pergeseran konten internal */
}

.black-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 1; }
.relative-z { position: relative; z-index: 2; }

.event-bottom {
    background-color: #fff;
    padding: 60px 0;
    width: 100%;
    max-width: 480px;
    overflow: hidden; /* Proteksi dari pergeseran konten tabel/peta */
}
.event-bottom .content-wrapper { padding: 0 20px; }

.maps-container { margin-top: 30px; width: 100%; padding: 0 10px; }
.maps-container iframe { width: 100%; height: 250px; border-radius: 12px; border: 1px solid #eee; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.countdown-event-wrapper { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.cd-item { background: white; color: black; padding: 10px; border-radius: 8px; min-width: 60px; display: flex; flex-direction: column; }
.cd-item .num { font-size: 24px; font-weight: bold; }
.cd-item .lab { font-size: 10px; text-transform: uppercase; }

.info-table { margin: 0 auto; text-align: left; border-collapse: collapse; }
.info-table td { padding: 5px; vertical-align: top; }

/* =========================================
   FORM UCAPAN & HALAMAN WISHES
   ========================================= */
#wish-form { text-align: left; width: 100%; }
#wish-form .btn-group { margin-left: 85px; display: flex; gap: 10px; }
#wish-form .btn-custom { flex: 1; padding: 12px 5px; white-space: nowrap; }

.section-top { display: flex; flex-direction: column; justify-content: flex-start !important; padding-top: 60px !important; }
.form-group-row { display: flex; align-items: center; margin-bottom: 15px; gap: 15px; text-align: left; }
.form-group-row label { width: 70px; font-weight: bold; }
.form-group-row input, .form-group-row textarea { flex: 1; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-family: 'Montserrat', sans-serif; }

.btn-custom { padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s; font-family: 'Montserrat', sans-serif; font-size: 14px; }
.btn-black { background: #000; color: #fff; border: 2px solid #000; }
.btn-outline { background: #eee; color: #000; border: 2px solid #000; }
.btn-custom:active { transform: scale(0.95); }

.comment-item { background: #f9f9f9; padding: 15px; border-radius: 5px; margin-bottom: 15px; border-left: 5px solid #000; text-align: left !important; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.comment-name { font-weight: bold; font-size: 14px; margin-bottom: 5px; display: block; }
.comment-text { text-align: justify; line-height: 1.6; font-size: 13px; color: #333; }
.read-more { color: #888; cursor: pointer; font-weight: bold; }

.pagination-controls { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.page-btn { background: #fff; color: #000; border: 1px solid #000; padding: 6px 14px; font-weight: bold; cursor: pointer; }
.page-btn.active { background: #000 !important; color: #fff !important; }

.btn-save-calendar { display: inline-flex; align-items: center; background: rgba(255, 255, 255, 0.9); color: #000; padding: 10px 20px; border-radius: 30px; text-decoration: none; font-family: 'Montserrat', sans-serif; font-size: 14px; transition: 0.3s; border: 1px solid #000; }
.btn-save-calendar:hover { background: #000; color: #fff; }
.btn-save-calendar:hover svg { stroke: white; }

/* =========================================
   TOMBOL MELAYANG (FLOATING CONTROLS)
   ========================================= */
.floating-container {
    position: fixed;
    bottom: 30px;
    left: calc(50% - 220px); /* Menyelaraskan posisi kiri relatif terhadap kontainer 480px */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 480px) {
    .floating-container {
        left: 20px; /* Kembali ke sisi kiri mentok saat layar mobile */
    }
}

.btn-floating {
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.btn-floating:active { transform: scale(0.9); }

/* Animasi putar untuk ikon musik yang sedang diputar */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   KADO POPUP & UTILITY MODALS
   ========================================= */
.bank-card {
    background: #fdfdfd;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    margin-top: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.btn-copy {
    background: #000;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
    margin-top: 12px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background 0.2s;
}
.btn-copy:active { background: #333; }

.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 10000; display: flex; justify-content: center; align-items: center; padding: 20px; }
.popup-container { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 400px; }
#popup-img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }

.nav-btn { background: rgba(255, 255, 255, 0.3); color: white; border: none; padding: 10px 15px; cursor: pointer; font-size: 20px; border-radius: 50%; position: absolute; z-index: 10001; }
.nav-btn:first-child { left: -50px; }
.nav-btn:last-child { right: -50px; }

.btn-close, .btn-close-dark { position: absolute; top: 20px; right: 20px; font-size: 40px; cursor: pointer; z-index: 10000; }
.btn-close { color: white; }
.btn-close-dark { color: black; }

.popup-content { background: white; padding: 40px 20px 30px; width: 90%; max-width: 400px; border-radius: 15px; position: relative; }
.scrollable { max-height: 80vh; overflow-y: auto; }

.hidden-completely { display: none !important; visibility: hidden !important; pointer-events: none !important; z-index: -1 !important; }
.popup-overlay.hidden-completely { display: none !important; }
.relative { position: relative; }

/* RESPONSIVE LAYOUT */
@media (max-width: 480px) {
    .form-group-row { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 8px; 
        width: 100%;
    }
    
    .form-group-row label {
        width: 100%;
        margin-bottom: 2px;
    }

    .form-group-row input, 
    .form-group-row textarea { 
        width: 100% !important; 
        display: block;
    }

    #wish-form .btn-group { 
        margin-left: 0 !important; 
        width: 100%; 
        gap: 12px;
    }
    
    .nav-btn { 
        background: rgba(0, 0, 0, 0.5); 
    }
    
    .nav-btn:first-child { left: 10px; }
    .nav-btn:last-child { right: 10px; }
}