/*
 * Shell B — App Shell Layout
 * Used by: Chat, Dashboard, Create post, Auth pages, Token purchase
 * ----------------------------------------------------------------- */

/* Root container */
.shell-app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: hsl(var(--background));
    overflow: hidden;
}

/* ── Page header ── */
.shell-app__header {
    flex-shrink: 0;
    height: var(--vp-page-header-height);
    padding-top: var(--vp-safe-top);
    height: calc(var(--vp-page-header-height) + var(--vp-safe-top));
    background: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    align-items: flex-end;
    padding-bottom: 0;
    z-index: 10;
}

.shell-app__header-inner {
    width: 100%;
    height: var(--vp-page-header-height);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.shell-app__header-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Scrollable page content ── */
.shell-app__content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ── Bottom navigation bar ── */
.shell-app__bottom-nav {
    flex-shrink: 0;
    height: calc(var(--vp-bottom-nav-height) + var(--vp-safe-bottom));
    padding-bottom: var(--vp-safe-bottom);
    background: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    display: flex;
    align-items: stretch;
    z-index: 10;
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-size: 0.625rem;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
    min-height: 44px;
}

.bottom-nav__item:hover,
.bottom-nav__item.is-active {
    color: hsl(var(--foreground));
}

.bottom-nav__item svg {
    width: 22px;
    height: 22px;
}

/* New post button — distinct style */
.bottom-nav__item--new {
    flex: 0 0 auto;
    width: 64px;
}

.bottom-nav__item--new .bottom-nav__icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: hsl(var(--foreground));
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav__item--new svg {
    color: hsl(var(--background));
}

/* Unread badge on chat nav item */
.bottom-nav__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: hsl(var(--destructive));
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bottom-nav__item {
    position: relative;
}

/* ── Desktop: left sidebar swaps bottom nav ── */
@media (min-width: 768px) {
    .shell-app {
        flex-direction: row;
    }

    .shell-app__bottom-nav {
        flex-direction: column;
        width: 64px;
        height: 100dvh;
        border-top: none;
        border-right: 1px solid hsl(var(--border));
        padding-bottom: 0;
        padding-top: var(--vp-safe-top);
    }

    .bottom-nav__item {
        height: 56px;
        width: 64px;
        flex: 0 0 auto;
    }

    .bottom-nav__item span {
        display: none;
    }

    /* hide labels on sidebar */

    .shell-app__bottom-nav-spacer {
        flex: 1;
    }

    /* pushes items to top */

    .shell-app__header {
        display: none;
        /* desktop uses sidebar label */
    }

    .shell-app__content {
        flex: 1;
    }
}