/* ═══ YouTube-style Sidebar ═══════════════════════════════ */

/* Hamburger button in nav */
.xq-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 160ms ease;
    flex-shrink: 0;
    margin-right: 0.5rem;
    color: #c7d0df;
}
.xq-hamburger:hover {
    background: rgba(255,255,255,0.1);
}
.xq-hamburger svg {
    display: block;
}

/* Backdrop */
.xq-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 250ms ease;
}
.xq-sidebar-backdrop.is-active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar panel */
.xq-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #0d111a;
    border-right: 1px solid rgba(255,255,255,0.07);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.xq-sidebar.is-open {
    transform: translateX(0);
}

/* Header row inside sidebar */
.xq-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    height: 58px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.xq-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    color: #c7d0df;
    transition: background 160ms ease;
    flex-shrink: 0;
}
.xq-sidebar-close:hover {
    background: rgba(255,255,255,0.1);
}

.xq-sidebar-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.xq-sidebar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Nav items */
.xq-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.xq-sidebar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: #c7d0df;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
    white-space: nowrap;
}
.xq-sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.xq-sidebar-item.is-active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 600;
}
.xq-sidebar-item svg {
    flex-shrink: 0;
    opacity: 0.75;
}
.xq-sidebar-item:hover svg,
.xq-sidebar-item.is-active svg {
    opacity: 1;
}

.xq-sidebar-item--danger {
    color: #ff5252;
}
.xq-sidebar-item--danger:hover {
    background: rgba(255,82,82,0.12);
    color: #ff6b6b;
}

/* Divider */
.xq-sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0.5rem 0;
}

/* Footer / user card */
.xq-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0.75rem;
    flex-shrink: 0;
}

.xq-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.xq-sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5c842, #e6a817);
    color: #090b10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.xq-sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.xq-sidebar-username {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e8eaf0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xq-sidebar-role {
    font-size: 0.72rem;
    color: #8892a4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Scrollbar styling */
.xq-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.xq-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.xq-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* Mobile */
@media (max-width: 640px) {
    .xq-sidebar {
        width: 85vw;
        max-width: 300px;
    }
}
