body.path-course.theme-fresk,
body.path-mod.theme-fresk {
    .activityiconcontainer.smaller {
        width: 42px !important;
        height: 42px !important;
    }
    #page {
        #page-header {
            margin-top: 1em;
            margin-bottom: 1rem;
            padding-inline: 0;
        }
        #topofscroll {
            margin-top: 0;
            padding-top: 0;
            background: transparent;
            #page-header {
                h1 {
                    color: $graytext !important;
                    font-size: 30px;
                }
            }
        }
        .fresk-drawers-content #topofscroll #page-content {
            margin: 0;
        }
        #region-main {
            [role="main"] {
                padding: 0 !important;
            }
            .section-navigation {
                &.navigationtitle {
                    display: none !important;
                }
                margin-bottom: .5em;
                .prevsection,
                .nextsection {
                    a {
                        .larrow {
                            margin-right: .5em;
                        }
                    }
                }
                .nextsection {
                    a {
                        display: flex;
                        flex-flow: row-reverse;
                        .rarrow {
                            margin-left: .5em;
                        }
                    }
                }
            }
            .course-content ul.topics,
            .course-content ul.fresk,
            .course-content ul.weeks {
                padding: 0;
                margin: 0;
                list-style: none;
            }

            .course-content {
                .topics,
                .fresk,
                .weeks {
                    .section {
                        background: white;
                        margin-bottom: 1em;
                        box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
                        border-radius: 8px;
                        padding: 1rem;
                        border-bottom: 0;
                        .course-section-header {
                            .icons-collapse-expand {
                                .icon-no-margin {
                                    .icon {
                                        color: $primary;
                                    }
                                }
                            }
                            .sectionname {
                                font-weight: 600;
                                font-size: 21px;
                                color: $graytext !important;
                            }
                            .section-collapsemenu {
                                font-size: 14px;
                                color: $secondary;
                                &:hover {
                                    color: $primary;
                                }
                            }
                        }
                        .course-content-item-content {
                            padding: 0 20px;
                            .course-description-item {
                                h1, h2, h3, h4, h5 {
                                    color: $graytext;
                                }
                                p {
                                    font-size: 14px;
                                    color: $graytext;
                                }
                                img {
                                    max-height: 400px;
                                    width: auto;
                                    display: block;
                                    margin: 0 auto;
                                    border-radius: 15px;
                                }
                            }
                            .section {
                                box-shadow: none;
                                .activity {
                                    padding: 0;
                                    margin-bottom: 1em;
                                    padding-top: map-get($spacers, 1);
                                    margin-top: map-get($spacers, 1);
                                    border-top: 0;
                                    .activity-item {
                                        border: 0;
                                        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
                                        border-radius: 8px;
                                        &.activityinline {
                                            padding: 1rem;
                                        }
                                        .activity-basis {
                                            .activitytitle {
                                                .text-uppercase {
                                                    font-size: 11px;
                                                    color: #6D6C83;
                                                }
                                                .activityname {
                                                    a {
                                                        color: $graytext;
                                                        font-size: 16px;
                                                        font-weight: bold;
                                                        &:hover {
                                                            color: $primary;
                                                        }
                                                    }
                                                }
                                            }
                                            .activity-badges {
                                                display: flex;
                                                button.locked,
                                                button.section-availability {
                                                    &:hover {
                                                        filter: none !important;
                                                        cursor: pointer;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                &.modtype_label {
                                    .activity-item {
                                        box-shadow: none;
                                    }
                                }
                            }
                        }
                        &.current {
                            .section-item {
                                .course-section-header {
                                    .sectionbadges {
                                        .badge.rounded-pill.bg-primary.text-white.order-1 {
                                            background-color: $primary !important;
                                        }
                                    }
                                }
                            }
                            >.section-item::before {
                                border-left: $primary 3px solid;
                            }
                        }
                        &.course-section.current::before {
                            border-left: $primary 3px solid;
                        }
                    }
                }
                //TODO: add other formats.
                .single-section.general-section, #tabs-tree-start {
                    background: white;
                    margin-bottom: 1em;
                    box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
                    border-radius: 8px;
                    padding: 1rem;
                    border-bottom: 0;
                }
            }
            .activity-navigation {
                a.btn.btn-link {
                    color: $primary !important;
                    font-size: 13px;
                    &:hover,
                    &:active,
                    &:focus {
                        text-decoration: none;
                    }
                }
            }

        }
    }
    .course-section-header {
        .bulkselect {
            left: -10px;
        }
    }
    .activity-item {
        .bulkselect {
            left: -30px;
        }
        .activity-altcontent.activity-description {
            width: 100%;
        }
        .activity-availability.availabilityinfo.isrestricted.isfullinfo{
            width: 100%;
        }
    }
}
body.theme-fresk {
    .modtype_subsection {
        > .activity-item {
            padding: 0 !important;
            .section.course-section {
                margin-bottom: 0 !important;
                .section-item {
                    padding: 0;
                }
                &.hidden {
                    background-color: #f8f9fa !important;
                    .section-item {
                        [data-for="cmlist"] {
                            background-color: #f8f9fa !important;
                        }
                    }
                }
            }
        }
    }
}

body.path-course.theme-fresk {
    &:not(.path-user, .pagelayout-admin, .pagelayout-report) {
        #page {
            #region-main {
                background-color: transparent !important;
                box-shadow: none !important;
                padding: 0 !important;
            }
        }
    }
}
/* not only in a course: grades, badges related with course...*/
[data-region="fresk-course-image"] {
    min-height: 200px !important;
    #courseimage {
        margin-bottom: -5em;
        display: block;
        width: 100%;
        height: 200px;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        /*margin-top: $navbar-height + $navbar-second-height;*/
        overflow: hidden;
    }
}
body.theme-fresk.theme-fresk-limitedwidth #page {
    &:not(.hascourseimage){
        .without-progress.forcollapse{
            margin: 1em auto !important;
        }
    }
}
#page {
    &.hascourseimage {
        .courseformatheader {
            min-height: 62px;
            max-width: 100%;
            padding: 0 10px 0 15px;
            margin: -40px 0 0 10px;
        }
    }
    .fresk-drawers-content #page-footer {
        margin-bottom: 0 !important;
    }
    &:not(.hascourseimage) {
        .teachersimages {
            margin-left: 25px;
        }
        .teachersimages-collapse {
            left: 25px !important;
        }
        .without-progress {
            .teachersimages-collapse {
                top: 9px !important;
            }
        }
        .without-progress.forcollapse {
            margin: 1em 0 0 0 !important;
        }
    }
    .courseformatheader {
        margin-top: 1em;
        display: flex;
        justify-content: space-between;
        position: relative;
        padding: 0 10px 0 0;
        &.forcollapse {
            &.without-progress {
                margin: -40px 50px 50px 50px;
            }
        }
        .teachersimages {
            display: flex;
            flex-flow: row wrap;
        }
        .teachersimages-collapse {
            position: relative;
            z-index: 32;
            .content-collapse {
                display: flex;
                flex-flow: row nowrap;
                justify-content: flex-start;
                align-items: center;
                .moreteachers {
                    display: flex;
                    flex-flow: row nowrap;
                    justify-content: center;
                    align-items: center;
                    background: $secondary;
                    font-size: 16px;
                    color: white;
                }
                .teachersimagescontainer-icon {
                    display: none;
                }
            }
            #teachersimages-collapse {
                background-color: #fff;
                border: 1px solid $secondary;
                border-radius: 4px;
                padding: 8px 0;
                margin-top: .75em;
                position: absolute;
                h6 {
                    color: #333 !important;
                    padding: 0 24px;
                }
                .teacherlink {
                    color: #333 !important;
                    display: block;
                    padding: 0 15px;
                    .teachersimagescontainer {
                        margin-left: 0;
                    }
                    &:hover {
                        background-color: #f5f5f8;
                        color: $secondary!important;
                    }
                }
            }
        }
        .teachersimages,
        .teachersimages-collapse {
            .teachersimagescontainer {
                position: relative;
                width: 62px;
                height: 62px;
                margin-left: -14px;
                &.moreteachers,
                img {
                    border: 3px solid #fff;
                    border-radius: 50%;
                }
            }
        }
        .progressinfo {
            width: 319px;
            height: 65px;
            box-shadow: 0 0 10px rgba(0, 0, 0, .06);
            border-radius: 8px;
            background: #FFFFFF;
            padding: 0 1em;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            margin-left: auto;
            .top {
                display: flex;
                justify-content: space-between;
                align-items: center;
                font-weight: 600;
                font-size: 14px;
                .top-left {
                    display: flex;
                    align-items: center;
                }
            }
            .bottom {
                .progress {
                    height: 0.46rem;
                    .progress-bar {
                        background-color: $primary;
                    }
                }
            }
        }
    }
}
body.theme-fresk.theme-fresk-limitedwidth .courseformatheader {
    padding: 0 10px 0 15px;
}
body.theme-fresk:not(.theme-fresk-limitedwidth) .courseformatheader {
    @media (min-width: 768px) {
        padding-inline: 3rem !important;
    }
}
body.theme-fresk.path-admin.theme-fresk-limitedwidth #page .courseformatheader{
    max-width: none;
    @media (min-width: 768px){
        padding-inline: 3rem !important;
    }
}
body#page-course-management #page.drawers .main-inner {
    max-width: 100% !important;
}
body.path-course.theme-fresk,
body.path-grade.theme-fresk,
body.path-report.theme-fresk,
body.path-enrol.theme-fresk,
body.path-filter.theme-fresk,
body.path-mod.theme-fresk,
body.path-admin.theme-fresk,
body.path-backup.theme-fresk,
body.path-question.theme-fresk,
body.pagelayout-incourse.theme-fresk{
    #page.drawers {
        padding-inline: 0 !important;
    }
    #page.drawers .fresk-drawers-content {
        @media (min-width: 768px){
            padding-inline: 3rem;
        }
    }
}
body.theme-fresk{
    #page-content {
        #region-main{
            .section.course-section {
                .btn.add-content {
                    i {
                        width: 16px;
                        height: 16px;
                        font-size: 16px;
                    }
                }
            }
            #course-addsection.changenumsections{
                .btn.add-section,
                .btn-add-content {
                    border: 2px dashed $filterstext !important;
                    color: grey !important;
                    background-color: transparent !important;
                    &:hover{
                        i{
                            color: $primary !important;
                        }
                        background-color: transparent !important;
                        color: $graytext !important;
                        border-color: $graytext !important;
                    }
                }
            }
        }
    }
    .badge.rounded-pill.bg-secondary.text-dark,
    .badge.rounded-pill.badge-secondary{
        display: flex;
        white-space: nowrap;
        align-items: center;
        i.icon.material-icons.visibility_off{
            margin-bottom: .2rem !important;
        }
    }
}
body.theme-fresk.editing {
    .section.course-section {
        .changenumsections {
            .divider.always-hidden:has(a.btn.add-content:hover) hr {
                border-color: #0f6cbf !important;
            }
            .divider.always-hidden {
                width: 100%;
                hr {
                    margin: .5rem .25rem;
                    border-top: 2px dashed #dee2e6;
                    opacity: 1;
                    visibility: visible;
                }
                .divider-content {
                    a.btn.add-content {
                        position: relative;
                        z-index: 1;
                        border-radius: .5rem !important;
                        font-size: .8203125rem;
                        font-weight: 700;
                        color: #083660 !important;
                        background-color: #cfe2f2 !important;
                        border-color: transparent !important;
                        &:hover {
                            color: #fff !important;
                            background-color: #0f6cbf !important;
                        }
                    }
                }
            }
        }
    }
}
.activity-item .activity-completion button.btn,
.activity-item .activity-completion a[role=button].btn {
    color: #1d2125;
    background-color: #fff;
    border-color: #ced4da;
    min-height: 32px;
    font-weight: bold;
    border-radius: 0.5rem;
}
.activity-item .activity-completion button.btn.dropdown-toggle {
    &:hover,
    &:focus {
        border-color: $secondary !important;
        color: $secondary !important;
        background-color: transparent !important;
    }
}

@media (max-width: 992px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page-content #region-main-box #region-main [role="main"] .tertiary-navigation .row {
            flex-wrap: wrap !important;
        }
        #page {
            .fresk-drawers-content #topofscroll #page-content {
                margin: 0 auto 0 auto;
            }
            &.hascourseimage {
            }
            #topofscroll {
                .secondary-navigation {
                    display: block;
                    margin: 25px auto 25px auto !important;
                }
            }
        }
    }
}
@media (max-width: 767.98px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .progressinfo {
                    width: 35%;
                    min-width: 165px;
                }
            }
            &:not(.hascourseimage) {
                .teachersimages-collapse {
                    left: 60px !important;
                }
                .without-progress {
                    .teachersimages-collapse {
                        top: 22px !important;
                        left: 60px !important;
                    }
                }
            }
        }
    }
}
@media (max-width: 590px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .teachersimages-collapse {
                    .content-collapse {
                        .teachersimagescontainer:nth-last-child(2) {
                            display: none;
                        }
                        .teachersimagescontainer-text {
                            display: none;
                        }
                        .teachersimagescontainer-icon {
                            display: block;
                            .icon {
                                font-size: 24px;
                                width: 24px;
                                height: 24px;
                                margin-right: 0;
                            }
                        }
                    }
                }
            }
        }
    }
}
@media (max-width: 540px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .teachersimages-collapse {
                    .content-collapse {
                        .teachersimagescontainer:nth-last-child(3) {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}
@media (max-width: 490px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .teachersimages-collapse {
                    .content-collapse {
                        .teachersimagescontainer:nth-last-child(4) {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}
@media (max-width: 440px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .teachersimages-collapse {
                    .content-collapse {
                        .teachersimagescontainer:nth-last-child(5) {
                            display: none;
                        }
                    }
                }
            }
        }
    }
}
@media (max-width: 400px) {
    body.path-course.theme-fresk,
    body.path-question.theme-fresk,
    body.path-grade.theme-fresk,
    body.path-mod.theme-fresk {
        #page {
            .courseformatheader {
                .teachersimages-collapse {
                    .content-collapse {
                        .teachersimagescontainer:nth-last-child(6) {
                            display: none;
                        }
                    }
                }
            }
            .courseformatheader.forcollapse {
                padding: 0 10px 0 55px;
            }
        }
    }
}

.activity {
    list-style: none;
    padding-top: map-get($spacers, 1);
    margin-top: map-get($spacers, 1);
    border-top: none !important;
    .editing &,
    .section &:first-child {
        padding-top: 0;
        margin-top: 0;
        border-top: none;
    }
}

@media (max-width: 500px) {
    body.format-fresk {
        [data-for="cmlist"] {
            .activity{
                display: flex;
                flex-direction: column;
                .activityimage-container{
                    width: 100% !important;
                    .activityimage{
                        border-radius: 8px 8px 0 0 !important;
                    }
                }
                .noimage{
                    overflow-x: auto;
                }
            }
        }
        .noimage{
            .activity-item{
                .activity-grid.d-flex{
                    display: flex !important;
                    flex-direction: column !important;
                }
            }
        }
    }
}

@media (max-width: 850px) and (min-width: 501px) {
    body.format-fresk {
        [data-for="cmlist"] {
            .activityimage-container{
                max-width: 30%;
            }
            .noimage{
                max-width: 70%;
                overflow-x: auto;
            }
        }
    }
}

/* END: not only in a course: grades, badges related with course...*/

/* Fixing broken grid for subsections from 4.5.3 upwards */
#page-course-view-section-topics,
#page-course-view-section-fresk,
#page-course-view-section-weeks {
    .activity {
        padding-top: .375rem;
    }
    .activity-item {
        border-radius: 8px;
        box-shadow: 0 0 8px rgb(0 0 0 / .1);
    }
    .modtype_subsection {
        &>.activity-item {
            box-shadow: none;
            border: none;
        }
        .course-section-header {
            a[data-for="sectiontoggler"] {
                margin-left: 17px;
            }
            .sectionname>a {
                margin-left: -6px;
            }
        }
    }
    &.editing {
        .activity {
            .divider {
                padding-bottom: .375rem;
            }
        }
        .add-content i {
            position: relative;
            top: -1px;
            left: -1px;
        }
        .section-modchooser i {
            position: relative;
            top: -2px;
        }
    }
}

body.path-course.path-course-view.editing {
    .section-modchooser.section-modchooser-link.btn.add-content div:has(i.icon) {
        display: flex !important;
        align-items: center !important;
        i.icon {
            margin-right: 3px;
        }
    }
}

/* Overriding section shadow to none */
body.path-course.theme-fresk #page #region-main .course-content {
    .topics .section,
    .weeks .section,
    .fresk .section {
        box-shadow: none;
    }
}

body.path-course.theme-fresk.single-section-page #page #region-main .course-content {
    .subsection.modtype_subsection {
        .section.course-section {
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.06) !important;
        }
    }
}

body.theme-fresk {
    a.btn.btn-icon {
        >.collapsed-icon {
            .dir-rtl-hide {
                display: flex;
                align-items: center;
            }
        }
    }
}
[id^="page-course-view-"] .modchooser.modal-dialog {
    .modal-body {
        .modchoosercontent .optionscontainer .option {
            border: 1px solid #dddedf;
        }
    }
}
