/* ============================================================
 * BOTTOM NAVIGATION — Navapraba Wedding
 * ============================================================
 * Fixed bottom nav untuk halaman undangan publik.
 * 
 * CARA PAKAI:
 * 1. Include CSS ini di <head> setelah animations.css
 * 2. Tambah <nav class="nv-bottom-nav theme-{name}"> di body
 * 3. Tiap section punya id (cover, couple, event, gallery, gift, rsvp)
 * 4. JS handler ada inline di tema (smooth scroll + active state)
 * 
 * Tema variants:
 * - .theme-pure       → cream + brown
 * - .theme-atelier    → sage + dusty pink
 * - .theme-heritage   → emerald + gold
 * ============================================================ */

/* ============ BASE LAYOUT ============ */
.nv-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    
    height: 64px;
    max-width: 480px;
    margin: 0 auto;
    
    /* Hidden by default, shown via JS setelah cover screen ditutup */
    transform: translate3d(0, 100%, 0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1),
                opacity 0.5s ease;
    
    /* Safe area untuk iPhone dengan notch */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Backdrop blur untuk premium feel */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* Subtle border atas */
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    
    will-change: transform, opacity;
}

.nv-bottom-nav.is-visible {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* ============ MENU ITEMS ============ */
.nv-bottom-nav a {
    flex: 1;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    
    text-decoration: none;
    
    /* Tap area minimal 44x44 untuk iOS HIG */
    min-width: 44px;
    
    transition: color 0.2s ease, transform 0.2s ease;
    
    /* Prevent text selection saat tap */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.nv-bottom-nav a:active {
    transform: scale(0.92);
}

/* Icon container — SVG inside */
.nv-bottom-nav .nv-icon {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Label di bawah icon */
.nv-bottom-nav .nv-label {
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1;
    margin-top: 2px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

/* Active state — icon larger + label bolder */
.nv-bottom-nav a.is-active .nv-icon {
    transform: scale(1.15) translateY(-1px);
}
.nv-bottom-nav a.is-active .nv-label {
    opacity: 1;
    font-weight: 600;
}

/* Active indicator dot di atas icon */
.nv-bottom-nav a::before {
    content: '';
    position: absolute;
    top: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.5, -0.5, 0.5, 1.5);
}
.nv-bottom-nav a {
    position: relative;
}
.nv-bottom-nav a.is-active::before {
    opacity: 1;
    transform: scale(1);
}

/* ============ THEME: PURE (Standard) ============ */
.nv-bottom-nav.theme-pure {
    background: rgba(253, 250, 245, 0.95);
    border-top-color: rgba(212, 165, 116, 0.25);
}
.nv-bottom-nav.theme-pure a {
    color: #8b7355;
}
.nv-bottom-nav.theme-pure a.is-active {
    color: #8b5a2b;
}
.nv-bottom-nav.theme-pure a::before {
    background: #8b5a2b;
}

/* ============ THEME: ATELIER (Premium) ============ */
.nv-bottom-nav.theme-atelier {
    background: rgba(253, 251, 247, 0.95);
    border-top-color: rgba(156, 175, 136, 0.3);
}
.nv-bottom-nav.theme-atelier a {
    color: #8b7d6f;
}
.nv-bottom-nav.theme-atelier a.is-active {
    color: #6b8a5f;
}
.nv-bottom-nav.theme-atelier a::before {
    background: #c98c6b;
}

/* ============ THEME: HERITAGE (Spesial) ============ */
.nv-bottom-nav.theme-heritage {
    background: rgba(26, 51, 41, 0.92);
    border-top-color: rgba(197, 162, 83, 0.4);
}
.nv-bottom-nav.theme-heritage a {
    color: #d4b86d;
    opacity: 0.7;
}
.nv-bottom-nav.theme-heritage a.is-active {
    color: #f0e4c2;
    opacity: 1;
}
.nv-bottom-nav.theme-heritage a::before {
    background: #c5a253;
    box-shadow: 0 0 8px rgba(197, 162, 83, 0.6);
}

/* ============ BODY OFFSET — biar content tidak ke-cover nav ============ */
/* Saat nav visible, tambah padding-bottom ke body */
body.has-bottom-nav {
    padding-bottom: 64px;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Footer juga perlu offset */
body.has-bottom-nav .footer {
    margin-bottom: 0;
}

/* ============ MUSIC TOGGLE REPOSITIONING ============ */
/* Tombol music yang sebelumnya di bottom-right, geser ke atas
   biar tidak overlap dengan bottom nav */
body.has-bottom-nav .music-toggle {
    bottom: 84px !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ============ AUTO-ADAPTIVE: hide label di layar sangat sempit ============ */
@media (max-width: 340px) {
    .nv-bottom-nav .nv-label {
        font-size: 8px;
    }
    .nv-bottom-nav {
        height: 58px;
    }
}

/* Layar lebih lebar (tablet): icon + label lebih leluasa */
@media (min-width: 481px) {
    .nv-bottom-nav {
        max-width: 480px;
        margin: 0 auto 12px;
        bottom: 12px;
        border-radius: 20px;
        border: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    }
    .nv-bottom-nav.theme-heritage {
        border-color: rgba(197, 162, 83, 0.3);
    }
    body.has-bottom-nav {
        padding-bottom: 90px;
    }
}

/* ============ RESPECT REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    .nv-bottom-nav,
    .nv-bottom-nav .nv-icon,
    .nv-bottom-nav a,
    .nv-bottom-nav a::before {
        transition: none !important;
        animation: none !important;
    }
}

/* ============ PRINT ============ */
@media print {
    .nv-bottom-nav { display: none !important; }
    body.has-bottom-nav { padding-bottom: 0 !important; }
}
