body.theme-fresk.format-fresk.editing {
    #section-0 {
        .modtype_subsection {
            > .activity-item {
                ul {
                    .course-section.hidden {
                        background-color: #f8f9fa !important;

                        ul[data-for="cmlist"] {
                            background-color: #f8f9fa !important;
                        }
                    }
                }
            }
        }
    }
}

body.theme-fresk.format-fresk {
    #section-0 {
        .modtype_subsection {
            ul {
                ul[data-for="cmlist"] {
                    .modtype_pulse {
                        .activity-item {
                            .activity-grid {
                                display: block !important;

                                .activity-wrapper-badges {
                                    justify-content: end !important;
                                }

                                .pulse-box {
                                    > .alert {
                                        margin-top: 1rem !important;
                                        margin-bottom: 0 !important;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

body.theme-fresk.format-fresk {
    #section-0 {
        .modtype_subsection {
            width: 100%;

            > .activity-item {
                &.restricted {
                    background-color: lightgray;
                    font-size: 0.8rem !important;

                    .instancename {
                        pointer-events: none;
                    }
                }

                height: fit-content;
                padding: 0 !important;

                .section.course-section {
                    margin-bottom: 0;

                    .section-item {
                        padding: 0;
                    }
                }

                > .activity-grid.activity-basis {
                    display: none;
                }

                > ul {
                    width: 100%;

                    .course-section.hidden {
                        background-color: #f8f9fa !important;

                        ul[data-for="cmlist"] {
                            background-color: #f8f9fa !important;
                        }
                    }

                    .course-content-item-content {
                        @media (max-width: 400px) {
                            padding: 0 !important;
                        }
                    }

                    ul[data-for="cmlist"] {
                        display: flex !important;
                        gap: 10px;
                        flex-flow: row wrap;
                        justify-content: flex-start;

                        .modtype_label {
                            .activity-item {
                                .activity-grid {
                                    display: block;
                                }
                            }
                        }

                        > .activity {
                            .activity-grid {
                                width: 100%;
                                display: flex;
                                justify-content: space-between;
                                align-items: center;
                            }

                            .activity-item {
                                width: 100%;
                                overflow: visible !important;
                                @media (max-width: 410px) {
                                    width: 90%;
                                }

                                .subsection-header-activity {
                                    display: flex;
                                    align-items: center;
                                    .activity-icon {
                                        width: 24px !important;
                                        height: 24px !important;
                                        .activityicon {
                                            width: 24px !important;
                                            height: 24px !important;
                                        }
                                    }

                                    .activity-name-area {
                                        .activitytitle {
                                            .activityname {
                                                max-width: 160px;
                                                overflow: hidden;
                                                display: -webkit-box;
                                                -webkit-box-orient: vertical;
                                                -webkit-line-clamp: 2;
                                                line-height: 16px;
                                                a {
                                                    color: black;
                                                    font-weight: 500!important;
                                                    font-size: 0.8rem!important;
                                                    text-decoration: none;
                                                    &:hover {
                                                        color: $primary;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }

                                .activity-wrapper-badges {
                                    display: flex;
                                    align-items: center;

                                    .activity-groupmode-info {
                                        .groupmode-information {
                                            height: 24px;
                                            width: 24px;
                                            display: flex;
                                            align-items: center;
                                            padding: 0;
                                            justify-content: center;

                                            i {
                                                height: 16px;
                                                width: 16px;
                                                margin-right: 0 !important;
                                            }
                                        }
                                    }

                                    .activity-availability {
                                        background: transparent;
                                        font-size: 0;
                                        height: 24px;
                                        width: 24px;
                                        margin: 0;
                                        display: flex;
                                        align-items: center;
                                        padding: 0;
                                        justify-content: center;

                                        .icon {
                                            margin: 0 !important;
                                        }
                                    }

                                    .activity-badges {
                                        height: 24px;
                                        width: 24px;
                                        margin-block: 0 !important;
                                        display: flex !important;
                                        justify-content: center;

                                        .badge {
                                            background-color: transparent !important;

                                            img.icon {
                                                margin-right: 0 !important;
                                            }
                                        }
                                    }

                                    .activity-dates {
                                        height: 24px;
                                        width: 24px;
                                        display: flex;
                                        justify-content: center;
                                        align-items: center;
                                        margin: 0 !important;

                                        i {
                                            height: 16px;
                                            width: 16px;
                                            margin-right: 0 !important;
                                        }
                                    }

                                    .activity-visibility {
                                        height: 24px;
                                        width: 24px;
                                        display: flex;
                                        justify-content: center;
                                        align-items: center;

                                        i {
                                            height: 16px;
                                            width: 16px;
                                            margin-right: 0 !important;
                                        }
                                    }

                                    .activity-afterlink {
                                        height: 24px;
                                        width: 24px;
                                        display: flex;
                                        justify-content: center;
                                        align-items: center;
                                        margin: 0;
                                        padding: 0;
                                        border: none !important;

                                        i {
                                            height: 16px;
                                            width: 16px;
                                            margin-right: 0 !important;
                                        }
                                    }

                                    .activity-groupmode-info {
                                        margin: 0 !important;
                                        border: none !important;

                                        .groupmode-icon-info {
                                            display: none !important;
                                        }

                                        i {
                                            height: 16px;
                                            width: 16px;
                                            margin-right: 0 !important;
                                        }
                                    }

                                    .activity-completion {
                                        height: 24px;
                                        width: 24px;
                                        display: flex;
                                        justify-content: center;
                                        align-items: center;
                                        margin: 0 !important;

                                        > button {
                                            height: 16px;
                                            width: 16px;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            color: $primary !important;
                                            border-radius: 4px !important;
                                            min-height: 16px !important;
                                            background-color: transparent !important;
                                            border-color: transparent !important;
                                            box-shadow: none !important;

                                            &:hover,
                                            &:focus {
                                                background-color: $primary !important;
                                                color: white !important;
                                            }
                                        }

                                        > .dropdown-menu {
                                            border: 1px solid #d3d3d3 !important;
                                            margin-inline: auto !important;
                                            min-width: fit-content !important;
                                        }
                                    }

                                    .requirements-wrapper {
                                        width: 24px;
                                        height: 24px;
                                        display: flex;
                                        justify-content: center;
                                        align-items: center;

                                        [data-region="completionrequirements"] {
                                            .completion-dropdown {
                                                > button {
                                                    font-size: 0 !important;
                                                    height: 16px;
                                                    width: 16px;
                                                    display: flex;
                                                    align-items: center;
                                                    justify-content: center;
                                                    color: $primary !important;
                                                    border-radius: 4px !important;
                                                    min-height: 16px !important;
                                                    background-color: transparent !important;
                                                    border-color: transparent !important;
                                                    box-shadow: none !important;

                                                    > i {
                                                        display: none !important;
                                                    }

                                                    &:hover,
                                                    &:focus {
                                                        background-color: $primary !important;
                                                        color: white !important;
                                                    }

                                                    &::after {
                                                        margin: 0 !important;
                                                    }
                                                }

                                                > .dropdown-menu {
                                                    border: 1px solid #d3d3d3 !important;
                                                    margin-inline: auto !important;
                                                    min-width: fit-content !important;

                                                    .completion-dialog {
                                                        font-size: 0.8rem !important;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

@media (max-width: 575px) {
    body.theme-fresk #section-0 .modtype_subsection .fresk-cmlist .section-fresk .activity-item .activity-grid .activity-wrapper-badges button {
        margin-top: 0 !important;
    }
    .activity-item .activity-wrapper-badges .activity-groupmode-info {
        width: auto !important;
        padding-top: 0 !important;
    }
    .activity-item .activity-wrapper-badges .activity-dates {
        margin-top: 0 !important;
    }
}

body.theme-fresk.format-fresk {
    #section-0 {
        .modtype_subsection {
            > .activity-item {
                > ul {
                    .course-section {
                        ul[data-for="cmlist"] {
                            > .activity {
                                margin-bottom: 0 !important;
                                width: 245px !important;
                                &.modtype_label {
                                    width: 100% !important;
                                }
                                &:not(.modtype_label) {
                                    .activity-item {
                                        width: 245px !important;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

body.theme-fresk.format-fresk {
    .modtype_subsection .activity-item li.section.course-section.fresk-subsection-banner {
        > .section-item {
            padding: 0;
        }

        .course-section-header {
            flex-direction: column;
            position: relative;
            padding: 0;
        }

        .subsection-banner {
            position: relative;
            width: 100%;
            overflow: hidden;
            border-radius: 8px;
        }

        .subsection-banner-img {
            position: absolute;
            inset: 0;
            background-position: center;
            background-size: cover;
            background-repeat: no-repeat;
        }

        .subsection-banner-overlay {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
        }

        .subsection-banner-content {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 12px;
            min-height: 110px;
            padding: 12px 16px 16px;
        }

        .subsection-banner-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;

            .subsection-banner-title {
                color: white !important;
                font-weight: bold;
                font-size: 15px;

                .subsection-banner-title-text {
                    color: white;
                }
            }
        }

        .course-section-header .btn-icon.icons-collapse-expand.subsection-banner-toggler {
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 8px;
            width: 32px;
            height: 32px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: $graytext;

            &:hover,
            &:focus {
                background-color: white;
                color: $primary;
            }
        }

        .course-section-header .sectionbadges {
            position: absolute;
            top: 12px;
            right: 56px;
            z-index: 2;
        }

        .subsection-banner-progress {
            display: flex;
            align-items: center;
            gap: 10px;

            .fresk-progress-bar {
                background-color: white;
                border-radius: 10px;
                width: 100%;
                height: 5px;

                .progress-bar {
                    border-radius: 9px;
                    height: 5px;
                }
            }

            .progress-percent {
                color: white;
                font-size: 13px;
                font-weight: lighter;
                margin: 0 0 1px;
                white-space: nowrap;
            }
        }

        .content.course-content-item-content {
            padding: 0.75rem;
        }

        &.fresk-subsection-textcolor {
            .subsection-banner-content .subsection-banner-title {
                color: var(--fresk-subsection-textcolor) !important;
            }

            .subsection-banner-content .subsection-banner-title .subsection-banner-title-text {
                color: var(--fresk-subsection-textcolor);
            }

            .subsection-banner-content .subsection-banner-progress .progress-percent {
                color: var(--fresk-subsection-textcolor) !important;
            }
        }
    }
}
body.theme-fresk.format-fresk {
    .modtype_subsection .activity-item li.section.course-section.fresk-subsection-progress {
        > .section-item > .course-section-header {
            flex-wrap: wrap;
        }

        .subsection-progress {
            order: 99;
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;

            .fresk-progress-bar {
                background-color: rgba(0, 0, 0, 0.1);
                border-radius: 10px;
                width: 100%;
                height: 5px;

                .progress-bar {
                    border-radius: 9px;
                    height: 5px;
                }
            }

            .progress-percent {
                color: $graytext;
                font-size: 13px;
                font-weight: lighter;
                margin: 0;
                white-space: nowrap;
            }
        }
    }
}
