:root {
    --gold-bg: #C4973A;
    --text-white: #FFFFFF;
    --text-dark: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile width */
    background-color: var(--gold-bg);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Area with Background */
.hero-section {
    position: relative;
    background-image: url('img/hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding-top: 20px;
    padding-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 250px;
}

/* Optional overlay for hero image if needed */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3); /* Slightly whiten background */
    z-index: 1;
}

.top-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 30px 25px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    gap: 15px;
}

.icon-black {
    color: #000;
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
    cursor: pointer;
}

.logo-container {
    margin-top:15px;
    width: 100%;
    max-width: 300px;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.main-logo {
    width: 90%;
    height: auto;
    object-fit: contain;
}

/* Pattern Separator */
.pattern-separator {
    width: 100%;
    height: 60px; /* Increased to make pattern larger */
    background-image: url('img/patern_horizontal.png');
    background-size: auto 100%;
    background-repeat: repeat-x;
    background-position: center;
    z-index: 3;
    position: relative;
    margin-top: -60px;
}

/* Content Area */
.content-section {
    flex: 1;
    background-color: var(--gold-bg);
    padding: 20px 30px 80px 30px;
    color: var(--text-white);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.text-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
    font-weight: 300;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background-color: #54712F; /* Changed to green as requested */
    border-radius: 30px 30px 0 0; /* Melengkung di bagian atas */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 10px 25px 10px; /* Adjusted padding for 5 items */
    border-top: none; 
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6); /* Dimmed color for inactive items */
    transition: all 0.3s ease;
    flex: 1; /* Distribute items evenly */
    padding: 5px 0;
}

.nav-item i {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    margin-bottom: 5px;
}

.nav-text {
    font-size: 0.6rem;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
}

.nav-item:active, .nav-item.active {
    color: var(--gold-bg); /* Simple color change for active state */
    transform: translateY(-3px); /* Subtle lift */
}

/* --- LOADING SCREEN ANIMATION --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #54712F 0%, #2E401A 100%); /* Gorgeous premium gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.loading-logo {
    width: 140px;
    height: auto;
    animation: goldGlowLogo 2s infinite ease-in-out;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border-top-color: #C4973A; /* Gold theme color */
    border-right-color: #C4973A; /* Gold theme color */
    animation: spinLoader 1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

@keyframes goldGlowLogo {
    0% {
        transform: scale(0.95);
        filter: drop-shadow(0 0 10px rgba(196, 151, 58, 0.3));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 25px rgba(196, 151, 58, 0.75));
    }
    100% {
        transform: scale(0.95);
        filter: drop-shadow(0 0 10px rgba(196, 151, 58, 0.3));
    }
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* --- REVEAL ANIMATIONS ON LOAD --- */
/* Hide content initially */
body:not(.loaded) .app-container {
    opacity: 0;
}

/* Reveal App Container */
body.loaded .app-container {
    animation: fadeIn 1s ease forwards;
}

/* Staggered Elements Reveal */
body.loaded .top-header {
    animation: slideDown 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
    opacity: 0;
}

body.loaded .logo-container {
    animation: zoomIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s forwards;
    opacity: 0;
}

body.loaded .content-section h1 {
    animation: slideUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 1.1s forwards;
    opacity: 0;
}

body.loaded .text-content p {
    animation: slideUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

body.loaded .text-content p:nth-child(1) { animation-delay: 1.3s; }
body.loaded .text-content p:nth-child(2) { animation-delay: 1.5s; }
body.loaded .text-content p:nth-child(3) { animation-delay: 1.7s; }

body.loaded .bottom-nav {
    animation: slideUpNav 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
    transform: translateY(100%);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideUpNav {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* --- SPA PAGE TRANSITIONS --- */
.view-page {
    display: none;
    opacity: 0;
}

.view-page.active {
    display: block;
    animation: fadeInPage 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards; /* Luxurious easeOutExpo curve */
}

#ucapan-page.view-page.active,
#dresscode-page.view-page.active,
#rundown-page.view-page.active,
#peraturan-page.view-page.active,
#undangan-page.view-page.active {
    display: flex; /* Pages needing flex layout */
}

@keyframes fadeInPage {
    from { 
        opacity: 0; 
        transform: scale(0.97) translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* --- UCAPAN PAGE STYLES --- */
.ucapan-page {
    background-color: #FFFFFF;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 100px 20px; /* Space for bottom nav */
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.pattern-vertical-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 100%;
    background-image: url('img/patern_horizontal.png');
    opacity: 0; /* Default invisible before animation */
    z-index: 0;
    clip-path: inset(0 0 100% 0); /* Fully clipped from bottom to top */
    transform: translateY(-15px);
    will-change: transform, clip-path, opacity; /* Force GPU Acceleration for 60/120 FPS */
}

/* Animate pattern vertical when page is active */
.view-page.active .pattern-vertical-bg {
    animation: revealTopToBottom 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0.05s forwards; /* Extremely smooth premium easeOutExpo curve with longer duration */
}

@keyframes revealTopToBottom {
    from {
        clip-path: inset(0 0 100% 0);
        transform: translateY(-15px);
        opacity: 0;
    }
    to {
        clip-path: inset(0 0 0 0);
        transform: translateY(0);
        opacity: 0.15;
    }
}

.ucapan-header {
    text-align: left;
    width: 100%;
    z-index: 1;
    margin-bottom: 20px;
    padding-left: 20px;
}

.ucapan-header h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 2px;
}

.ucapan-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #000;
    margin-top: -5px;
    letter-spacing: 1px;
}

.ucapan-card-container {
    position: relative;
    width: 100%;
    flex: 1; /* Fills available middle space */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.ucapan-card-img {
    position: absolute;
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
}



.ucapan-footer {
    text-align: center;
    z-index: 1;
    margin-top: 30px;
    color: #000;
}

.signature-font {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.ucapan-footer h4 {
    font-size: 1rem;
    font-weight: 700;
}

.ucapan-footer p {
    font-size: 0.85rem;
    font-weight: 400;
    margin-top: 2px;
}

/* --- WELCOME MODAL (ONBOARDING) --- */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); 
    backdrop-filter: blur(0px); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Di atas segalanya kecuali loading screen */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, 
                backdrop-filter 0.4s ease, 
                background-color 0.4s ease,
                visibility 0.4s;
}

.welcome-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black background */
    backdrop-filter: blur(8px); /* Beautiful premium blur */
}

.welcome-modal-content {
    background-color: var(--gold-bg); /* Warna emas sesuai tema */
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.welcome-modal-overlay.show .welcome-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.logo-container-modal {
    margin-bottom: 10px;
}

.modal-logo {
    width: 80px;
    height: auto;
}

/* Menyembunyikan navigasi bawah saat di halaman welcome */
body.on-welcome-page .bottom-nav {
    display: none;
}

.welcome-step {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    opacity: 0;
}

.welcome-step.active {
    display: flex;
    animation: stepEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes stepEnter {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-title {
    color: #FFFFFF;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: center;
}

.welcome-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-bottom: 25px;
    text-align: center;
}

.welcome-btn {
    width: 100%;
    max-width: 300px;
    background-color: #54712F; /* Hijau tema */
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.welcome-btn:active {
    transform: translateY(2px);
}

.welcome-btn.btn-secondary {
    background-color: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
}

/* --- DRESS CODE PAGE --- */
.dresscode-page {
    background-color: #FFFFFF;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 100px 20px;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

#dresscode-page.view-page.active {
    display: flex;
}

.dresscode-header {
    text-align: center;
    z-index: 1;
    width: 100%;
    margin-bottom: 10px;
}

.dresscode-header h2 {
    font-size: 1rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 2px;
}

.dresscode-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #000;
    margin-top: 5px;
}

.dresscode-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.dresscode-image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    margin-bottom: 20px;
}

.dresscode-image-container img {
    width: 85%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
}

.dresscode-rules {
    width: 100%;
    max-width: 400px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.rule-badge {
    min-width: 32px;
    height: 32px;
    background-color: var(--gold-bg);
    color: #FFFFFF;
    border-radius: 5px 15px 5px 15px; /* Leaf-like shape */
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.rule-text {
    flex: 1;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.4;
}

.rule-text strong {
    font-weight: 700;
}

.rule-text span {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* --- RUNDOWN PAGE --- */
.rundown-page {
    background-color: #FFFFFF;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 100px 20px;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

#rundown-page.view-page.active {
    display: flex;
}

.rundown-header {
    text-align: center;
    z-index: 1;
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.rundown-logo {
    width: 70px;
    height: auto;
}

.rundown-title-img {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.rundown-content {
    width: 100%;
    max-width: 400px;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.rundown-table-header {
    display: flex;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #000;
}

.rundown-col-waktu {
    width: 40%;
    text-align: left;
    padding-left: 10px;
}

.rundown-col-agenda {
    width: 60%;
    padding-left: 15px;
}

.rundown-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Garis vertikal di tengah */
.rundown-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40%;
    width: 2px;
    background-color: #54712F; /* Hijau tema */
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    position: relative;
    z-index: 2; /* Agar di atas garis */
}

.time-col {
    width: 40%;
    text-align: left;
    padding-left: 5px;
    padding-right: 15px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #000;
    line-height: 1.4;
    align-self: flex-start;
}

.agenda-col {
    width: 60%;
    padding-left: 15px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #333;
}

.agenda-col strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 2px;
}

.agenda-col span {
    font-weight: 400;
    color: #555;
    font-size: 0.75rem;
}

/* --- PERATURAN PAGE --- */
.peraturan-page {
    background-color: #FFFFFF;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px 100px 20px;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

#peraturan-page.view-page.active {
    display: flex;
}

.peraturan-header {
    text-align: center;
    z-index: 1;
    width: 100%;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.peraturan-logo {
    width: 140px;
    height: auto;
}

.peraturan-title-img {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.peraturan-content {
    width: 100%;
    max-width: 400px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 60px;
}

.peraturan-wajib {
    font-size: 1rem;
    line-height: 2;
    color: #000;
}

.peraturan-wajib strong {
    font-weight: 800;
}

.peraturan-alamat {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #222;
    font-weight: 500;
}

.peraturan-sosmed {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-top: 30px;
}

.sosmed-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #54712F; /* Hijau tema */
    font-weight: 700;
}

.sosmed-item i {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* --- UNDANGAN PAGE --- */
.undangan-page {
    background-color: #FFFFFF;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px 100px 20px;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

#undangan-page.view-page.active {
    display: flex;
}

.undangan-header {
    text-align: center;
    z-index: 1;
    width: 100%;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.undangan-logo {
    width: 160px;
    height: auto;
}

.undangan-title-img {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.undangan-content {
    width: 100%;
    max-width: 400px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.undangan-intro {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #222;
    margin-bottom: 40px;
}

.undangan-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 50px;
    text-align: left;
}

.detail-row {
    display: flex;
    align-items: flex-start;
}

.detail-label {
    width: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #000;
}

.detail-separator {
    width: 15px;
    font-weight: 600;
    color: #000;
}

.detail-value {
    flex: 1;
    font-size: 0.9rem;
    color: #000;
    font-weight: 600;
    line-height: 1.4;
}

.undangan-closing {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #222;
    margin-bottom: 40px;
}

/* --- FLOATING MUSIC BUTTON --- */
.music-toggle-btn {
    position: fixed;
    bottom: 95px; /* Float above the bottom navigation bar */
    right: calc((100vw - 480px) / 2 + 20px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(84, 113, 47, 0.9); /* Theme green with elegance opacity */
    border: 2px solid #C4973A; /* Gold theme border */
    color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

@media (max-width: 480px) {
    .music-toggle-btn {
        right: 20px; /* Aligned nicely inside screen boundary on true mobile */
    }
}

.music-toggle-btn:active {
    transform: scale(0.9);
}

.music-toggle-btn.playing i {
    animation: rotateMusic 4s linear infinite;
}

/* Hidden during onboarding/welcome modal */
body.on-welcome-page .music-toggle-btn {
    display: none;
}

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

/* --- COUNTDOWN TIMER --- */
.countdown-container {
    background-color: rgba(255, 255, 255, 0.95); /* Elegant semi-translucent white */
    border: 2px solid #C4973A; /* Gold theme border */
    border-radius: 20px;
    padding: 18px 10px;
    margin: 15px 25px 15px 25px; /* Elegant normal margins to let the horizontal batik show clearly! */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
    text-align: center;
}

.countdown-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #54712F; /* Green theme color */
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.cd-num {
    font-size: 1.7rem;
    font-weight: 800;
    color: #000;
    line-height: 1.1;
    font-variant-numeric: tabular-nums; /* Prevents text layout shifting while counting! Very premium detail */
}

.cd-text {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-top: 3px;
}

.countdown-colon {
    font-size: 1.5rem;
    font-weight: 800;
    color: #C4973A; /* Gold color */
    margin-top: -15px; /* Aligns colon vertically with numbers */
}
