
:root {
  --retina-alert-dialog-button-border: {
    @media (--retina-query) {
      border-top: none;
      background-size: 100% 1px;
      background-repeat: no-repeat;
      background-position: top;
      background-image: linear-gradient(180deg, var(--alert-dialog-separator-color), var(--alert-dialog-separator-color) 50%, transparent 50%);
    }
  }
}

/*~
  name: Alert Dialog
  category: Alert Dialog
  elements: ons-alert-dialog
  markup: |
    <div class="alert-dialog-mask"></div>
    <div class="alert-dialog">
      <div class="alert-dialog-container">
        <div class="alert-dialog-title">Alert</div>

        <div class="alert-dialog-content">
          Hello World!
        </div>

        <div class="alert-dialog-footer">
          <button class="alert-dialog-button alert-dialog-button--primal">OK</button>
        </div>
      </div>
    </div>
*/

.alert-dialog {
  @apply(--reset-box-model);
  @apply(--reset-base);
  @apply(--reset-cursor);
  @apply(--reset-font);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 270px;
  margin: auto;
  background-color: var(--alert-dialog-background-color);
  border-radius: 8px;
  overflow: visible;
  max-width: 95%;
  color: var(--alert-dialog-text-color);
}

.alert-dialog-container {
  height: inherit;
  padding-top: 16px;
  overflow: hidden;
}

.alert-dialog-title {
  @apply(--reset-font);
  font-size: var(--font-size);
  font-weight: var(--font-weight--large);
  padding: 0 8px;
  text-align: center;
  color: var(--alert-dialog-text-color);
}

.alert-dialog-content {
  @apply(--reset-box-model);
  padding: 4px 12px 8px;
  font-size: var(--font-size--mini);
  min-height: 36px;
  text-align: center;
  color: var(--alert-dialog-text-color);
}

.alert-dialog-footer {
  width: 100%;
}

.alert-dialog-button {
  @apply(--reset-box-model);
  @apply(--reset-base);
  @apply(--reset-font);
  @apply(--reset-cursor);
  @apply(--ellipsis);
  text-decoration: none;
  letter-spacing: 0;
  vertical-align: middle;
  border: none;
  border-top: 1px solid var(--alert-dialog-separator-color);
  font-size: calc(var(--font-size) - 1px);
  padding: 0 8px;
  margin: 0;
  display: block;
  width: 100%;
  background-color: transparent;
  text-align: center;
  height: 44px;
  line-height: 44px;
  outline: none;
  color: var(--alert-dialog-button-color);
  @apply(--retina-alert-dialog-button-border);
}

.alert-dialog-button:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.alert-dialog-button--primal {
  font-weight: var(--font-weight--large);
}

.alert-dialog-footer--rowfooter {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
}

.alert-dialog-button--rowfooter {
  flex: 1;
  display: block;
  width: 100%;
  border-left: 1px solid var(--alert-dialog-separator-color);
  @media (--retina-query) {
    border-top: none;
    border-left: none;
    background-size: 100% 1px, 1px 100%;
    background-repeat: no-repeat;
    background-position: top, left;
    background-image:
      linear-gradient(0deg, transparent, transparent 50%, var(--alert-dialog-separator-color) 50%),
      linear-gradient(90deg, transparent, transparent 50%, var(--alert-dialog-separator-color) 50%);
  }
}

.alert-dialog-button--rowfooter:first-child {
  border-left: none;
  @media (--retina-query) {
    border-top: none;
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top, left;
    background-image: linear-gradient(0deg, transparent, transparent 50%, var(--alert-dialog-separator-color) 50%);
  }
}

.alert-dialog-mask {
  @apply(--reset-base);
  @apply(--reset-cursor);
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.2);
}

/*~
  name: Alert Dialog without Title
  category: Alert Dialog
  elements: ons-alert-dialog
  markup: |
    <div class="alert-dialog-mask"></div>
    <div class="alert-dialog">
      <div class="alert-dialog-container">
        <div class="alert-dialog-content">
          Hello World!
        </div>

        <div class="alert-dialog-footer">
          <button class="alert-dialog-button alert-dialog-button--primal">OK</button>
        </div>
      </div>
    </div>
*/

/*~
  name: Alert Dialog with Multiple Buttons
  category: Alert Dialog
  elements: ons-alert-dialog
  markup: |
    <div class="alert-dialog-mask"></div>
    <div class="alert-dialog">
      <div class="alert-dialog-container">
        <div class="alert-dialog-content">
          Hello World!
        </div>

        <div class="alert-dialog-footer">
          <button class="alert-dialog-button">Cancel</button>
          <button class="alert-dialog-button alert-dialog-button--primal">OK</button>
        </div>
      </div>
    </div>
*/

/*~
  name: Alert Dialog with Multiple Buttons 2
  category: Alert Dialog
  elements: ons-alert-dialog
  markup: |
    <div class="alert-dialog-mask"></div>
    <div class="alert-dialog">
      <div class="alert-dialog-container">
        <div class="alert-dialog-title">Alert</div>

        <div class="alert-dialog-content">
          Hello World!
        </div>

        <div class="alert-dialog-footer alert-dialog-footer--rowfooter">
          <button class="alert-dialog-button alert-dialog-button--rowfooter">Left</button>
          <button class="alert-dialog-button alert-dialog-button--primal alert-dialog-button--rowfooter">Center</button>
          <button class="alert-dialog-button alert-dialog-button--rowfooter">Right</button>
        </div>
      </div>
    </div>
*/

/*~
  name: Material Alert Dialog
  category: Alert Dialog
  elements: ons-alert-dialog
  markup: |
    <div class="alert-dialog-mask alert-dialog-mask--material"></div>
    <div class="alert-dialog alert-dialog--material">
      <div class="alert-dialog-container alert-dialog-container--material">
        <div class="alert-dialog-title alert-dialog-title--material">
          Dialog title
        </div>
        <div class="alert-dialog-content alert-dialog-content--material">
          Some dialog content.
        </div>
        <div class="alert-dialog-footer alert-dialog-footer--material">
          <button class="alert-dialog-button alert-dialog-button--material">OK</button>
          <button class="alert-dialog-button alert-dialog-button--material">CANCEL</button>
        </div>
      </div>
    </div>
*/

.alert-dialog--material {
  border-radius: 2px;
  background-color: var(--material-alert-dialog-background-color);
}

.alert-dialog-container--material {
  padding: 22px 0 0 0;
  @apply(--material-shadow-5);
}

.alert-dialog-title--material {
  @apply(--material-font);
  text-align: left;
  font-size: 20px;
  font-weight: 500;
  padding: 0 24px;
  color: var(--material-alert-dialog-title-color);
}

.alert-dialog-content--material {
  @apply(--material-font);
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  padding: 0 24px;
  margin: 24px 0 10px 0;
  min-height: 0;
  color: var(--material-alert-dialog-content-color);
}

.alert-dialog-footer--material {
  display: block;
  padding: 0;
  height: 52px;
  box-sizing: border-box;
  margin: 0;
  line-height: 1;
}

.alert-dialog-button--material {
  @apply(--material-font);
  text-transform: uppercase;
  display: inline-block;
  width: auto;
  float: right;
  background: none;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  height: 36px;
  line-height: 36px;
  padding: 0 8px;
  margin: 8px 8px 8px 0;
  box-sizing: border-box;
  min-width: 50px;
  color: var(--material-alert-dialog-button-color);
  @media (--retina-query) {
    background: none;
  }
}

.alert-dialog-button--material:active {
  background-color: initial;
}

/* stylelint-disable */ .alert-dialog-button--rowfooter--material,
.alert-dialog-button--rowfooter--material:first-child { /* stylelint-enable */
  border: 0;
  @media (--retina-query) {
    background: none;
  }
}

/* stylelint-disable */ .alert-dialog-button--primal--material { /* stylelint-enable */
  font-weight: 500;
  @media (--retina-query) {
    background: none;
  }
}

.alert-dialog-mask--material {
  background-color: rgba(0, 0, 0, 0.3);
}
