/**=====================
  Dropzone CSS starts
==========================**/

@use "../utils/variables" as *;
.media-dropzone,
.dropzone {
  padding: calc(20px + (10 - 20) * ((100vw - 320px) / (1920 - 320)));
  background-color: $white;
  margin-bottom: 20px;
  cursor: pointer;
  border-radius: calc(9px + (25 - 9) * ((100vw - 320px) / (1920 - 320)));
  box-shadow: none !important;

  .dropzone {
    padding: calc(20px + (10 - 20) * ((100vw - 320px) / (1920 - 320)));
    border: 1px dashed #ddd;
    border-radius: calc(9px + (25 - 9) * ((100vw - 320px) / (1920 - 320)));
    box-shadow: none !important;

    .dz-preview {
      width: 10%;
      height: 140px;
    }
  }

  i {
    font-size: calc(40px + (50 - 40) * ((100vw - 320px) / (1920 - 320))) !important;
    color: $dark-color !important;
  }

  .media-close {
    position: absolute;
    top: calc(8px + (11 - 8) * ((100vw - 320px) / (1920 - 320)));
    right: calc(8px + (14 - 8) * ((100vw - 320px) / (1920 - 320)));
    font-size: calc(18px + (21 - 18) * ((100vw - 320px) / (1920 - 320))) !important;
    font-weight: 600;
    line-height: 1;
    color: rgba($dark-color, 0.75) !important;
    cursor: pointer !important;
  }

  .dz-preview {
    box-shadow: none;
    display: inline-block;
    background: $transparent-color !important;
    border: 1px solid rgba($dark-color, 0.45) !important;
    border-radius: $border-radius;
    width: 10.1%;
    position: relative;
    overflow: unset;
    margin-top: 25px;
    margin-right: 12px;
    margin-bottom: 12px;
    margin-top: 0;

    .dz-image {
      width: 100%;
      height: 100%;
      opacity: 0.5;

      img {
        width: 100%;
        height: 100%;
        border-radius: 3px;
      }
    }

    .dz-details {
      z-index: 1;
      position: absolute;
      top: unset !important;
      bottom: 0 !important;
      left: 0 !important;
      opacity: 0;
      font-size: 13px;
      width: 100% !important;
      border-radius: 0px;
      padding: 5px;
      text-align: center;
      color: rgba(0, 0, 0, 0.9);
      line-height: 150%;
      transition: opacity 0.2s linear;
      display: flex;
      align-items: center;
      justify-content: center;
      background: white;
      transform: translateY(17px);
      transition: all 0.25s ease;
      border-radius: 0;

      .dz-size {
        display: none;
      }

      .dz-filename {
        text-align: center;
        font-weight: 500;
        font-size: 12px;
        color: rgba(29, 35, 39, 0.8);
        line-height: 18px;
        padding: 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        border-bottom-left-radius: 2px;
        border-bottom-right-radius: 2px;
        height: unset !important;
      }
    }

    &:hover {
      .dz-details {
        opacity: 1;
        transform: translateY(0px);
        transition: all 0.25s ease;
      }

      .dz-image {
        opacity: 0.6;
      }
    }

    .dz-success-mark,
    .dz-error-mark {
      margin-left: 0 !important;
      position: absolute;
      left: 50% !important;
      transform: translate(-50%, -50%) !important;
      top: 50% !important;
      height: 54px;
    }

    .dz-error-message {
      top: 145px !important;
      color: $dark-color !important;
      background: $white !important;
      border: 1px solid $dark-color !important;
      border-radius: 4px;

      &:after {
        border-bottom: 6px solid $dark-color !important;
      }
    }

    .dz-progress {
      opacity: 1;
      z-index: 1;
      pointer-events: none;
      position: absolute;
      height: 12px;
      left: 50% !important;
      top: 50% !important;
      transform: translateX(-50%);
      width: 100px;
      background: transparent !important;
      border: 1px solid transparent !important;
      border-radius: 8px;
      overflow: hidden;
      border: none;
      position: relative;
      z-index: 0;
      overflow: hidden;

      &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--primary-color);
        z-index: -1;
      }

      .dz-upload {
        border-color: var(--primary-color) !important;
        background-color: var(--primary-color) !important;
      }
    }

    &.dz-processing {
      .dz-image {
        opacity: 0.7;
      }
    }

    &.dz-success {
      .dz-image {
        opacity: 1;
      }

      &.dz-complete {
        .dz-image {
          opacity: 1;
        }
      }
    }
  }
}

.upload-files-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  margin: calc(4px + (20 - 4) * ((100vw - 320px) / (1920 - 320))) 0;

  .dz-message {
    padding: 0;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;

    .upload-icon {
      font-size: 40px;
      color: var(--primary-color);
      line-height: 1;
      margin-bottom: 8;
      display: inline-block;

      i {
        color: var(--primary-color) !important;
        font-size: calc(38px + (50 - 38) * ((100vw - 320px) / (1920 - 320))) !important;
      }
    }

    h3 {
      font-size: calc(14px + (16 - 14) * ((100vw - 320px) / (1920 - 320)));
      margin: 0;
      line-height: 1.6;
      margin-block: calc(8px + (15 - 8) * ((100vw - 320px) / (1920 - 320)));
    }

    .browse-files {
      font-weight: 500;
      cursor: pointer !important;
      color: $dark-color;
      border: 1px solid $white-dark;
      background: #f6f7f7;
      font-size: 14px;
      line-height: 1;
      padding: 10px 24px;
      border-radius: 4px;
      white-space: nowrap;
      margin-top: 16px;
    }
  }

  .d-flex {
    align-items: center;
    justify-content: center;
    gap: 15px;
  }

  button {
    margin-top: unset !important;

    &.browse-files {
      margin-top: unset;
      padding: 8px 30px;
      font-size: 14px;
      line-height: 21px;
      background-color: transparent !important;
      color: var(--primary-color) !important;
      border: unset;
      position: relative;
      z-index: 0;
      border-color: transparent !important;
      overflow: hidden;

      &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--primary-color);
        opacity: 0.1;
        z-index: -1;
      }
    }
  }

  .media-close {
    position: absolute;
    top: 11px;
    right: 14px;
    font-size: 21px !important;
    font-weight: 600;
    line-height: 1;
    color: rgba($dark-color, 0.75) !important;
    cursor: pointer !important;
  }

  .upload-button {
    background-color: var(--primary-color);
    color: $white;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    padding: 8px 30px;
    cursor: pointer !important;
    min-height: unset;
    margin-top: 16px;

    .spinner {
      border-radius: 100%;
    }

    .upload-button-icon {
      line-height: 1;

      i {
        font-size: 18px;
      }
    }
  }
}

.media-dropzone {
  display: none;

  &.show {
    display: block;
  }
}

/**=====================
  Dropzone CSS end
==========================**/