@import "../../../themes/ionic.globals.wp";

// Windows Button
// --------------------------------------------------

/// @prop - Margin top of the button
$button-wp-margin-top: 4px !default;

/// @prop - Margin end of the button
$button-wp-margin-end: 2px !default;

/// @prop - Margin bottom of the button
$button-wp-margin-bottom: 4px !default;

/// @prop - Margin start of the button
$button-wp-margin-start: 2px !default;

/// @prop - Padding top of the button
$button-wp-padding-top: 0 !default;

/// @prop - Padding end of the button
$button-wp-padding-end: 1.1em !default;

/// @prop - Padding bottom of the button
$button-wp-padding-bottom: $button-wp-padding-top !default;

/// @prop - Padding start of the button
$button-wp-padding-start: $button-wp-padding-end !default;

/// @prop - Height of the button
$button-wp-height: 36px !default;

/// @prop - Border width of the button
$button-wp-border-width: 3px !default;

/// @prop - Border style of the button
$button-wp-border-style: solid !default;

/// @prop - Border color of the button
$button-wp-border-color: transparent !default;

/// @prop - Border radius of the button
$button-wp-border-radius: 0 !default;

/// @prop - Font size of the button text
$button-wp-font-size: 14px !default;

/// @prop - Background color of the button
$button-wp-background-color: color($colors-wp, primary) !default;

/// @prop - Text color of the button
$button-wp-text-color: color-contrast($colors-wp, $button-wp-background-color) !default;

/// @prop - Background color of the activated button
$button-wp-background-color-activated: color-shade($button-wp-background-color) !default;

// Windows Large Button
// --------------------------------------------------

/// @prop - Padding top of the large button
$button-wp-large-padding-top: 0 !default;

/// @prop - Padding end of the large button
$button-wp-large-padding-end: 1em !default;

/// @prop - Padding bottom of the large button
$button-wp-large-padding-bottom: $button-wp-large-padding-top !default;

/// @prop - Padding start of the large button
$button-wp-large-padding-start: $button-wp-large-padding-end !default;

/// @prop - Height of the large button
$button-wp-large-height: 2.8em !default;

/// @prop - Font size of the large button
$button-wp-large-font-size: 20px !default;

// Windows Small Button
// --------------------------------------------------

/// @prop - Padding top of the small button
$button-wp-small-padding-top: 0 !default;

/// @prop - Padding end of the small button
$button-wp-small-padding-end: 0.9em !default;

/// @prop - Padding bottom of the small button
$button-wp-small-padding-bottom: $button-wp-small-padding-top !default;

/// @prop - Padding start of the small button
$button-wp-small-padding-start: $button-wp-small-padding-end !default;

/// @prop - Height of the small button
$button-wp-small-height: 2.1em !default;

/// @prop - Font size of the small button
$button-wp-small-font-size: 13px !default;

/// @prop - Font size of an icon in the small button
$button-wp-small-icon-font-size: 1.4em !default;

// Windows Outline Button
// --------------------------------------------------

/// @prop - Border width of the outline button
$button-wp-outline-border-width: 1px !default;

/// @prop - Border style of the outline button
$button-wp-outline-border-style: solid !default;

/// @prop - Border color of the outline button
$button-wp-outline-border-color: $button-wp-background-color !default;

/// @prop - Text color of the outline button
$button-wp-outline-text-color: $button-wp-background-color !default;

/// @prop - Background color of the outline button
$button-wp-outline-background-color: transparent !default;

/// @prop - Background color of the activated outline button
$button-wp-outline-background-color-activated: $button-wp-background-color !default;

/// @prop - Opacity of the background color of the activated outline button
$button-wp-outline-background-color-opacity-activated: 0.16 !default;

// Windows Clear Button
// --------------------------------------------------

/// @prop - Text color of the clear button
$button-wp-clear-text-color: $button-wp-background-color !default;

/// @prop - Background color of the clear button
$button-wp-clear-background-color: transparent !default;

/// @prop - Background color of the activated clear button
$button-wp-clear-background-color-activated: rgba(158, 158, 158, 0.2) !default;

/// @prop - Background color of the clear button on hover
$button-wp-clear-background-color-hover: rgba(158, 158, 158, 0.1) !default;

// Windows Round Button
// --------------------------------------------------

/// @prop - Padding top of the round button
$button-wp-round-padding-top: $button-round-padding-top !default;

/// @prop - Padding end of the round button
$button-wp-round-padding-end: $button-round-padding-end !default;

/// @prop - Padding bottom of the round button
$button-wp-round-padding-bottom: $button-round-padding-bottom !default;

/// @prop - Padding start of the round button
$button-wp-round-padding-start: $button-round-padding-start !default;

/// @prop - Border radius of the round button
$button-wp-round-border-radius: $button-round-border-radius !default;

// Material Design Decorator Button
// --------------------------------------------------

/// @prop - Font weight of the strong button
$button-wp-strong-font-weight: bold !default;

// Windows Default Button
// --------------------------------------------------

.button-wp {
  height: $button-wp-height;
  font-size: $button-wp-font-size;
  color: $button-wp-text-color;
  background-color: $button-wp-background-color;
  border: $button-wp-border-width $button-wp-border-style $button-wp-border-color;

  @include border-radius($button-wp-border-radius);
  @include margin($button-wp-margin-top, $button-wp-margin-end, $button-wp-margin-bottom, $button-wp-margin-start);
  @include padding($button-wp-padding-top, $button-wp-padding-end, $button-wp-padding-bottom, $button-wp-padding-start);
}

.button-wp:hover:not(.disable-hover) {
  background-color: $button-wp-background-color;
  border-color: $button-wp-background-color-activated;
}

.button-wp:active {
  background-color: $button-wp-background-color-activated;
}

// Windows Default Button Color Mixin
// --------------------------------------------------

@mixin wp-button-default($color-name, $color-base, $color-contrast) {
  $bg-color: $color-base;
  $bg-color-activated: color-shade($bg-color);
  $fg-color: $color-contrast;

  .button-wp-#{$color-name} {
    color: $fg-color;
    background-color: $bg-color;
  }

  .button-wp-#{$color-name}:hover:not(.disable-hover) {
    background-color: $bg-color;
    border-color: $bg-color-activated;
  }

  .button-wp-#{$color-name}:active {
    background-color: $bg-color-activated;
  }
}

// Windows Button Sizes
// --------------------------------------------------

.button-large-wp {
  height: $button-wp-large-height;
  font-size: $button-wp-large-font-size;

  @include padding($button-wp-large-padding-top, $button-wp-large-padding-end, $button-wp-large-padding-bottom, $button-wp-large-padding-start);
}

.button-small-wp {
  height: $button-wp-small-height;
  font-size: $button-wp-small-font-size;

  @include padding($button-wp-small-padding-top, $button-wp-small-padding-end, $button-wp-small-padding-bottom, $button-wp-small-padding-start);
}

.button-small-wp[icon-only] ion-icon {
  font-size: $button-wp-small-icon-font-size;
}

// Windows Block Button
// --------------------------------------------------

.button-block-wp {
  @include margin-horizontal(0);
}

// Windows Full Button
// --------------------------------------------------

.button-full-wp {
  border-right-width: 0;
  border-left-width: 0;

  @include margin-horizontal(0);
  @include border-radius(0);
}

// Windows Outline Button
// --------------------------------------------------

.button-outline-wp {
  color: $button-wp-outline-text-color;
  background-color: $button-wp-outline-background-color;
  border-color: $button-wp-outline-border-color;
  border-style: $button-wp-outline-border-style;
  border-width: $button-wp-outline-border-width;
}

.button-outline-wp:hover:not(.disable-hover) {
  background-color: $button-wp-clear-background-color-hover;
}

.button-outline-wp:active {
  background-color: rgba($button-wp-outline-background-color-activated, $button-wp-outline-background-color-opacity-activated);
}

// Windows Outline Button Color Mixin
// --------------------------------------------------

@mixin wp-button-outline($color-name, $color-base, $color-contrast) {
  $fg-color: color-shade($color-base, 5%);

  .button-outline-wp-#{$color-name} {
    color: $fg-color;
    background-color: $button-wp-outline-background-color;
    border-color: $fg-color;
  }

  .button-outline-wp-#{$color-name}:hover:not(.disable-hover) {
    background-color: $button-wp-clear-background-color-hover;
    border-color: $fg-color;
  }

  .button-outline-wp-#{$color-name}:active {
    background-color: rgba($fg-color, $button-wp-outline-background-color-opacity-activated);
  }
}

// Windows Clear Button
// --------------------------------------------------

.button-clear-wp {
  color: $button-wp-clear-text-color;
  background-color: $button-wp-clear-background-color;
}

.button-clear-wp:active {
  background-color: $button-wp-clear-background-color-activated;
}

.button-clear-wp:hover:not(.disable-hover) {
  background-color: $button-wp-clear-background-color-hover;
}

// Windows Clear Button Color Mixin
// --------------------------------------------------

@mixin wp-button-clear($color-name, $color-base, $color-contrast) {
  $fg-color: $color-base;

  .button-clear-wp-#{$color-name} {
    color: $fg-color;
    background-color: $button-wp-clear-background-color;
  }

  .button-clear-wp-#{$color-name}:active {
    background-color: $button-wp-clear-background-color-activated;
  }

  .button-clear-wp-#{$color-name}:hover:not(.disable-hover) {
    color: $fg-color;
  }
}

// Windows Round Button
// --------------------------------------------------

.button-round-wp {
  @include border-radius($button-wp-round-border-radius);
  @include padding($button-wp-round-padding-top, $button-wp-round-padding-end, $button-wp-round-padding-bottom, $button-wp-round-padding-start);
}

.button-wp [icon-only] {
  @include padding(0);
}

// Generate Windows Button Colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  @include wp-button-default($color-name, $color-base, $color-contrast);
  @include wp-button-outline($color-name, $color-base, $color-contrast);
  @include wp-button-clear($color-name, $color-base, $color-contrast);
}

// WP strong Button
// --------------------------------------------------

.button-strong-wp {
  font-weight: $button-wp-strong-font-weight;
}
