/* Phone tab bar — PhoneTabBar.razor. Liquid Glass (phone v5).
   Restyle this file only. The component marks the capsule (.phone-tabbar),
   each tab (.phone-tabbar-item), the active one (.active) and the More badge.
   On Home the capsule narrows (.phone-tabbar-with-fab) so the round New button
   can sit to its right. `mobilenav` stays on the element for the boot outline
   and the scroll shrink. */

.phone-tabbar {
    display: none;
    position: fixed;
    z-index: 500;
    left: 16px;
    right: 16px;
    bottom: calc(28px + env(safe-area-inset-bottom));
    margin: 0 auto;
    max-width: none;
    height: 64px;
    padding: 0 4px;
    box-sizing: border-box;
    align-items: center;
    gap: 0;
    border-radius: 32px;
    /* Solid white when backdrop-filter is missing. */
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .65);
    box-shadow:
        0 12px 32px -10px rgba(15, 23, 42, .30),
        0 2px 6px rgba(15, 23, 42, .08),
        inset 0 1px 0 rgba(255, 255, 255, .9),
        inset 0 -1px 1px rgba(255, 255, 255, .35);
    transform-origin: bottom center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .phone-tabbar,
    [data-theme] .mobilenav.phone-tabbar {
        background: rgba(255, 255, 255, .52);
        -webkit-backdrop-filter: blur(22px) saturate(190%);
        backdrop-filter: blur(22px) saturate(190%);
    }
    [data-theme="dark"] .phone-tabbar,
    [data-theme="dark"] .mobilenav.phone-tabbar {
        background: rgba(12, 18, 36, .72);
        border-color: rgba(140, 170, 255, .22);
        color: #EEF2FF;
    }
    [data-theme="dark"] .phone-tabbar-item,
    [data-theme="dark"] .phone-tabbar-item svg { color: #A3AED0; }
    [data-theme="dark"] .phone-tabbar-item.active,
    [data-theme="dark"] .phone-tabbar-item.active svg { color: #7CA6FF; background: rgba(255,255,255,.08); }
}

/* Home only, and only while the bar itself is on screen: leave room for New. */
@media (max-width: 480px) {
    .phone-tabbar.phone-tabbar-with-fab { right: 88px; }
}

.phone-tabbar.mobilenav-min {
    transform: scale(0.94) translateY(6px);
    opacity: 0.9;
}

.phone-tabbar-item {
    position: relative;
    z-index: 0;
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 0 2px;
    border: none;
    border-radius: 28px;
    background: none;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    overflow: visible;
}

.phone-tabbar-item,
.phone-tabbar-item:visited,
.phone-tabbar-item svg {
    color: #5B6474;
}

.phone-tabbar-item svg {
    width: 22px;
    height: 22px;
    flex: none;
}

.phone-tabbar-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-tabbar-item.active,
.phone-tabbar-item.active:visited {
    color: #2A63E2;
    background: rgba(255, 255, 255, .72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 0 0 1px rgba(255, 255, 255, .7),
        0 2px 8px -2px rgba(15, 23, 42, .18);
}
.phone-tabbar-item.active svg { color: #2A63E2; }

.phone-tabbar-badge {
    position: absolute;
    top: 5px;
    left: 50%;
    margin-left: 5px;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    background: #DC2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 1.5px solid rgba(255, 255, 255, .9);
    line-height: 1;
}

@media (max-width: 899px) {
    .phone-tabbar { display: flex; }
}

/* Home's New, parked beside the capsule. The words stay for the name; the
   circle shows the plus. */
@media (max-width: 480px) {
    .dash .home-new {
        position: fixed;
        right: 16px;
        bottom: calc(28px + env(safe-area-inset-bottom));
        z-index: 500;
    }
    .dash .home-new .btn-primary {
        width: 64px;
        height: 64px;
        padding: 0;
        border-radius: 32px;
        justify-content: center;
        color: #fff;
        background: rgba(42, 99, 226, .88);
        background: #2A63E2;
        border: 1px solid rgba(255, 255, 255, .35);
        box-shadow:
            0 12px 28px -8px rgba(42, 99, 226, .55),
            inset 0 1px 0 rgba(255, 255, 255, .45),
            inset 0 -2px 4px rgba(15, 23, 42, .15);
    }
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .dash .home-new .btn-primary {
            background: rgba(42, 99, 226, .88);
            -webkit-backdrop-filter: blur(22px) saturate(190%);
            backdrop-filter: blur(22px) saturate(190%);
        }
    }
    .dash .home-new .home-new-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
    .dash .home-new .topbar-new-menu {
        top: auto;
        bottom: calc(100% + 8px);
        right: 0;
    }

    /* In the page, not over the tabs. A fixed bar covered every project tab. */
    .phone-logvisit {
        display: flex;
        position: static;
        width: 100%;
        height: 48px;
        margin: 0 0 12px;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        font-size: 17px;
        font-weight: 600;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phone-tabbar { transition: none; }
}

/* Dark navy glass. Outside @supports so a browser without backdrop-filter
   still gets the navy slab, and after the white glass so it wins. */
html[data-theme="dark"] .phone-tabbar,
html[data-theme="dark"] .mobilenav.phone-tabbar {
    background: rgba(8, 12, 28, .88);
    border-color: rgba(140, 170, 255, .28);
    color: #EEF2FF;
    box-shadow:
        0 12px 32px -10px rgba(0, 0, 0, .55),
        inset 0 1px 0 rgba(140, 170, 255, .22);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
}
html[data-theme="dark"] .phone-tabbar-item,
html[data-theme="dark"] .phone-tabbar-item:visited,
html[data-theme="dark"] .phone-tabbar-item svg { color: #A3AED0; }
html[data-theme="dark"] .phone-tabbar-item.active,
html[data-theme="dark"] .phone-tabbar-item.active:visited,
html[data-theme="dark"] .phone-tabbar-item.active svg {
    color: #7CA6FF;
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 0 0 0 1px rgba(140, 170, 255, .28);
}
