/* ============================================================
   Mobile top-bar integration — phone only (<= 767px)
   ============================================================ */
.top-bar-tabs { display: none; }

@media (max-width: 767.98px) {
    /* ---- shared top bar layout ---- */
    .vortex-nav .container { flex-wrap: nowrap !important; }
    .nav-title { display: none; }

    .top-bar-tabs {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
        margin: 0 8px;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .top-bar-tabs::-webkit-scrollbar { display: none; }

    /* ---- professional pill/button style ---- */
    .top-bar-tab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 38px;
        padding: 0 14px;
        border-radius: 10px;
        border: 1px solid #21262d;
        background: #161b22;
        color: #8b949e;
        font-size: 0.8rem;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: all .15s ease;
        flex-shrink: 0;
    }
    .top-bar-tab.active {
        background: linear-gradient(135deg, #1f6feb 0%, #388bfd 100%);
        border-color: #388bfd;
        color: #fff;
        box-shadow: 0 2px 14px rgba(56, 139, 253, 0.35);
    }
    .top-bar-tab:active { transform: scale(0.97); }
    .top-bar-tab svg { display: block; }
}

/* ============================================================
   HOME
   ============================================================ */
@media (max-width: 767.98px) {
    body[data-page="home"] #homeTabButtons { display: none !important; }
    body[data-page="home"] .tabs-container { margin-top: 2px; }
    body[data-page="home"] .media-row { grid-auto-columns: 46%; }
    body[data-page="home"] .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ============================================================
   SEARCH
   ============================================================ */
@media (max-width: 767.98px) {
    body[data-page="search"] .filter-strip { display: none !important; }
    body[data-page="search"] .home-shell { padding-top: 8px; }
}

/* ============================================================
   ADMIN
   ============================================================ */
@media (max-width: 767.98px) {
    body[data-page="admin"] .admin-header { display: none !important; }
    body[data-page="admin"] #runBtn span[data-i18n="syncLibrary"] { display: none; }
}

/* ============================================================
   PROWLARR page
   ============================================================ */
@media (max-width: 767.98px) {
    body[data-page="prowlarr"] .tabs-container { display: none !important; }
}

/* ============================================================
   V-MATCH fullscreen immersive (when swipe mode is open)
   ============================================================ */
@media (max-width: 767.98px) {
    body.vmatch-native-active .vortex-nav,
    body.vmatch-native-active .mobile-bottom-nav { display: none !important; }

    body.vmatch-native-active { overflow: hidden; height: 100dvh; }

    #vmatchSwipeApp {
        position: fixed;
        inset: 0;
        height: 100dvh;
        z-index: 60;
        background: #0d1117;
        display: flex;
        flex-direction: column;
    }
    #vmatchSwipeApp .vmatch-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        padding: 0;
        display: flex;
        flex-direction: column;
    }

    /* native vm-nav is the ONLY top bar in immersive mode */
    #vmatchSwipeApp .vm-nav {
        padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
        background: #0d1117;
        position: relative;
        z-index: 5;
        flex-shrink: 0;
    }
    #vmatchSwipeApp .vm-tab { padding: 8px 18px; font-size: 0.95rem; }
    #vmatchSwipeApp .vm-btn-icon { width: 40px; height: 40px; }

    #vmatchSwipeApp .vm-cards-area {
        margin: 6px 14px !important;
        flex: 1 1 auto;
        min-height: 0;
        border-radius: 18px;
    }
    #vmatchSwipeApp .vm-card { border-radius: 18px; }

    /* rating panel back to full size, sits above bottom safe area */
    #vmatchSwipeApp .vm-rating-panel {
        padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
        margin: 0;
        flex-shrink: 0;
    }
    #vmatchSwipeApp .vm-score-circle { width: 80px; height: 80px; }
    #vmatchSwipeApp .vm-score-text { font-size: 2rem; font-weight: 900; }
    #vmatchSwipeApp .vm-btn-skip,
    #vmatchSwipeApp .vm-btn-watchlist { padding: 16px 0; font-size: 1.05rem; }
}
