@import '~styles/mixins';

$space_from_label: $form_element_vertical_spacing + 2px;

.multipe-upload-zone {
  .progress-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;

    // font style
    font-weight: bold;
    font-size: 12px;
    color: $color_dark;
    width: 100%;

    .progress {
      @include transition(all);
      z-index: 1;
      background-color: $color_success;
      position: absolute;
      height: 100%;
      top: 0;
      left: 0;
      // if text included
      align-items: center;
      justify-content: center;
      font-weight: bold;
      color: white;

      // Another solution is to use clip-path: inset(0 0 0 $progress_%);
      // https://codepen.io/jeshb/pen/PzGVNW
    }
  }

  .Dropzone {
    cursor: pointer;
    //background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%23333' stroke-width='4' stroke-dasharray='15%2c 15' stroke-dashoffset='12' stroke-linecap='square'/%3e%3c/svg%3e");
    border: 1px dashed $color_border;
    margin: auto;
    margin-top: $space_from_label;
    padding: 20px;

    min-height: 160px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    border-radius: 2px;

    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;

    &.small {
      padding: 20px 0;
    }

    &.no-label {
      margin-top: 0;
    }

    .info {
      font-size: 18px;
      font-weight: 900;
      line-height: 1.11;

      padding: 8px 0px 8px 0px;

      margin: auto;

      &.small {
        font-size: 12px;
      }

      &.with-preview {
        font-size: 14px;
      }
    }

    .subinfo {
      font-size: 14px;
      padding: 0 10px;
      color: $color-title-grey;

      &.small {
        font-size: 12px;
      }
    }

    .icon {
      font-size: 34px;
    }

    &.error {
      border-color: $color_error;
    }

    &.active {
      background-color: rgb(220, 220, 220);
      border-color: $color_dark_grey;
    }

    &.accept {
      border-color: $color_success;
      color: $color_success;
    }

    &.reject {
      border-color: $color_error;
      color: $color_error;
    }

    &.disabled {
      cursor: not-allowed;
    }
  }

  .files {
    &.picture,&.video {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      > * {
        width: 49%;
      }
    }
  }

  .video-link{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;

    .info-video{
      justify-content: center;
      align-items: center;
      position: absolute;
      display: flex;
      padding: 20px;
      flex-direction: column;
      a {
        margin-top: 10px;
      }
    }

    .player-video{
      background-color: $color-grey-background;
      z-index: 1;
      > * {
        width: 100% !important;
        height: 100% !important;
      }
    }
  }

  .picture-preview {
    margin-top: $space_from_label;
    position: relative;
    height: 150px;
    background-color: $color-grey-background;
    text-align: center;
    img {
      height: 100%;
      width: 100%;
      object-fit: contain;
    }

    .icon {
      cursor: pointer;
      position: absolute;
      top: 0;
      right: 0;
      font-size: 18px;
      z-index: 10;
      @include ball(30px);
      border-radius: 0;
      @include transition(all);
      &:hover {
        background-color: rgba(255, 255, 255, 0.6);
      }
    }
  }

  // New version
  .file-preview {
    position: relative;
    border: 1px solid $color_border_light;
    display: flex;
    border-radius: $border-radius;
    margin-top: $space_from_label;
    align-items: center;
    font-size: 14px;
    justify-content: space-between;

    .left {
      display: flex;
      align-items: center;
    }
    .file {
      color: $color_primary;
    }
    .error {
      color: $color_error;
    }
    .icon {
      display: block;
      line-height: 1;
      padding: 15px;
      font-size: 21px;
    }
    .action {
      cursor: pointer;
      @include transition;
      &:hover {
        opacity: 0.8;
      }
    }
  }
}
