@import '~@equitysim/react-uikit/dist/styles/styleguide';
@import '~@equitysim/react-uikit/dist/styles/global/utils/size';

$transition: all 0.3s ease-in-out;

%grid {
    display: grid;
    grid-template-columns: ($h-gap-size + $h-block-size * 2) 1fr;
    grid-gap: v-space(2);
}

.c-course-creation {
    &__name {
        @extend %modal-section-large;

        label {
            size: 1.2rem;
            line-height: v-space(2);
        }
    }

    &__name-input {
        input {
            font-size: 2.4rem;
            padding: 0;
            font-weight: $font-weight-bold;
        }
    }

    &__course-duration {
        @extend %modal-section-large;

        &-input {
            @extend %input;
            @extend %input--small;
            @extend %input__border;
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-gap: v-space(2);
            padding: 0 1.2rem; // To match input-text size small (not inlcuded in _forms.scss styleguid
        }
    }

    &__label {
        @extend %label;
        display: block;
        margin-bottom: 0;
    }

    &__section-input {
        @extend %modal-section-large;
        margin: v-space(4) 0;

        label {
            @extend %label;
            display: block;
        }

        &--side-label {
            @extend %grid;

            label {
                @extend %label;
                margin: 0;
                display: flex;
                align-items: center;
                height: 100%;
            }
        }
    }

    &__help-icon {
        height: auto;
        margin-left: v-space(1);
        width: v-space(2);
        vertical-align: -0.4rem;
        color: $grey-70;
    }

    &__button {
        height: v-space(8);
        box-shadow: none;
        border-radius: 0 !important;
        font-size: 1.4rem !important;
    }

    &__engagement {
        @extend %modal-section-large;
        width: 100%;
        margin-top: v-space(3);
    }

    &__engagement-row {
        margin-bottom: v-space(2);
    }

    &__engagement-input {
        width: $h-block-size;
        justify-self: center;
    }

    &__engagement-input-label {
        @extend %heading-xs;
        align-self: center;
        margin: 0;
    }

    &__checkbox {
        justify-self: end;
        align-self: center;
        height: v-space(2);
        width: v-space(2);
    }

    &__section-heading {
        @extend %modal-section-large;
        margin-top: v-space(2);

        h2 {
            @extend %heading-sm;
            color: $seafoam-140;
        }

        h3 {
            @extend %heading-xs;
        }

        p {
            @extend %body-text-xs;
            line-height: 1.25;
        }
    }

    &__accordion {
        border-bottom: 1px solid $grey-92;

        & > * {
            padding-bottom: v-space(2);
        }

        &--open {
            & > * {
                overflow: visible;
            }
        }

        &-content--open {
            overflow: visible;
        }
    }

    &__header-template {
        @extend %modal-section-large;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding-top: v-space(3);
        padding-bottom: v-space(3);

        svg {
            transition: $transition;
        }

        &:hover svg {
            transform: translateY(8px);
        }
    }

    &__heading {
        @extend %heading-sm;
        color: $seafoam-140;
        margin-bottom: 0;
        position: relative;

        &::after {
            content: attr(data-valid-symbol);
            position: absolute;
            left: -#{v-space(3)};
            color: $grey-80;
            font-weight: lighter;
            font-size: 1.6rem;
        }

        &--valid::after {
            color: $seafoam-140;
        }

        &--invalid::after {
            color: $danger-color;
        }
    }

    &__toggle {
        display: flex;
        float: right;
        width: 1.4rem;
        height: 1.4rem;
        color: $seafoam-140;
        transition: $transition;

        &--open {
            transform: rotate(180deg);
        }

        svg {
            height: v-space(1);
        }
    }

    &__navigation {
        @extend %modal-section-large;
        display: flex;
    }

    &__navigation-button {
        width: auto;
        min-height: auto;
        height: auto;

        color: $seafoam;
        text-transform: uppercase;

        padding: v-space(3) 0;

        i {
            max-width: v-space(2);
        }
    }

    &__back-icon {
        max-width: v-space(2);
        margin-right: v-space(1);
        transform: rotate(90deg);
    }

    &__next-icon {
        transform: rotate(-90deg);
        max-width: v-space(2);
        margin-left: v-space(1);
    }

    &__value {
        display: flex;
        align-items: center;
        height: $input-size-small-height;
        padding-left: calc(2rem + 0.1rem); // input padding + border width
    }

    &__total-value {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: v-space(5);
        font-weight: bolder;
    }

    &__fixed-value {
        align-self: start;
        height: 4rem;
        line-height: 4rem;

        &--static {
            display: block;
        }
    }

    &__start-date {
        position: relative;

        %date-label {
            position: absolute;
            top: -#{v-space(2.5)};
            left: 0;
        }

        &:before {
            @extend %date-label;
            content: 'Start';
        }
    }

    &__end-date {
        position: relative;

        &:before {
            @extend %date-label;
            content: 'End';
        }
    }
}
