/*
 * mobile-nav.css — native-app style bottom navigation ("footer sidebar") for phones/tablets.
 *
 * On screens below the theme's xl breakpoint (1200px) the full sidebar is hidden behind a
 * toggle, so primary navigation lives in a fixed bottom bar of icon "thumbnails" — the same
 * pattern native mobile apps use. The last slot ("Menu") opens the full sidebar for everything
 * else. Hidden on desktop, where the normal sidebar is always visible.
 */

.nk-mobile-nav { display: none; }

@media (max-width: 1199.98px) {
    .nk-mobile-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        margin: 0;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        list-style: none;
        background: linear-gradient(185deg, #16315f 0%, #102a4e 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.28);
    }

    .nk-mobile-nav > li {
        flex: 1 1 0;
        min-width: 0;
    }

    .nk-mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0) * 0);
        min-height: 56px;
        color: #b7c2d0;
        font-size: 10px;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
        transition: color .15s ease, background .15s ease;
    }

    .nk-mobile-nav-link .icon {
        font-size: 20px;
        line-height: 1;
    }

    .nk-mobile-nav-link > span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nk-mobile-nav-link:hover,
    .nk-mobile-nav-link:focus {
        color: #e6ebf2;
    }

    .nk-mobile-nav-link.active {
        color: #fff;
    }

    .nk-mobile-nav-link.active .icon {
        color: #fff;
    }

    /* Active pill accent above the icon, native-tab-bar style. */
    .nk-mobile-nav-link.active::before {
        content: "";
        position: absolute;
        top: 0;
        width: 30px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: linear-gradient(90deg, var(--brand-1, #3f74d6), var(--brand-cyan, #4ea1ff));
    }

    .nk-mobile-nav > li { position: relative; }

    /* Account menu opens upward above the bar (native action-sheet feel). */
    .nk-mobile-nav .mnav-account-menu {
        top: auto;
        bottom: calc(100% + 10px);
        right: 6px;
        left: auto;
        min-width: 210px;
        padding-left: 20px;
        z-index: 1050;
        box-shadow: 0 8px 28px rgba(16, 42, 78, 0.28);
    }
    .nk-mobile-nav .mnav-account-menu .btn-link { text-decoration: none; }
    .nk-mobile-nav .mnav-account-menu .icon { font-size: 18px; }

    /* Keep page content & footer clear of the fixed bar. Must include the safe-area inset,
       otherwise on phones with a home indicator the bar (~56px + inset) is taller than the
       clearance and overlaps the last content — e.g. list pagination becomes unclickable. */
    .nk-content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)); }
    .nk-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }

    /* Extra breathing room under list controls so paging buttons sit clear of the bar. */
    .dataTables_wrapper .dataTables_paginate,
    .dataTables_wrapper .dataTables_info { margin-bottom: 1rem; }
}
