//---- Layout
//---- universe Moodle Theme
.main-content {
    margin-bottom: $page-padding-global;

    .embedded-main & {
        margin: 0;
    }
}

.layout {
    &.fullscreen {
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
        transition: 350ms;
        width: 100vw;
        margin: 0;
        opacity: 1;
        background-color: $modal-content-bg;

        .theme-dark & {
            background-color: $dm-modal-content-bg;
        }

        >div {
            height: 100%;
            width: 100%;
        }

        .loading-icon {
            margin-left: auto;
            margin-right: auto;
            text-align: center;
            display: inline-block;
            width: 100%;
            top: 40%;
            position: fixed;

            .icon {
                width: 1em;
                height: 1em;
                font-size: 4em;
            }
        }
    }
}

#page-report {
    margin: $page-padding-global 60px;
    width: calc(100% - 120px);
    border-radius: $btn-border-radius;
}

#page {
    width: 100%;
    position: relative;
    z-index: 2;

    @include media-breakpoint-between(xs,sm) {
        margin-top: $navbar-height;
    }
}

.maintenance-wrapper {
    padding: 40px;
    background-color: $container-bg;
    border-radius: $btn-border-radius-md;

    .theme-dark & {
        background-color: $dm-container-bg;
    }
}

#page-popup {
    padding: 20px;
    background-color: $container-bg;
    border-radius: $btn-border-radius;

    .theme-dark & {
        background-color: $dm-container-bg;
    }

    .closewindow {
        margin: 1rem 0;

        .btn {
            width: 100%;
        }
    }
}

.wrapper-xl,
.wrapper-lg,
.wrapper-md,
.wrapper-sm {
    margin-left: auto;
    margin-right: auto;
}


.wrapper-lg {
    width: 90%;
    max-width: $wrapper-lg;

    @include media-breakpoint-between(xs, md) {
        width: calc(100% - 40px);
    }
}

.wrapper-md {
    width: $wrapper-md;
    max-width: 100%;

    @include media-breakpoint-between(xs, md) {
        width: 100%;
    }

    .wrapper-md {
        width: 100%;
    }
}

.wrapper-sm {
    width: 600px;

    @include media-breakpoint-between(xs, md) {
        width: 100%;
    }
}

.wrapper-blocks {
    width: 100%;
    margin: 0 auto;
}

.wrapper-page {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.wrapper-page-withblocks {
    width: 100%;
    max-width: 100%;
}

.rui-btn-show-hide {
    position: fixed;
    top: 100px;
    right: 10px;
    z-index: $zindex-fixed;
}

.wrapper--margin {
    margin-top: 60px;
    margin-bottom: 60px;
}

.wrapper-xl {
    width: calc(100% - 120px);

    @include media-breakpoint-between(md, lg) {
        max-width: calc(100vw - 80px);
    }

    @include media-breakpoint-between(xs, sm) {
        max-width: 100%;
    }

    .path-report & {
        max-width: 100%;
    }
}

.wrapper-xxl {
    width: 100%;
}

.rui-blocks-wrapper {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.wrapper--with-margin {
    @media (min-width: 700px) {
        width: calc(100% - 200px);

        .show-drawer-left.show-drawer-right & {
            width: calc(100% - 80px);
        }
    }

    @media (min-width: 320px) and (max-width: 701px) {
        width: 100%;
    }
}

.wrapper-fw {
    width: 100%;
}

.wrapper-bg {
    padding: 20px;
    background-color: $container-bg;
    border-radius: $btn-border-radius;

    .alert {
        margin-top: 0;
    }
}

.region-main-content {
    position: relative;
}

.rui-title-container {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;

    &+.singlebutton,
    &+.rui-nav-tabs {
        margin-top: 20px;
    }

    &:first-of-type,
    #page .rui-course-card-content & {
        margin-top: 0;
    }

    .rui-page-title--icon & {
        margin-bottom: 0;
    }

    //Remove activity icon inside the title
    .rui-main-content-title {

        .rui-icon-container {
            display: none;
        }
    }

    #page-mod-quiz-summary & {
        margin-top: 0;
    }
}

.rui-title-container+form,
.mform+div {
    margin-top: $page-padding-global;
}



//---- UI elements
.sep--left {
    position: relative;

    &:before {
        content: '';
        background-color: $border-color;
        width: 1px;
        height: 30px;

        position: absolute;
        top: calc(50% - 15px);
        left: -5px;

        .theme-dark & {
            background-color: $dm-border-color;
        }
    }
}


#page-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;

    #page {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;

        @include media-breakpoint-up(md) {
            padding-top: $navbar-height;
        }

        @include media-breakpoint-between(xs, sm) {
            padding: 16px;
        }

        #page-content {
            flex: 1 0 auto;
        }
    }
}

//---- Footer
.rui-page-footer {
    margin: 30px auto 0;
    flex-shrink: 0;

    background-color: $footer-bg;
    border-radius: $btn-border-radius-lg;
    color: $footer-text-color;

    &.rui-page-footer--fw {
        width: 100%;
    }


    a:not(.btn) {
        opacity: .85;

        &:after {
            background-color: $footer-link-color-hover;
        }

        &:hover {
            opacity: 1;
            color: $footer-link-color-hover;
            text-decoration: none;
        }
    }

    @include media-breakpoint-up(md) {
        padding: 60px;
    }

    @include media-breakpoint-between(xs, sm) {
        padding: 30px;
    }

    hr {
        border-color: $footer-text-color;
        opacity: .2;

        .theme-dark & {
            border-color: $dm-border-color;
        }
    }

    .theme-dark & {
        background-color: $dm-black;
        color: $dm-body-color-secondary;
    }
}

.rui-footer--contact,
.rui-footer--social {

    @include media-breakpoint-up(md) {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
    }

    @include media-breakpoint-between(xs, sm) {
        display: block;
        text-align: center;
    }

    list-style: none;

    padding: 0;
    font-size: $font-size-xs;
    color: $footer-text-color;

    li {
        display: inline-flex;
        align-items: center;

        margin-top: .35rem;
        margin-right: 1rem;
        margin-bottom: .35rem;

        &:last-of-type {
            margin-right: 0;
        }
    }

    .theme-dark & {
        color: $dm-body-color-light;
    }

    a {
        color: $footer-text-color;

        .theme-dark & {
            color: $dm-body-color-light;
        }

        &:hover {
            opacity: .6;
        }

    }
}

.rui-footer-buttons-wrapper {
    flex-wrap: wrap;
    padding: 20px 30px;

    @include media-breakpoint-between(xs, sm) {
        padding: 20px;
    }
}

.rui-social-list {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;

    list-style: none;

    padding: 0;
    font-size: $font-size-xs;
    color: $footer-text-color;

    li {
        display: inline-flex;
        align-items: center;

        margin-top: .35rem;
        margin-right: 1rem;
        margin-bottom: .35rem;

        &:last-of-type {
            margin-right: 0;
        }
    }

    .theme-dark & {
        color: $dm-body-color-light;
    }

    a {
        color: $body-color;

        .theme-dark & {
            color: $dm-body-color-light;
        }

        &:hover {
            opacity: .6;
        }

    }
}

.rui-topbar-wrapper {
    padding: 10px;
    margin: 0;

    width: 100%;
    height: $navbar-height;
    position: fixed;
    top: 0;
    left: 0;
    z-index: $zindex-fixed + 200;

    display: flex;
    align-items: center;

    background: var(--topbar-color);
    background: linear-gradient(90deg, var(--topbar-color) 0%, var(--topbar-color-2) 100%);

    font-size: 0.875rem; //14px
    color: var(--topbar-btn-text);

    .theme-dark & {
        background: var(--dm-topbar-color);
        background: linear-gradient(90deg, var(--dm-topbar-color) 0%, var(--dm-topbar-color-2) 100%);
        color: $dm-topbar-btn-text;
    }

    .dir-rtl & {
        background: linear-gradient(90deg, var(--topbar-color-2) 0%, var(--topbar-color) 100%);
    }

    .dir-rtl.theme-dark & {
        background: linear-gradient(90deg, var(--dm-topbar-color-2) 0%, var(--dm-topbar-color) 100%);
    }  
}

#page-wrapper:before {
    content: '';
    width: 100%;
    height: 69px;
    position: fixed;
    z-index: 0;
    top: $navbar-height;
    background: var(--topbar-color);
    background: linear-gradient(90deg, var(--topbar-color) 0%, $container-bg 100%);

    .theme-dark & {
        background: var(--dm-topbar-color);
        background: linear-gradient(90deg, var(--dm-topbar-color) 0%, $dm-container-bg 100%);      
    }

    .dir-rtl & {
        background: linear-gradient(90deg, $container-bg 0%, var(--topbar-color) 100%);
    }

    .dir-rtl.theme-dark & {
        background: linear-gradient(90deg, $dm-container-bg 0%, var(--dm-topbar-color) 100%);
    } 
}

#page-wrapper:after {
    content: '';
    width: 100%;
    height: 70px;
    position: fixed;
    z-index: 1;
    top: $navbar-height;
    left: 0;
    background: $body-bg;
    border-radius: 40px 40px 0 0;

    @include media-breakpoint-between(xs, sm) {
        border-radius: 0;
    }

    .theme-dark & {
        background: $dm-body-bg;
    }
}

.rui-topbar {
    position: relative;
    display: flex;
    align-items: center;

    .navbar-nav {
        font-size: 0.875rem; //14px
        font-weight: $font-weight-medium;
        justify-content: space-between;

        // .nav-link {
        //     color: $topbar-text;
        //     border-radius: $btn-border-radius;

        //     .theme-dark & {
        //         color: $dm-topbar-text;
        //     }

        //     &.active {
        //         color: $nav-tabs-link-active-color;
        //         //background-color: $nav-tabs-link-active-bg;

        //         .theme-dark & {
        //             color: $dm-topbar-btn-hover-text;
        //             //background-color: $dm-topbar-btn-hover;
        //         }
        //     }

        //     &[aria-expanded="true"],
        //     &:hover {
        //         color: $nav-tabs-link-hover-color;
        //         //background-color: $nav-tabs-link-hover-bg;

        //         .theme-dark & {
        //             color: $dm-topbar-btn-hover-text;
        //             //background-color: $dm-topbar-btn-hover;
        //         }
        //     }
        // }
    }

    .site-name {
        margin-left: 20px;
        width: max-content;
        max-width: 260px;
        font-size: $font-size-sm;

        @if variable-exists(fontheadings) {
            font-family: $fontheadings;
        }

        font-weight: $font-weight-bold;
    }

    .rui-navbar-brand--img .site-name {
        margin-left: 0;
    }

}

//---- Moodle Pages mods */
.addtagcoll {
    margin-bottom: 40px;
}




//---- TODO: Course Index Page
.course-hero {
    width: 95%;
    margin-top: 60px;
    margin-bottom: $page-padding-global;

    img {
        border-radius: 5px;
    }
}

.course-teachers-box {
    max-width: $page-main-container-width;
    margin-top: 30px;
    margin-bottom: 30px;

    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;

    overflow-x: auto;

    .course-contact-title-item {
        margin-right: .5rem;
        display: flex;

        .rui-course-list-wrapper & {
            margin-right: 20px;
            margin-bottom: 20px;
            width: calc(50% - 20px);
        }
    }

    .course-contact-title {
        margin-left: .5rem;
        margin-right: .5rem;
        margin-bottom: 0;

        font-size: $font-size-md;
        font-weight: $font-weight-medium;
        color: $body-color-secondary;

        .theme-dark & {
            color: $dm-body-color-secondary;
        }
    }

    .course-contact {
        display: flex;
        align-items: center;

        &:hover {
            text-decoration: none;
        }

        .course-teacher-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50px;
            position: relative;

            @include media-breakpoint-between(xs, sm) {
                width: 40px;
                height: 40px;
            }
        }

        .course-teacher-content {
            margin: 0 10px;

            .rui-course-list-wrapper & {
                margin: 0 10px;
            }
        }

        .course-teacher-name {
            margin: 0;
            font-weight: $font-weight-medium;
            font-size: $btn-font-size-lg;
        }

        .course-teacher-role {
            font-size: $font-size-md;
            color: $body-color-secondary;

            .theme-dark & {
                color: $dm-body-color-secondary;
            }
        }
    }
}

.rui-course-contact-desc {
    margin-left: 60px;
    font-size: $font-size-md;
}

.course-hero-img {
    border-radius: $btn-border-radius-lg;
    width: 100%;
    max-width: 100%;
}

.course-progressbar-wrapper {
    padding: 0;
    position: relative;

    .rui-progress {
        margin: 10px 0 20px;
        width: 100%;
        height: 2px;
        border-radius: $btn-border-radius;
    }

}


@include media-breakpoint-down(sm) {
    .header-button-group {
        width: 100%;

        .btn {
            width: 100%;
        }
    }
}

.page-header-content,
.header-content {
    &:empty {
        display: none;
    }

    .rui-page-title {
        margin-bottom: 20px;
    }

    @include media-breakpoint-down(sm) {
        width: 100%;

        div {
            width: 100%;
        }

        .btn {
            width: 100%;
            border-radius: $border-radius-md !important;

            &+.btn {
                margin-top: 5px;
            }
        }
    }
}


.page-header-content {
    margin: 30px 0;
    width: 100%;
    position: relative;

    display: flex;
    justify-content: space-between;
    align-items: center;

    @include media-breakpoint-down(sm) {
        margin: 0 0 10px 0;
    }

    .rui-page-title--icon {
        margin-left: .5rem;
        margin-right: .5rem;

        .path-mod & {
            margin-left: 0;
            margin-right: 0;
        }
    }

    .rui-main-content-title {

        .path-mod &,
        .path-course & {

            //max-width: 900px;
            line-height: 1.3;

            @include media-breakpoint-between(xs, sm) {
                margin-top: 10px;
            }
        }
    }

    .rui-course-header &,
    .rui-title-container,
    .rui-page-title {
        margin-bottom: 0;

        font-size: 3rem;

        .path-mod &,
        .path-course & {
            //max-width: 900px;
            line-height: 1.1;

            @include media-breakpoint-up(md) {
                font-size: 6vw;
            }

            @include media-breakpoint-between(xs, sm) {
                font-size: 2rem;
            }
        }

        @include media-breakpoint-between(xs, sm) {
            font-size: 1.875rem;
        }
    }
}

#page-files-index,
#page-question-bank-exportquestions-export,
#page-question-bank-importquestions-import,
#page-question-bank-managecategories-category,
#page-question-edit,
#page-contentbank,
#page-contentbank-edit,
#page-course-completion,
#page-course-edit,
#page-course-switchrole,
#page-course-view-site,
#page-course-search,
#page-notes-index,
#page-notes-edit,
#page-mod-quiz-report,
#page-mod-quiz-edit,
.pagelayout-admin,
.path-admin,
.path-admin-roles,
.path-badges,
.path-filter,
.path-grade,
.path-group,
.path-user,
.path-report,
.path-question-type {

    .page-header-headings .rui-main-content-title--h1,
    .page-content-header--img .rui-main-content-title--h1 {
        font-size: 1.25rem;
        font-weight: $font-weight-medium;

        @include media-breakpoint-between(xs, md) {
            margin: 10px 0;
        }
    }

    .page-header-content .rui-page-title--icon {
        margin: 0;
    }

    .page-content-header--img .page-header-image {
        margin: 0;
        display: none;
    }

}

/** Navbar logo. */
.rui-logo {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;

    &.rui-logo-box {
        
        display: flex;
        align-items: center;
        justify-content: center;
        
        border-radius: 40px;
        background-color: $container-bg;
        box-shadow: $box-shadow-md;

        transition: all 350ms ease;

        &:hover {
            box-shadow: $box-shadow-lg;
        }

        @include media-breakpoint-up(md) {
        margin: 0 10px 0 0;
        }

        @include media-breakpoint-between(xs, sm) {
        margin: 0;
        }
        .theme-dark & {
            background-color: $dm-container-bg;
        }
    }

    img {
        height: 30px;
        border-radius: 30px;
    }
    
}

.rui-logo-ml {
    margin-left: 10px;
}

.rui-navbar-nav {
    .nav-item {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;

        .nav-link {
            position: relative;
            width: max-content;

            margin-right: .5rem;
            padding: 0 1rem;

            display: flex;
            align-items: center;
            justify-content: center;

            min-width: 30px;
            height: 30px;
            border-radius: 40px;

            color: var(--topbar-btn-text);
            line-height: 1.8;

            .theme-dark & {
                color: $dm-topbar-text;
            }

            @include media-breakpoint-down(sm) {
                margin-right: 0;
                width: 100%;
            }

            &[aria-expanded="true"],
            &:hover {
                background-color: var(--topbar-btn-hover);

                .theme-dark & {
                    color: $dm-topbar-btn-hover;
                }
            }
        }

    }
}

@include media-breakpoint-up(md) {
    .rui-navbar-nav--sep {
        position: relative;

        &:before {
            content: '';
            background-color: rgba($black, .15);
            width: 1px;
            height: 16px;

            position: absolute;
            top: calc(50% - 8px);
            left: -6px;
        }
    }
}

.popover-region-notifications:not(.collapsed) {
    .nav-link {
        background-color: $gray-700;
    }
}

.rui-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    width: max-content;
    min-height: 40px;

    border: none;
    border-radius: 40px;
    font-size: $font-size-sm;
    font-weight: $font-weight-medium;
    color: var(--topbar-btn-text);

    &[aria-expanded="true"],
    &:hover {
        color: $topbar-btn-hover-text;
        background-color: var(--topbar-btn-hover);
        text-decoration: none;
    }

    .theme-dark & {
        background-color: $dm-topbar-btn;
        color: $dm-topbar-btn-text;
    }
}

.rui-signup-btn {
    padding: 0 1rem;
    color: var(--topbar-btn-text);
    //background-color: $nav-tabs-link-active-bg;

    &:hover {
        color: $nav-tabs-link-hover-color;
        background-color: $nav-tabs-link-hover-bg;
    }
}

.rui-login-btn {
    padding: 0 1rem;
    color: $nav-tabs-link-hover-color;
    background-color: $nav-tabs-link-hover-bg;

    &:hover {
        color: $nav-tabs-link-active-color;
        background-color: $nav-tabs-link-active-bg;
    }
}


.rui-icon-menu {
    padding: 0;
    margin: 0;
    display: inline-flex;

    position: relative;
    list-style: none;

    @include media-breakpoint-down(sm) {
        margin: 0 0 0 auto;
    }

    li {
        margin: 0 2px;
        align-items: center;
    }

    li,
    .popover-region {
        display: inline-flex;
    }

    .popover-region {
        margin-right: 2px;
    }

}

.rui-icon-menu--sep {
    &:before {
        content: '';
        background-color: $border-color;

        position: absolute;
        top: -14px;
        left: calc(50% - 10px);

        width: 20px;
        height: 1px;

        .theme-dark & {
            background-color: $dm-border-color;
        }
    }
}

.nav-editswitch {
    width: max-content;
}

.mobile-nav--open #topBar:before {
    @include media-breakpoint-between(xs, sm) {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        background-color: rgba($container-bg, .8);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        width: 100%;
        height: 100vh;
    }
}

.rui-icon-menu--horizontal {
    display: inline-flex;
    align-items: center;

    li {
        display: inline-flex;
        margin-bottom: 0;
        margin-left: .4rem;
    }
}

.rui-topbar-special-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    background: transparent;
    font-size: $font-size-xs;
    color: var(--topbar-btn-text);
    border-radius: 40px;
    padding: 5px;

    .theme-dark & {
        background: transparent;
        color: var(--dm-topbar-btn-text);
    }
    
    &.active,
    &:hover {
        background-color: var(--topbar-btn-hover);
        color: var(--topbar-btn-hover-text);

        .theme-dark & {
            background-color: var(--dm-topbar-btn-hover);
            color: var(--dm-topbar-btn-hover-text);
        }
    }
}

.rui-nav-tabs+* {
    margin-top: $page-padding-global;
}


.rui-navbar-brand,
body:not(#rui-lang-btn).rui-navbar-lang {
    position: relative;

    @include media-breakpoint-down(sm) {
        margin-left: 0;
        margin-right: 0;
    }
}

.rui-navbar-brand--img {
    margin-left: 0;

    color: var(--topbar-btn-text);

    .theme-dark & {
        color: $dm-topbar-btn-text;
    }
}

.rui-navbar-brand:hover {
    text-decoration: none;
}

@include media-breakpoint-between(xs, md) {
    .rui-navbar-collapse {
        padding: 20px;

        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;

        background-color: var(--primary-color-700);

        border-radius: 0 0 $border-radius $border-radius;

        display: inline-flex;
        flex-wrap: wrap;

        @include media-breakpoint-down(sm) {
            top: 95px;
        }
    }
}

.dark-mode-logo {
    .rui-custom-logo {
        display: inline-flex;
    
        .theme-dark & {
            display: none;
        }
    }
}


.rui-custom-dmlogo {
    display: none;

    .theme-dark & {
        display: inline-flex;
    }
}


.rui-topbar-customfield {
    position: relative;

    width: auto;
    max-width: 280px;

    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;

    font-size: $font-size-xs;

    @include media-breakpoint-between(xs,sm) {
    display: none;
    }

    @include media-breakpoint-only(md) {
        max-width: 210px;
        margin: 0 50px 0 0;
    }

    // &::before {
    //     content: '';
    //     background-color: $border-color;
    //     width: 1px;
    //     height: 16px;

    //     position: absolute;
    //     top: calc(50% - 8px);
    //     left: -6px;
    // }

    &:after {
        content: '';
        background-color: rgba($topbar-btn-text, .3);
        width: 1px;
        height: 16px;

        position: absolute;
        top: calc(50% - 8px);
        right: -6px;

        .theme-dark & {
            background-color: rgba($dm-topbar-btn-text, .3);
        }
    }


    p {
        margin-bottom: 0;
    }

    a {
        color: var(--topbar-btn-text);

        .theme-dark & {
            color: $dm-topbar-btn-text;
        }
    }
}

/* Footer */
.rui-footer-content {
    font-size: $font-size-md;

    div {
        gap: 10px;
    }

    a {
        color: $footer-link-color;

        &:hover {
            color: $footer-link-color-hover;
            text-decoration: underline;
        }
    }
}

.rui-footer-copy {
    p {
        margin-bottom: .25rem;

        &:last-of-type {
            margin-bottom: 0;
        }
    }
}

.rui-page-footer .rui-footer-nav-title {
    font-size: $font-size-base;
    color: $footer-text-color;

    .theme-dark & {
        color: $dm-body-color;
    }
}

.rui-page-footer .rui-footer-nav-items {
    font-size: $font-size-sm;
    color: $footer-text-color;
    opacity: .6;

    .theme-dark & {
        color: $dm-body-color-secondary;
    }

    li {
        margin: .35rem 0;

        a {
            color: $footer-link-color;

            &:after {
                background-color: $footer-link-color;
                opacity: .8;
            }

            .theme-dark & {
                color: $dm-body-color-secondary;
            }

            &:hover {
                text-decoration: none;
                opacity: .8;
                color: $footer-link-color;
            }
        }
    }
}

.rui-footer-block--3 {
    font-size: $font-size-sm;
    color: $body-color-light;

    .theme-dark & {
        color: $dm-body-color-light;
    }
}

.generalbox {
    &:empty {
        display: none;
    }
}

// Dark mode.
.theme-dark .rui-dark-mode-status--on {
    display: flex;
}

body:not(.theme-dark) .rui-dark-mode-status--on,
.theme-dark .rui-dark-mode-status--off {
    display: none;
}

// Not logged in users
.notloggedin,
.moodle-guest-user {
    .hidefornotloggedin {
        display: none !important;
    }
}

body:not(.moodle-guest-user):not(#page-admin-setting-themesettinguniverse) 
body:not(.notloggedin):not(#page-admin-setting-themesettinguniverse) {
    .hideforloggedin {
        display: none !important;
    }
}

.theme-dark {
    .hide-on-darkmode {
        display: none;
    }
}

body:not(.theme-dark) {
    .hide-on-lightmode {
        display: none;
    }
}

.rui-custom-alert {
    padding: 14px 60px 14px 24px;
    max-width: 600px;

    @include media-breakpoint-between(xs, sm) {
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        left: 10px;
    }

    display: inline-flex;
    justify-content: flex-start;
    align-content: flex-start;

    position: fixed;
    z-index: 9999;
    bottom: 0;
    left: 15px;

    background-color: $black;
    color: $white;
    font-weight: $font-weight-normal;
    box-shadow: $box-shadow-lg;

    &.fade:not(.show) {
        z-index: -1;
    }

    .rui-custom-alert-close {
        position: absolute;
        top: 5px;
        right: 5px;

        padding: 10px;

        display: flex;
        justify-content: center;
        align-content: center;

        background-color: transparent;
        border: none;
        border-radius: $btn-border-radius-xl;

        background-color: $gray-100;
        color: $gray-600;

        width: 40px;
        height: 40px;

        transition: $transition-base;

        .theme-dark & {
            background-color: $dm-gray-100;
            color: $dm-gray-600;
        }

        &:hover {
            background-color: $red-100;
            color: $red-600;
        }
    }
}


.rui-main-nav {
    .nav-item {
        font-size: 1rem;
    }
}

.rui-main-nav {
    padding: 0;
    margin: 0;

    .nav-item {
        position: relative;
        font-weight: $font-weight-medium;
        list-style: none;

        .nav-link {
            width: 100%;
            display: flex;
            align-items: center;

            padding: .35rem 1.25rem;
            margin: 9px 0;

            border-radius: $btn-border-radius;
            color: $body-color;

            z-index: 1;

            &:hover {
                &:before {
                    background-color: $white;
                }
            }

            &.active {
                &:before {
                    background-color: $white;
                    color: $body-color-light;
                }
            }

            &:before {
                content: '';

                position: absolute;

                width: 100%;
                top: -3px;
                bottom: -3px;
                left: 0;

                border-radius: $btn-border-radius;

                z-index: -1;
            }

            .nav-link-icon {
                opacity: .6;
            }
        }
    }
}

.wrapper-course {
    width: 100%;
    transition: $transition-base;
}

#blocks-dashboardonecol {
    .block-region {
        margin-bottom: 1.25rem;

        &:last-of-type {
            margin-bottom: 0;
        }
    }
}

$fixed-header-y: $navbar-height;


#page.drawers {
    
    .main-inner {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        padding: 0;
        flex: 1 0 auto;
    }

    .activity-header {
        margin: 0;
        width: 100%;
    }

    position: relative;
    @include transition(350ms);
    //height: calc(100vh - #{$navbar-height});
    left: 0;
    right: 0;

    @include media-breakpoint-up(lg) {
        &.show-drawer-right {
            padding-left: 0;
            padding-right: $drawer-right-width;
        }

        &.show-drawer-left {
            padding-left: $drawer-right-width;
            padding-right: 0;
        }

        &.show-drawer-left.show-drawer-right {
            padding-left: $drawer-right-width;
            padding-right: $drawer-right-width;
        }
    }
}

.drawer-left-toggle {
    position: fixed;
    top: 90px;
    
    @include media-breakpoint-up(mdl) {
        left: 30px;
    }

    @include media-breakpoint-only(md) {
        left: 35px;
    }

    @include media-breakpoint-between(xs, sm) {
        left: 10px;
    }

    .btn {
        width: 40px;
        height: 40px;
        padding: 4px;

        background-color: $gray-900;
        color: $gray-100;

        &:hover {
            background-color: var(--main-theme-color) !important;
            color: var(--primary-color-100);
        }

        .theme-dark & {
            background-color: $dm-gray-300;
            color: $dm-gray-900;
        }

        @include media-breakpoint-between(xs, md) {
            box-shadow: rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px, rgba(17, 17, 26, 0.1) 0px 24px 80px;
        }
    }
}

@include media-breakpoint-down(sm) {

    //the scroll to top button
    .drawer-toggles {
        z-index: 100;

        .drawer-right-toggle,
        .drawer-left-toggle {
            top: calc(99vh - (#{$navbar-height} * 2.5));
        }
    }

    #page.drawers.scroll-down {
        .drawer-right-toggle {
            transform: translateX(150%);
            pointer-events: auto;
            visibility: hidden;
        }

        .drawer-left-toggle {
            transform: translateX(-150%);
            pointer-events: auto;
            visibility: hidden;
        }
    }
}

@include media-breakpoint-up(lg) {

    .drawer-left,
    .drawer-right {
        // top: $navbar-height + 10px;
        height: calc(100% - #{$navbar-height});
    }
}

.drawercontent {
    padding: 0 10px 0 0;
    margin-right: 4px;
    height: calc(100% - 70px);

    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;

    .drawer-right & {
        margin: 0;
        padding: 0 0 80px 0;

        @include media-breakpoint-between(xs, sm) {
        padding-bottom: 100px;
        }
    }

    .dropdown-menu .dropdown-item {
        width: 220px;
        white-space: normal;
    }
}


// Dashboard  
@include media-breakpoint-up(lg) {
    .rui-blocks-area--sm {
        flex: 0 0 320px;
        max-width: 320px;
    }
}

// Scrollbar
#page.drawers,
.drawercontent,
.filemanager .fp-content,
.rui-card-course-contacts,
.cb-toolbar-container .dropdown-scrollable,
.rui-column-mh,
.rui-nav--admin,
.rui-content-message-container,
.rui-course-card-text,
#sidepre-blocks .rui-sidebar-blocks-wrapper,
.table-dynamic div:first-of-type,
.course-teachers-box,
.notification-area .control-area {
    @include thin-scrolls($scroll-bg-track);

    .theme-dark & {
        @include thin-scrolls($dm-drawer-scroll-bg-track);
    }
}

// Grid layout
.rui-grid-layout {
    display: grid;
    flex-direction: column;
    align-items: stretch;

    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}


// RWD
.rui-mobile-nav {
    @include media-breakpoint-up(md) {
        display: none;
        z-index: -2;
    }

    @include media-breakpoint-between(xs, sm) {
        position: fixed;
        top: 0;
        left: 0;

        display: flex;
        justify-content: center;
        align-items: center;

        width: 100%;
        height: $navbar-height;
        z-index: 1;
    }
}



@include media-breakpoint-between(xs, sm) {

    .rui-mobile-nav-btn-close,
    .rui-mobile-nav-btn {
        position: absolute;
        top: calc(50% - 20px);
        right: 10px;
        z-index: $zindex-fixed;
    }

    .rui-mobile-nav-btn-close {
        display: none;
        opacity: 0;
        right: 0;

        .opened & {
            position: absolute;
            opacity: 1;
            z-index: 4;
            display: flex;
        }
    }

    .rui-topbar {

        .moremenu,
        .rui-icon-menu {
            z-index: -1;
            display: none;
            opacity: 0;

            .opened & {
                background-color: $container-bg;
                position: absolute;
                left: 0;
                opacity: 1;
                z-index: 3;
                display: flex;

                .theme-dark & {
                    background-color: $dm-container-bg;
                }
            }

            .rui-icon-menu {
                .opened & {
                    padding-left: 30px;
                }
            }

        }

        .moremenu.navigation {
            .opened & {
                @include media-breakpoint-between(xs, sm) {
                    padding: 10px;
                    width: calc(100% + 20px);
                    left: -20px;
                    border-radius: $btn-border-radius-md;
                    box-shadow: $box-shadow-lg;
                }
            }
        }

        .rui-icon-menu {
            .opened & {
                right: 50px;

                @include media-breakpoint-up(md) {
                    width: max-content;
                }

                @include media-breakpoint-between(xs, sm) {
                    align-items: center;
                    justify-content: flex-end;
                    border-radius: 40px;
                    background-color: $container-bg;

                    .theme-dark & {
                        background-color: $dm-container-bg;
                    }
                }
            }
        }
    }

    .moremenu .nav-link {
        margin: 0;
    }

    .more-nav {
        a {
            margin: 0;
        }

        .dropdown-menu {
            width: 100%;
            max-width: calc(100% - 7px);
            left: 2px !important;
        }
    }

    #topbarLeft {
        z-index: 3;
    }
}


// Fix some unnecessary layout gaps
.box:empty {
    display: none;
}

#page-login-change_password {
    background-image: none!important;
}

// H5P
.h5p-question-content {
    margin: 0;
}

.rui-editmode--top .editmode-switch-form {

        @include media-breakpoint-up(lg) {
            margin-left: 20px;
            position: relative;

            &:before {
                content: '';
                background-color: rgba($black, .15);
                width: 1px;
                height: 16px;

                position: absolute;
                top: calc(50% - 8px);
                left: -10px;
            }

            .dir-rtl & {
                margin-right: 20px;
                margin-left: 0;
            }
        }

        @include media-breakpoint-down(md) {
            padding: 5px 10px;
            background-color: $container-bg;
            border: none;
            border-radius: $btn-border-radius;

            box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .26), 0 14px 44px 0 rgba(0, 0, 0, .2);
            position: fixed;
            right: 20px;
            bottom: 14px;
            z-index: $zindex-tooltip;

            .theme-dark & {
                background-color: $black;
            }
        }
}

.rui-editmode--footer .editmode-switch-form {
    padding: 5px;
    background-color: $container-bg;
    border: none;
    border-radius: $btn-border-radius;

    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .26), 0 14px 44px 0 rgba(0, 0, 0, .2);
    position: fixed;
    right: 20px;
    bottom: 13px;
    z-index: $zindex-tooltip;

    transition: $transition-base;
}

.scrolled.back-to-top-on .editmode-switch-form {
    right: 70px;
}

.rui-editmode--top.scrolled.back-to-top-on .editmode-switch-form {
    right: 0;
    background: $container-bg;
    padding: 3px 1px;
    border-radius: $btn-border-radius;
}

.theme-dark.rui-editmode--footer .editmode-switch-form {
    background-color: $dm-gray-100;
}

#back-to-top {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 8px;

    z-index: 9999;
    transition: $transition-base;

    box-shadow: $box-shadow;
    background-color: $gray-900;
    color: $gray-100;
    border: 0;
    border-radius: $btn-border-radius-xl;

    .theme-dark & {
        background-color: $dm-gray-100;
        color: $dm-gray-900;
    }

    .scrolled & {
        display: flex;
    }
}


// Filter.
.filtering-title {
    font-size: $font-size-sm;
}

.filtering-group {
    padding: 12px 16px 16px;
}

.filtering-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 3px 3px 3px 12px;
    margin-bottom: 2px;

    font-size: $font-size-sm;
    border-radius: $btn-border-radius;

    cursor: pointer;

    .total {
        background-color: $gray-200;
        color: $gray-800;
        border-radius: $btn-border-radius;
    
        min-width: 18px;
    
        display: inline-flex;
        align-items: center;
        padding: 1px 4px;
        justify-content: center;
    
        font-size: 11px;
        font-weight: $font-weight-bold;
        margin-left: 10px;
    }

    &:hover {
        background-color: $gray-100;

        .theme-dark & {
            background-color: $dm-gray-300;
        }
    }

    &.checked {
        background-color: var(--main-theme-color);
        color: var(--primary-color-100);
    
        .total {
            background-color: var(--primary-color-200);
            color: var(--main-theme-color);
        }
    }

    &.disabled {
        display: none;
        // color: $gray-500;
        // .theme-dark & {
        //     color: $dm-gray-500;
        // }
    }
}

/* Items */
.filtering-item.filtered {
    display: none;
}

// Category Dropdown menu
.rui-course-count-badge {
    margin-left: auto;
    padding: 2px 4px;
    background-color: $dropdown-link-active-bg;
    color: $dropdown-link-active-color;

    min-width: 20px;
    width: auto;
    height: 20px;
    border-radius: 20px;

    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rui-cat-menu-0 {
    margin: 0;
    padding: 0;
    list-style: none;

    .categories-depth-0 a {
        font-size: 16px;
        gap: 10px;
    }

    .categories-depth-1 a {
        font-size: 14px;
        gap: 10px;
    }

    .categories-depth-3 a {
        font-size: 12px;
        gap: 10px;
    }

    ul {
        list-style: none;
        margin: 0;
    }
}

#root .info {
    img.img-fluid {
        margin: 10px 0;
        border-radius: $btn-border-radius;
    }
}