mor-upload{
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    box-sizing: border-box;
    vertical-align: middle;
    -webkit-user-select: none;
    background: @colorWhite;

    .setup-form();

    &[type='button'] {
        -webkit-appearance: none;
    }

    .fileinput{
        display: none;
    }

    // &.type-upload-box{
    //     height: @fontSize*10;
    // }

    .drag-note{
        position: absolute;
        left: 0;
        top: 0;
        background: @colorWhite;
        width: 100%;
        height: 100%;
        z-index: 3;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;

        &.show{
            opacity: 1;
        }

        p{
            width: 100%;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            text-align: center;
            color: #666;
            margin: 0;
            font-size: @fontSize*0.75;

            .mo-icon{
                font-size: @fontSize;
                vertical-align: -1px;
            }
        }
    }

    .inside-name,
    .ismax-note,
    .upload-box-note{
        font-size: @fontSize*0.75;
        color: @colorFormTextNote;
        line-height: 1.2em;
    }

    .form-body > .inside-name{
        margin-top: @fontSize/2;
    }

    .upload-box-note{
        margin-top: @fontSize*0.25;
        color: @colorFormTextNote;
    }

    .upload-wrap{
        border: 1px @colorFormBorder solid;
        border-radius: @borderRadius;
        padding: @fontSize*0.1875 @fontSize*0.3125;
        position: relative;
        overflow: hidden;
        font-size: 0;
        background: @colorFormBackground;
        box-sizing: border-box;
    }

    .upload-box{
        height: @fontSize*10;
    }

    .upload-input{
        .filelist{
            position: relative;
            font-size: 0;
            display: inline-block;
            // width: 80%;
            // left: 20%;
            width: 100%;
            left: 0;
            top: 0;
        }
    }

    .filelist.type-button,
    .filelist.type-box{
        margin-top: @fontSize*0.5;
        width: 100%;

        .file-item{
            color: @colorFormItemColor;
            background: @colorWhite;
            text-decoration: none;
            padding: 0.3em 0.5em;
            font-size: @fontSize*0.8125;
            position: relative;
            display: block;
            cursor: default;
            border-radius: @borderRadius;
            margin: 1px 0;

            .progress{
                border-radius: @borderRadius 0 0 @borderRadius;
            }

            .upload-operate{
                position: absolute;
                top: 0;
                right: @fontSize * 0.8125 * 0.5;
                height: 100%;
                display: flex;
                align-items: center;
            }

            i.mo-icon,
            .mo-loader{
                font-size: @fontSize*0.75;
                cursor: default;
                z-index: 2;
                color: @colorFormItemColor;
                display: none;

                &:hover{
                    cursor: pointer;
                    color: @colorFormItemColorHover;
                }
            }

            .preview-file{
                display: none;
            }

            &:hover{
                i.mo-icon,
                .mo-loader{
                    display: block;
                }
            }

            &.done{
                i.mo-icon.uploading,
                i.mo-icon.reupload{
                    display: none;
                }

                &.current{
                    background: @colorFromItemBackgroundCurrent;

                    i.remove,
                    i.openfile{
                        display: block;
                    }
                }

                i.remove:hover,
                i.openfile:hover{
                    display: block;
                }
            }

            &.fail{
                i.mo-icon.uploading{
                    display: none;
                }

                i.mo-icon.reupload,
                i.mo-icon.remove{
                    display: block;
                }
            }

            &.thumbnail{
                background: @colorWhite !important;
                padding: 0;
                margin: @fontSize*0.25;
                height: 100px;
                width: 100px;
                display: flex;
                justify-content: center;
                align-items: center;
                border: 1px @colorImageBorder solid;
                overflow: hidden;

                img {
                    max-width: 100%;
                    max-height: 100%;
                    border: none !important;
                    padding: 0;
                    margin-bottom: 0;
                }

                .upload-operate{
                    width: 100%;
                    height: 100%;
                    left: 0;
                    top: 0;
                    display: none;
                    background: rgba(0, 0, 0, 0.7);
                    justify-content: center;

                    > .mo-icon{
                        font-size: @fontSize*1.25;
                        color: @colorFormItemColor;
                    }
                }

                &:hover .upload-operate{
                    display: flex;
                }

                .preview-file{
                    width: 100%;
                    height: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;

                    > .mo-icon-file-o{
                        font-size: @fontSize*2;
                        display: block;
                        color: @colorFormItemColor !important;
                    }
                }

                &.fail{
                    .preview-file{
                        background: lighten(@colorDanger, 37%);
                    }
                }
            }
        }

        &.thumbnail-list{
            display: flex;
            flex-flow: row wrap;
        }
    }

    .upload-input,
    .upload-box,
    .filelist{
        .file-item,
        .upload-box-preview{
            &.done:hover{
                color: @colorBlack;
                cursor: pointer;
                background: @colorFromItemBackgroundHover;
            }

            .progress{
                background: @colorSuccess;
                opacity: 0.2;
                width: 0%;
                height: 100%;
                position: absolute;
                top: 0;
                left: 0;
                border-radius: 100em 0 0 100em;
                transition: width 0.3s;

                &.wait{
                    width: 10% !important;
                }

                &.verification{
                    width: 20% !important;
                }

                &.uploading{
                    width: 30%;
                }

                &.uploaded{
                    width: 100% !important;
                }
            }

            i.mo-icon,
            .mo-loader{
                display: none;
            }

            &,
            .upload-operate,
            .upload-failed-operate{
                i.mo-icon{
                    margin: 0 0.2em;
                }

                i.mo-icon.remove{
                    &:hover{
                        color: @colorDanger;
                        cursor: pointer !important;
                    }
                }

                i.mo-icon.reupload{
                    &:hover{
                        color: @colorSuccess;
                        cursor: pointer !important;
                    }
                }
            }

            &.uploading{
                i.mo-icon.uploading{
                    display: block;

                    &:hover{
                        cursor: default;
                        color: @colorFormItemColor;
                    }
                }
            }

            &.done{
                cursor: pointer;

                .progress{
                    width: 0%;
                    transition: width 0s;
                }
            }

            &.fail{
                background: lighten(@colorDanger, 37%);

                > .progress{
                    width: 0%;
                    transition: width 0s;
                }

                &:hover{
                    background: lighten(@colorDanger, 37%);
                }
            }
        }
    }

    .upload-input{
        min-height: @formHeight;

        .upload-file,
        .file-item{
            color: @colorFormItemColor;
            background-color: darken(@colorFromItemBackground, 5%);
            display: inline-block;
            padding: 0.4em 0.7em;
            border-radius: 100em;
            margin: @fontSize*0.1875 @fontSize*0.125;
            vertical-align: top;
            max-width: 100%;
            line-height: calc(42px - 6px - 6px - 2px - 0.8em);
            height: calc(42px - 6px - 6px - 2px);
            text-decoration: none;
            position: relative;
            cursor: default;
            font-size: @fontSize*0.8125;
            overflow: hidden;
            box-sizing: border-box;

            span{
                max-width: 100%;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
                display: inline-block;
                // padding-right: 0.2em;
                vertical-align: middle;
                position: relative;
                z-index: 1;
                box-sizing: border-box;
            }

            &:hover{
                cursor: pointer;
                text-decoration: none;
                color: @colorFormItemColorHover;
                background: @colorFromItemBackgroundHover;

                i.mo-icon{
                    cursor: pointer;
                    color: @colorFormItemColorHover;
                }
            }
        }

        .upload-file{
            .mo-icon{
                vertical-align: middle;
            }
        }

        .file-item{
            padding-right: 2em;

            &:hover{
                cursor: default;
                color: @colorFormItemColor;

                .mo-icon{
                    color: @colorFormItemColor;
                }
            }

            i.mo-icon,
            .mo-loader{
                font-size: @fontSize*0.75;
                position: absolute;
                right: 0.7em;
                top: 50%;
                transform: translateY(-50%);
                cursor: default;
                z-index: 2;
            }

            &.done{
                &:hover{
                    color: @colorFormPlaceholderHover;

                    .mo-icon{
                        color: @colorFormPlaceholderHover;
                    }
                }

                i.mo-icon.uploading,
                i.mo-icon.reupload{
                    display: none;
                }

                i.mo-icon.remove{
                    display: block;
                }
            }

            &.fail{
                > span{
                    padding-right: 1.2em;
                }

                i.mo-icon.uploading{
                    display: none;
                }

                i.mo-icon.reupload{
                    display: block;
                    right: 2em;
                }

                > i.mo-icon.remove{
                    display: block;
                }
            }
        }
    }

    .upload-box{
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0;

        .upload-box-con{
            flex-direction: row;
            justify-content: center;
            display: flex;
            position: relative;
            height: 100%;

            .upload-file{
                color: @colorFormItemColor;
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                flex-direction: column;

                .mo-icon{
                    font-size: @fontSize*2;
                    display: block;
                    line-height: 1.2em;
                }

                .mo-icon-upload{
                    text-align: center;
                }

                > span{
                    font-size: @fontSize*0.875;
                    display: block;
                }

                &:hover{
                    cursor: pointer;
                    color: @colorFormItemColorHover;
                }
            }
        }

        .upload-box-preview{
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;

            .upload-box-preview-img{
                max-width: 100%;
                max-height: 100%;
                margin: 0;
                padding: 0;
                border: none !important;
            }

            .upload-box-preview-file{
                text-align: center;
                display: flex;
                flex-direction: column;

                span{
                    font-size: @fontSize*0.75;
                    color: @colorFormItemColor;
                }

                .mo-icon-file-o{
                    display: block;
                }

                .upload-failed-operate{
                    display: block;
                    padding-top: @fontSize*0.5;

                    i.mo-icon,
                    .mo-loader{
                        font-size: @fontSize;
                        cursor: default;
                        z-index: 2;
                        display: none;
                        margin: 0 0.3em;
                    }
                }
            }

            .mo-icon{
                font-size: @fontSize*2;
                color: @colorFormItemColor;
            }

            &.fail{
                span,
                .mo-icon{
                    color: @colorDanger;
                }

                i.mo-icon.reupload,
                i.mo-icon.remove{
                    display: inline-block;
                    color: @colorFormItemColor;
                }
            }
        }

        .upload-box-operate{
            display: none;
            background: rgba(0, 0, 0, 0.7);
            height: 100%;
            width: 100%;
            left: 0;
            top: 0;
            position: absolute;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            align-content: center;

            .ismax-note{
                width: 100%;
                display: block;
                color: @colorWhite;
            }

            > a{
                text-decoration: none;
                cursor: pointer;
                color: @colorComponentItemFont;
                display: inline-block;
                margin: 0 0.5em;
                font-size: @fontSize*1.75;

                .mo-icon{
                    font-size: @fontSize*1.75;
                }

                &:hover{
                    color: @colorWhite;
                }

                &.del:hover{
                    color: @colorDanger;
                }
            }
        }

        &:hover{
            .upload-box-operate{
                display: flex;
            }
        }
    }

    .upload-button{

    }

    &:hover > .upload-wrap{
        border-color: @colorFormBorderHover;
    }

    &.focus > .upload-wrap{
        border-color: @colorFormBorderFocus;
    }

    // mor-img{
    //     width: 100%;
    //     height: 100%;
    //     position: relative;

    //     img{
    //         max-width: 100%;
    //         max-height: 100%;
    //         position: absolute;
    //         left: 50%;
    //         top: 50%;
    //         transform: translate(-50%, -50%);
    //     }
    // }

    &.st-normal{}

    &.st-disabled,
    &.st-readonly{
        .upload-wrap{
            border-color: @colorFormBorderDisable;
            -webkit-user-select: none;
            cursor: not-allowed !important;
            background-color: @colorFormBackgroundDisable;

            &:hover{
                border-color: @colorFormBorderDisable;
            }
        }

        .upload-box-preview:hover{
            border-color: @colorFormBorderDisable !important;
            background-color: @colorFormBackgroundDisable !important;
            color: @colorFormItemColorDisable !important;
            cursor: not-allowed !important;
        }

        .file-item{
            cursor: pointer !important;
            background-color: @colorFromItemBackgroundDisable !important;
            padding-right: 1em;

            .mo-icon{
                display: none !important;
            }

            span{
                padding-right: 0;
            }

            &:hover{
                color: @colorFormItemColorDisable !important;
                background-color: @colorFromItemBackgroundDisable !important;
            }
        }

        .upload-file{
            color: @colorFormItemColor !important;
            cursor: not-allowed !important;
        }
    }

    // default statement
    &{
        .st-normal;
    }
}
