.demio-upload {
  margin: 20px 0;
}

.demio-upload-dragger {
  margin: 0;

  &:hover {
    .demio-upload-dragger-message {
      color: #02BF6F;

      .demio-icon path {
        fill: #02BF6F;
      }
    }
  }

  &.--hide {
    display: none;
  }

  &.ant-upload-drag-hover {
    border-color: #02BF6F !important;
    background: #fff !important;

    .demio-upload-drop-message {
      display: block;
    }

    .demio-upload-info {
      display: none;
    }
  }

  .ant-upload-drag-container {
    pointer-events: none;
  }

  .demio-upload-drop-message {
    display: none;
  }

  .demio-upload-dragger-message {
    margin-bottom: 16px;
    font-weight: normal;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    letter-spacing: 0.5px;
    color: #5D676B;
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-content: center;
    transition: all .3s;

    .demio-icon {
      margin: 0 auto 4px;
      transition: all .3s;
      fill: #5D676B;

      path {
        // TODO: remove when icon fill is removed
        transition: all .3s;
        fill: #5D676B;
      }
    }
  }

  .demio-upload-dragger-description {
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    letter-spacing: 0.4px;
    color: #9FA6AD;
    width: 80%;
    max-width: 400px;
    margin: 0 auto;
    white-space: normal;

    strong {
      text-transform: uppercase;
    }
  }

  .upload-error {
    color: #f5222d;
  }

  .ant-upload-disabled .Button {
    border-color: #d2dae4;
    color: #929292;
  }

  &.ant-upload.ant-upload-drag {
    min-height: 164px;
    border: 2px dashed #DEE4E8;
    background: #FAFAFA;
    padding: 0;

    .ant-upload-btn {
      height: 160px;
    }
  }
}

.demio-upload-info-container {
  background: #FFFFFF;
  border: 1px solid #DEE4E8;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  font-weight: normal;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: #5D676B;
  padding: 8px;
  position: relative;
  min-height: 42px;

  &.--image-only {
    .demio-upload-preview {
      margin: 0;
    }

    .demio-upload-options-button {
      position: absolute;
      bottom: 6px;
      right: 6px;
    }
  }

  &.--loading {
    display: flex;
    justify-content: center;
    align-items: center;

    .demio-upload-loading-container {
      box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04);
      border-radius: 2px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 28px;
      height: 28px;
    }

    .ant-progress {
      // this is kind of a hack because it doesn't want to center
      height: 23px;
    }

    .ant-progress-inner {
      animation: demioUploadLoading 1s infinite linear;
    }

    .demio-upload-progress {
      display: none;
    }

    .demio-upload-options-button {
      position: absolute;
      bottom: 6px;
      right: 6px;
    }
  }
}

.demio-upload-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  position: relative;

  img {
    max-height: 148px;
    max-width: 100%;
  }

  .ant-progress-inner {
    top: -1px;
    position: relative;
  }
}

.demio-upload-processing {
  padding: 4px 8px;
  background: #fff;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04);
  border-radius: 2px;
  position: absolute;
}

.demio-upload-file-info {
  margin-left: 8px;
  max-width: 100%;
  overflow: hidden;

  .file-name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-right: 8px;
  }

  .file-info {
    margin-top: 4px;
    font-weight: normal;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.4px;
    color: #9FA6AD;
  }
}

.demio-upload-bottom {
  display: flex;
  align-items: center;

  .ant-progress-inner {
    margin-bottom: 3px;
  }
}

.demio-upload-progress {
  font-weight: normal;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
  color: #02BF6F;
  margin-left: 4px;
}

.demio-upload-options-button {
  background: #FFFFFF;
  border: 1px solid #DEE4E8;
  border-radius: 4px;
  padding: 4px;
  margin: auto 0 0 auto;
  display: flex;
  cursor: pointer;
  transition: all .3s;

  &:hover,
  &.ant-dropdown-open {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.16);
  }
}

.demio-upload-options-menu {
  border: 1px solid #DEE4E8;

  .ant-dropdown-menu-item {
    font-weight: normal;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.25px;
    color: #5D676B;
    padding: 10px 16px;
    display: flex;
    align-items: center;

    .demio-icon {
      fill: #5D676B;
      margin-right: 8px;
    }

    &:hover {
      background: #F7F7F7;
    }

    &.--red {
      color: #EE4C3B;

      &:hover {
        background: #fffafa;
      }

      .demio-icon {
        fill: #EE4C3B;
      }
    }

    &.ant-dropdown-menu-item-disabled {
      color: #9FA6AD;
      user-select: none;

      .demio-icon {
        fill: #9FA6AD;
        margin-right: 8px;
      }

      &:hover {
        background: #fff;
      }
    }
  }
}

.demio-upload-modal {
  .ant-modal-header {
    height: 78px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .ant-modal-close {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 78px;
  }

  .ant-modal-title {
    font-style: normal;
    font-weight: 600;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    letter-spacing: 0.25px;
    color: #2C3336;
  }

  .ant-modal-body {
    padding: 0;
  }
}

.demio-upload-modal-top {
  margin: 40px;
}

.demio-upload-cropper-container {
  position: relative;
  height: 240px;

  .reactEasyCrop_CropArea {
    min-width: 240px;
    min-height: 240px;
  }
}

.demio-upload-modal-bottom {
  height: 72px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid #EFF3F6;
  padding-right: 16px;

  .ant-btn:first-child {
    margin-right: 8px;
  }

  .ant-btn-default {
    color: #2C3336;

    &:hover {
      border-color: #2C3336;
    }
  }
}

.ant-slider {
  margin-top: 20px;
}

.ant-slider-handle {
  border-color: #02BF6F;

  &:focus {
    outline: none;
    box-shadow: unset;
  }
  &:hover {
    outline: none;
    box-shadow: 0 0 0 5px rgba(2, 191, 111, 0.2);
  }
}

.ant-slider-track {
  background-color: #02BF6F;
}

.ant-slider:hover {
  .ant-slider-track {
    background-color: #02BF6F;
  }
  .ant-slider-handle:not(.ant-tooltip-open) {
    border-color: #02BF6F;
  }
}

.ant-slider-rail {
  background-color: #e1e1e1;
}

@keyframes demioUploadLoading {
  100% {
    transform: rotate(360deg)
  }
}
