/* ============================================================
   A PHIM — Mobile Bottom Navigation Bar (Glassmorphism & Slender Side Icons)
   5 Tabs: Bộ lọc — Lịch sử — [Trang chủ Floating Center] — Yêu thích — Tài khoản
   Slender 1.35 stroke icons & 450 font-weight labels for elegant contrast
   ============================================================ */

@media (max-width: 1023px) {
    html {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    body {
        max-width: 100vw !important;
    }
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── Bottom Nav Dock Container ── */
#bottom-nav-dock {
    display: none;
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 68px !important;
    box-sizing: border-box !important;
    z-index: 9500 !important;
    background: transparent !important;
    overflow: visible !important;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    isolation: isolate;
}

@media (max-width: 1023px) {
    #bottom-nav-dock {
        display: block !important;
    }
}

/* Background SVG Curved Notch */
.bn-bg-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 68px;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 -4px 12px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 10px rgba(252, 213, 118, 0.15));
}

/* Five fixed columns keep every icon aligned with the centered notch. */
.bn-tabs-container {
    position: relative;
    z-index: 2;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: center;
    justify-items: center;
    width: 100% !important;
    max-width: 100% !important;
    height: 68px;
    box-sizing: border-box !important;
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)) !important;
}

/* Individual Tab Items */
.bn-tab {
    flex: none;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    cursor: pointer;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: color 0.18s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    outline: none;
    padding: 6px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* 5th Tab (Account) guaranteed visible */
#bn-tab-account {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.bn-tab:active {
    transform: scale(0.92);
}

.bn-tab-icon {
    width: 24px;
    height: 24px;
    display: block;
    transition: transform 0.2s ease, stroke 0.18s ease;
    color: inherit;
}

.bn-tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    white-space: nowrap;
    text-align: center;
    font-family: 'Be Vietnam Pro', sans-serif;
    transition: color 0.18s ease, font-weight 0.18s ease;
    letter-spacing: 0;
}

/* Active State (Gold #fcd576 Accent) */
.bn-tab.active {
    color: #fcd576 !important;
    text-shadow: 0 0 12px rgba(252, 213, 118, 0.5);
}

.bn-tab.active .bn-tab-label {
    color: #fcd576 !important;
    font-weight: 600 !important;
}

.bn-tab.active .bn-tab-icon path,
.bn-tab.active .bn-tab-icon circle {
    stroke: #fcd576 !important;
    stroke-width: 1.6 !important;
}

/* Center Floating Home Button (Glowing Gold #fcd576) */
.bn-tab-center {
    flex: none;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bn-center-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff3b0 0%, #fcd576 45%, #f59e0b 100%);
    position: absolute;
    top: -25px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(252, 213, 118, 0.85), 0 0 12px rgba(252, 213, 118, 0.6);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    border: 2.5px solid rgba(255, 255, 255, 0.85);
}

.bn-tab-center:active .bn-center-circle {
    transform: scale(0.90);
    box-shadow: 0 0 16px rgba(252, 213, 118, 0.6);
}

.bn-center-icon {
    width: 28px;
    height: 28px;
    display: block;
}

/* Desktop: hide mobile bottom nav */
@media (min-width: 1024px) {
    #bottom-nav-dock {
        display: none !important;
    }
}

/* 🎯 Proportional scaling for smaller mobile screens (< 400px) */
@media (max-width: 390px) {
    .bn-center-circle { width: 50px; height: 50px; top: -22px; }
    .bn-center-icon { width: 25px; height: 25px; }
    .bn-tab-icon { width: 22px; height: 22px; }
    .bn-tab-label { font-size: 9.5px; }
    .bn-tab { padding: 4px 0; gap: 3px; }
    .bn-tabs-container { padding: 0 6px !important; }
}

@media (max-width: 360px) {
    .bn-center-circle { width: 46px; height: 46px; top: -20px; }
    .bn-center-icon { width: 23px; height: 23px; }
    .bn-tab-icon { width: 20px; height: 20px; }
    .bn-tab-label { font-size: 9px; }
    .bn-tab { gap: 2px; }
    .bn-tabs-container { padding: 0 4px !important; }
}
