// Name:            PureView
//
// Description:     Define style for PureView Plugin
//
// Component:       `.am-pureview`
//
// =============================================================================


/* ==========================================================================
   Component: PureView Plugin
 ============================================================================ */

.@{ns}pureview {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: @z-index-pureview;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  overflow: hidden;
  transition: transform .3s;
  transform: translate(0, 100%);

  &.@{ns}active {
    transform: translate(0, 0);
  }

  ul,
  ol {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
  }
}

.@{ns}pureview-slider {
  overflow: hidden;
  height: 100%;

  li {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    // .flexbox();
    // .justify-content(center);
    // .align-items(center);

    // fuck legacy browsers
    // https://github.com/allmobilize/amazeui/issues/120
    // GREAT: AutoPrefixer can help us do these dammit things
    // -webkit-box-align: center;
    // -webkit-box-pack: center;

    vertical-align: middle;
    transition: all .3s linear;
    // .translate3d(-100%);
    z-index: 100;
    visibility: hidden;

    &.@{ns}pureview-slide-prev {
      transform: translate(-100%, 0);
      // visibility: visible;
      z-index: 109;
    }

    &.@{ns}pureview-slide-next {
      transform: translate(100%, 0);
      // visibility: visible;
      z-index: 109;
    }

    &.@{ns}active {
      position: relative;
      z-index: 110;
      transform: translate(0, 0);
      visibility: visible;
    }
  }

  .pinch-zoom-container {
    width: 100%;
    z-index: @z-index-pureview + 1;
  }

  .@{ns}pinch-zoom {
    position: relative;
    width: 100%;
    // overflow-y: auto;  /* scrollable */
    // -webkit-overflow-scrolling: touch; /* scrollable */
    display: flex;
    justify-content: center;
    align-items: center;
    // .flexbox();
    // .justify-content(center);
    // .align-items(center);

    // fuck legacy browsers
    // https://github.com/allmobilize/amazeui/issues/120
    // -webkit-box-align: center;
    // -webkit-box-pack: center;

    &:after {
      .am-icon-font();
      content: @fa-var-spinner;
      animation: icon-spin 2s infinite linear;
      font-size: 24px;
      line-height: 24px;
      color: #eee;
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -12px;
      margin-top: -12px;
      z-index: 1;
    }

    // image loaded
    &.@{ns}pureview-loaded {
      &:after {
        display: none;
      }
    }
  }

  img {
    position: relative;
    display: block;
    max-width: 100%;
    max-height: 100%;
    //max-width:100%;
    //height:auto;
    opacity: 0;
    z-index: 200;
    -webkit-user-drag: none;
    transition: opacity .2s ease-in;

    &.@{ns}img-loaded {
      opacity: 1;
    }
  }
}

.@{ns}pureview-direction {
  position: absolute;
  top: 50%;
  width: 100%;
  margin-top: -18px !important;
  z-index: @z-index-pureview + 2;

  .@{ns}touch &,
  .@{ns}pureview-only & {
    display: none;
  }

  li {
    position: absolute;
    width: 36px;
    height: 36px;
  }

  a {
    display: block;
    height: 36px;
    border: none;
    color: #ccc;
    opacity: 0.5;
    cursor: pointer;
    text-align: center;

    z-index: @z-index-pureview + 5;

    &:before {
      content: @fa-var-chevron-circle-left;
      line-height: 36px;
      font-size: 24px;
    }

    &:hover {
      opacity: 1;
    }
  }

  .@{ns}pureview-prev {
    left: 15px;
  }

  .@{ns}pureview-next {
    right: 15px;

    a:before {
      content: @fa-var-chevron-circle-right;
    }
  }

}

.@{ns}pureview-bar {
  position: absolute;
  bottom: 0;
  height: 45px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.35);
  color: @gray-lighter;
  line-height: 45px;
  padding: 0 10px;
  font-size: 14px;
  display: flex;

  .@{ns}pureview-title {
    .text-overflow(block);
    margin-left: 6px;
    flex: 1;
  }

  .@{ns}pureview-total {
    font-size: 10px;
    line-height: 48px;
  }
}

.@{ns}pureview-actions {
  position: absolute;
  z-index: @z-index-pureview + 10;
  left: 0;
  right: 0;
  top: 0;
  height: 45px;
  background-color: rgba(0, 0, 0, 0.35);

  a {
    position: absolute;
    left: 10px;
    color: #ccc;
    display: block;
    width: 45px;
    line-height: 45px;
    text-align: left;
    font-size: 16px;

    &:hover {
      color: @white;
    }
  }

  [data-am-toggle="share"] {
    left: auto;
    right: 10px;
  }
}

.@{ns}pureview-bar,
.@{ns}pureview-actions {
  opacity: 0;
  transition: all .15s;
  z-index: @z-index-pureview + 10;

  .@{ns}pureview-bar-active & {
    opacity: 1;
  }
}

.@{ns}pureview-nav {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: @z-index-pureview + 11;

  .@{ns}pureview-bar-active & {
    display: none;
  }

  li {
    display: inline-block;
    background: #ccc;
    background: rgba(255, 255, 255, 0.5);
    width: 8px;
    height: 8px;
    margin: 0 3px;
    border-radius: 50%;
    text-indent: -9999px;
    overflow: hidden;
    cursor: pointer;
  }

  .@{ns}active {
    background: #fff;
    background: rgba(255, 255, 255, 0.9);
  }
}

[data-am-pureview] img {
  cursor: pointer;
}

// body
.@{ns}pureview-active {
  overflow: hidden;
}
