.upload-files__file-in-progress {
  display: contents;
}

.upload-files__file-failed {
  display: contents;
}

.upload-files__file-uploaded {
  display: contents;
}

.upload-files__dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 108px;
  border: dashed 2px $color-neutral-400;
  user-select: none;
  color: $color-neutral-500;
  margin-bottom: 30px;
  cursor: pointer;

  @include rounded($rounded-md);

  &:hover,
  &.upload-files__dropzone--dragging {
    color: $color-primary-500;
    border-color: $color-primary-500;
  }

  * {
    pointer-events: none;
  }
}

.upload-files__dropzone-content {
  text-align: center;
}

.upload-files__dropzone-icon {
  font-size: 21px;
}

.upload-files__dropzone-text {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.upload-files__dropzone-progress {
  @include absolute(auto, auto, 0, 0);

  height: 6px;
  background-color: $color-primary-500;
}

.upload-files__file-name {
  text-overflow: ellipsis;
  overflow: hidden;
  width: 90%;
}

.upload-files__list {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
}

.upload-files__item {
  display: flex;

  &:not(:last-child) {
    margin-bottom: 10px;
  }
}

.upload-files__preview {
  flex: 0 0 48px;
  margin-right: 16px;
}

.upload-files__icon {
  border: solid 1px $color-neutral-400;
  color: $color-neutral-600;
  overflow: hidden;

  @include center-text(48px, 22px);
  @include rounded($rounded);

  img {
    display: block;
    max-width: 100%;
    max-height: 100%;
  }
}

.upload-files__description {
  min-width: 0;
  width: 100%;
  padding-top: 6px;
}

.upload-files__name {
  @extend %ellipsis;

  position: relative;
  font-size: 13px;
  font-weight: 600;
  padding-right: 40px;
  margin-bottom: 8px;
}

.upload-files__percentage {
  font-size: 13px;
  font-weight: 600;
  color: $color-neutral-400;

  @include absolute(0, 0, auto, auto);
}

.upload-files__progress {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 10px;
  background-color: $color-neutral-100;

  @include rounded($rounded);
}

.upload-files__progress-bar {
  background-color: $color-primary-500;

  @include absolute(0, auto, 0, 0);

  &.upload-files__progress-bar--finished {
    background-color: $color-success-500;
  }
}

.upload-files__error {
  color: $color-error-500;
}

.upload-files__state {
  flex: 0 0 32px;
  margin-left: 16px;
  text-align: right;
  padding-top: 6px;
  font-size: 13px;
  color: $color-success-500;
}

.upload-files__state-waiting {
  color: $color-success-500;
}

.upload-files__state-failed {
  color: $color-error-500;
}

.upload-files__state-loading {
  display: inline-block;
}

.upload-files__state-link {
  color: $color-neutral-400;

  &:hover {
    color: $color-neutral-900;
  }
}
