// @import "./variables.scss";


@mixin upload-list-item() {
  width: $upload-files-picture-card-item-width;
  height: $upload-files-picture-card-item-height;
  border: $upload-files-picture-card-item-border;
  border-radius: $upload-files-picture-card-item-border-radius;
  background-color: $upload-files-picture-card-item-bg-color;
}

.#{$namespace}upload {
  &.#{$namespace}upload-disabled {
    .#{$namespace}upload-trigger {
      cursor: not-allowed;
    }
  }
  .#{$namespace}upload-trigger {
    display: inline-block;
    text-align: center;
    cursor: pointer;
    &-picture-card {
      @include upload-list-item();
      display: flex;
      align-items: center;
      justify-content: center;
      border-style: dashed;
      &:hover {
        border-color: $upload-files-picture-card-trigger-hover-border-color;
      }
    }

    &-drag {
      background-color: $upload-files-drag-bg-color;
      box-sizing: border-box;
      width: $upload-files-drag-width;
      height: $upload-files-drag-height;
      text-align: center;
      cursor: pointer;
      position: relative;
      border: $upload-files-drag-border;
      border-radius: $upload-files-drag-border-radius;
      &:hover {
        border-color: $upload-files-drag-hover-border-color;
      }
    }
    &-dragover {
      background-color: $upload-files-drag-active-bg-color;
      border: $upload-files-drag-active-border-color;
    }
  }

  &-tipPosition-row {
    .#{$namespace}upload-container, .#{$namespace}upload-tip {
      display: inline;
    }
  }

  &-tip {
    font-size: $upload-tip-font-size;
    color: $upload-tip-color;
    margin-top: $upload-tip-margin-top;
  }

  &-list { 
    margin-top: 12px;
    
    &-item {
      height: $upload-files-text-item-height;
      line-height: $upload-files-text-item-line-height;
      padding: 0 12px 0 0px;
      position: relative;
      color: $upload-files-item-color;
      &:hover {
        background-color: $upload-files-item-bg-color;
      }
      &-content {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
      }

      &-error {
        color: $upload-files-item-error-color;
        .#{$namespace}tooltip-elements, .#{$namespace}tooltip {
          width: 100%;
          height: 100%;
        }
        .#{$namespace}tooltip-elements {
          display: flex;
          align-items: center;
          justify-content: center;
        }
        .#{$namespace}tooltip {
          padding: 0;
          line-height: $upload-files-text-item-line-height;
        }
        .#{$namespace}-list-icon-del {
          display: inline-block;
        }
      }

      &-success {
        .#{$namespace}upload-list-icon-del {
          display: none;
        }
        &:hover {
          .#{$namespace}upload-list-icon-del {
            display: initial;
          }
          .#{$namespace}upload-list-icon-success {
            display: none;
          }
          .#{$namespace}upload-list-item-name-title {
            color: $upload-files-item-suceess-title-hover-color;
          }
        }
      }

      &-icon {
        display: flex;
        align-items: center;
        margin-right: 12px;
        font-size: $upload-files-text-item-left-icon-font-size;
        > span {
          color: $upload-item-left-icon-color;
        }
      }
    
      &-name {
        flex: 1;
        &-title {
          cursor: pointer;
        }
      }

      &-right {
        cursor: pointer;
        font-size: 16px;
        margin-left: 8px;
      }

      &-text-progress, &-picture-progress {
        position: absolute;
        bottom: 2px;
        height: 2px;
        left: 28px;
        right: 14px;
      }

      &-picture-progress {
        left: 38px;
      }

      &-actions {
        position: absolute;
        z-index: 10;
        white-space: nowrap;
        opacity: 0;
        text-align: center;
        transition: all .3s;
        color: $upload-files-picture-card-mask-color;
        font-size: 22px;
        background-color: $upload-files-picture-card-mask-bg-color;
        > span {
          margin: 0 8px;
        }
        &::after {
          display: inline-block;
          content: "";
          height: 100%;
          vertical-align: middle;
        }
      }
    }

    &-icon-loading {
      &::after {
        display: inline-block;
        width: $upload-files-item-loading-width-height;
        height: $upload-files-item-loading-width-height;
        content: '';
        -webkit-animation: loading .5s infinite linear;
        animation: loading .5s infinite linear;
        border: 2px solid $upload-files-item-loading-color;
        border-top-color: transparent;
        border-right-color: transparent;
        border-radius: 50%;
      }
    }

    &-icon-success {
      font-family: "font_family" !important;
      font-size: 1em;
      line-height: normal;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      color: $upload-files-item-suceess-color;
      &::before {
        content: "\E610";
      }
    }

    &-icon-del {
      font-family: font_family;
      font-size: 1em;
      font-style: normal;
      line-height: normal;
      display: inline-block;
      width: 1em;
      height: 1em;
      cursor: pointer;
      &::before {
        content: '\E644'
      }
    }
  }

  &-picture-card {
    .#{$namespace}upload-container {
      display: flex;
    }
    .#{$namespace}upload-list {
      margin-top: 0;
      display: flex;
    }
    .#{$namespace}upload-list-item {
      @include upload-list-item();
      margin: 0 8px 8px 0;
      padding: $upload-files-picture-card-item-padding;

      &-content {
        justify-content: center;
        flex-direction: column;
      }

      &:hover {
        .#{$namespace}upload-list-item-actions {
          opacity: 1;
          > span {
            cursor: pointer;
          }
        }
      }
      &-error {
        .#{$namespace}tooltip-elements {
          flex-direction: column;
        }
      }
    }
    .#{$namespace}upload-list-item-success {
      &-info {
        height: 100%;
      }
      &-img {
        width: 100%;
        height: 100%;
      }
      .#{$namespace}upload-list-item-actions {
        top: $upload-files-picture-card-item-padding;
        left: $upload-files-picture-card-item-padding;
        right: $upload-files-picture-card-item-padding;
        bottom: $upload-files-picture-card-item-padding;
      }
    }

    .#{$namespace}upload-list-icon-loading {
      &::after {
        width: $upload-files-picture-card-item-loading-width-height;
        height: $upload-files-picture-card-item-loading-width-height;
      }
    }

    .#{$namespace}upload-list-item-error {
      border-color: $upload-files-item-error-color;
      color: $upload-files-item-error-color;
      &-icon {
        font-size: 25px;
      }
      &-text {
        font-size: 14px;
      }
      .#{$namespace}upload-list-item-actions {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
      }
    }
  }

  &-picture {
    .#{$namespace}upload-list-item {
      height: $upload-files-picture-item-height;
      line-height: $upload-files-picture-item-line-height;
      &-icon {
        font-size: $upload-files-picture-item-left-icon-font-size;
        > img {
          width: $upload-files-picture-item-left-img-width;
          height: $upload-files-picture-item-left-img-height;
        }
      }
      &-error {
        .#{$namespace}tooltip {
          padding: 0;
          line-height: 36px;
        }
      }
    }
  }
}