@import "colors";

.cm-progress{
  position: relative;
  width: 100%;
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #7f7f7f;


  &.cm-progress-show-info{
    .cm-progress-outer{
      padding-right: 45px;
      margin-right: -45px;
    }
  }
  .cm-progress-outer{
    width: 100%;
    display: inline-block;
  }
  .cm-progress-inner{
    display: inline-block;
    width: 100%;
    background-color: #f7f7f7;
    border-radius: 100px;
    vertical-align: middle;
  }
  .cm-progress-info{
    display: inline-block;
    width: 35px;
    margin-left: 10px;
    font-family: tahoma;
    position: relative;
    top: -1px;
  }

  .cm-progress-bar{
    border-radius: 100px;
    background-color: @color-blue;
    -webkit-transition: all .4s cubic-bezier(.08,.82,.17,1) 0s;
    transition: all .4s cubic-bezier(.08,.82,.17,1) 0s;
    position: relative;
    height: 10px;
  }

  &.cm-progress-active{
    .cm-progress-bar{
      &:before{
        content: "";
        opacity: 0;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-radius: 10px;
        -webkit-animation: cm-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;
        animation: cm-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;
      }
    }
  }

  &.success{
    .cm-progress-bar{
      background-color: @color-success;
    }
  }

  &.warning{
    .cm-progress-bar{
      background-color: @color-warning;
    }
  }

  &.primary{
    .cm-progress-bar{
      background-color: @color-blue;
    }
  }

  &.danger{
    .cm-progress-bar{
      background-color: @color-danger;
    }
  }

  &.cm-progress-circle{
    width: auto;
    .cm-progress-outer{
      width: auto;
      padding-right: 0;
      margin-right: 0;
    }
    .cm-progress-inner{
      position: relative;
      line-height: 1;
      font-size: 25px;
      background-color: transparent;
    }
    .cm-progress-info{
      display: block;
      position: absolute;
      width: 100%;
      text-align: center;
      line-height: 1;
      top: 50%;
      -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
      transform: translateY(-50%);
      left: 0;
      font-family: tahoma;
      margin: 0;
    }
  }

  &.cm-progress-finished{
    .cm-progress-bar{
      background-color: @color-success;
    }
    .cm-progress-info{
      color: @color-success;
    }
  }

  &.cm-progress-exception{
    .cm-progress-bar{
      background-color: @color-danger;
    }
    .cm-progress-info{
      color: @color-danger;
    }
  }

  .cm-progress-bar-path{
    transition: stroke-dashoffset 0.3s ease 0s, stroke 0.3s ease;
  }
}

@-webkit-keyframes cm-progress-dash {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes cm-progress-dash {
  0% {
    stroke-dashoffset: 1000;
  }
  50% {
    stroke-dashoffset: 200;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@-webkit-keyframes cm-progress-active {
  0% {
    opacity: .1;
    width: 0
  }

  20% {
    opacity: .5;
    width: 0
  }

  to {
    opacity: 0;
    width: 100%
  }
}

@keyframes cm-progress-active {
  0% {
    opacity: .1;
    width: 0
  }

  20% {
    opacity: .5;
    width: 0
  }

  to {
    opacity: 0;
    width: 100%
  }
}