:host {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    text-align: center;
    .farris-image-cropper{
        width: 100%;
        position: relative;
        .farris-source-image{
            max-width: 100%;
            max-height: 100%;
            transform-origin: center;
        }
    }
    .farris-image-overlay {
        position: absolute;
        pointer-events: none;
        touch-action: none;
        outline: white solid 100vw;
        top: 0;
        left: 0;
    }

    .farris-image-cropper-wrapper {
        position: absolute;
        display: flex;
        color: #53535C;
        background: transparent;
        outline: rgba(0, 0, 0, 0.3) solid 100vw;
        outline: var(--cropper-outline-color, rgba(0, 0, 0, 0.3)) solid 100vw;
        touch-action: none;
        @media (orientation: portrait) {
            outline-width: 100vh;
        }
        &:after {
            position: absolute;
            content: '';
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            pointer-events: none;
            border: dashed 1px;
            opacity: .75;
            color: inherit;
            z-index: 1;
        }
        .farris-image-cropper-move {
            width: 100%;
            cursor: move;
            border: 1px solid #388fff;
        }
        &:focus {
            .farris-image-cropper-move {
                border-color: dodgerblue;
                border-width: 2px;
            }
        }
        .farris-image-cropper-resize {
            position: absolute;
            display: inline-block;
            line-height: 6px;
            padding: 8px;
            opacity: .85;
            z-index: 1;

            .farris-image-cropper-square {
                display: inline-block;
                background: #388fff;
                width: 6px;
                height: 6px;
                border: 1px solid #59a1ff;
                box-sizing: content-box;
            }

            &.topleft {
                top: -12px;
                left: -12px;
                cursor: nwse-resize;
            }

            &.top {
                top: -12px;
                left: calc(50% - 12px);
                cursor: ns-resize;
            }

            &.topright {
                top: -12px;
                right: -12px;
                cursor: nesw-resize;
            }

            &.right {
                top: calc(50% - 12px);
                right: -12px;
                cursor: ew-resize;
            }

            &.bottomright {
                bottom: -12px;
                right: -12px;
                cursor: nwse-resize;
            }

            &.bottom {
                bottom: -12px;
                left: calc(50% - 12px);
                cursor: ns-resize;
            }

            &.bottomleft {
                bottom: -12px;
                left: -12px;
                cursor: nesw-resize;
            }

            &.left {
                top: calc(50% - 12px);
                left: -12px;
                cursor: ew-resize;
            }

        }

        .farris-image-cropper-resize-bar {
            position: absolute;
            z-index: 1;

            &.top {
                top: -11px;
                left: 11px;
                width: calc(100% - 22px);
                height: 22px;
                cursor: ns-resize;
            }

            &.right {
                top: 11px;
                right: -11px;
                height: calc(100% - 22px);
                width: 22px;
                cursor: ew-resize;
            }

            &.bottom {
                bottom: -11px;
                left: 11px;
                width: calc(100% - 22px);
                height: 22px;
                cursor: ns-resize;
            }

            &.left {
                top: 11px;
                left: -11px;
                height: calc(100% - 22px);
                width: 22px;
                cursor: ew-resize;
            }
        }

        &.farris-image-cropper-rounded {
            outline-color: transparent;

            &:after {
                border-radius: 100%;
                box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.3);
                box-shadow: 0 0 0 100vw (var(--cropper-outline-color, rgba(0, 0, 0, 0.3)));

                @media (orientation: portrait) {
                    box-shadow: 0 0 0 100vh rgba(0, 0, 0, 0.3);
                    box-shadow: 0 0 0 100vh (var(--cropper-outline-color, rgba(0, 0, 0, 0.3)));
                }
            }

            .farris-image-cropper-move {
                border-radius: 100%;
            }
        }
    }

    &.farris-image-cropper-disabled {
        .farris-image-cropper-wrapper {
            .farris-image-cropper-resize, .farris-image-cropper-resize-bar, .farris-image-cropper-move {
                display: none;
            }
        }
    }
    .farris-image-cropper-error{
        width: 100%;
        text-align: center;
        font-size: 14px;
        
    }
    .farris-image-cropper-loading{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        .farris-image-cropper-loading-spinner{
            width: 31px;
            height: 31px;
            margin: 0 auto;
            border: 2px solid #388fff;
            border-radius: 50%;
            border-left-color: transparent;
            border-right-color: transparent;
            -webkit-animation: cssload-spin 425ms infinite linear;
            position: absolute;
            top: calc(50% - 15px);
            left: calc(50% - 15px);
            animation: cssload-spin 425ms infinite linear;
        }
    }
}

@-webkit-keyframes cssload-spin {
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg)
    }
}

@keyframes cssload-spin {
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg)
    }
}
