/*
|--------------------------------------------------------------------------
| EasyResult Online Exam
| Admin Layout / Sidebar
|--------------------------------------------------------------------------
*/

:root {
    --sidebar-width: 270px;
    --navbar-height: 56px;

    --sidebar-bg: #16213e;
    --sidebar-hover: #243b55;
    --sidebar-active: #0d6efd;
    --sidebar-text: #ced4da;
    --sidebar-muted: #adb5bd;
    --sidebar-border: rgba(255, 255, 255, 0.06);
}

/*
|--------------------------------------------------------------------------
| Navbar
|--------------------------------------------------------------------------
| Keep navbar above the fixed sidebar.
|--------------------------------------------------------------------------
*/

.navbar {
    position: relative;
    z-index: 1050;
    min-height: var(--navbar-height);
}

/*
|--------------------------------------------------------------------------
| Sidebar
|--------------------------------------------------------------------------
*/

.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;

    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));

    margin: 0;
    padding: 0;

    overflow-x: hidden;
    overflow-y: auto;

    background: var(--sidebar-bg);
    color: #fff;

    box-sizing: border-box;
    z-index: 1040;

    scrollbar-width: thin;
    scrollbar-color: #495057 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 10px;
}

/*
|--------------------------------------------------------------------------
| Menu Title
|--------------------------------------------------------------------------
*/

.sidebar .menu-title {
    display: block;

    padding: 16px 20px 8px;

    color: var(--sidebar-muted);

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: 1px;
    text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| Navigation Links
|--------------------------------------------------------------------------
*/

.sidebar .nav-link {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 46px;

    margin: 0;
    padding: 11px 20px;

    box-sizing: border-box;

    color: var(--sidebar-text);
    background: transparent;

    border-left: 4px solid transparent;

    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}

.sidebar .nav-link i {
    width: 20px;
    min-width: 20px;
    margin-right: 10px !important;

    text-align: center;
    font-size: 15px;
}

.sidebar .nav-link span {
    min-width: 0;
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    border-left-color: #ffc107;
}

.sidebar .nav-link.active:hover {
    background: var(--sidebar-active);
}

/*
|--------------------------------------------------------------------------
| Main Content
|--------------------------------------------------------------------------
| IMPORTANT:
| .main-content belongs to the page, NOT sidebar.php.
|--------------------------------------------------------------------------
*/

.main-content {
    width: auto;
    min-width: 0;
    min-height: calc(100vh - var(--navbar-height));

    margin-left: var(--sidebar-width);
    padding: 25px;

    box-sizing: border-box;
}

/*
|--------------------------------------------------------------------------
| Container inside Main Content
|--------------------------------------------------------------------------
*/

.main-content > .container,
.main-content > .container-fluid {
    width: 100%;
    max-width: 100%;
}

/*
|--------------------------------------------------------------------------
| Prevent Bootstrap / content overflow
|--------------------------------------------------------------------------
*/

.main-content .row {
    --bs-gutter-y: 1.5rem;
}

.main-content img {
    max-width: 100%;
}

/*
|--------------------------------------------------------------------------
| Mobile / Tablet
|--------------------------------------------------------------------------
|
| The sidebar is hidden below 992px unless .show is added.
| This keeps the desktop layout clean and allows a future navbar
| toggle button to control the sidebar without changing this CSS.
|--------------------------------------------------------------------------
*/

@media (max-width: 991.98px) {

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 18px rgba(0, 0, 0, 0.15);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}

@media (max-width: 575.98px) {

    .main-content {
        padding: 15px;
    }

    .sidebar {
        width: min(var(--sidebar-width), 88vw);
    }
}

/*
|--------------------------------------------------------------------------
| Print
|--------------------------------------------------------------------------
*/

@media print {

    .navbar,
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
    }
}
