@import "../bootstrap/variables.less";
@import "../bootstrap/mixins.less";
@import "../../core/include/variables.less";
@import "../../core/include/mixins.less";

.dropzone,
.dropzone * {
  .box-sizing(border-box);
}

.dropzone {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  padding: 1em;
  border: 1px solid rgba(0, 0, 0, 0.03);
  min-height: 160px;
  .border-radius(3px);
  background: rgba(0, 0, 0, 0.03);
  padding: 23px;

  &.dz-drag-hover {
    border-color: green;
    background: green;
  }

  &.dz-clickable {
    cursor: pointer;
  }

  &.dz-drag-hover {
    border-color: green;
    background: green;
  }

  &.dz-started .dz-message {
    display: none;
  }

  .dz-message {
    opacity: 1;
    -ms-filter: none;
    filter: none;
  }

  .dz-preview {
    .box-shadow(1px 1px 4px rgba(0, 0, 0, 0.16));
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    position: relative;
    display: inline-block;
    margin: 14px;
    vertical-align: top;
    border: 1px solid #acacac;
    padding: 6px 6px 28px 6px;
    &.dz-image-preview:hover {
      .dz-details {
        img {
          display: block;
          opacity: 0.1;
          filter: alpha(opacity=10);
          -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
        }
      }
    }

    .dz-details {
      width: 100px;
      height: 100px;
      position: relative;
      background: #ebebeb;
      padding: 5px;

      .dz-filename {
        overflow: hidden;
        height: 100%;
      }

      img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100px;
        height: 100px;
      }

      .dz-size {
        position: absolute;
        bottom: -28px;
        left: 3px;
        height: 28px;
        line-height: 28px;
      }
    }
    // details

    &.dz-error {
      .dz-error-mark {
        display: block;
        opacity: 1;
        -ms-filter: none;
        filter: none;
      }

      .dz-progress .dz-upload {
        background: #ee1e2d;
      }
    }

    &.success {
      .dz-progress {
        display: none;
        display: block;
        .opacity(0);
        .transition(opacity 0.4s ease-in-out);
      }
      .dz-success-mark {
        display: block;
        .opacity(1);
      }
    }

    &:hover .dz-details img {
      display: none;
    }

    &:hover {
      .dz-success-mark, .dz-error-mark {
        display: none;
      }
    }

    .dz-success-mark, .dz-error-mark {
      display: none;
      position: absolute;
      width: 40px;
      height: 40px;
      font-size: 30px;
      text-align: center;
      right: -10px;
      top: -10px;
      display: block;
      .opacity(0);
      .transition(opacity 0.4s ease-in-out);

      span {
        display: none;
      }
    }

    .dz-success-mark {
      color: #8cc657;
      background-position: -268px -163px;
    }

    .dz-error-mark {
      color: #ee162d;
      background-position: -268px -123px;
    }

    .dz-progress {
      position: absolute;
      top: 100px;
      left: 6px;
      right: 6px;
      height: 6px;
      background: #d7d7d7;
      .dz-upload {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 0%;
        background-color: #8cc657;
        -webkit-animation: loading 0.4s linear infinite;
        -moz-animation: loading 0.4s linear infinite;
        -o-animation: loading 0.4s linear infinite;
        -ms-animation: loading 0.4s linear infinite;
        animation: loading 0.4s linear infinite;
        transition: width 0.3s ease-in-out;
        .transition(width 0.3s ease-in-out);
        .border-radius(2px);
        position: absolute;
        top: 0;
        left: 0;
        width: 0%;
        height: 100%;
      }
    }

    .dz-error-message {
      position: absolute;
      top: 0px;
      left: 0px;
      background-color: #ee1e2d;
      padding: 8px 10px;
      color: #ffffff;
      min-width: 100%;
      max-width: 100%;
      min-height: 100%;
      max-height: 100%;
      display: block;
      .opacity(0);
      .transition(opacity 0.3s ease-in-out);
    }

    &:hover.dz-error .dz-error-message {
      display: block;
      .opacity(1);
    }
  }
  //preview
  .dz-default.dz-message {
    .opacity(1);
    .transition(opacity 0.3s ease-in-out);
    position: absolute;
    width: 428px;
    height: 123px;
    margin-left: -214px;
    margin-top: -61.5px;
    top: 50%;
    left: 50%;
    font-size: 24px;
    text-align: center;
    color: #999;
  }

  &.dz-square .dz-default.dz-message {
    background-position: 0 -123px;
    width: 268px;
    margin-left: -134px;
    height: 174px;
    margin-top: -87px;
  }

  &.dz-drag-hover .dz-message {
    .opacity(0.15);
  }

  &.dz-started .dz-message {
    display: block;
    .opacity(0);
  }
}

// dropzone

#dropzone {
  margin: 30px 0;
  .box-shadow(0 0 50px rgba(0, 0, 0, 0.13));
  padding: 4px;
  .border-radius(3px);
  .dropzone {
    .box-shadow(none);
  }
}