/**
 *
 * This file may have been modified by Bytedance Inc. (“Bytedance Inc.'s Modifications”). 
 * All Bytedance Inc.'s Modifications are Copyright (year) Bytedance Inc..  
 * 
 * This source code is licensed under the Apache license.
 * See LICENSE file in the project root for license information.
 *
 */
.@{ant-prefix}-sp-img-preview.img-preview-wrap {
  position: fixed;
  overflow: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  display: flex;

  .img-preview-fade-leave {
    opacity: 0;
    transition: opacity 0.3s;
  }
  &:hover {
    .img-preview-fade-leave {
      opacity: 1;
    }
  }
  .img-preview-tips {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.1));
    color: #fff;
    font-size: 14px;
    padding: 24px;
    line-height: 20px;
    z-index: 1;
    &-separator {
      padding: 0 12px;
    }
  }
  .img-preview-body {
    .img-preview-wrapper {
      text-align: center;
      user-select: none;

      .img-preview-img-content {
        max-width: 100vw;
        max-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        .img-preview-loading-icon {
          position: absolute;
          top: calc(50% - 16px);
          left: calc(50% - 16px);
          font-size: 32px;
          color: #fff;
        }
        img {
          cursor: grab;
          // transition: transform 0.2s ease-in-out;
          user-select: none;
        }
      }
    }
  }

  .img-preview {
    margin: auto;
  }

  .img-preview-title {
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    font-weight: bold;
  }

  .img-preview-operator {
    width: 521px;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    padding: 16px 32px 16px 24px;
    box-shadow: 0px 6px 32px rgba(31, 37, 51, 0.06);
    font-size: 24px;
    display: flex;
    justify-content: left;

    &.show-part {
      width: 465px;
    }

    &-page,
    &-scale,
    &-rotate,
    &-recover,
    &-download {
      display: flex;
      line-height: 24px;
      height: 24px;
      vertical-align: top;
      position: relative;
      color: @color-text-icon-0;
      margin: 0 0;
      align-items: center;
    }

    &-page {
      display: flex;
      font-size: 16px;
      flex: 0 0 144px;
      justify-content: space-between;
      padding-right: 24px;
      margin-right: 32px;
      border-right: 1px solid @color-line-1;
    }
    &-left {
      display: inline-block;
      cursor: pointer;
      font-size: 24px;
      transform: rotate(180deg);
    }

    &-right {
      font-size: 24px;
      cursor: pointer;
    }

    &-scale {
      flex: 0 0 125px;
      display: flex;
      justify-content: space-between;
    }
    &-percent {
      font-size: 16px;
    }

    &-zoom-out {
      cursor: pointer;
    }

    &-zoom-in {
      margin-top: 2px;
      cursor: pointer;
    }

    &-rotate,
    &-recover,
    &-download {
      flex: 1;
      justify-content: flex-end;
      cursor: pointer;
    }
    &-disabled {
      color: @color-line-0;
      cursor: not-allowed !important;
    }
  }

  .img-preview-close {
    width: 48px;
    height: 48px;
    font-size: 22px;
    border-radius: 50%;
    box-shadow: 0px 6px 32px rgba(31, 37, 51, 0.06);
    top: 40px;
    right: 32px;
    position: fixed;
    cursor: pointer;
    border: 0;
    outline: none;
    color: @color-text-icon-0;
    z-index: 10;
    transition: all 0.3s;
    background-color: #fff;
    &:hover {
      color: @color-text-icon-0;
      background-color: @color-text-icon-3;
    }
  }

  .img-preview-header {
    padding: 13px 20px 14px;
    border-radius: 5px 5px 0 0;
    background: #fff;
    color: #666;
    border-bottom: 1px solid #e9e9e9;
  }

  .img-preview-footer {
    border-top: 1px solid #e9e9e9;
    padding: 10px 20px;
    text-align: right;
    border-radius: 0 0 5px 5px;
  }
}

.img-preview-mask {
  &.img-preview-mask-hidden {
    display: none;
  }
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
  z-index: 1010;
}
