/* MODULE SCSS => ./scss2/_button.scss
*//*
 * LICENCE : CloudUnit is available under the Affero Gnu Public License GPL V3 : https://www.gnu.org/licenses/agpl-3.0.html
 *     but CloudUnit is licensed too under a standard commercial license.
 *     Please contact our sales team if you would like to discuss the specifics of our Enterprise license.
 *     If you are not sure whether the GPL is right for you,
 *     you can always test our software under the GPL and inspect the source code before you contact us
 *     about purchasing a commercial license.
 *
 *     LEGAL TERMS : "CloudUnit" is a registered trademark of Treeptik and can't be used to endorse
 *     or promote products derived from this project without prior written permission from Treeptik.
 *     Products or services derived from this software may not be called "CloudUnit"
 *     nor may "Treeptik" or similar confusing terms appear in their names without prior written permission.
 *     For any questions, contact us : contact@treeptik.fr
 */

.button, .icon-button {
  position: relative;
  outline: 0;
  border: 0;
  padding: 0;
  background-color: transparent;
  line-height: normal;
}

//button
.button {
  text-transform: uppercase;
  font-weight: 600;
  padding: 9px 18px;
  min-width: 88px;
  font-size: 14px;
  display: inline-block;
  text-align: center;
  overflow: hidden;
  margin-left : 5px;
}

.button.raised {
  background-color: $color-primary;
  color: #fff;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, .24);
}

.button.raised:hover {
  box-shadow: 1px 1px 1px rgba(0, 0, 0, .24);
  background-color: $color-primary;
  color: #fff;
}

.icon-button {
  display: inline-block;
  text-align: center;
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 36px;
  i {
    display: inline-block;
    vertical-align: middle;
    background-repeat: no-repeat;
    position: relative;
    font-size: 16px;
    height: 20px;
    width: 20px;
    margin: 12px 0;
  }
}

.icon-button.danger {
  color: $brand-danger;
}

.icon-button.selected, .icon-button.selected:hover {
  color: $color-primary;
}

.subheader .icon-button .icon-whhg {
  font-size: 21px;
}

.float-button {
  position: fixed;
  width: 56px;
  height: 56px;
  outline: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  bottom: 2%;
  right: 0;
  background-color: $brand-success;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  .ink {
    background: rgba(255, 255, 255, 0.19);
  }
}

.float-button:active {
  box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.26);
}

.app-button {
  float: left;
  margin-left: 5px;
  margin-top: 10px;
  margin-right: 5px;
  width: 45px;
  height: 45px;
  outline: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background-color: $color-primary;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover, .icon-button:hover {
  background-color: transparent;
  text-decoration: none;
  color: inherit;
}

.button:disabled,
.button.disabled,
.icon-button.disabled,
.icon-button:disabled,
.button.raised:disabled,
.button.raised.disabled,
.button.raised:disabled:hover,
.button.raised.disabled:hover {
  color: $color-disabled;
  background-color: $color-bg-muted;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
  box-shadow: none;
}

.icon-button.disabled:hover {
  background-color: transparent;
}

.button-link {
  line-height: 24px;
}

.ink {
  display: block;
  position: absolute;
  background: rgba(0, 0, 0, .2);
  border-radius: 100%;
  @include scale(0);
}

/*animation effect*/
.ink.animate {
  @include animation(ripple 0.5s linear);
}

@keyframes ripple {
  /*scale the element to 250% to safely cover the entire link and fade it out*/
  100% {
    @include opacity(0);
    @include scale(2.5);
  }
}

button.button-effect {
  float: left;
  min-width: 105px;
  display: block;
  margin: 0em;
  margin-left: 1em;
  border: none;
  background: none;
  color: inherit;
  position: relative;
  z-index: 1;
  -moz-osx-font-smoothing: grayscale;
  font-size: 1.2em;
  font-weight: 600;
  background: none;
  border: none;
  height: 50px;
  transition: color 0.3s;
  -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
  transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
  color: white;
}

button.button-effect.small {
  height: 30px;
  min-width: 95px;
}

button.button-effect:focus {
  outline: none;
}

button.button-effect > span {
  vertical-align: middle;
}

button.button-effect::before,
button.button-effect::after {
  content: '';
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
  transition: transform 0.3s, opacity 0.3s;
  -webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
  transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
}

button.button-effect::before {
  border: 2px solid $color-primary;
  opacity: 0;
  -webkit-transform: scale3d(1.2, 1.2, 1);
  transform: scale3d(1.2, 1.2, 1);
  border-width: 1px;
  border-color: $color-primary;
}

button.button-effect::after {
  background: $color-primary;
}

button.button-effect:hover {
  color: $color-primary;
}

button.button-effect:hover::before {
  opacity: 1;
  -webkit-transform: scale3d(1, 1, 1);
  transform: scale3d(1, 1, 1);
}

button.button-effect:hover::after {
  opacity: 0;
  -webkit-transform: scale3d(0.8, 0.8, 1);
  transform: scale3d(0.8, 0.8, 1);
}

button.button-effect.disabled,
button.button-effect[disabled],
button.button-effect.disabled::after,
button.button-effect[disabled]::after {
  color: $color-disabled;
  background: $color-bg-muted;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
  box-shadow: none;
}

button.button-effect:active {
    border-color: darken( $color-primary, 10% );
}