@import '../../style/common';

.@{prefix} {
  &image-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;

    &__swipe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      user-select: none;
    }

    &__item {
      position: absolute;
      top: 0;
      left: 100%;
      width: 100%;
      height: 100%;
      will-change: left right;
    }

    &__image {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      width: auto;
      max-width: 100%;
      height: auto;
      max-height: 100%;
      margin: auto 0;
      object-fit: contain;
      will-change: transform;
    }

    &--changing &__item {
      transition-timing-function: all ease-in-out;
      transition-property: left;
    }

    &--changing &__image {
      transition-timing-function: ease-in-out;
      transition-property: transform;
    }

    &__close-button {
      position: absolute;
      display: flex;
      width: 24px;
      height: 24px;
      margin: 0;
      padding: 0;
      background: transparent;
      border: none;

      @distance: 16px;

      &--top-left {
        top: @distance;
        left: @distance;
      }

      &--top-right {
        top: @distance;
        right: @distance;
      }

      &--bottom-left {
        bottom: @distance;
        left: @distance;
      }

      &--bottom-right {
        right: @distance;
        bottom: @distance;
      }
    }

    &__close-icon {
      position: relative;
      width: 100%;
      height: 100%;
      outline: none;
      opacity: 0.8;
      fill: #fff;
    }

    &__indicators {
      position: absolute;
      right: 0;
      bottom: 32px;
      left: 0;
      display: flex;
      align-content: center;
      align-items: center;
      justify-content: center;
    }

    &__indicator-item {
      position: relative;
      display: inline-flex;
      width: 6px;
      height: 6px;
      margin: 0 2px;
      background-color: #fff;
      border-radius: 50%;
      opacity: 0.3;
      transition: opacity 0.2s ease;
      will-change: opacity;

      &--active {
        opacity: 1;
      }
    }
  }
}
