/**
 * N-Sync - Global Styles
 * Sleek scrollbars + mobile sidebar support
 */

/* ========== Sleek Custom Scrollbars ========== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* ========== Sidebar layout stability ========== */
/* The sidebar-container <div> must stretch to its flex parent's full height
   so the dark <aside> background never stops short of the viewport bottom. */
#sidebar-container {
    display: flex;
    flex-shrink: 0;
    height: 100%;
}

/* Prevent the sidebar from ever shrinking or overflowing its parent */
#sidebar-aside {
    min-width: 16rem;   /* = w-64 */
    max-width: 16rem;
    height: 100vh;
    height: 100dvh;     /* safe for mobile browser chrome */
    transition: transform 0.3s ease;
}

/* ========== Mobile Sidebar ========== */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 767px) {
    #sidebar-aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;          /* dynamic viewport height for mobile browsers */
        transform: translateX(-100%);
        z-index: 50;
    }
    #sidebar-aside.open {
        transform: translateX(0);
    }
}
