/*!
 * Bootstrap Colorpicker
 * http://mjolnic.github.io/bootstrap-colorpicker/
 *
 * Originally written by (c) 2012 Stefan Petre
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 */
@imgPath: "../img/bootstrap-colorpicker/";

.bgImg(@imgFilename) {
  background-image: url("@{imgPath}@{imgFilename}");
}

.borderRadius(@size) {
          border-radius: @size;

  -webkit-border-radius: @size;
     -moz-border-radius: @size;
}

.colorpicker-saturation {
  float: left;
  width: 100px;
  height: 100px;
  cursor: crosshair;

  .bgImg('saturation.png');
  i {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 5px;
    height: 5px;
    margin: -4px 0 0 -4px;
    border: 1px solid #000;

    .borderRadius(5px);
    b {
      display: block;
      width: 5px;
      height: 5px;
      border: 1px solid #fff;

      .borderRadius(5px);
    }
  }
}

.colorpicker-hue,
.colorpicker-alpha {
  float: left;
  width: 15px;
  height: 100px;
  margin-bottom: 4px;
  margin-left: 4px;
  cursor: row-resize;
  i {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 1px;
    margin-top: -1px;
    background: #000;
    border-top: 1px solid #fff;
  }
}

.colorpicker-hue {
  .bgImg('hue.png');
}

.colorpicker-alpha {
  display: none;

  .bgImg('alpha.png');
}

.colorpicker-saturation,
.colorpicker-hue,
.colorpicker-alpha {
  background-size: contain;
}

.colorpicker {
  top: 0;
  left: 0;
  z-index: 2500;
  min-width: 130px;
  padding: 4px;
  margin-top: 1px;

  *zoom: 1;
  .borderRadius(4px);

  &:before,
  &:after {
    display: table;
    line-height: 0;
    content: "";
  }
  &:after {
    clear: both;
  }
  &:before {
    position: absolute;
    top: -7px;
    left: 6px;
    display: inline-block;
    content: '';
    border-right: 7px solid transparent;
    border-bottom: 7px solid #ccc;
    border-bottom-color: rgba(0, 0, 0, .2);
    border-left: 7px solid transparent;
  }
  &:after {
    position: absolute;
    top: -6px;
    left: 7px;
    display: inline-block;
    content: '';
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
    border-left: 6px solid transparent;
  }
  div {
    position: relative;
  }
  &.colorpicker-with-alpha {
    min-width: 140px;
  }
  &.colorpicker-with-alpha .colorpicker-alpha {
    display: block;
  }
}

.colorpicker-color {
  height: 10px;
  margin-top: 5px;
  clear: both;
  background-position: 0 100%;

  .bgImg('alpha.png');
  div {
    height: 10px;
  }
}

.colorpicker-selectors {
  display: none;
  height: 10px;
  margin-top: 5px;
  clear: both;
  i {
    float: left;
    width: 10px;
    height: 10px;
    cursor: pointer;
  }
  i + i {
    margin-left: 3px;
  }
}

.colorpicker-element .input-group-addon i,
.colorpicker-element .add-on i {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: text-top;
  cursor: pointer;
}

.colorpicker.colorpicker-inline {
  position: relative;
  z-index: auto;
  display: inline-block;
  float: none;
}

.colorpicker.colorpicker-horizontal {
  width: 110px;
  min-width: 110px;
  height: auto;

  .colorpicker-saturation {
    margin-bottom: 4px;
  }
  .colorpicker-color {
    width: 100px;
  }
  .colorpicker-hue,
  .colorpicker-alpha {
    float: left;
    width: 100px;
    height: 15px;
    margin-bottom: 4px;
    margin-left: 0;
    cursor: col-resize;
  }
  .colorpicker-hue i,
  .colorpicker-alpha i {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 1px;
    height: 15px;
    margin-top: 0;
    background: #fff;
    border: none;
  }
  .colorpicker-hue {
    .bgImg('hue-horizontal.png');
  }
  .colorpicker-alpha {
    .bgImg('alpha-horizontal.png');
  }
}

.colorpicker.colorpicker-hidden {
  display: none;
}

.colorpicker.colorpicker-visible {
  display: block;
}

.colorpicker-inline.colorpicker-visible {
  display: inline-block;
}

.colorpicker-right {
  &:before {
    right: 6px;
    left: auto;
  }
  &:after {
    right: 7px;
    left: auto;
  }
}
