@viewer-prefix-cls: react-viewer;

@font-face {
  font-family: 'icomoon';
  src:url('fonts/icomoon.eot');
  src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
      url('fonts/icomoon.ttf') format('truetype'),
      url('fonts/icomoon.woff') format('woff'),
      url('fonts/icomoon.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

.@{viewer-prefix-cls} {

  &.inline {
    position: relative;
    width: 100%;
    height: 100%;
  }

  @zIndex: 1000;

  @btn-background-color: rgba(0, 0, 0, .5);
  @btn-hover-background-color: rgba(0, 0, 0, .8);

  & ul {
    margin: 0;
    padding: 0;
  }

  & li {
    list-style: none;
  }

  & {
    opacity: 0;
  }

  &-mask {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: #373737;
    background-color: rgba(55, 55, 55, 0.6);
    height: 100%;
    filter: alpha(opacity=50);
    z-index: @zIndex;
  }

  &-btn {
    background-color: @btn-background-color;
  }

  &-btn:hover{
    background-color: @btn-hover-background-color;
  }

  &-close {
    position: absolute;
    top: 0px;
    right: 0px;
    overflow: hidden;
    width: 40px;
    height: 40px;
    border-radius: 0 0 0 40px;   
    cursor: pointer;
    z-index: @zIndex + 10;
  }

  &-close > i {
    position: relative;
    top: 8px;
    left: 18px;
  }

  &-canvas {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    overflow: hidden;
    z-index: @zIndex + 5;
    > img {
      display: block;
      margin: 15px auto;
      width: auto;
      height: auto;
      user-select: none;
    }
    > img.drag {
      cursor: move;
    }
  }

  &-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    text-align: center;
    z-index: @zIndex + 5;
  }

  &-attribute {
    margin: 0;
    margin-bottom: 6px;
    opacity: .8;
    color: #ccc;
    font-size: 15px;
  }

  @toolbarHeight: 28px;

  &-toolbar {
    overflow: hidden;
    height: @toolbarHeight;
    margin-bottom: 6px !important;
  }

  &-toolbar li {
    display: inline-block;
    width: @toolbarHeight;
    height: @toolbarHeight;
    border-radius: @toolbarHeight;
    margin-right: 3px;
    cursor: pointer;
    line-height: 29px;
  }

  &-toolbar li:hover {
    background-color: rgba(0, 0, 0, .8);
  }

  li.empty {
    background-color: transparent;
    cursor: default;
  }

  &-navbar {
    overflow: hidden;
    background-color: @btn-background-color;
  }

  @viewer-list-item-width: 30px;
  @viewer-list-item-height: 50px;
  @viewer-list-item-img-width: @viewer-list-item-width + 30px;
  @viewer-list-item-img-marginLeft: -(@viewer-list-item-img-width - @viewer-list-item-width) /2;

  &-list {
    height: @viewer-list-item-height;
    padding: 1px;
  }

  &-list > li {
    display: inline-block;
    width: @viewer-list-item-width;
    height: @viewer-list-item-height;
    cursor: pointer;
    overflow: hidden;
    margin-right: 1px;
  }

  &-list > li > img {
    width: @viewer-list-item-img-width;
    height: @viewer-list-item-height;
    margin-left: @viewer-list-item-img-marginLeft;
    opacity: .5;
  }  

  &-list > li.active > img {
    opacity: 1;
  }

  @transitionDuration: .3s;
  @transitionFunc: ease-out;

  &-transition {
    transition: opacity @transitionDuration @transitionFunc;
  }

  &-image-transition {
    transition-property: width, height, margin, transform;
    transition-duration: @transitionDuration;
    transition-timing-function: @transitionFunc;
  }

  &-list-transition {
    transition: margin @transitionDuration @transitionFunc;
  }
}

@icon-prefix-cls: react-viewer-icon;

.@{icon-prefix-cls} {
  & {
    font-family: 'icomoon' !important;
    display: inline-block;
    font-style: normal;
    vertical-align: baseline;
    text-align: center;
    text-transform: none;
    text-rendering: auto;
    line-height: 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: white;
    font-size: 13px;    
  }

  &-zoomIn:before {
    content: '\ea0a';
  }

  &-zoomOut:before {
    content: '\ea0b';
  }

  &-prev:before {
    content: '\ea38';
  } 

  &-next:before {
    content: '\ea34';
  } 

  &-close:before {
    content: '\ea0f';
  } 

  &-rotateLeft:before {
    content: '\e967';
  }  

  &-rotateRight:before {
    content: '\e968';
  } 

  &-reset:before {
    content: '\e984';
  }

  &-scaleX:before {
    content: '\ea60';
  } 

  &-scaleY:before {
    content: '\ea5f';
  }     
}

.spin {
  color: #2db7f5;
  vertical-align: middle;
  text-align: center;
  opacity: 0;
  position: absolute;
  -webkit-transition: -webkit-transform .3s cubic-bezier(.78,.14,.15,.86);
  transition: -webkit-transform .3s cubic-bezier(.78,.14,.15,.86);
  transition: transform .3s cubic-bezier(.78,.14,.15,.86);
  transition: transform .3s cubic-bezier(.78,.14,.15,.86),-webkit-transform .3s cubic-bezier(.78,.14,.15,.86);
  font-size: 12px;
  display: none;  
}
.spin-spinning {
  opacity: 1;
  position: static;
  display: inline-block;  
}
.spin-dot {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;  
}
.spin-dot:after, .spin-dot:before {
  content: '';
  border-radius: 50%;
  background-color: #2db7f5;
  -webkit-animation: antSpinBounce 2.2s infinite ease-in-out;
  animation: antSpinBounce 2.2s infinite ease-in-out;
  display: block;
  position: absolute;
  opacity: .5;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.spin-dot:after, .spin-dot:before {
  content: '';
  border-radius: 50%;
  background-color: #2db7f5;
  -webkit-animation: antSpinBounce 2.2s infinite ease-in-out;
  animation: antSpinBounce 2.2s infinite ease-in-out;
  display: block;
  position: absolute;
  opacity: .5;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}
.spin-dot:after {
  -webkit-animation-delay: -1.1s;
  animation-delay: -1.1s;
}
@keyframes antSpinBounce {
  0%,
  100% {
    transform: scale(0);
  }
  50% {
    transform: scale(1);
  }
}