@class-prefix-image-uploader: ~'adm-image-uploader';

.@{class-prefix-image-uploader} {
  --cell-size: 80px;
  --gap: 12px;
  ---gap: var(--gap);
  ---gap-horizontal: var(--gap-horizontal, var(--gap));
  ---gap-vertical: var(--gap-vertical, var(--gap));

  &-grid,
  &-space {
    --gap: var(---gap);
    --gap-horizontal: var(---gap-horizontal);
    --gap-vertical: var(---gap-vertical);
  }

  &-cell {
    position: relative;
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 4px;
    overflow: hidden;

    &-fail {
      border: red solid 1px;
      box-sizing: border-box;
    }

    &-delete {
      position: absolute;
      top: 0;
      right: 0;
      width: 14px;
      height: 14px;
      background-color: rgba(0, 0, 0, 0.7);
      border-radius: 0 0 0 12px;
      font-size: 8px;
      color: var(--adm-color-white);
      cursor: pointer;
      &-icon {
        position: absolute;
        left: 4px;
        top: 3px;
      }
    }

    &-mask {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      color: var(--adm-color-white);
      background-color: rgba(50, 50, 51, 0.88);
    }

    &-loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      box-sizing: border-box;
      padding-top: 8px;
    }

    &-mask-message {
      display: inline-block;
      padding: 6px 4px;
      font-size: var(--adm-font-size-4);
    }

    &-image {
      width: var(--cell-size);
      height: var(--cell-size);
    }
  }

  &-upload-button-wrap {
    position: relative;

    .@{class-prefix-image-uploader}-upload-button {
      background-color: var(--adm-color-box);
      text-align: center;
      line-height: var(--cell-size);
      display: block;

      &-icon {
        color: var(--adm-color-weak);
        font-size: 32px;
      }
    }
    .@{class-prefix-image-uploader}-input {
      cursor: pointer;
      position: absolute;
      opacity: 0;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      border-radius: 4px;
    }
  }

  .@{class-prefix-image-uploader}-gap-measure {
    position: absolute;
    left: 0;
    top: 0;
    height: var(--gap-horizontal);
    width: 0;
  }
}
