@import "../../themes/ionic.globals.ios";

// iOS Alerts
// --------------------------------------------------

/// @prop - Max width of the alert
$alert-ios-max-width:                           270px !default;

/// @prop - Border radius of the alert
$alert-ios-border-radius:                       13px !default;

/// @prop - Background color of the alert
$alert-ios-background:                          #f8f8f8 !default;

/// @prop - Box shadow of the alert
$alert-ios-box-shadow:                          none !default;

// deprecated
$alert-ios-head-padding:                        null !default;

/// @prop - Padding top of the alert head
$alert-ios-head-padding-top:                    12px !default;

/// @prop - Padding end of the alert head
$alert-ios-head-padding-end:                    16px !default;

/// @prop - Padding bottom of the alert head
$alert-ios-head-padding-bottom:                 7px !default;

/// @prop - Padding start of the alert head
$alert-ios-head-padding-start:                  $alert-ios-head-padding-end !default;

/// @prop - Text align of the alert head
$alert-ios-head-text-align:                     center !default;

/// @prop - Margin top of the alert title
$alert-ios-title-margin-top:                    8px !default;

/// @prop - Font size of the alert title
$alert-ios-title-font-size:                     17px !default;

/// @prop - Font weight of the alert title
$alert-ios-title-font-weight:                   600 !default;

/// @prop - Font size of the alert sub title
$alert-ios-sub-title-font-size:                 14px !default;

/// @prop - Text color of the alert sub title
$alert-ios-sub-title-text-color:                #666 !default;

// deprecated
$alert-ios-message-padding:                     null !default;

/// @prop - Padding top of the alert message
$alert-ios-message-padding-top:                 0 !default;

/// @prop - Padding end of the alert message
$alert-ios-message-padding-end:                 16px !default;

/// @prop - Padding bottom of the alert message
$alert-ios-message-padding-bottom:              21px !default;

/// @prop - Padding start of the alert message
$alert-ios-message-padding-start:               $alert-ios-message-padding-end !default;


/// @prop - Font size of the alert message
$alert-ios-message-font-size:                   13px !default;

/// @prop - Text align of the alert message
$alert-ios-message-text-align:                  center !default;

/// @prop - Text color of the alert message
$alert-ios-message-text-color:                  inherit !default;

// deprecated
$alert-ios-message-padding-empty:               null !default;

/// @prop - Padding top of the alert empty message
$alert-ios-message-empty-padding-top:           0 !default;

/// @prop - Padding end of the alert empty message
$alert-ios-message-empty-padding-end:           0 !default;

/// @prop - Padding bottom of the alert empty message
$alert-ios-message-empty-padding-bottom:        12px !default;

/// @prop - Padding start of the alert empty message
$alert-ios-message-empty-padding-start:         0 !default;

/// @prop - Maximum height of the alert content
$alert-ios-content-max-height:                  240px !default;

/// @prop - Margin top of the alert input
$alert-ios-input-margin-top:                    10px !default;

// deprecated
$alert-ios-input-padding:                       null !default;

/// @prop - Padding top on the alert input
$alert-ios-input-padding-top:                   6px !default;

/// @prop - Padding end on the alert input
$alert-ios-input-padding-end:                   $alert-ios-input-padding-top !default;

/// @prop - Padding bottom on the alert input
$alert-ios-input-padding-bottom:                $alert-ios-input-padding-top !default;

/// @prop - Padding start on the alert input
$alert-ios-input-padding-start:                 $alert-ios-input-padding-end !default;

/// @prop - Border color of the alert input
$alert-ios-input-border-color:                  #ccc !default;

/// @prop - Border of the alert input
$alert-ios-input-border:                        $hairlines-width solid $alert-ios-input-border-color !default;

/// @prop - Border radius of the alert input
$alert-ios-input-border-radius:                 4px !default;

/// @prop - Background color of the alert input
$alert-ios-input-background-color:              #fff !default;

/// @prop - Flex wrap of the alert button group
$alert-ios-button-group-flex-wrap:              wrap !default;

/// @prop - Flex of the alert button
$alert-ios-button-flex:                         1 1 auto !default;

/// @prop - Margin of the alert button
$alert-ios-button-margin:                       0 !default;

/// @prop - Min width of the alert button
$alert-ios-button-min-width:                    50% !default;

/// @prop - Minimum height of the alert button
$alert-ios-button-min-height:                   44px !default;

/// @prop - Font size of the alert button
$alert-ios-button-font-size:                    17px !default;

/// @prop - Color of the text in the alert button
$alert-ios-button-text-color:                   color($colors-ios, primary) !default;

/// @prop - Background color of the alert button
$alert-ios-button-background-color:             transparent !default;

/// @prop - Background color of the alert activated button
$alert-ios-button-background-color-activated:   #e9e9e9 !default;

/// @prop - Border width of the alert button
$alert-ios-button-border-width:                 $hairlines-width !default;

/// @prop - Border style of the alert button
$alert-ios-button-border-style:                 solid !default;

/// @prop - Border color of the alert button
$alert-ios-button-border-color:                 #dbdbdf !default;

/// @prop - Border radius of the alert button
$alert-ios-button-border-radius:                0 !default;

/// @prop - Font weight of the main text on the alert button
$alert-ios-button-main-font-weight:             bold !default;

/// @prop - Border top of the alert list
$alert-ios-list-border-top:                     $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color !default;

// deprecated
$alert-ios-radio-label-padding:                 null !default;

/// @prop - Padding top on the label for the radio alert
$alert-ios-radio-label-padding-top:             13px !default;

/// @prop - Padding end on the label for the radio alert
$alert-ios-radio-label-padding-end:             $alert-ios-radio-label-padding-top !default;

/// @prop - Padding bottom on the label for the radio alert
$alert-ios-radio-label-padding-bottom:          $alert-ios-radio-label-padding-top !default;

/// @prop - Padding start on the label for the radio alert
$alert-ios-radio-label-padding-start:           $alert-ios-radio-label-padding-end !default;

/// @prop - Text color of the label for the radio alert
$alert-ios-radio-label-text-color:              initial !default;

/// @prop - Text color of the label for the checked radio alert
$alert-ios-radio-label-text-color-checked:      $alert-ios-button-text-color !default;

/// @prop - Min width of the radio alert
$alert-ios-radio-min-width:                     30px !default;

/// @prop - Top of the icon in the radio alert
$alert-ios-radio-icon-top:                      -7px !default;

// deprecated
$alert-ios-radio-icon-left:                     7px !default;
/// @prop - Start of the icon in the radio alert
$alert-ios-radio-icon-start:                    $alert-ios-radio-icon-left !default;

/// @prop - Width of the icon in the radio alert
$alert-ios-radio-icon-width:                    6px !default;

/// @prop - Height of the icon in the radio alert
$alert-ios-radio-icon-height:                   12px !default;

/// @prop - Border width of the icon in the radio alert
$alert-ios-radio-icon-border-width:             2px !default;

/// @prop - Border style of the icon in the radio alert
$alert-ios-radio-icon-border-style:             solid !default;

/// @prop - Border color of the icon in the radio alert
$alert-ios-radio-icon-border-color:             $alert-ios-button-text-color !default;

/// @prop - Transform of the icon in the radio alert
$alert-ios-radio-icon-transform:                rotate(45deg) !default;

// deprecated
$alert-ios-checkbox-label-padding:              null !default;

/// @prop - Padding top of the label for the checkbox in the alert
$alert-ios-checkbox-label-padding-top:          13px !default;

/// @prop - Padding end of the label for the checkbox in the alert
$alert-ios-checkbox-label-padding-end:          $alert-ios-checkbox-label-padding-top !default;

/// @prop - Padding bottom of the label for the checkbox in the alert
$alert-ios-checkbox-label-padding-bottom:       $alert-ios-checkbox-label-padding-top !default;

/// @prop - Padding start of the label for the checkbox in the alert
$alert-ios-checkbox-label-padding-start:        $alert-ios-checkbox-label-padding-end !default;

/// @prop - Text color of the label for the checkbox in the alert
$alert-ios-checkbox-label-text-color:           initial !default;

/// @prop - Text color of the label for the checked checkbox in the alert
$alert-ios-checkbox-label-text-color-checked:   initial !default;

// deprecated
$alert-ios-checkbox-margin:                     null !default;

/// @prop - Margin top of the checkbox in the alert
$alert-ios-checkbox-margin-top:                 10px !default;

/// @prop - Margin end of the checkbox in the alert
$alert-ios-checkbox-margin-end:                 6px !default;

/// @prop - Margin bottom of the checkbox in the alert
$alert-ios-checkbox-margin-bottom:              10px !default;

/// @prop - Margin start of the checkbox in the alert
$alert-ios-checkbox-margin-start:               16px !default;

/// @prop - Size of the checkbox in the alert
$alert-ios-checkbox-size:                       21px !default;

/// @prop - Border width of the checkbox in the alert
$alert-ios-checkbox-border-width:               $hairlines-width !default;

/// @prop - Border style of the checkbox in the alert
$alert-ios-checkbox-border-style:               solid !default;

/// @prop - Border radius of the checkbox in the alert
$alert-ios-checkbox-border-radius:              50% !default;

/// @prop - Border color of the checkbox in the alert when off
$alert-ios-checkbox-border-color-off:           $list-ios-border-color !default;

/// @prop - Border color of the checkbox in the alert when on
$alert-ios-checkbox-border-color-on:            color($colors-ios, primary) !default;

/// @prop - Background color of the checkbox in the alert when off
$alert-ios-checkbox-background-color-off:       $list-ios-background-color !default;

/// @prop - Background color of the checkbox in the alert when on
$alert-ios-checkbox-background-color-on:        color($colors-ios, primary) !default;

/// @prop - Top of the icon in the checkbox alert
$alert-ios-checkbox-icon-top:                   4px !default;

// deprecated
$alert-ios-checkbox-icon-left:                  7px !default;
/// @prop - Start of the icon in the checkbox alert
$alert-ios-checkbox-icon-start:                 $alert-ios-checkbox-icon-left !default;

/// @prop - Width of the icon in the checkbox alert
$alert-ios-checkbox-icon-width:                 4px !default;

/// @prop - Height of the icon in the checkbox alert
$alert-ios-checkbox-icon-height:                9px !default;

/// @prop - Border width of the icon in the checkbox alert
$alert-ios-checkbox-icon-border-width:          $alert-ios-checkbox-border-width !default;

/// @prop - Border style of the icon in the checkbox alert
$alert-ios-checkbox-icon-border-style:          $alert-ios-checkbox-border-style !default;

/// @prop - Border color of the icon in the checkbox alert
$alert-ios-checkbox-icon-border-color:          $background-ios-color !default;

/// @prop - Transform of the icon in the checkbox alert
$alert-ios-checkbox-icon-transform:             rotate(45deg) !default;


.alert-ios .alert-wrapper {
  @include border-radius($alert-ios-border-radius);

  overflow: hidden;

  max-width: $alert-ios-max-width;

  background-color: $alert-ios-background;

  box-shadow: $alert-ios-box-shadow;
}


// iOS Alert Header
// --------------------------------------------------

.alert-ios .alert-head {
  @include text-align($alert-ios-head-text-align);

  @include deprecated-variable(padding, $alert-ios-head-padding) {
    @include padding($alert-ios-head-padding-top, $alert-ios-head-padding-end, $alert-ios-head-padding-bottom, $alert-ios-head-padding-start);
  }
}

.alert-ios .alert-title {
  @include margin($alert-ios-title-margin-top, null, null, null);

  font-size: $alert-ios-title-font-size;
  font-weight: $alert-ios-title-font-weight;
}

.alert-ios .alert-sub-title {
  font-size: $alert-ios-sub-title-font-size;
  color: $alert-ios-sub-title-text-color;
}


// iOS Alert Message
// --------------------------------------------------

.alert-ios .alert-message,
.alert-ios .alert-input-group {
  @include text-align($alert-ios-message-text-align);

  font-size: $alert-ios-message-font-size;
  color: $alert-ios-message-text-color;

  @include deprecated-variable(padding, $alert-ios-message-padding) {
    @include padding($alert-ios-message-padding-top, $alert-ios-message-padding-end, $alert-ios-message-padding-bottom, $alert-ios-message-padding-start);
  }
}

.alert-ios .alert-message {
  max-height: $alert-ios-content-max-height;
}

.alert-ios .alert-message:empty {
  @include deprecated-variable(padding, $alert-ios-message-padding-empty) {
    @include padding($alert-ios-message-empty-padding-top, $alert-ios-message-empty-padding-end, $alert-ios-message-empty-padding-bottom, $alert-ios-message-empty-padding-start);
  }
}


// iOS Alert Input
// --------------------------------------------------

.alert-ios .alert-input {
  @include appearance(none);
  @include margin($alert-ios-input-margin-top, null, null, null);
  @include border-radius($alert-ios-input-border-radius);

  border: $alert-ios-input-border;
  background-color: $alert-ios-input-background-color;

  @include deprecated-variable(padding, $alert-ios-input-padding) {
    @include padding($alert-ios-input-padding-top, $alert-ios-input-padding-end, $alert-ios-input-padding-bottom, $alert-ios-input-padding-start);
  }
}


// iOS Alert Radio/Checkbox Group
// --------------------------------------------------

.alert-ios .alert-radio-group,
.alert-ios .alert-checkbox-group {
  overflow: scroll;

  max-height: $alert-ios-content-max-height;

  border-top: $alert-ios-list-border-top;

  -webkit-overflow-scrolling: touch;

}

.alert-ios .alert-tappable {
  display: flex;

  min-height: $alert-ios-button-min-height;
}


// iOS Alert Radio Label
// --------------------------------------------------

.alert-ios .alert-radio-label {
  overflow: hidden;

  flex: 1;

  order: 0;

  text-overflow: ellipsis;
  white-space: nowrap;

  color: $alert-ios-radio-label-text-color;

  @include deprecated-variable(padding, $alert-ios-radio-label-padding) {
    @include padding($alert-ios-radio-label-padding-top, $alert-ios-radio-label-padding-end, $alert-ios-radio-label-padding-bottom, $alert-ios-radio-label-padding-start);
  }
}


// iOS Alert Radio Label: Checked
// --------------------------------------------------

.alert-ios [aria-checked=true] .alert-radio-label {
  color: $alert-ios-radio-label-text-color-checked;
}


// iOS Alert Radio Checkmark: Unchecked
// -----------------------------------------

.alert-ios .alert-radio-icon {
  position: relative;

  order: 1;

  min-width: $alert-ios-radio-min-width;
}


// iOS Alert Radio Checked
// -----------------------------------------

.alert-ios [aria-checked=true] .alert-radio-inner {
  @include position($alert-ios-radio-icon-top, null, null, $alert-ios-radio-icon-start);

  position: absolute;

  width: $alert-ios-radio-icon-width;
  height: $alert-ios-radio-icon-height;

  border-width: $alert-ios-radio-icon-border-width;
  border-top-width: 0;
  border-left-width: 0;
  border-style: $alert-ios-radio-icon-border-style;
  border-color: $alert-ios-radio-icon-border-color;
  transform: $alert-ios-radio-icon-transform;
}


// iOS Alert Checkbox Label
// --------------------------------------------------

.alert-ios .alert-checkbox-label {
  overflow: hidden;

  flex: 1;

  text-overflow: ellipsis;
  white-space: nowrap;

  color: $alert-ios-checkbox-label-text-color;

  @include deprecated-variable(padding, $alert-ios-checkbox-label-padding) {
    @include padding($alert-ios-checkbox-label-padding-top, $alert-ios-checkbox-label-padding-end, $alert-ios-checkbox-label-padding-bottom, $alert-ios-checkbox-label-padding-start);
  }
}

.alert-ios [aria-checked=true] .alert-checkbox-label {
  color: $alert-ios-checkbox-label-text-color-checked;
}

// iOS Alert Checkbox Outer Circle: Unchecked
// -----------------------------------------

.alert-ios .alert-checkbox-icon {
  @include border-radius($alert-ios-checkbox-border-radius);

  position: relative;

  width: $alert-ios-checkbox-size;
  height: $alert-ios-checkbox-size;

  border-width: $alert-ios-checkbox-border-width;
  border-style: $alert-ios-checkbox-border-style;
  border-color: $alert-ios-checkbox-border-color-off;
  background-color: $alert-ios-checkbox-background-color-off;

  @include deprecated-variable(margin, $alert-ios-checkbox-margin) {
    @include margin($alert-ios-checkbox-margin-top, $alert-ios-checkbox-margin-end, $alert-ios-checkbox-margin-bottom, $alert-ios-checkbox-margin-start);
  }
}


// iOS Alert Checkbox Outer Circle: Checked
// -----------------------------------------

.alert-ios [aria-checked=true] .alert-checkbox-icon {
  border-color: $alert-ios-checkbox-border-color-on;
  background-color: $alert-ios-checkbox-background-color-on;
}


// iOS Alert Checkbox Inner Checkmark: Checked
// -----------------------------------------

.alert-ios [aria-checked=true] .alert-checkbox-inner {
  @include position($alert-ios-checkbox-icon-top, null, null, $alert-ios-checkbox-icon-start);

  position: absolute;

  width: $alert-ios-checkbox-icon-width;
  height: $alert-ios-checkbox-icon-height;

  border-width: $alert-ios-checkbox-icon-border-width;
  border-top-width: 0;
  border-left-width: 0;
  border-style: $alert-ios-checkbox-icon-border-style;
  border-color: $alert-ios-checkbox-icon-border-color;
  transform: $alert-ios-checkbox-icon-transform;
}


// iOS Alert Button
// --------------------------------------------------

.alert-ios .alert-button-group {
  @include margin-horizontal(null, -$alert-ios-button-border-width);

  flex-wrap: $alert-ios-button-group-flex-wrap;
}

.alert-ios .alert-button {
  @include margin($alert-ios-button-margin);
  @include border-radius($alert-ios-button-border-radius);

  overflow: hidden;

  flex: $alert-ios-button-flex;

  min-width: $alert-ios-button-min-width;
  height: $alert-ios-button-min-height;

  border-top: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
  border-right: $alert-ios-button-border-width $alert-ios-button-border-style $alert-ios-button-border-color;
  font-size: $alert-ios-button-font-size;
  color: $alert-ios-button-text-color;
  background-color: $alert-ios-button-background-color;
}

.alert-ios .alert-button:last-child {
  border-right: 0;
  font-weight: $alert-ios-button-main-font-weight;
}

.alert-ios .alert-button.activated {
  background-color: $alert-ios-button-background-color-activated;
}
