//Core mixins

//-------------------------
// Coloring
//-------------------------

.linear-gradient(@style;) {
  background-image: -webkit-linear-gradient(@style);
  background-image: -moz-linear-gradient(@style);
  background-image: -o-linear-gradient(@style);
  background-image: -ms-linear-gradient(@style);
  background-image: linear-gradient(@style);
}

.linear-gradient(@from; @to;) {
  background-color: @to;
  .linear-gradient(~`"@{from},@{to}"`);
}

.linear-gradient(none) {
  background-image: none;
}


.radial-gradient(@style;) {
  background-image: -webkit-radial-gradient(@style);
  background-image: -moz-radial-gradient(@style);
  background-image: -o-radial-gradient(@style);
  background-image: -ms-radial-gradient(@style);
  background-image: radial-gradient(@style);
}

.radial-gradient(@x; @y; @from; @to;) {
  background-color: @to;
  @style: ~`"@{x} @{y}, circle, @{from}, @{to}"`;
  .radial-gradient(@style);
}

.radial-gradient(none) {
  background-image: none;
}

.white-back(@dense) {
  background-color: rgba(255, 255, 255,@dense);
}

.black-back(@dense) {
  background-color: rgba(0, 0, 0,@dense);
}


//-------------------------
// Shadows
//-------------------------

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

.box-shadow(@size; @dense;) {
  .box-shadow(@size rgba(0, 0, 0,@dense));
};

.text-shadow(@shadow;) {
  -moz-text-shadow: @shadow;
  -o-text-shadow: @shadow;
  -ms-text-shadow: @shadow;
  text-shadow: @shadow;
}

.text-shadow(@size, @dense) {
  .text-shadow(@size rgba(0, 0, 0,@dense));
}

//-------------------------
// Transforms
//-------------------------

//noinspection CssUnknownProperty
.border-radius(@radius;) {
  -webkit-border-radius: @radius;
  -moz-border-radius: @radius;
  -o-border-radius: @radius;
  -ms-border-radius: @radius;
  border-radius: @radius;
}

.border-radius(@UL; @UR; @DR; @DL;) {
  .border-radius(@UL @UR @DR @DL;);
}

//noinspection CssUnknownProperty
.rotate(@deg;) {
  -webkit-transform: rotate(@deg);
  -moz-transform: rotate(@deg);
  -o-transform: rotate(@deg);
  -ms-transform: rotate(@deg);
  transform: rotate(@deg);
}

//noinspection CssUnknownProperty
.scale(@scale;) {
  -moz-transform: scale(@scale);
  -webkit-transform: scale(@scale);
  -ms-transform: scale(@scale);
  -o-transform: scale(@scale);
  transform: scale(@scale);
}

//noinspection CssUnknownProperty
.skew(@deg;) {
  -webkit-transform: skew(@deg);
  -moz-transform: skew(@deg);
  -o-transform: skew(@deg);
  -ms-transform: skew(@deg);
  transform: skew(@deg);
}

.cover(@z;) {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: @z;
  content: '';
  text-align: center;
  .box-sizing(border-box);
}

//-------------------------
// Sizing
//-------------------------

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


.square(@length;) {
  width: @length;
  height: @length;
}

.circle(@radius;) {
  .border-radius(50%);
  .square(@radius * 2);
}

//-------------------------
// Positioning
//-------------------------
.stick-left(@px) {
  position: absolute;
  left: @px;
}

.stick-top(@px) {
  position: absolute;
  top: @px;
}

.stick-right(@px) {
  position: absolute;
  right: @px;
}

.stick-bottom(@px) {
  position: absolute;
  bottom: @px;
}
.position(@left, @top){
  left:@left;
  top:@top;
}

//-------------------------
// Interactivity
//-------------------------
//noinspection CssUnknownProperty
.user-select(@userSelect) {
  -webkit-user-select: @userSelect;
  -moz-user-select: @userSelect;
  -o-user-select: @userSelect;
  -ms-user-select: @userSelect;
  user-select: @userSelect;
}

//noinspection CssUnknownProperty
.pointer-events(@event) {
  -ms-pointer-events: @event;
  -moz-pointer-events: @event;
  -o-pointer-events: @event;
  pointer-events: @event;
}

.grabbable() {
  cursor: pointer;
  cursor: -moz-grab;
  cursor: -o-grab;
  cursor: -webkit-grab;
  cursor: -ms-grab;
  &:active {
    cursor: -moz-grabbing;
    cursor: -webkit-grabbing;
    cursor: -o-grabbing;
    cursor: -ms-grabbing;
  }
}


//-------------------------
// Animations
//-------------------------
//noinspection CssUnknownProperty
.animation(@animation;){
  -webkit-animation: @animation;
  -moz-animation: @animation;
  -o-animation: @animation;
  animation: @animation;
}
//noinspection CssUnknownProperty
.transition(@transition;){
  -webkit-transition: @transition;
  -moz-transition: @transition;
  -ms-transition: @transition;
  -o-transition: @transition;
  transition: @transition;
}
