// @import '../_utils.scss';
// @import './progress.scss';
// @import './icon.scss';
$base-list-height: if($--size-height-base <= 26, 1, 0.5);

.#{$upload-prefix-cls} {
  form,
  input[type="file"] {
    display: none;
  }

  &-click-wrapper {
    display: inline-block;
  }

  &-list {
    margin-top: $upload-list-margin-top;

    &-file {
      color: $text-color;
      border-radius: $border-radius-small;
      transition: background-color $transition-time $ease-in-out;
      overflow: hidden;
      position: relative;

      @include theme-font-color($__upload-list-file_font-color);

      @if $--size-switch == yes {
        @include computed-line-height();
        font-size:  $--size-font-size-base; 
        padding: ($--size-height-base - $--size-line-height-base) / 2 - $base-list-height $--size-offset-base;
      }@else {
        padding: $upload-list-file-padding; 
      }

      // & > span{
      span.li-body-span {
        cursor: pointer;
        transition: color $transition-time $ease-in-out;

        > i {
          margin-right: $upload-list-file-span-i-margin-right;
        }

        .fail {
          color: #f14c5d;

          @include theme-color($__upload-list-file-fail_font-color);
        }

        i {
          display: inline-block;
          width: $font-size-small;
          height: $font-size-small;
          color: $text-color;
          text-align: center;

          @include theme-font-color($__upload-list-file-icon_font-color);
        }
      }

      &:hover {
        // background: $input-disabled-bg;
        background: $upload-list-file-background;

        @include theme-background-color($__upload-list-file_hover_background-color);

        & > span {
          color: $primary-color;

          @include theme-font-color($__upload-list-file_hover_font-color);

          i {
            color: $text-color;

            @include theme-font-color($__upload-list-file-icon_hover_font-color);
          }
        }
        .#{$upload-prefix-cls}-list-remove {
          opacity: 1;
        }
      }
    }

    &-file-text-nowrap {
      .li-body {
        display: flex;
        align-items: center;

        span.li-body-span {
          display: flex;
          flex: 1;
          overflow: hidden;
          align-items: center;

          i {
            width: auto;
            height: auto;
          }
        }

        span.file-name {
          // flex: 1;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }

    &-remove {
      // opacity: 0;
      font-size: $upload-list-remove-font-size;
      cursor: pointer;
      float: right;
      margin-right: $upload-list-remove-margin-right;
      color: $legend-color;
      transition: all $transition-time ease;
      padding-left: 10px;

      @include theme-font-color($__upload-list-remove_font-color);

      &:hover {
        color: $upload-list-remove-hover-color;

        @include theme-font-color($__upload-list-remove_hover_font-color);
      }
    }

    .remove-fail {
      @include theme-color($__upload-list-file-fail_font-color);
    }
  }

  &-drag {
    background: $upload-drag-background;
    border: $upload-drag-border;
    border-radius: $border-radius-small;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color $transition-time ease;

    @include theme-background-color($__upload-drag_background-color);
    @include theme-border-color($__upload-drag_border-color);
    @include theme-font-color($__upload-drag_font-color);

    &:hover {
      border: 1px dashed $primary-color;

      @include theme-border-color($__upload-drag_hover_border-color);
    }

    .#{$css-prefix}icon {
      @include theme-font-color($__upload-drag-icon_font-color);
    }
  }

  &-dragOver {
    border: 2px dashed $primary-color;

    @include theme-border($__upload-dragover_border);
  }

  &-self {
    > .#{$upload-prefix-cls} {
      display: inline-block;
    }
  }
  .#{$uploaded-prefix-cls}-wrap {
      display: block;
      margin-top: $upload-self-uploaded-wrap-margin-top;
      border: $upload-self-uploaded-wrap-border;
      border-radius: $upload-self-uploaded-wrap-border-radius;
      text-align: $upload-self-uploaded-wrap-text-align;
      color: $upload-self-uploaded-wrap-color;
      font-weight: $upload-self-uploaded-wrap-font-weight;

      @include theme-border-color($__uploaded_self_border-color);
      @include theme-font-color($__uploaded_self_font-color);
      @if $--size-switch == yes {
        font-size:  $--size-font-size-base;
        line-height:$--size-height-base;
      }@else {
        font-size: $upload-self-uploaded-wrap-font-size;
        line-height: $upload-self-uploaded-wrap-line-height;
      }
      .#{$uploaded-prefix-cls}-title {
        padding-left: $upload-self-uploaded-title-padding-left;
        background: $upload-self-uploaded-title-background;
        @include theme-background-color($__uploaded-title_self_background-color);
      }
      .#{$uploaded-prefix-cls}-close {
        font-size: $upload-self-uploaded-close-font-size;
        cursor: pointer;
        float: right;
        margin-right: $upload-self-uploaded-close-margin-right;
        @include theme-font-color($__uploaded-close_self_font-color);
      }
      .#{$upload-prefix-cls}-list {
        margin-top: $upload-self-uploaded-list-margin-top;
      }
  }
  &[disabled] {
    .#{$upload-prefix-cls}-drag {
      @include theme-font-color($__upload-drag_disabled_font-color);

      &:hover {
        @include theme-border-color($__upload-drag_disabled_border-color);
      }
    }
    .#{$upload-prefix-cls}-dragOver {
      @include theme-border-color($__upload-dragover_disabled_border-color);
    }
  }
}
