/* ---------------------------------------------------
   GLOBAL RESET & LAYOUT
--------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Kanit', sans-serif;
    overflow: hidden;
}

/* fixed top-bar offset */
body {
    padding-top: 56px;
}

/* ---------------------------------------------------
   TOP-BAR
--------------------------------------------------- */
#topBar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 1040;
    /* background-color: #28a745 !important; */
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

/* ---------------------------------------------------
   WRAPPER & CONTENT
--------------------------------------------------- */
#main-wrapper {
    display: flex;
    height: calc(100vh - 56px);
    transition: all .3s ease;
}

#main-content {
    flex: 1 1 auto;
    overflow-y: auto;
    transition: all .3s ease;
}

/* ---------------------------------------------------
   SIDEBAR
--------------------------------------------------- */

/* The off-canvas sidebar from Bootstrap */
#sidebarOffcanvas {
    position: fixed !important;
    top: 56px; /* Adjusted to start below the topbar */
    left: 0;
    z-index: 1020; /* Lower z-index than topbar */
    height: calc(100vh - 56px); /* Adjusted to fill the remaining vertical space */
    width: 200px;
    transform: translateX(-200px);
    /* Initially hidden */
    transition: transform .3s ease;
    visibility: visible !important;
}

/* Show sidebar */
#main-wrapper:not(.sidebar-hidden) #sidebarOffcanvas {
    transform: translateX(0) !important;
}

/* Hide sidebar */
#main-wrapper.sidebar-hidden #sidebarOffcanvas {
    transform: translateX(-200px) !important;
}

/* On desktop, main content is pushed to the right */
@media (min-width: 992px) {
    #main-content {
        margin-left: 0;
        width: 100%;
    }

    #main-wrapper:not(.sidebar-hidden) #main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }

    #main-wrapper.sidebar-hidden #main-content {
        margin-left: 0;
        width: 100%;
    }
}
