/* Smart Muslim — bottom nav final, built entirely from HTML/CSS.
 * The centre rise is decorative; only the five buttons receive touch events.
 */

:root {
    --sm-routine-center-nav-height: 74px;
    --sm-routine-center-nav-lift: 18px;
    --sm-routine-center-nav-gap: 10px;
}

#view-tabs.bottom-nav--routine-center {
    position: fixed !important;
    isolation: isolate;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: min(430px, calc(100% - 28px)) !important;
    max-width: 430px !important;
    height: var(--sm-routine-center-nav-height) !important;
    padding: 0 6px !important;
    overflow: visible !important;
    pointer-events: none;
    border: 2px solid #0F5C46 !important;
    border-radius: 30px !important;
    background: #FBF8F1 !important;
    box-shadow: 0 10px 24px rgba(20, 59, 45, .19), inset 0 1px 0 rgba(255,255,255,.94) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 0;
    height: 100% !important;
    padding: 7px 0 5px !important;
    gap: 0 !important;
    color: #9A9B98 !important;
    background: transparent !important;
    pointer-events: auto;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item--center {
    z-index: 2;
    justify-content: flex-start !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transform: translateY(calc(var(--sm-routine-center-nav-lift) * -1));
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item--center::before {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 50%;
    width: 70px;
    height: 70px;
    content: '';
    pointer-events: none;
    border: 2px solid #0F5C46;
    border-radius: 50%;
    background: #FBF8F1;
    box-shadow: 0 7px 17px rgba(20,59,45,.16), inset 0 1px 0 rgba(255,255,255,.94);
    transform: translateX(-50%);
}

#view-tabs.bottom-nav--routine-center .home-nav-icon {
    display: grid !important;
    place-items: center;
    flex: 0 0 38px;
    width: 38px !important;
    height: 38px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    background: transparent !important;
    transform: none !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item--center .home-nav-icon {
    flex-basis: 40px;
    width: 40px !important;
    height: 40px !important;
    margin-top: 7px;
}

#view-tabs.bottom-nav--routine-center .home-nav-icon img {
    display: block !important;
    width: 34px !important;
    height: 34px !important;
    max-width: none !important;
    object-fit: contain !important;
    opacity: .52 !important;
    filter: grayscale(1) sepia(.08) !important;
    transform: none !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item--center .home-nav-icon img {
    width: 36px !important;
    height: 36px !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item.is-active .home-nav-icon {
    background: color-mix(in srgb, #EAF5EF 82%, #FBF8F1) !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item.is-active .home-nav-icon img {
    opacity: 1 !important;
    filter: none !important;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item > span:last-child {
    display: block;
    max-width: 100%;
    margin-top: 2px;
    overflow: hidden;
    color: inherit !important;
    font-size: .58rem !important;
    font-weight: 700 !important;
    line-height: 1.05;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-tabs.bottom-nav--routine-center .bottom-nav-item--center > span:last-child { margin-top: 1px; }
#view-tabs.bottom-nav--routine-center .bottom-nav-item.is-active > span:last-child { color: #0F5C46 !important; font-weight: 800 !important; }
#view-tabs.bottom-nav--routine-center .bottom-nav-item::after { display: none !important; }

#onboarding-overlay[style*="display: grid"] ~ #view-tabs.bottom-nav--routine-center,
body.onboarding-open #view-tabs.bottom-nav--routine-center {
    display: none !important;
    pointer-events: none !important;
}

body { padding-bottom: calc(var(--sm-routine-center-nav-height) + var(--sm-routine-center-nav-lift) + var(--sm-routine-center-nav-gap) * 2 + env(safe-area-inset-bottom, 0px)) !important; }
body.onboarding-open { padding-bottom: 0 !important; }

@media (max-width: 360px) {
    :root {
        --sm-routine-center-nav-height: 70px;
        --sm-routine-center-nav-lift: 16px;
    }
    #view-tabs.bottom-nav--routine-center { width: calc(100% - 20px) !important; padding-inline: 3px !important; border-radius: 27px !important; }
    #view-tabs.bottom-nav--routine-center .bottom-nav-item { padding-top: 6px !important; padding-bottom: 5px !important; }
    #view-tabs.bottom-nav--routine-center .bottom-nav-item--center::before { width: 66px; height: 66px; }
    #view-tabs.bottom-nav--routine-center .bottom-nav-item--center .home-nav-icon { margin-top: 6px; }
    #view-tabs.bottom-nav--routine-center .bottom-nav-item > span:last-child { font-size: .53rem !important; }
}

body.dark-theme #view-tabs.bottom-nav--routine-center {
    border-color: #5d8b78 !important;
    background: #17231e !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

body.dark-theme #view-tabs.bottom-nav--routine-center .bottom-nav-item--center::before { background: #17231e; border-color: #5d8b78; }
body.dark-theme #view-tabs.bottom-nav--routine-center .bottom-nav-item.is-active .home-nav-icon { background: rgba(157,219,189,.16) !important; }
