/*
 * Mobile bottom bar, redesign 11.2026 (partials/mobile-bar.php).
 * Overrides the legacy .dashboard-bottom-strip box from sass/_dashboard-content.scss,
 * which still decides visibility (display:block only at max-width 1024px).
 */

.dashboard-bottom-strip.mbar {
    --mbar-h: 64px;
    --mbar-gap: 10px;
    --mbar-bg: #1f1c22;
    --mbar-ink: #aaa5b0;
    --mbar-active: #ff5cb6;
    --mbar-hub-off: #3a3540;
    --mbar-pink: #ec008c;

    left: var(--mbar-gap);
    right: var(--mbar-gap);
    bottom: calc(var(--mbar-gap) + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: var(--mbar-h);
    background: var(--mbar-bg);
    border: 0;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(20, 8, 20, 0.28);
    direction: rtl;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.dashboard-bottom-strip.mbar.super-hide {
    transform: translateY(calc(100% + 40px)) !important;
    -webkit-transform: translateY(calc(100% + 40px)) !important;
}

.mbar-inner {
    display: flex;
    align-items: stretch;
    height: 100%;
    padding: 0 4px;
}

.mbar-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--mbar-ink);
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.15s ease, transform 0.12s ease;
}

.mbar-item:hover,
.mbar-item:focus {
    color: var(--mbar-ink);
    text-decoration: none;
}

.mbar-item:active {
    transform: scale(0.94);
}

.mbar-item:focus-visible {
    outline: 2px solid var(--mbar-active);
    outline-offset: -4px;
    border-radius: 14px;
}

.mbar-item svg {
    width: 24px;
    height: 24px;
    display: block;
    flex: none;
}

.mbar-label {
    font-size: 15px;
    white-space: nowrap;
}

.mbar-item.is-active,
.mbar-item.is-active:hover,
.mbar-item.is-active:focus {
    color: var(--mbar-active);
}

.mbar-item.is-active .mbar-label {
    font-weight: 700;
}

/* center: the trainee's current plan */

.mbar-hub {
    flex-grow: 1.3;
    gap: 3px;
}

.mbar-hub,
.mbar-hub:hover,
.mbar-hub:focus,
.mbar-hub.is-active,
.mbar-hub.is-active:hover,
.mbar-hub.is-active:focus {
    color: #fff;
}

.mbar-hub-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--mbar-hub-off);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.mbar-hub-circle img {
    width: 24px;
    height: auto;
    display: block;
}

.mbar-hub.is-active .mbar-hub-circle {
    background: var(--mbar-pink);
}

.mbar-hub .mbar-label {
    font-size: 14px;
}

/* plans screen open (js/dashboard.js adds .select-plan-state): "בית" is the active tab */

.mbar.select-plan-state .mbar-item.is-active {
    color: var(--mbar-ink);
}

.mbar.select-plan-state .mbar-item.is-active .mbar-label {
    font-weight: inherit;
}

.mbar.select-plan-state .mbar-hub.is-active {
    color: #fff;
}

.mbar.select-plan-state .mbar-hub.is-active .mbar-hub-circle {
    background: var(--mbar-hub-off);
}

.mbar.select-plan-state .mbar-home {
    color: var(--mbar-active);
}

.mbar.select-plan-state .mbar-home .mbar-label {
    font-weight: 700;
}

/* fixed elements that sat right above the old 50px bar */

@media screen and (max-width: 1024px) {
    body:has(.mbar) .pwa-notification,
    body:has(.mbar) .ebook-circle {
        bottom: calc(var(--mbar-footprint, 84px) + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-bottom-strip.mbar,
    .mbar-item,
    .mbar-hub-circle {
        transition: none;
    }
}
