@yee-dialog-prefix-cls: ~'@{yee-prefix}-modal';
@yee-table-prefix-cls: ~'@{yee-prefix}-table';
@yee-modal-footer-padding-vertical: 10px;
@yee-modal-footer-padding-horizontal: 16px;

.@{yee-dialog-prefix-cls} {
  .yee-reset-component;

  position: relative;
  top: 100px;
  width: auto;
  margin: 0 auto;
  padding-bottom: 24px;
  pointer-events: none;

  &-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: @yee-zindex-modal;
    overflow: auto;
    outline: 0;
    -webkit-overflow-scrolling: touch;
  }

  &-title {
    margin: 0;
    color: @yee-modal-heading-color;
    font-weight: 500;
    font-size: @yee-font-size-lg;
    line-height: 22px;
    word-wrap: break-word;
  }

  &-content {
    position: relative;
    background-color: @yee-component-background;
    background-clip: padding-box;
    border: 0;
    border-radius: @yee-border-radius-base;
    box-shadow: @yee-shadow-2;
    pointer-events: auto;
  }

  &-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: @yee-zindex-popup-close;
    padding: 0;
    color: @yee-text-color-secondary;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    background: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    transition: color 0.3s;

    &-x {
      display: block;
      width: 56px;
      height: 56px;
      font-size: @yee-font-size-lg;
      font-style: normal;
      line-height: 56px;
      text-align: center;
      text-transform: none;
      text-rendering: auto;
    }

    &:focus,
    &:hover {
      color: @yee-icon-color-hover;
      text-decoration: none;
    }
  }

  &-header {
    padding: 16px 24px;
    color: @yee-text-color;
    background: @yee-modal-header-bg;
    border-bottom: @yee-border-width-base @yee-border-style-base @yee-modal-header-border-color-split;
    border-radius: @yee-border-radius-base @yee-border-radius-base 0 0;
  }

  &-body {
    padding: @yee-modal-body-padding;
    font-size: @yee-font-size-base;
    line-height: @yee-line-height-base;
    word-wrap: break-word;
  }

  &-footer {
    padding: @yee-modal-footer-padding-vertical @yee-modal-footer-padding-horizontal;
    text-align: right;
    background: @yee-modal-footer-bg;
    border-top: @yee-border-width-base @yee-border-style-base @yee-modal-footer-border-color-split;
    border-radius: 0 0 @yee-border-radius-base @yee-border-radius-base;
    button + button {
      margin-bottom: 0;
      margin-left: 8px;
    }
  }

  &.zoom-enter,
  &.zoom-appear {
    transform: none; // reset scale avoid mousePosition bug
    opacity: 0;
    animation-duration: @yee-animation-duration-slow;
    user-select: none; // https://github.com/ant-design/ant-design/issues/11777
  }

  &-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: @yee-zindex-modal-mask;
    height: 100%;
    background-color: @yee-modal-mask-bg;
    filter: ~'alpha(opacity=50)';

    &-hidden {
      display: none;
    }
  }

  &-open {
    overflow: hidden;
  }
}

.@{yee-dialog-prefix-cls}-centered {
  text-align: center;
  &::before {
    display: inline-block;
    width: 0;
    height: 100%;
    vertical-align: middle;
    content: '';
  }
  .@{yee-dialog-prefix-cls} {
    top: 0;
    display: inline-block;
    text-align: left;
    vertical-align: middle;
  }
}

@media (max-width: @yee-screen-sm-max) {
  .@{yee-dialog-prefix-cls} {
    max-width: calc(100vw - 16px);
    margin: 8px auto;
  }
  .@{yee-dialog-prefix-cls}-centered {
    .@{yee-dialog-prefix-cls} {
      flex: 1;
    }
  }
}
