/* ============================================================
 * Member Bottom Navigation — adapted from game branch phaseA-lobby
 * + phaseW-bottom-nav (F86) for visual parity.
 *
 * The member tabbar lives in resources/views/layouts/navbars/tabbar.blade.php.
 * It uses the same class structure as the game branch's bottom nav so the
 * cyber-HUD treatment is identical: dim idle items, calm teal active card,
 * 2px top accent bar, no gradient wash, no drip indicator.
 * ============================================================ */

.modern-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    gap: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
    background:
        linear-gradient(180deg,
            rgba(8, 11, 16, 0.96) 0%,
            rgba(5, 7, 12, 0.99) 100%);
    border-top: 1px solid rgba(0, 217, 255, 0.12);
    box-shadow:
        0 -1px 0 rgba(255, 255, 255, 0.02) inset,
        0 -8px 24px rgba(0, 0, 0, 0.55);
}

.modern-bottom-nav.nav-3tab { grid-template-columns: repeat(3, 1fr); }
.modern-bottom-nav.nav-4tab { grid-template-columns: repeat(4, 1fr); }
.modern-bottom-nav.nav-5tab { grid-template-columns: repeat(5, 1fr); }

/* Subtle horizontal accent line above the nav. */
.modern-bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 217, 255, 0.18) 30%,
        rgba(0, 217, 255, 0.32) 50%,
        rgba(0, 217, 255, 0.18) 70%,
        transparent 100%);
    pointer-events: none;
}

/* Each item — uniform calm dim state. */
.modern-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 14px;
    background: transparent;
    color: rgba(226, 232, 240, 0.45);
    text-decoration: none !important;
    position: relative;
    min-height: 56px;
    transition:
        color 220ms cubic-bezier(0.2, 0.7, 0.2, 1),
        background 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.modern-bottom-nav .bottom-nav-item .nav-icon {
    color: rgba(226, 232, 240, 0.55);
    font-size: 20px;
    line-height: 1;
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), color 200ms ease;
}

.modern-bottom-nav .bottom-nav-item .nav-label {
    color: rgba(226, 232, 240, 0.55);
    font-family: 'Chakra Petch', 'Orbitron', var(--font-display), sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    transition: color 200ms ease;
}

/* Hover — soft bump on idle items (desktop only). */
@media (hover: hover) {
    .modern-bottom-nav .bottom-nav-item:not(.active):hover {
        background: rgba(0, 217, 255, 0.05);
    }
    .modern-bottom-nav .bottom-nav-item:not(.active):hover .nav-icon,
    .modern-bottom-nav .bottom-nav-item:not(.active):hover .nav-label {
        color: rgba(226, 232, 240, 0.85);
    }
}

/* Active — calm teal tint card, bright label/icon, single 2px top accent bar. */
.modern-bottom-nav .bottom-nav-item.active {
    background: rgba(0, 217, 255, 0.06);
    color: var(--accent, #00d9ff);
}
.modern-bottom-nav .bottom-nav-item.active .nav-icon {
    color: var(--accent, #00d9ff);
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(0, 217, 255, 0.45));
    animation: memberNavIconPop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modern-bottom-nav .bottom-nav-item.active .nav-label {
    color: var(--accent, #00d9ff);
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.32);
}

/* Top accent bar on active item. */
.modern-bottom-nav .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent, #00d9ff) 30%,
        var(--accent, #00d9ff) 70%,
        transparent 100%);
    box-shadow:
        0 0 8px rgba(0, 217, 255, 0.55),
        0 2px 6px rgba(0, 217, 255, 0.35);
    pointer-events: none;
}

@keyframes memberNavIconPop {
    0%   { transform: scale(1); }
    55%  { transform: scale(1.12); }
    100% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .modern-bottom-nav .bottom-nav-item.active .nav-icon {
        animation: none;
        transform: scale(1.06);
    }
}

/* Mobile tightening — keep 5 tabs readable at 375px. */
@media (max-width: 480px) {
    .modern-bottom-nav .bottom-nav-item .nav-label {
        font-size: 9px;
        letter-spacing: 0.14em;
    }
    .modern-bottom-nav .bottom-nav-item .nav-icon {
        font-size: 18px;
    }
}

/* Desktop — hide on >= 992px so the sidebar takes over. */
@media (min-width: 992px) {
    .modern-bottom-nav { display: none; }
}

/* On mobile, hide the legacy header + left sidebar — the bottom nav and
   in-page HUD strip replace them. Scoped to body.role-web (member pages)
   so admin/agent panels keep their hamburger-toggle sidebar — they have
   no bottom-nav replacement and need the side menu to navigate. */
@media (max-width: 991px) {
    body.role-web .sidebar,
    body.role-web .navbar.navbar-absolute,
    body.role-web .navbar-absolute,
    body.role-web > nav.navbar {
        display: none !important;
    }
    /* Main panel had left margin for the sidebar — release it. */
    body.role-web .main-panel {
        margin-left: 0 !important;
        width: 100% !important;
    }
    /* Top of content was offset by the absolute navbar — drop the offset. */
    body.role-web .main-panel > .content,
    body.role-web #app.content {
        padding-top: 12px !important;
    }
    /* Bottom — leave room for the fixed bottom nav (~80px). */
    body.role-web .main-panel,
    body.role-web .content-wrapper,
    body.role-web #app.content {
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0)) !important;
    }
}
