@import './variables.scss';
@import './animation.scss';

$module: #{$prefix}-sidesheet;

.#{$module} {
    @include font-size-regular;
    position: fixed;
    margin: $spacing-sideSheet-margin;
    top: 0;
    left: 0;
    height: 100%;

    &-inner:focus,
    &-content:focus {
        outline: none;
    }

    &-inner-wrap {
        position: absolute;
    }

    &-left,
    &-right {
        top: 0;
        width: 0%;
        height: 100%;

        .#{$module}-inner-wrap {
            height: 100%;
        }

        &.#{$module} {
            width: 100%;
        }
    }

    &-right {
        right: 0;

        .#{$module}-inner-wrap {
            right: 0;
        }
    }

    &-top,
    &-bottom {
        left: 0;
        width: 100%;
        height: 0%;

        .#{$module}-inner-wrap {
            width: 100%;
        }

        &.#{$module} {
            height: 100%;
        }
    }

    &-top {
        top: 0;
    }

    &-bottom {
        bottom: 0;

        .#{$module}-inner-wrap {
            bottom: 0;
        }
    }

    &-title {
        flex: 1 0 auto;
        margin: $spacing-sideSheet_title-margin;
        @include font-size-header-5;
        font-weight: $font-sideSheet_title-fontWeight;
        color: $color-sideSheet_main-text;
        text-align: left;
    }

    &-inner {
        // position: relative;
        z-index: 1;
        overflow: auto;
        background-color: $color-sideSheet-bg;
        // background-clip: padding-box;
        border: 0;
        transition: $transition_duration-sideSheet_inner $transition_function-sideSheet_inner
            $transition_delay-sideSheet_inner;
    }

    &-header {
        display: flex;
        align-items: flex-start;
        padding: $spacing-sideSheet_header-padding;
        padding-bottom: $spacing-sideSheet_header-paddingBottom;
    }

    &-body {
        padding: $spacing-sideSheet_body-paddingY $spacing-sideSheet_body-paddingX;
        flex: 1;
    }

    &-content {
        height: 100%;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        overflow: hidden;
        // padding: 0 $spacing-loose;
    }

    &-mask {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: $color-sideSheet_mask-bg;
        opacity: 1;
        transition: opacity $transition_duration-sideSheet_mask-bg $transition_function-sideSheet_mask-bg
            $transition_delay-sideSheet_mask-bg;

        &-hidden {
            opacity: 0;
            display: none;
        }
    }

    &-footer {
        padding: $spacing-sideSheet_footer-padding;
    }
}

.#{$module}-fixed {
    .#{$module}-inner {
        box-shadow: var(--semi-shadow-elevated);
    }

    &.#{$module}-left {
        left: 0;
        // width will inject by js
        .#{$module}-inner {
            left: 0;
        }
    }

    &.#{$module}-right {
        left: auto;
        // width will inject by js
        .#{$module}-inner {
            right: 0;
        }
    }

    &.#{$module}-top,
    &.#{$module}-bottom {
        height: auto;
    }

    &.#{$module}-bottom {
        top: auto;

        .#{$module}-inner {
            bottom: 0;
        }
    }
}

.#{$module}.#{$module}-popup {
    position: absolute;
}
.#{$module}-hidden {
    display: none;
}

@import './rtl.scss';
