/* ============================================================
   BODHDISHA BOTTOM TAB BAR
   Mobile-only app navigation. Hidden on tablet + desktop.
   Requires: bd-core.css v2 (tokens)
   ============================================================ */

.bd-tabbar {
    display: none; /* desktop default */
}

/* ---------------------------------------------------------
   MOBILE (<= 767px) — show the tab bar
   --------------------------------------------------------- */
@media (max-width: 767px) {

    .bd-tabbar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: stretch;

        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-tabbar);

        background: rgba(255, 255, 255, .98);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        border-top: 1px solid var(--bd-line);
        box-shadow: 0 -2px 14px rgba(15, 23, 42, .06);

        padding: 4px 0 calc(4px + var(--bd-safe-bottom));
        -webkit-tap-highlight-color: transparent;
    }

    /* Push content above tabbar */
    body {
        padding-bottom: calc(var(--bd-tabbar-h) + var(--bd-safe-bottom) + 4px);
    }

    /* Sticky mobile CTA sits above the tabbar */
    .bd-mobile-cta {
        bottom: calc(var(--bd-tabbar-h) + var(--bd-safe-bottom));
    }

    /* Back-to-top + floating chat clear the tabbar */
    .bd-to-top,
    .bd-back-to-top {
        bottom: calc(var(--bd-tabbar-h) + var(--bd-safe-bottom) + 16px);
    }

    .bd-floating-chat {
        bottom: calc(var(--bd-tabbar-h) + var(--bd-safe-bottom) + 72px);
    }
}

/* ---------------------------------------------------------
   TAB ITEM
   --------------------------------------------------------- */
.bd-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;

    min-height: 52px;
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: var(--bd-muted);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .01em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
    transition: color var(--bd-dur-fast) var(--bd-ease),
                transform var(--bd-dur-fast) var(--bd-ease);
    position: relative;
}

.bd-tabbar__item:active {
    transform: scale(.94);
}

.bd-tabbar__item i {
    font-size: 18px;
    line-height: 1;
    transition: transform var(--bd-dur) var(--bd-ease);
}

.bd-tabbar__item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Active state */
.bd-tabbar__item.is-active {
    color: var(--bd-primary);
}

.bd-tabbar__item.is-active i {
    transform: translateY(-1px) scale(1.05);
}

/* Indicator bar above the active icon */
.bd-tabbar__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--bd-primary);
}

/* ---------------------------------------------------------
   NOTIFICATION DOT (optional, for future use)
   --------------------------------------------------------- */
.bd-tabbar__item .bd-tabbar__dot {
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bd-danger);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .25);
    animation: bd-tabbar-pulse 2s ease-in-out infinite;
}

@keyframes bd-tabbar-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(220, 38, 38, .25); }
    50%      { box-shadow: 0 0 0 5px rgba(220, 38, 38, .04); }
}

/* ---------------------------------------------------------
   LANDSCAPE PHONE — tighter
   --------------------------------------------------------- */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 480px) {
    .bd-tabbar__item {
        min-height: 44px;
        font-size: 10px;
    }
    .bd-tabbar__item i { font-size: 16px; }
}

/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .bd-tabbar__item,
    .bd-tabbar__item i {
        transition-duration: .01ms !important;
    }
    .bd-tabbar__item .bd-tabbar__dot {
        animation: none;
    }
}