/* ==========================================================================
   QuickPlayHub - Sidebar Navigation Styles (k4.games authentic rail)
   ========================================================================== */

#site-sidebar.site-sidebar {
    position: fixed;
    top: var(--header-height, 62px);
    bottom: 0;
    left: 0;
    z-index: 46;

    width: 64px;
    max-width: calc(100vw - 48px);

    display: flex;
    flex-direction: column;

    background: #141328;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;

    transform: none;
    visibility: visible;
    pointer-events: auto;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;

    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

#site-sidebar::-webkit-scrollbar {
    display: none;
}

/* Expanded sidebar overlays page smoothly */
#site-sidebar.site-sidebar.sidebar-is-open {
    width: 240px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

#site-sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 8px 24px;
}

#site-sidebar .sidebar-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;

    min-height: 46px;
    padding: 6px 10px;
    gap: 14px;

    color: #ffffff;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    text-decoration: none;

    transition: all 0.15s ease;
}

#site-sidebar .sidebar-nav-item::after,
#site-sidebar .sidebar-nav-item::before {
    display: none !important;
    content: none !important;
}

#site-sidebar .sidebar-nav-item:hover {
    color: #ffffff;
    background: linear-gradient(to top right, #5f3dc4, #40397e, #2c2c4a);
}

#site-sidebar .sidebar-nav-item:focus-visible {
    outline: 2px solid #a796ff;
    outline-offset: -2px;
}

#site-sidebar .sidebar-nav-item.active {
    color: #ffffff;
    background: linear-gradient(to top right, #5f3dc4, #40397e, #2c2c4a);
    font-weight: 600;
}

#site-sidebar .sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    min-width: 32px;
    flex: 0 0 32px;

    background: transparent;
}

#site-sidebar .sidebar-icon img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Labels: hidden when collapsed, visible when expanded */
#site-sidebar .sidebar-label {
    opacity: 0;
    transform: translateX(-6px);
    white-space: nowrap;

    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;

    transition: opacity 0.18s ease, transform 0.18s ease;
}

#site-sidebar.sidebar-is-open .sidebar-label {
    opacity: 1;
    transform: translateX(0);
}

#site-sidebar .sidebar-divider {
    height: 1px;
    margin: 8px 6px 8px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

#site-sidebar .sidebar-all-categories .sidebar-label {
    font-weight: 700;
}

/* Backdrop */
#sidebar-overlay {
    position: fixed;
    top: var(--header-height, 62px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Reserve rail space */
.main-wrapper {
    margin-left: 64px;
}

@media (max-width: 768px) {
    #site-sidebar.site-sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    #site-sidebar.site-sidebar.sidebar-is-open {
        transform: translateX(0);
    }
    #site-sidebar .sidebar-label {
        opacity: 1;
        transform: none;
    }
    .main-wrapper {
        margin-left: 0;
    }
}
