// Define functions to use in less
// Animations
.animation(@animation) {
    -webkit-animation: @animation;
        -o-animation: @animation;
            animation: @animation;
}
.animation-name(@name) {
    -webkit-animation-name: @name;
        animation-name: @name;
}
.animation-duration(@duration) {
    -webkit-animation-duration: @duration;
        animation-duration: @duration;
}
.animation-timing-function(@timing-function) {
    -webkit-animation-timing-function: @timing-function;
        animation-timing-function: @timing-function;
}
.animation-delay(@delay) {
    -webkit-animation-delay: @delay;
        animation-delay: @delay;
}
.animation-iteration-count(@iteration-count) {
    -webkit-animation-iteration-count: @iteration-count;
        animation-iteration-count: @iteration-count;
}
.animation-direction(@direction) {
    -webkit-animation-direction: @direction;
        animation-direction: @direction;
}
.animation-fill-mode(@fill-mode) {
    -webkit-animation-fill-mode: @fill-mode;
        animation-fill-mode: @fill-mode;
}

.rgba-color ( @color,  @x:0.6) {
    color: rgba(red(@color), green(@color), blue(@color), @x);
}

.rgba-bg-color (@color,  @x:0.6) {
    background-color: rgba(red(@color), green(@color), blue(@color), @x);
}

.rgba-border (@color,  @x:0.6) {
    border-color: rgba(red(@color), green(@color), blue(@color), @x);
}

.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
    background: @color;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop));
    background: -ms-linear-gradient(bottom, @start, @stop);
    background: -moz-linear-gradient(center bottom, @start 0%, @stop 100%);
    background: -o-linear-gradient(@stop, @start);
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
}

.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
    background: @color;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop)));
    background: -ms-linear-gradient(bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
    background: -moz-linear-gradient(center bottom, rgb(@start,@start,@start) 0%, rgb(@stop,@stop,@stop) 100%);
    background: -o-linear-gradient(rgb(@stop,@stop,@stop), rgb(@start,@start,@start));
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop), rgb(@start,@start,@start)));
}

.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
    border-top: solid 1px @top-color;
    border-left: solid 1px @left-color;
    border-right: solid 1px @right-color;
    border-bottom: solid 1px @bottom-color;
}

.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
    -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
    -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
    box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
}

.rounded(@radius: 2px) {
    -webkit-border-radius: @radius;
    -moz-border-radius: @radius;
    border-radius: @radius;
}

.border-radius(@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;
    .background-clip(padding-box);
}

.border-radius-all(@arguments) {
    -webkit-border-radius: @arguments;
    -moz-border-radius: @arguments;
    border-radius: @arguments;
    .background-clip(padding-box);
}

.opacity(@opacity: 0.5) {
    -moz-opacity: @opacity;
    -khtml-opacity: @opacity;
    -webkit-opacity: @opacity;
    opacity: @opacity;
    @opperc: @opacity * 100;
    -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
    filter: ~"alpha(opacity=@{opperc})";
}

.transition-duration(@duration: 0.2s) {
    -moz-transition-duration: @duration;
    -webkit-transition-duration: @duration;
    -ms-transition-duration: @duration;
    -o-transition-duration: @duration;
    transition-duration: @duration;
}
.transform-origin(@origin) {
    -moz-transform-origin: @origin;
    -webkit-transform-origin: @origin;
    -ms-transform-origin: @origin;
    -o-transform-origin: @origin;
    transform-origin: @origin;
}

.transform(...) {
    -webkit-transform: @arguments;
    -moz-transform: @arguments;
    -o-transform: @arguments;
    -ms-transform: @arguments;
    transform: @arguments;
}

.rotation(@deg:5deg) {
    .transform(rotate(@deg));
}

// Transformations
.scale(@ratio) {
  -webkit-transform: scale(@ratio);
      -ms-transform: scale(@ratio); // IE9 only
       -o-transform: scale(@ratio);
          transform: scale(@ratio);
}
.scale(@ratioX; @ratioY) {
  -webkit-transform: scale(@ratioX, @ratioY);
      -ms-transform: scale(@ratioX, @ratioY); // IE9 only
       -o-transform: scale(@ratioX, @ratioY);
          transform: scale(@ratioX, @ratioY);
}
.scaleX(@ratio) {
  -webkit-transform: scaleX(@ratio);
      -ms-transform: scaleX(@ratio); // IE9 only
       -o-transform: scaleX(@ratio);
          transform: scaleX(@ratio);
}
.scaleY(@ratio) {
  -webkit-transform: scaleY(@ratio);
      -ms-transform: scaleY(@ratio); // IE9 only
       -o-transform: scaleY(@ratio);
          transform: scaleY(@ratio);
}
.skew(@x; @y) {
  -webkit-transform: skewX(@x) skewY(@y);
      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
       -o-transform: skewX(@x) skewY(@y);
          transform: skewX(@x) skewY(@y);
}
.translate(@x; @y) {
  -webkit-transform: translate(@x, @y);
      -ms-transform: translate(@x, @y); // IE9 only
       -o-transform: translate(@x, @y);
          transform: translate(@x, @y);
}
.translateY(@y) {
  -webkit-transform: translateY(@y);
      -ms-transform: translateY(@y); // IE9 only
       -o-transform: translateY(@y);
          transform: translateY(@y);
}
.translateX(@x) {
  -webkit-transform: translateX(@x);
      -ms-transform: translateX(@x); // IE9 only
       -o-transform: translateX(@x);
          transform: translateX(@x);
}
.translate3d(@x; @y; @z) {
  -webkit-transform: translate3d(@x, @y, @z);
          transform: translate3d(@x, @y, @z);
}
.rotate(@degrees) {
  -webkit-transform: rotate(@degrees);
      -ms-transform: rotate(@degrees); // IE9 only
       -o-transform: rotate(@degrees);
          transform: rotate(@degrees);
}
.rotateX(@degrees) {
  -webkit-transform: rotateX(@degrees);
      -ms-transform: rotateX(@degrees); // IE9 only
       -o-transform: rotateX(@degrees);
          transform: rotateX(@degrees);
}
.rotateY(@degrees) {
  -webkit-transform: rotateY(@degrees);
      -ms-transform: rotateY(@degrees); // IE9 only
       -o-transform: rotateY(@degrees);
          transform: rotateY(@degrees);
}
.perspective(@perspective) {
  -webkit-perspective: @perspective;
     -moz-perspective: @perspective;
          perspective: @perspective;
}
.perspective-origin(@perspective) {
  -webkit-perspective-origin: @perspective;
     -moz-perspective-origin: @perspective;
          perspective-origin: @perspective;
}
.transform-origin(@origin) {
  -webkit-transform-origin: @origin;
     -moz-transform-origin: @origin;
      -ms-transform-origin: @origin; // IE9 only
          transform-origin: @origin;
}

// Transitions

.transition(@transition) {
  -webkit-transition: @transition;
       -o-transition: @transition;
          transition: @transition;
}
.transitions(@atr1; @atr2) {
  -webkit-transition: @atr1, @atr2;
       -o-transition: @atr1, @atr2;
          transition: @atr1, @atr2;
}
.transition-property(@transition-property) {
  -webkit-transition-property: @transition-property;
          transition-property: @transition-property;
}
.transition-delay(@transition-delay) {
  -webkit-transition-delay: @transition-delay;
          transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
  -webkit-transition-duration: @transition-duration;
          transition-duration: @transition-duration;
}
.transition-timing-function(@timing-function) {
  -webkit-transition-timing-function: @timing-function;
          transition-timing-function: @timing-function;
}
.transition-transform(@transition) {
  -webkit-transition: -webkit-transform @transition;
     -moz-transition: -moz-transform @transition;
       -o-transition: -o-transform @transition;
          transition: transform @transition;
}
// Grayscale
.grayscale(@grayscale) {
     -webkit-filter: grayscale(@grayscale);
        -moz-filter: grayscale(@grayscale);
          -o-filter:  grayscale(@grayscale);
          -ms-filter: grayscale(@grayscale);       
              filter: grayscale(@grayscale); 
}

// Filter 
.filter(@filter) {
  -webkit-filter: @filter;
     -moz-filter: @filter;
       -o-filter: @filter;
      -ms-filter: @filter;
          filter: @filter;
}
// Blur
.blur(@blur) {
     -webkit-filter: blur(@blur);
        -moz-filter: blur(@blur);
          -o-filter:  blur(@blur);
          -ms-filter: blur(@blur);       
              filter: blur(@blur); 
}

// User select
// For selecting text on the page
.user-select(@select) {
  -webkit-user-select: @select;
     -moz-user-select: @select;
      -ms-user-select: @select; // IE10+
          user-select: @select;
}

// transform
.transform(@transform) {
  -webkit-transform: @transform;
      -ms-transform: @transform; // IE9 only
       -o-transform: @transform;
          transform: @transform;
}

.inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
    -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
    -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
    box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
}

.box-shadow(@arguments) {
    -webkit-box-shadow: @arguments;
    -moz-box-shadow: @arguments;
    box-shadow: @arguments;
}

.box-sizing(@sizing: border-box) {
    -ms-box-sizing: @sizing;
    -moz-box-sizing: @sizing;
    -webkit-box-sizing: @sizing;
    box-sizing: @sizing;
}

.user-select(@argument: none) {
    -webkit-user-select: @argument;
    -moz-user-select: @argument;
    -ms-user-select: @argument;
    user-select: @argument;
}

.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
    -moz-column-width: @colwidth;
    -moz-column-count: @colcount;
    -moz-column-gap: @colgap;
    -moz-column-rule-color: @columnRuleColor;
    -moz-column-rule-style: @columnRuleStyle;
    -moz-column-rule-width: @columnRuleWidth;
    -webkit-column-width: @colwidth;
    -webkit-column-count: @colcount;
    -webkit-column-gap: @colgap;
    -webkit-column-rule-color: @columnRuleColor;
    -webkit-column-rule-style: @columnRuleStyle;
    -webkit-column-rule-width: @columnRuleWidth;
    column-width: @colwidth;
    column-count: @colcount;
    column-gap: @colgap;
    column-rule-color: @columnRuleColor;
    column-rule-style: @columnRuleStyle;
    column-rule-width: @columnRuleWidth;
}

.translate(@x:0, @y:0) {
    .transform(translate(@x, @y));
}

.background-clip(@argument: padding-box) {
    -moz-background-clip: @argument;
    -webkit-background-clip: @argument;
    background-clip: @argument;
}

.fade {
   opacity: 0;
   -webkit-transition: opacity 0.35s linear;
      -moz-transition: opacity 0.35s linear;
       -ms-transition: opacity 0.35s linear;
        -o-transition: opacity 0.35s linear;
           transition: opacity 0.35s linear;
 }

 .fade-scale {
  transform: scale(0);
  opacity: 0;
  -webkit-transition: all .35s linear;
  -o-transition: all .35s linear;
  transition: all .35s linear;
}

.fade-scale.in {
  opacity: 1;
  .transform(scale(1));
}

// FIXED CLASS
.fixed() {
    -webkit-backface-visibility: visible;
    -moz-backface-visibility: visible;
    -ms-backface-visibility: visible;
    backface-visibility: visible;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

//toRightFromLeft

@-webkit-keyframes toRightFromLeft {
    49% {
        -webkit-transform: translate(100%);
    }
    50% {
        opacity: 0;
        -webkit-transform: translate(-100%);
    }
    51% {
        opacity: 1;
    }
}
@-moz-keyframes toRightFromLeft {
    49% {
        -moz-transform: translate(100%);
    }
    50% {
        opacity: 0;
        -moz-transform: translate(-100%);
    }
    51% {
        opacity: 1;
    }
}
@keyframes toRightFromLeft {
    49% {
        transform: translate(100%);
    }
    50% {
        opacity: 0;
        transform: translate(-100%);
    }
    51% {
        opacity: 1;
    }
}

/* Wobble Horizontal */

@-webkit-keyframes hvr-wobble-horizontal {
    16.65% {
        -webkit-transform: translateX(8px);
        transform: translateX(8px);
    }

    33.3% {
        -webkit-transform: translateX(-6px);
        transform: translateX(-6px);
    }

    49.95% {
        -webkit-transform: translateX(4px);
        transform: translateX(4px);
    }

    66.6% {
        -webkit-transform: translateX(-2px);
        transform: translateX(-2px);
    }

    83.25% {
        -webkit-transform: translateX(1px);
        transform: translateX(1px);
    }

    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}

@keyframes hvr-wobble-horizontal {
    16.65% {
        -webkit-transform: translateX(8px);
        transform: translateX(8px);
    }

    33.3% {
        -webkit-transform: translateX(-6px);
        transform: translateX(-6px);
    }

    49.95% {
        -webkit-transform: translateX(4px);
        transform: translateX(4px);
    }

    66.6% {
        -webkit-transform: translateX(-2px);
        transform: translateX(-2px);
    }

    83.25% {
        -webkit-transform: translateX(1px);
        transform: translateX(1px);
    }

    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}
// Placeholder text
.placeholder(@color: @input-color-placeholder) {
    &::-moz-placeholder {
        color: @color;   // Firefox
        opacity: 1; 
    } // See https://github.com/twbs/bootstrap/pull/11526
    &:-ms-input-placeholder { 
        color: @color; 
    } // Internet Explorer 10+
    &::-webkit-input-placeholder { 
        color: @color; 
    } // Safari and Chrome
}
.transformxy(@trX: -50%, @trY: -50%) {
    left: 50%;
    top: 50%;
    bottom: auto;
    right: auto;
    -webkit-transform: translateX(@trX) translateY(@trY);
    -moz-transform: translateX(@trX) translateY(@trY);
    transform: translateX(@trX) translateY(@trY);
}
.transformX(@trX: -50%) {
    left: 50%;
    right: auto;
    -webkit-transform: translateX(@trX);
    -moz-transform: translateX(@trX);
    transform: translateX(@trX);
}
.transformY(@trY: -50%) {
    top: 50%;
    bottom: auto;
    -webkit-transform: translateY(@trY);
    -moz-transform: translateY(@trY);
    transform: translateY(@trY);
}