@import "./alert";
@import "./alert.ios.vars";

// iOS Alert
// --------------------------------------------------

.alert-ios {
  font-family: $alert-ios-font-family;
  font-size: $alert-ios-font-size;
}

.alert-ios .alert-wrapper {
  @include border-radius($alert-ios-border-radius);

  overflow: hidden;

  max-width: $alert-ios-max-width;

  background-color: $alert-ios-background-color;

  box-shadow: $alert-ios-box-shadow;
}


// iOS Translucent Alert
// -----------------------------------------

.alert-translucent-ios .alert-wrapper {
  background: $alert-ios-translucent-background-color;

  backdrop-filter: $alert-ios-translucent-filter;
  -webkit-backdrop-filter: $alert-ios-translucent-filter;
}


// iOS Alert Header
// --------------------------------------------------

.alert-ios .alert-head {
  @include text-align($alert-ios-head-text-align);

  @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 padding($alert-ios-message-padding-top, $alert-ios-message-padding-end, $alert-ios-message-padding-bottom, $alert-ios-message-padding-start);

  @include text-align($alert-ios-message-text-align);

  font-size: $alert-ios-message-font-size;
  color: $alert-ios-message-text-color;
}

.alert-ios .alert-message {
  max-height: $alert-ios-content-max-height;
}

.alert-ios .alert-message: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 placeholder($alert-ios-input-placeholder-color);
  @include appearance(none);

  @include border-radius($alert-ios-input-border-radius);

  @include margin($alert-ios-input-margin-top, null, null, null);

  @include padding($alert-ios-input-padding-top, $alert-ios-input-padding-end, $alert-ios-input-padding-bottom, $alert-ios-input-padding-start);

  border: $alert-ios-input-border;
  background-color: $alert-ios-input-background-color;
}


// 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;

  overscroll-behavior: contain;
}

.alert-ios .alert-tappable {
  display: flex;

  height: $alert-ios-tappable-height;

  contain: strict;
}


// iOS Alert Radio Label
// --------------------------------------------------

.alert-ios .alert-radio-label {
  @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);

  overflow: hidden;

  flex: 1;

  order: 0;

  text-overflow: ellipsis;
  white-space: nowrap;

  color: $alert-ios-radio-label-text-color;
}


// 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 {
  @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);

  overflow: hidden;

  flex: 1;

  text-overflow: ellipsis;
  white-space: nowrap;

  color: $alert-ios-checkbox-label-text-color;
}

// iOS Alert Checkbox Outer Circle: Unchecked
// -----------------------------------------

.alert-ios .alert-checkbox-icon {
  @include border-radius($alert-ios-checkbox-border-radius);

  @include margin($alert-ios-checkbox-margin-top, $alert-ios-checkbox-margin-end, $alert-ios-checkbox-margin-bottom, $alert-ios-checkbox-margin-start);

  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;

  contain: strict;
}


// 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;
}
