/**
 * Mobile bottom tab bar — full-width 5-column grid, labels never clipped
 */

:root {
    --tab-inactive: rgba(255, 255, 255, 0.55);
    --tab-active: #00e5ff;
    --tab-glow: drop-shadow(0 0 4px rgba(0, 229, 255, 0.28));
    --tab-bar-height: 72px;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px)) !important;
    }

    #akiv-toast {
        bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Layout + typography: phones (≤768px). Bar visible until lg (991px) — see duplicate block below. */
@media (max-width: 768px) {
    .ios-tab-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        pointer-events: none;
    }

    .ios-tab-bar__inner {
        pointer-events: auto;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: stretch;
        width: 100%;
        max-width: none;
        margin: 0;
        height: var(--tab-bar-height);
        min-height: var(--tab-bar-height);
        padding: 8px;
        gap: 0;
        border-radius: 0;
        background: rgba(9, 9, 11, 0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    }

    .ios-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        min-width: 0;
        width: 100%;
        text-decoration: none;
        color: var(--tab-inactive);
        border-radius: 14px;
        transition: color 200ms ease, background 200ms ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        overflow: visible;
    }

    .ios-tab-item:active {
        transform: scale(0.96);
    }

    .ios-tab-item.active {
        color: var(--tab-active);
        background: rgba(0, 229, 255, 0.1);
    }

    .ios-tab-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        position: relative;
        overflow: visible;
    }

    .ios-tab-icon .ios-tab-svg,
    .ios-tab-icon svg {
        display: block;
        width: 18px;
        height: 18px;
        color: inherit;
        flex-shrink: 0;
        transition: color 200ms ease, filter 200ms ease, width 200ms ease, height 200ms ease;
    }

    .ios-tab-item.active .ios-tab-icon .ios-tab-svg,
    .ios-tab-item.active .ios-tab-icon svg {
        width: 20px;
        height: 20px;
        color: var(--tab-active);
        filter: var(--tab-glow);
    }

    .ios-tab-label {
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: 0;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
        width: auto;
        color: inherit;
    }

    .ios-tab-item.active .ios-tab-label {
        color: var(--tab-active);
    }

    .ios-tab-item--login:not(.active) {
        color: rgba(245, 208, 97, 0.9);
    }

    .ios-tab-item--login:not(.active) .ios-tab-icon svg {
        color: rgba(245, 208, 97, 0.9);
    }

    .ios-tab-item--login.active {
        color: var(--tab-active);
        background: rgba(0, 229, 255, 0.1);
    }

    .ios-tab-badge {
        position: absolute;
        top: 0;
        right: 0;
        min-width: 14px;
        height: 14px;
        padding: 0 3px;
        border-radius: 999px;
        background: #ff3b30;
        color: #fff;
        font-size: 8px;
        font-weight: 700;
        line-height: 14px;
        text-align: center;
        border: 1.5px solid rgba(9, 9, 11, 0.95);
        transform: translate(25%, -25%);
        pointer-events: none;
    }
}

/* Tablet portrait (769–991): same grid — top navbar hidden, bottom bar only */
@media (min-width: 769px) and (max-width: 991.98px) {
    .ios-tab-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        pointer-events: none;
    }

    .ios-tab-bar__inner {
        pointer-events: auto;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        width: 100%;
        max-width: none;
        margin: 0;
        height: var(--tab-bar-height);
        padding: 8px;
        background: rgba(9, 9, 11, 0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    }

    .ios-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 4px;
        min-width: 0;
        border-radius: 14px;
        text-decoration: none;
        color: var(--tab-inactive);
        overflow: visible;
    }

    .ios-tab-item.active {
        color: var(--tab-active);
        background: rgba(0, 229, 255, 0.1);
    }

    .ios-tab-icon svg {
        display: block;
        width: 18px;
        height: 18px;
        color: inherit;
    }

    .ios-tab-item.active .ios-tab-icon svg {
        width: 20px;
        height: 20px;
        color: var(--tab-active);
        filter: var(--tab-glow);
    }

    .ios-tab-label {
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
    }
}

@media (min-width: 992px) {
    .ios-tab-bar {
        display: none !important;
    }
}
