/**
 * English Mastery Hub - Hub Two-Column Layout & 33% Sidebar TOC Styles
 * Applied across Reading, Listening, Speaking, and Writing Hubs.
 */

/* ==========================================================================
   1. TWO-COLUMN CONTAINER (1/3 TO 2/3 GRID)
   ========================================================================== */
.hub-two-column-layout {
    display: flex;
    gap: 2rem;
    max-width: 1540px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
    padding-top: 1.5rem;
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: calc(100vh - 5rem);
}

@media (min-width: 640px) {
    .hub-two-column-layout {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-bottom: 4rem;
        padding-top: 2rem;
    }
}

@media (min-width: 1280px) {
    .hub-two-column-layout {
        gap: 2.5rem;
        padding-left: 2rem;
        padding-right: 2rem;
        padding-bottom: 5rem;
        padding-top: 2rem;
    }
}

/* Guard: Fixed Navigation Clearance.
   When the hub layout is paired with a fixed top navigation bar (declaring pt-20 / sm:pt-24),
   enforce generous vertical clearance so header cards, rounded borders, and badges are never clipped */
.hub-two-column-layout.pt-20,
.hub-two-column-layout[class*="pt-20"] {
    padding-top: 5.25rem !important;
}

@media (min-width: 640px) {
    .hub-two-column-layout.sm\:pt-24,
    .hub-two-column-layout[class*="sm:pt-24"] {
        padding-top: 6.25rem !important;
    }
}

/* ==========================================================================
   2. LEFT SIDEBAR / TOC (33.3% OF DESKTOP VIEWPORT)
   ========================================================================== */
.hub-sidebar-column {
    width: 33.333%;
    min-width: 320px;
    max-width: 440px;
    flex-shrink: 0;
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-right: 0.5rem;
    z-index: 30;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                min-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease, 
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                margin 0.3s ease, 
                padding 0.3s ease;
}

/* Custom Sleek Scrollbar for Sidebar */
.hub-sidebar-column::-webkit-scrollbar {
    width: 5px;
}
.hub-sidebar-column::-webkit-scrollbar-track {
    background: transparent;
}
.hub-sidebar-column::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9999px;
}
.hub-sidebar-column::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* ==========================================================================
   3. MAIN CONTENT CANVAS (~66.7% OF DESKTOP VIEWPORT)
   ========================================================================== */
.hub-main-column {
    flex: 1;
    min-width: 0; /* Prevents flex children from blowing out width */
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop Collapsed State (>= 1024px) */
@media (min-width: 1024px) {
    .hub-two-column-layout.sidebar-collapsed {
        gap: 0;
    }

    .hub-two-column-layout.sidebar-collapsed .hub-sidebar-column {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        border: none !important;
        transform: translateX(-30px);
    }

    .hub-two-column-layout.sidebar-collapsed .hub-main-column {
        width: 100% !important;
        max-width: 100% !important;
    }

    .hub-two-column-layout.sidebar-collapsed .hub-floating-expand-btn {
        display: none !important;
    }
}

/* Floating Expand Pill Purged - Unified directly into Top Nav Burger Button (#navBurgerBtn) */
.hub-floating-expand-btn,
#hubFloatingExpandBtn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Light Theme Navigation Drawer Trigger Button Shield */
html[data-theme="light"] #hubDrawerBtn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] #hubDrawerBtn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Nav Stats Pills (e.g. 179 Tests badge) */
html[data-theme="light"] nav [class*="bg-slate-800"] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

/* Close/Collapse Button Responsive Icons */
@media (max-width: 1023px) {
    .hub-sidebar-close-desktop-icon {
        display: none !important;
    }
    .hub-sidebar-close-mobile-icon {
        display: inline-block !important;
    }
}

@media (min-width: 1024px) {
    .hub-sidebar-close-mobile-icon {
        display: none !important;
    }
    .hub-sidebar-close-desktop-icon {
        display: inline-block !important;
    }
}

/* ==========================================================================
   4. SIDEBAR SECTIONS & NAV ITEMS
   ========================================================================== */
.hub-sidebar-card {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="light"] .hub-sidebar-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .hub-sidebar-card [class*="bg-slate-800"] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .hub-sidebar-card [class*="bg-slate-900"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .hub-sidebar-card [class*="border-slate-800"],
html[data-theme="light"] .hub-sidebar-card [class*="border-slate-700"] {
    border-color: #e2e8f0 !important;
}

.hub-sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

html[data-theme="light"] .hub-sidebar-section-title {
    color: #475569 !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .hub-sidebar-card a[href*="dashboard"] {
    color: #334155 !important;
}
html[data-theme="light"] .hub-sidebar-card a[href*="dashboard"]:hover {
    color: #4f46e5 !important;
}

html[data-theme="light"] #hubSidebarCloseBtn {
    color: #475569 !important;
}
html[data-theme="light"] #hubSidebarCloseBtn:hover {
    color: #0f172a !important;
    background: rgba(15, 23, 42, 0.06) !important;
}

.hub-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    width: 100%;
    text-align: left;
}

html[data-theme="light"] .hub-sidebar-item {
    color: #1e293b !important;
}

html[data-theme="light"] .hub-sidebar-item .text-white,
html[data-theme="light"] .hub-sidebar-item .text-slate-100,
html[data-theme="light"] .hub-sidebar-item .text-slate-900 {
    color: #0f172a !important;
}

html[data-theme="light"] .hub-sidebar-item .text-slate-400,
html[data-theme="light"] .hub-sidebar-item .text-slate-500 {
    color: #475569 !important;
}

html[data-theme="light"] .hub-sidebar-item:hover .text-white,
html[data-theme="light"] .hub-sidebar-item:hover .text-slate-100,
html[data-theme="light"] .hub-sidebar-item:hover .text-slate-900 {
    color: #0284c7 !important;
}

.hub-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

html[data-theme="light"] .hub-sidebar-item:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.08);
}

.hub-sidebar-item.active {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
    font-weight: 600;
}

html[data-theme="light"] .hub-sidebar-item.active {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.25);
}

.hub-sidebar-item .item-badge {
    font-family: 'Geist Mono', monospace;
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-weight: 600;
}

html[data-theme="light"] .hub-sidebar-item .item-badge {
    background: rgba(15, 23, 42, 0.06) !important;
    color: #334155 !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    font-weight: 700 !important;
}

/* Quick launch featured cards */
.hub-launch-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    border-radius: 0.875rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.hub-launch-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   5. MOBILE & TABLET OFF-CANVAS DRAWER & LAYOUT (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
    /* Prevent horizontal viewport blowout across mobile devices */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    body.hub-sidebar-open {
        overflow: hidden !important;
    }

    /* Convert container from flex row to standard full-width block.
       CRITICAL: position: static and z-index: auto prevents creating a parent
       stacking context that would trap the fixed sidebar drawer behind the backdrop! */
    .hub-two-column-layout {
        display: block !important;
        position: static !important;
        z-index: auto !important;
        transform: none !important;
        filter: none !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-sizing: border-box !important;
    }

    /* Ensure main content takes clean 100% width with no left gap or offset */
    .hub-main-column {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* Fixed Off-Canvas Sliding Drawer - Top Layer (z-index: 1000) */
    .hub-sidebar-column {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: min(340px, 86vw) !important;
        min-width: 0 !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        z-index: 1000 !important;
        background: #0b0f19 !important;
        padding: 1.5rem 1.25rem 2.5rem 1.25rem !important;
        box-shadow: 24px 0 60px rgba(0, 0, 0, 0.75) !important;
        transform: translateX(-105%) !important;
        visibility: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
    }

    html[data-theme="light"] .hub-sidebar-column {
        background: #ffffff !important;
        box-shadow: 24px 0 60px rgba(15, 23, 42, 0.25) !important;
    }

    .hub-sidebar-open .hub-sidebar-column {
        transform: translateX(0) !important;
        visibility: visible !important;
    }

    /* Mobile Backdrop Overlay - Middle Layer (z-index: 990, behind drawer at 1000, in front of main content) */
    .hub-sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.65) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 990 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease, visibility 0.25s !important;
    }

    .hub-sidebar-open .hub-sidebar-backdrop {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Mobile Trigger Button */
.hub-mobile-drawer-btn {
    display: none;
}

@media (max-width: 1023px) {
    .hub-mobile-drawer-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(30, 41, 59, 0.8);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #f8fafc;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.45rem 0.85rem;
        border-radius: 9999px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    html[data-theme="light"] .hub-mobile-drawer-btn {
        background: rgba(241, 245, 249, 0.9);
        border: 1px solid rgba(15, 23, 42, 0.1);
        color: #0f172a;
    }

    .hub-mobile-drawer-btn:active {
        transform: scale(0.96);
    }
}

/* ==========================================================================
   6. HORIZONTAL FILTER BARS & TABS MOMENTUM & VISUAL HINTS (MOB-07)
   ========================================================================== */
.hub-filter-scroll,
.hub-pills-row,
.hub-tabs-row {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
}

@media (max-width: 768px) {
    .hub-filter-scroll,
    .hub-pills-row,
    .hub-tabs-row {
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }
}

/* ==========================================================================
   7. GLOBAL SLIDE-OUT NAVIGATION DRAWER & BURGER BUTTON
   ========================================================================== */
.nav-burger-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 9999px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto !important;
    position: relative;
    z-index: 60;
}

html[data-theme="light"] .nav-burger-btn {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.nav-burger-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: scale(1.05);
}

.nav-burger-btn:active {
    transform: scale(0.95);
}

.nav-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.nav-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(350px, 88vw);
    background: #0b1120;
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45);
    z-index: 99995;
    transform: translateX(-105%);
    visibility: hidden;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
    font-family: inherit;
}

html[data-theme="light"] .nav-drawer {
    background: #ffffff;
    color: #0f172a;
    border-right-color: rgba(0, 0, 0, 0.1);
}

.nav-drawer.active {
    transform: translateX(0);
    visibility: visible;
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.6);
}

html[data-theme="light"] .nav-drawer-header {
    background: #f8fafc;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.nav-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

html[data-theme="light"] .nav-drawer-close {
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

.nav-drawer-close:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

html[data-theme="light"] .nav-drawer-close:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

.nav-drawer-body {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}

.drawer-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0 10px 4px 10px;
}

html[data-theme="light"] .drawer-group-title {
    color: #64748b;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none !important;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.drawer-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

html[data-theme="light"] .drawer-item:hover {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.06);
}

.drawer-item-highlight {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
}

.drawer-item-highlight:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
}

.drawer-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #38bdf8;
    transition: transform 0.2s ease;
}

html[data-theme="light"] .drawer-item-icon {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
}

.drawer-item:hover .drawer-item-icon {
    transform: scale(1.06);
}

.drawer-item-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-item-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: #f8fafc;
}

html[data-theme="light"] .drawer-item-name {
    color: #0f172a;
}

.drawer-item-desc {
    font-size: 11.5px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-theme="light"] .drawer-item-desc {
    color: #64748b;
}

.nav-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.4);
}

html[data-theme="light"] .nav-drawer-footer {
    background: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.08);
}

.drawer-footer-text {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

html[data-theme="light"] .drawer-footer-text {
    color: #64748b;
}

/* ==========================================================================
   DESKTOP ICON SIDEBAR NAVIGATION RAIL (SHADCN & COMPONENT GALLERY STANDARD)
   ========================================================================== */
.desktop-sidebar-rail {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 68px;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 950;
    padding: 12px 0;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    user-select: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.desktop-sidebar-rail::-webkit-scrollbar {
    display: none;
}
html[data-theme="light"] .desktop-sidebar-rail,
:root[data-theme="light"] .desktop-sidebar-rail {
    background: rgba(255, 255, 255, 0.96);
    border-color: #E2E8F0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}
.sidebar-rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.sidebar-rail-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding-top: 8px;
}
.sidebar-rail-divider {
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
    flex-shrink: 0;
}
html[data-theme="light"] .sidebar-rail-divider,
:root[data-theme="light"] .sidebar-rail-divider {
    background: #E2E8F0;
}
.sidebar-rail-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    flex-shrink: 0;
}
.sidebar-rail-logo:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}
.sidebar-rail-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    padding: 0;
}
.sidebar-rail-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.06);
}
html[data-theme="light"] .sidebar-rail-btn:hover,
:root[data-theme="light"] .sidebar-rail-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.sidebar-rail-btn.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
}
html[data-theme="light"] .sidebar-rail-btn.active,
:root[data-theme="light"] .sidebar-rail-btn.active {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.25);
}
.emh-sidebar-floating-tooltip {
    position: fixed;
    pointer-events: none;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 9px;
    padding: 7px 12px;
    z-index: 999999;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-4px);
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}
html[data-theme="light"] .emh-sidebar-floating-tooltip,
:root[data-theme="light"] .emh-sidebar-floating-tooltip {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
}
.emh-sidebar-floating-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
.emh-sidebar-floating-tooltip .emh-tooltip-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.emh-sidebar-floating-tooltip .emh-tooltip-sub {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.3;
}
html[data-theme="light"] .emh-sidebar-floating-tooltip .emh-tooltip-sub,
:root[data-theme="light"] .emh-sidebar-floating-tooltip .emh-tooltip-sub {
    color: #64748b;
}
.emh-sidebar-floating-tooltip .emh-tooltip-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

/* ==========================================================================
   DESKTOP VS MOBILE RESPONSIVE SEGREGATION
   ========================================================================== */
.hub-sticky-filter-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: top 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 1025px) {
    .desktop-sidebar-rail {
        display: flex !important;
    }
    body {
        padding-left: 68px !important;
    }
    nav.fixed, .glass-nav, header.sticky, .navbar, nav.sticky {
        display: none !important;
    }
    .hub-two-column-layout.pt-20,
    .hub-two-column-layout[class*="pt-20"],
    .hub-two-column-layout.sm\:pt-24,
    .hub-two-column-layout[class*="sm:pt-24"] {
        padding-top: 1.5rem !important;
    }
    .hub-sticky-filter-bar {
        top: 0 !important;
    }
    #navBurgerBtn, .nav-burger-btn {
        display: none !important;
    }
    .hub-two-column-layout .hub-sidebar-column {
        display: none !important;
    }
    .hub-two-column-layout .hub-main-column {
        width: 100% !important;
        max-width: 100% !important;
    }
}
@media (max-width: 1024px) {
    .desktop-sidebar-rail {
        display: none !important;
    }
    body {
        padding-left: 0 !important;
    }
    nav.fixed, .glass-nav, header.sticky, .navbar, nav.sticky {
        display: block !important;
        left: 0 !important;
        width: 100% !important;
    }
    .hub-sticky-filter-bar {
        top: 5rem !important;
    }
    #navBurgerBtn, .nav-burger-btn {
        display: inline-flex !important;
    }
    .hub-two-column-layout .hub-sidebar-column {
        display: flex !important;
    }
}


