/*
@styleguide

@title Button

Use the button classes on and `<a>`, `<button>`, `<input>` elements.

<button class="btn btn-default">Default Button</button>

    <button class="btn btn-default">Default Button</button>

<button class="btn btn-primary">Primary Button</button>

    <button class="btn btn-primary">Primary Button</button>

<button class="btn btn-secondary">Secondary Button</button>

    <button class="btn btn-secondary">Secondary Button</button>

<button class="btn btn-warning">Warning Button</button>

    <button class="btn btn-warning">Warning Button</button>

<button class="btn btn-negative">Negative Button</button>

    <button class="btn btn-negative">Negative Button</button>

<button class="btn btn-positive">Positive Button</button>

    <button class="btn btn-positive">Positive Button</button>
*/


/* Buttons
// ============================== */

%button {
  display: inline-block;
  padding: 0.75em 1em;
  letter-spacing: 0.03rem;
  cursor: pointer;
  font-size: 0.7368em; /*14px*/
  font-family: $primaryfontbold;
  text-transform: uppercase;
  font-weight: 400;
  border: 1px solid $borders;
  color: $primarycolour;
  border-radius: $borderradius;
  transition: all 0.25s;
  position: relative;
  margin-bottom: 0.5em;
  box-shadow: none;
  
  &:hover {
    border-color: rgba(0,0,0,0.16);
    background: $primarycolour;
    box-shadow: 0px 5px 6px rgba(0,0,0,0.14);
    transform: translateY(-1px);
  }

  &:active, &:focus {
    border-color: rgba(0,0,0,0.40);
    outline: none
          
  }
}

%button--default {
  background: $superweak;
  color: $black;
  &:hover {
    background: mix($weak, $black, 30%);
    color: $white;
  }
}

%button--small {
  font-size: 0.7em;
}

%button--primary {
  background: $primarycolour !important;
  color: $white !important;

  &:before {
    opacity: 0.6;
  }

  &:hover {
    background: mix($primarycolour, $white, 77%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--secondary {
  background: $secondarycolour !important;
  color: $white !important;

  &:hover {
    background: mix($secondarycolour, $white, 77%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--positive {
  background: transparent !important;
  color: $positivecolour !important;
  border-color: $positivecolour !important;

  &:hover {
    background: mix($positivecolour, $white, 30%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--info {
  background: transparent !important;
  color: $highlightcolour !important;
  border-color: $highlightcolour !important;

  &:hover {
    background: mix($highlightcolour, $white, 30%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--warning {
  background: $warningcolour !important;
  color: $white !important;

  &:hover {
    background: mix($warningcolour, $white, 70%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--negative {
  background: $negativecolour !important;
  color: $white !important;

  &:hover {
    background: mix($negativecolour, $white, 70%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--highlight {
  background: $highlightcolour !important;
  color: $white !important;

  &:hover {
    background: mix($highlightcolour, $white, 70%) !important;

    &:before {
      opacity: 0;
    }
  }
}

%button--highlight-hover {
  background: mix($highlightcolour, $white, 30%) !important;
}

.btn, .button {
  @extend %button;
}

.btn-default, .button--default {
  @extend %button--default;
}

.btn-primary, .button--primary {
  @extend %button--primary;
}

.btn-secondary, .button--secondary {
  @extend %button--secondary;
}

.btn-success, .btn-positive, .button--positive {
  @extend %button--positive;
}

.btn-warning, .button--warning {
  @extend %button--warning;
}

.btn-danger, .btn-negative, .button--negative {
  @extend %button--negative;
}

.btn-info, .btn-highlight, .button--highlight {
  @extend %button--info;
}

.btn-small, .button--small {
  @extend %button--small;
}

.btn-link{
    border-color: transparent;
    &:hover{
      background: none;   
      border-color: #ccc;
      box-shadow: none;
    }
}


.btn-secondary-outline, .btn-info-outline{
  color: $highlightcolour;
  border-color: $highlightcolour; 
  background: transparent;
  &:hover, &:focus{
      background: $highlightcolour;
  }
}
.btn-primary-outline{
  color: $primarycolour;
  border-color: $primarycolour; 
  background: transparent;
  &:hover, &:focus{
      background: $primarycolour;
  }
}
.btn-success-outline{
  color: $positivecolour;
  border-color: $positivecolour;
  background: transparent;
  &:hover, &:focus{
      background: $positivecolour;
  }
}

.btn-warning-outline{
  color: $warningcolour;
  border-color: $warningcolour;  
  background: transparent;
  &:hover, &:focus{
      background: $warningcolour;
  }
}

.btn-danger-outline{
  color: $negativecolour;
  border-color: $negativecolour; 
  background: transparent;
  &:hover, &:focus{
      background: $negativecolour;
  }
}

/* Specifics
//bigger ripple for tactile buttons */
.btn-tactile {
  &:focus, &:disabled, &.disabled {
    .ripple {
      transform: scale(36);
      transform: scale(36);
      opacity: 0.4;
    }
  }
  .spinner{
    opacity: 0;
    position: absolute !important;
    right: 2px;
    top: 0px;
  }
}

.btn-tactile {
  font-family: $heavyweight;
  position: relative;
  font-size: 0.85em;
  padding: 0.5em 0.8em 0.5em 3em;
  overflow: hidden; 
  &:hover {
    background: $highlightcolour !important;
    border-color: rgba(55, 55, 55, 0.1) !important;
    i{background-color: rgba(255, 255, 255, 0.09);}
  }
  &.btn-with-spinner{
    padding-left: 2.1em;
  }
  .ripple {
    top: 17px;
  }

  i[class^="icon-"], .fa {
    color: $white;
    font-size: 1.5em;
    position: absolute;
    padding: 0.03em 0.3em;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    text-align: center;
    border-radius: 0;
    line-height: 0.9;
    box-shadow: (-1px) 0 0 0 transparent inset;

    &:before {
      padding-top: 9px;
      display: block;
    }

    &:after {
      content: "";
      width: 1px;
      @mixin gradient-3stop-vertical rgba($alphawhite, 0), rgba($alphawhite, 0.3), rgba($alphawhite, 0);
      top: 2px;
      right: 0;
      height: 100%;
      position: absolute;
      display: block;
    }

    &:focus, &:disabled, &.disabled {
      outline: none !important;
      border-color: transparent !important;

      .ripple {
        opacity: 0.3;
        transform: scale(36);
      }
    }

    &.disabled {
      .ripple {
        transform: scale(36);
      }
    }
  }

  .icon-vocusv {
    top: 18%;
    left: 10px;
  }

  .fa-check-circle {
    right: 0 !important;
    left: auto !important;
    top: 0 !important;
  }

  .fa {
    font-size: 1.32em;

    &:before {
      padding-top: 10px;
      display: block;
    }
  }
  .spinner{
    transform: scale(0.6);
  }
  &.disabled, &:disabled, &:focus {
    .spinner {
      opacity: 1;
    }
  }
}

.btn-text{
  background: 0;
  border: 0;
  font-family: $heavyweight;
  color: $primarycolour;
  font-size: 14px;
  letter-spacing: -0.01em;
  float: none;
  vertical-align: top;
  padding-top: 0;
/*  padding-bottom: 40px;*/

  &:hover{
    background: none;
    color: $highlightcolour;
    box-shadow: none;
  }
  &:focus{
    border-color: transparent;
    outline: none;
  }
  i{
    font-size: 32px;
    margin: 0 5px 0 7px;
    position: relative;
    top: 9px;
  }
}
/* Button Ripple */
.ripple {
  width: 5%;
  height: 12%;
  background: #fff;
  opacity: 0;
  position: absolute;
  top: 14px;
  left: 50%;
  margin-left: -5px;
  transform-origin: center center;
  transition-timing-function: ease-out;
  border-radius: 50%;
  transition: 0.9s all;
}


.btn > .dropdown-toggle {
  padding-right: 8px;
  padding-left: 8px;
  border-width: 0;
  border-left-width: 1px;
  margin-bottom: 0;
}
.btn-dropdown{
  padding-right: 2.8em;
  span{
    padding-top: 0.3em;
  }
  .dropdown-toggle{
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    &:hover{
      transform: none;
      box-shadow: none;
      background: rgba(256,255,255,0.2);
    }
    &:after{
      margin-top: -0.1rem;
      margin-left: .15rem;
      border-top: .37em solid;
      border-right: .33em solid transparent;
      border-left: .33em solid transparent;
    }
  }
  
  .dropdown-item, .dropdown-menu{
      text-transform: none;
   }
  
  .btn-secondary&:hover{
    .dropdown-toggle{
      background: mix($highlightcolour, $white, 80%) !important;
    }
  }
  .btn-default&:hover{
    .dropdown-toggle{
      background: mix($darkgrey, $white, 80%) !important;
    }
  }
}

/*override border colour on active*/
.open > .btn-secondary.dropdown-toggle, .open > .btn-secondary.dropdown-toggle:hover{
  border-color: rgba(256,255,255,0.4);
}

