@import "~theme/globals";

:host {
    --horizontal-margin: 10px;
    --vertical-margin: 10px;

    ion-card {
        margin: var(--vertical-margin) var(--horizontal-margin);
    }

    ion-item {
        --padding-start: 12px;
    }

    ion-item.core-module-main-item {
        --min-height: 52px;

        .core-module-title .item-heading ion-icon {
            @include margin-horizontal(8px, null);
            vertical-align: middle;
        }

        .core-module-buttons,
        .buttons.core-module-buttons {
            margin: 0;
        }

        .core-module-buttons,
        .core-module-buttons-more {
            display: flex;
            flex-flow: row;
            align-items: center;
            z-index: 1;
            justify-content: space-around;
            align-content: center;
        }

        .core-module-buttons core-course-module-completion,
        .core-module-buttons-more button {
            cursor: pointer;
            pointer-events: auto;
        }

        .core-module-buttons core-course-module-completion {
            text-align: center;
        }

        .core-module-additional-info {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
        }
    }

    .core-course-module-info {
        .core-module-dates-availabilityinfo {
            background: var(--light);
            border-radius: var(--small-radius);
            padding: 8px;
        }

        .core-module-dates + .core-module-availabilityinfo {
            border-top: 1px solid var(--stroke);
            padding-top: 8px;
        }

        .core-module-availabilityinfo {
            font-size: 90%;
            ::ng-deep  ul {
                margin-top: 0.5em;
            }
        }
    }

    .core-module-loading {
        width: 100%;
        text-align: center;
        padding-top: 10px;
        clear: both;
    }

    .core-module-main-item + .core-course-module-info ion-label {
        margin-top: 0px;
    }

    .core-module-availabilityinfo  ion-icon,
    .core-module-dates ion-icon {
        @include margin-horizontal(null, 8px);
    }

    .core-course-module-info ::ng-deep core-course-module-completion .core-module-automatic-completion-conditions .completioninfo.completion_complete {
        display: none;
    }

    .core-course-last-module-viewed {
        padding: 8px 12px;
        color: var(--subdued-text-color);
        border-top: 1px solid var(--stroke);

        ion-icon {
            margin-right: 4px;
        }
    }

    &.indented ion-card {
        border: none;
        border-radius: 0;
        margin-inline-start: calc(var(--horizontal-margin) + 1rem);
    }

    &.indented + ::ng-deep core-course-module.indented ion-card {
        border-top: 1px solid var(--border-color);
    }

}
