:root {
    /* Premium Color Palette */
    --color-primary: #041B33; /* Deep Navy */
    --color-primary-dark: #020c1b;
    --color-gold: #FFB800; /* Vibrant Gold matching reference */
    --color-gold-light: #FFD966;
    --color-gold-dark: #cc9300;
    --color-white: #ffffff;
    
    /* Typography */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-script: 'Great Vibes', cursive;
    
    /* Glassmorphism */
    --glass-bg: rgba(2, 21, 46, 0.6);
    --glass-border: rgba(255, 184, 0, 0.4);
    
    /* UI */
    --nav-bg: #036691; /* Match reference menu blue */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: #2b1b11; /* Outer dark brown to contrast the mobile frame */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

/* This is the mobile phone simulator container */
#app-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px; /* Support up to large phones/phablets */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport for modern mobile browsers */
    background: 
        linear-gradient(rgba(4, 27, 51, 0.88), rgba(4, 27, 51, 0.95)),
        url('https://images.unsplash.com/photo-1549487770-983df504ce8a?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover no-repeat;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    display: flex;
    flex-direction: column;
}

/* Scrollable content area */
#scroll-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: none; /* Firefox */
}
#scroll-content::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

/* Floating particles inside the app wrapper only */
#app-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--color-gold) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    animation: floatingDust 100s linear infinite;
}
@keyframes floatingDust {
    from { background-position: 0 0; }
    to { background-position: 500px 500px; }
}

/* --- Top Fluttering Red & White Flag --- */
.flag-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px; /* Ribbon height */
    z-index: 20;
    pointer-events: none;
    /* Mathematically perfect parallel sine waves for Red and White */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 120" preserveAspectRatio="none"><path d="M0,0 L0,50 Q250,100 500,50 T1000,50 L1000,0 Z" fill="%23ce1126"></path><path d="M0,50 Q250,100 500,50 T1000,50 L1000,100 Q750,50 500,100 Q250,150 0,100 Z" fill="%23ffffff"></path></svg>') repeat-x;
    background-size: 800px 100%;
    animation: flagFlutter 5s linear infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

@keyframes flagFlutter {
    from { background-position-x: 0; }
    to { background-position-x: -800px; }
}

/* Typography Utilities */
.text-gold { color: var(--color-gold); }
.text-white { color: var(--color-white); }
.font-bold { font-weight: 700; }
.font-script { 
    font-family: var(--font-script); 
    font-size: 3.5rem;
    line-height: 1.1;
}
.font-serif { font-family: var(--font-serif); }
.italic { font-style: italic; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-shadow { text-shadow: 2px 2px 5px rgba(0,0,0,0.8); }

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Sections & Animations */
.section {
    display: none;
    min-height: 100%;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 5;
}
.section.active {
    display: block;
    animation: fadeInUp 0.6s ease forwards;
}

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

.content-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 3rem;
}

/* Staggered Animations for Elements inside Active Section */
.section.active .center-content > * {
    opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.section.active .center-content > *:nth-child(1) { animation-delay: 0.2s; }
.section.active .center-content > *:nth-child(2) { animation-delay: 0.4s; }
.section.active .center-content > *:nth-child(3) { animation-delay: 0.6s; }
.section.active .center-content > *:nth-child(4) { animation-delay: 0.8s; }
.section.active .center-content > *:nth-child(5) { animation-delay: 1.0s; }
.section.active .center-content > *:nth-child(6) { animation-delay: 1.2s; }
.section.active .center-content > *:nth-child(7) { animation-delay: 1.4s; }

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

/* Glassmorphism Classes for Premium Look */
.glass-effect {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* Shine sweeping effect on glass containers */
.glass-effect::before {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-25deg);
    animation: shineSweep 6s infinite;
}
@keyframes shineSweep {
    0% { left: -150%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* Global Header Logo (Using the official JPG) */
.global-logo {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30; /* Higher than waves to prevent being covered */
    box-shadow: 2px 2px 15px rgba(0,0,0,0.5);
    border-radius: 0 0 15px 0;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.global-logo .logo-img {
    height: 55px; /* Reduced height for a more proportionate look */
    display: block; /* Remove bottom whitespace */
    object-fit: contain;
}

/* Hide old duplicated section logos */
.header-logo {
    display: none !important;
}

/* Ornaments */
.ornament-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}
.ornament-line span {
    height: 1.5px;
    flex: 1;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    max-width: 150px;
}
.ornament-line i {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 8px var(--color-gold));
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from { filter: drop-shadow(0 0 2px var(--color-gold)); transform: scale(0.95); }
    to { filter: drop-shadow(0 0 12px var(--color-gold-light)); transform: scale(1.05); }
}

/* Glass Guest Box */
.guest-box {
    border-radius: 12px;
    padding: 1.8rem 2.5rem;
    width: 90%;
}

/* Premium Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 50%, var(--color-gold-dark) 100%);
    color: #000;
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 30px;
    padding: 14px 40px;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 184, 0, 0.4), inset 0 2px 2px rgba(255,255,255,0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(255, 184, 0, 0.6), inset 0 2px 2px rgba(255,255,255,0.5);
}
.btn-primary:active {
    transform: translateY(2px) scale(0.98);
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: buttonShine 3s infinite 1s;
}
@keyframes buttonShine {
    to { left: 200%; }
}

/* Arch Profile Photo Frame */
.arch-frame {
    width: 200px;
    height: 250px;
    border-radius: 100px 100px 0 0;
    border: 3px solid var(--color-gold);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: transparent;
}
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info Box */
.info-box {
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    padding: 1.2rem;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    background: transparent;
    box-sizing: border-box;
    text-align: center;
}

/* Map Frame */
.map-frame {
    width: 100%;
    border-radius: 12px;
    padding: 4px;
    background: var(--color-gold);
}
.map-frame iframe {
    border-radius: 8px;
    display: block;
}

/* Music Controls */
.music-controls {
    position: absolute;
    right: 15px;
    bottom: 150px; /* Above bottom nav */
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-music {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-gold);
    border: none;
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Bottom Ship Container */
.bottom-illustration {
    position: absolute;
    bottom: 60px; /* Right above menu */
    left: -20px;
    width: calc(100% + 40px);
    height: 140px;
    z-index: 8;
    pointer-events: none;
}

/* --- Realistic Ocean Waves and Ships --- */
.ocean-container {
    position: absolute;
    bottom: 0; /* Flush with the bottom edge of the screen */
    left: 0;
    width: 100%;
    height: 100px; /* Adjusted height to fill the bottom */
    pointer-events: none;
    z-index: 10;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat-x;
    background-position: bottom;
}

.wave-back {
    z-index: 1;
    background-size: 800px 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,60 Q250,120 500,60 T1000,60 L1000,150 L0,150 Z" fill="%23012a4a"></path></svg>');
    animation: waveRollBack 15s linear infinite;
    opacity: 0.9;
}

.wave-mid {
    z-index: 2;
    background-size: 1000px 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,40 Q250,0 500,40 T1000,40 L1000,150 L0,150 Z" fill="%2301497c"></path></svg>'); /* Lighter blue */
    animation: waveRollMid 12s linear infinite;
    filter: drop-shadow(0 -3px 5px rgba(0,0,0,0.5)); /* 3D depth shadow */
}

/* Corner Ships Sandwiched in Waves */
.corner-ships {
    position: absolute;
    bottom: 0; /* Stick to the bottom */
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3; /* Between mid and front waves */
}

.ship-bl {
    position: absolute;
    bottom: 0;
    left: -20px;
    width: 60%;
    max-width: 250px;
    opacity: 0;
    animation: 
        shipEntranceLeft 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        shipBobLeft 6s ease-in-out infinite 1.5s;
}

.ship-br {
    position: absolute;
    bottom: 0;
    right: -20px;
    width: 60%;
    max-width: 250px;
    opacity: 0;
    animation: 
        shipEntranceRight 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        shipBobRight 6s ease-in-out infinite 1.5s;
}

.wave-front {
    z-index: 4; /* Overlaps the bottom of the ships */
    background-size: 1200px 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,70 Q250,130 500,70 T1000,70 L1000,150 L0,150 Z" fill="%23028090"></path></svg>'); /* Premium Teal/Cyan */
    animation: waveRollFront 9s linear infinite;
    filter: drop-shadow(0 -5px 6px rgba(0,0,0,0.5)); /* Deep 3D Shadow */
    opacity: 0.95;
}

@keyframes shipEntranceLeft {
    from { transform: translateX(-100px) translateY(50px) rotate(-15deg); opacity: 0; }
    to { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes shipEntranceRight {
    from { transform: translateX(100px) translateY(50px) rotate(15deg); opacity: 0; }
    to { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes shipBobLeft {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(4px) translateY(-8px) rotate(2deg); }
}
@keyframes shipBobRight {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(-4px) translateY(-8px) rotate(-2deg); }
}

@keyframes waveRollBack { from { background-position-x: 0; } to { background-position-x: -1600px; } }
@keyframes waveRollMid { from { background-position-x: 0; } to { background-position-x: -2000px; } }
@keyframes waveRollFront { from { background-position-x: 0; } to { background-position-x: -2400px; } }

/* Bottom Navigation (Modern Floating Style) */
.satumomen_menu {
    position: absolute;
    bottom: 25px; /* Floating above the bottom edge */
    left: 50%;
    transform: translateX(-50%); /* Center it perfectly */
    width: calc(100% - 40px); /* Leave space on the left and right */
    max-width: 420px;
    background: rgba(3, 102, 145, 0.85); /* Translucent premium blue */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 70px; /* Slightly taller for breathing room */
    border-radius: 35px; /* Pill shape rounded corners */
    z-index: 50;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 2px 5px rgba(255,255,255,0.2);
}
.satumomen_menu::-webkit-scrollbar {
    display: none;
}
.satumomen_menu_list {
    display: inline-flex;
    padding: 0 10px;
    margin: 0;
    height: 100%;
    list-style: none;
    align-items: center;
}
.satumomen_menu_item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 70px;
    height: 55px; /* Shorter than container to allow floating active pill */
    margin: 0 5px;
    border-radius: 20px;
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8;
}
.satumomen_menu_item span {
    font-size: 0.6rem;
    font-weight: 500;
    margin-top: 4px;
    font-family: var(--font-sans);
}
.satumomen_menu_item svg,
.satumomen_menu_item i {
    width: 20px;
    height: 20px;
    font-size: 20px;
}
.satumomen_menu_item.active {
    background: var(--color-gold);
    color: #000;
    opacity: 1;
}

/* Visibility Control for Cover / Main Content */
.initially-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.6s ease;
}
.initially-hidden.reveal {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* === Responsive Media Queries === */

/* Tablets and small laptops (desktop frame view) */
@media screen and (min-width: 481px) {
    #app-wrapper {
        border-radius: 12px; /* Smooth corners on desktop */
        border: 1px solid rgba(255,255,255,0.1);
    }
}

/* Standard Mobile Devices */
@media screen and (max-width: 480px) {
    body {
        align-items: flex-start;
        background-color: var(--color-primary-dark);
    }
    #app-wrapper {
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    .font-script { font-size: 3.2rem; }
    .header-logo { top: 20px; left: 10px; }
    .bottom-illustration { background-size: 130px; }
}

/* Very Small Mobile Devices (e.g., iPhone SE, older Androids) */
@media screen and (max-width: 360px) {
    .font-script { font-size: 2.8rem; }
    .header-logo { transform: scale(0.85); transform-origin: top left; }
    .guest-box, .info-box { padding: 1rem; }
    .btn-primary { padding: 10px 25px; font-size: 0.8rem; }
    .section { padding: 2rem 1rem; }
    .center-content { margin-top: 2.5rem; }
    .arch-frame { width: 180px; height: 230px; }
}

/* --- Countdown Timer --- */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.countdown-box {
    background-color: #ffb703;
    color: black;
    border-radius: 8px;
    padding: 15px 5px 10px 5px;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.countdown-box span {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 5px;
}
.countdown-box small {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- RSVP Modal --- */
.rsvp-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.rsvp-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.rsvp-modal {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 20px;
    color: #333;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.rsvp-modal-overlay.active .rsvp-modal {
    transform: scale(1);
}
.rsvp-modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.rsvp-modal h2 {
    font-family: serif;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}
.wa-input-group {
    display: flex;
}
.wa-prefix {
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-weight: 600;
}
.wa-input-group .form-control {
    border-radius: 0 6px 6px 0;
}
.btn-submit {
    width: 100%;
    background-color: #ffb703;
    color: black;
    font-weight: bold;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 10px;
}

/* --- Guest List --- */
.guest-list-container {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
    width: 100%;
    box-sizing: border-box;
}
.guest-list-container::-webkit-scrollbar { width: 6px; }
.guest-list-container::-webkit-scrollbar-thumb { background: #ffb703; border-radius: 4px; }

.guest-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #ffb703;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.guest-item:last-child { margin-bottom: 0; }

.guest-avatar {
    width: 30px;
    height: 30px;
    background-color: #ffb703;
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.guest-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.guest-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.guest-name { font-weight: bold; color: #ffb703; font-size: 0.85rem; }
.guest-status { font-size: 0.55rem; background: #ffb703; color: black; padding: 2px 5px; border-radius: 4px; font-weight: bold; }
.guest-comment { font-size: 0.75rem; color: white; line-height: 1.3; margin-bottom: 2px; }
.guest-time { font-size: 0.65rem; color: #aaa; }
