/* Popovers variants */
@mixin popover-variant($name, $color, $bg) {
  .popover.#{$name} .popover-title {
    color: $color;
    background-color: $bg;
  }
}

/* Modal variants */
@mixin modal-variant($name, $brand-color, $text-color) {
  .modal-#{$name} .modal-header {
    background-color: $brand-color;
    color: $text-color;
    font-weight: bold;
    border-top-left-radius: $border-radius-base;
    border-top-right-radius: $border-radius-base;

    & .close {
      color: $text-color;
    }
  }
}

/* Badge variants */
@mixin badge-variant($color, $background) {
  color: $color;
  background-color: $background;
  border: 1px solid $background;

  a & {
      &:hover,
      &:focus {
          color: $color;
      }
  }
}

/* Tag variants */
@mixin tag-variant($color, $background) {
  color: $color;
  background-color: $background;
  border: 1px solid darken(adjust-hue($background, -10), 5%);

  a,i {
    color: $color;

    &:hover,
    &:focus,
    &:active {
      text-decoration: none;
    }
  }

  &:hover,
  &:focus {
        border: 1px solid darken($background, 25%);
        background: lighten($background, 8%);
        cursor: pointer;
        i {
            opacity: 1;
        }
    }
}

/* Pill variants */
@mixin pill-variant($variant, $background-color, $text-color, $border-color) {
  .nav-pills > li.active.#{$variant} > a,
  .nav-pills > li.active.#{$variant} > a:hover,
  .nav-pills > li.active.#{$variant} > a:focus {
    background-color: $background-color;
    color: $text-color;
    border: 1px solid $border-color;
  }

  .list-group-item.active > .badge,
  .nav-pills > .active.#{$variant} > a > .badge {
    color: $gray-base;
    padding: 3px 7px;
    border: 1px solid $gray;
  }

  .nav-pills span.badge {
    font-weight: normal;
  }
}

@mixin button-mixin($background-color, $text-color, $border-color, $variant:"") {
  .btn {
    font-weight: 600;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.4;
    margin: 1px 2px;
  }

  [disabled].btn{
    background-color: $gray-darker !important;
    color: $white !important;
    border: 1px solid $gray-darker;
    font-weight: normal;

    &:focus,
    &:active,
    &.active,
    &:hover {
        color: $gray-lightest;
        background-color: $gray;
        border: 1px solid $gray;
        cursor: not-allowed;
    }
  }

  [disabled].btn-link {
    background-color: transparent !important;
    color: $gray-darker !important;
    border: none;

    &:focus,
    &:active,
    &.active,
    &:hover {
      background-color: transparent !important;
      color: $gray-darker !important;
      border: none;
      cursor: not-allowed;
    }
  }

  .btn-#{$variant} {
    border-radius: $border-radius-base;
    background-color: $background-color;
    color: $text-color;
    border: 1px solid $border-color;

    &:hover {
        color: $text-color;
        @if $variant != "" {
          background-color: lighten($background-color, 2.5%);
        }
        @else {
          background-color: darken($background-color, 2.5%);
        }
    }

    &:focus,
    &:active,
    &.active,
    &.focus {
        color: $text-color;
        @if $variant != "" {
          background-color: lighten($background-color, 5%);
        }
        @else {
          background-color: darken($background-color, 5%);
        }
    }

    &:active {
      &:focus {
        @if $variant != "" {
          background-color: lighten($background-color, 10%);
        }
        @else {
          background-color: darken($background-color, 10%);
        }
      }
    }
  }

}

@mixin table-variant($color, $text-color) {

    background: mix($table-bg-hover, $color, 50%);
    > th {
      color: $text-color !important;
      border-bottom: none;
    }

    &:hover {
      background-color: mix($table-bg-hover, $color, 69%) !important;
    }

    &.table-bordered {
        border-top-color: darken($color, 5%);
        > thead > tr > th {
            border-color: darken($color, 5%);
            border-bottom: 1px solid darken($color, 5%);
            color: $text-color !important;
        }
    }
}




@mixin text-shadow ($string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
  text-shadow: $string;
}
@mixin box-shadow ($string) {
  -webkit-box-shadow: $string;
  -moz-box-shadow:    $string;
  box-shadow:         $string;
}
@mixin drop-shadow ($x: 0, $y: 1px, $blur: 2px, $spread: 0, $alpha: 0.25) {
  -webkit-box-shadow: $x $y $blur $spread rgba(0, 0, 0, $alpha);
  -moz-box-shadow:  $x $y $blur $spread rgba(0, 0, 0, $alpha);
  box-shadow:   $x $y $blur $spread rgba(0, 0, 0, $alpha);
}
@mixin inner-shadow ($x: 0, $y: 1px, $blur: 2px, $spread: 0, $alpha: 0.25) {
  -webkit-box-shadow: inset $x $y $blur $spread rgba(0, 0, 0, $alpha);
  -moz-box-shadow:    inset $x $y $blur $spread rgba(0, 0, 0, $alpha);
  box-shadow:         inset $x $y $blur $spread rgba(0, 0, 0, $alpha);
}

@mixin box-sizing ($type: border-box) {
  -webkit-box-sizing: $type;
  -moz-box-sizing:    $type;
  box-sizing:         $type;
}

@mixin border-radius ($radius: 5px) {
  -webkit-border-radius: $radius;
  -moz-border-radius:    $radius;
  border-radius:         $radius;

  -moz-background-clip:    padding;
  -webkit-background-clip: padding-box;
  background-clip:         padding-box;
}
@mixin border-radiuses ($topright: 0, $bottomright: 0, $bottomleft: 0, $topleft: 0) {
  -webkit-border-top-right-radius:    $topright;
  -webkit-border-bottom-right-radius: $bottomright;
  -webkit-border-bottom-left-radius:  $bottomleft;
  -webkit-border-top-left-radius:     $topleft;

  -moz-border-radius-topright:        $topright;
  -moz-border-radius-bottomright:     $bottomright;
  -moz-border-radius-bottomleft:      $bottomleft;
  -moz-border-radius-topleft:         $topleft;

  border-top-right-radius:            $topright;
  border-bottom-right-radius:         $bottomright;
  border-bottom-left-radius:          $bottomleft;
  border-top-left-radius:             $topleft;

  -moz-background-clip:    padding;
  -webkit-background-clip: padding-box;
  background-clip:         padding-box;
}

@mixin opacity ($opacity: 0.5) {
  -webkit-opacity:  $opacity;
  -moz-opacity:     $opacity;
  opacity:    $opacity;
}

@mixin gradient ($startColor: #eee, $endColor: white) {
  background-color: $startColor;
  background: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor));
  background: -webkit-linear-gradient(top, $startColor, $endColor);
  background: -moz-linear-gradient(top, $startColor, $endColor);
  background: -ms-linear-gradient(top, $startColor, $endColor);
  background: -o-linear-gradient(top, $startColor, $endColor);
}

@mixin horizontal-gradient ($startColor: #eee, $endColor: white) {
  background-color: $startColor;
  background-image: -webkit-gradient(linear, left top, right top, from($startColor), to($endColor));
  background-image: -webkit-linear-gradient(left, $startColor, $endColor);
  background-image: -moz-linear-gradient(left, $startColor, $endColor);
  background-image: -ms-linear-gradient(left, $startColor, $endColor);
  background-image: -o-linear-gradient(left, $startColor, $endColor);
}

@mixin animation ($name, $duration: 300ms, $delay: 0, $ease: ease) {
  -webkit-animation: $name $duration $delay $ease;
  -moz-animation:    $name $duration $delay $ease;
  -ms-animation:     $name $duration $delay $ease;
}

@mixin transition ($transition) {
  -webkit-transition: $transition;
  -moz-transition:    $transition;
  -ms-transition:     $transition;
  -o-transition:      $transition;
}
@mixin transform($string){
  -webkit-transform: $string;
  -moz-transform:    $string;
  -ms-transform:     $string;
  -o-transform:      $string;
}
@mixin scale ($factor) {
  -webkit-transform: scale($factor);
  -moz-transform:    scale($factor);
  -ms-transform:     scale($factor);
  -o-transform:      scale($factor);
}
@mixin rotate ($deg) {
  -webkit-transform: rotate($deg);
  -moz-transform:    rotate($deg);
  -ms-transform:     rotate($deg);
  -o-transform:      rotate($deg);
}
@mixin skew ($deg, $deg2) {
  -webkit-transform: skew($deg, $deg2);
  -moz-transform:    skew($deg, $deg2);
  -ms-transform:     skew($deg, $deg2);
  -o-transform:      skew($deg, $deg2);
}
@mixin translate ($x, $y:0) {
  -webkit-transform: translate($x, $y);
  -moz-transform:    translate($x, $y);
  -ms-transform:     translate($x, $y);
  -o-transform:      translate($x, $y);
}
@mixin translate3d ($x, $y: 0, $z: 0) {
  -webkit-transform: translate3d($x, $y, $z);
  -moz-transform:    translate3d($x, $y, $z);
  -ms-transform:     translate3d($x, $y, $z);
  -o-transform:      translate3d($x, $y, $z);
}
@mixin perspective ($value: 1000) {
  -webkit-perspective:  $value;
  -moz-perspective:   $value;
  -ms-perspective:  $value;
  perspective:    $value;
}
@mixin transform-origin ($x:center, $y:center) {
  -webkit-transform-origin: $x $y;
  -moz-transform-origin:    $x $y;
  -ms-transform-origin:     $x $y;
  -o-transform-origin:      $x $y;
}

@mixin antialiasing ($type:antialiased) {
  /* antialiased, none, subpixel-antialiased*/
	-webkit-font-smoothing: $type;
	font-smoothing: $type;
	font-smooth: always;
}

@mixin max-height ($height: auto) {
  max-height: $height;
  -webkit-transition: max-height $height;
	-moz-transition: max-height $height;
}

// Drop shadows
//
// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
// supported browsers that have box shadow capabilities now support it.
@mixin box-shadow($shadow) {
  -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
  box-shadow: $shadow;
}
