@dialog-prefix-cls: ~'@{ant-prefix}-modal';

.@{dialog-prefix-cls} {
  .reset-component();
  .modal-mask();

  position: relative;
  top: 100px;
  width: auto;
  margin: 0 auto;
  padding-bottom: 24px;
  background-color: @modal-content-bg;

  &-wrap {
    z-index: @zindex-modal;
  }

  &-title {
    margin: 0;
    color: @modal-heading-color;
    // font-weight: 500;
    font-weight: 600;
    font-size: @modal-header-title-font-size;
    text-transform: @br-text-transform;
    // line-height: @modal-header-title-line-height;
    word-wrap: break-word;
  }

  &-content {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: @br-modal-min-width;
    max-width: @br-modal-max-width;
    min-height: 138px;
    max-height: 80vh;
    background-color: @modal-content-bg;
    background-clip: padding-box;
    border: 0;
    // border-top: @br-border-width-lg @border-style-base @primary-color;
    box-shadow: 0 -3px 0 0 @primary-color;
    // border-radius: @border-radius-base;
    // box-shadow: @shadow-2;
    pointer-events: auto;

    &.@{dialog-prefix-cls}-auto-adjust {
      .@{dialog-prefix-cls}-body {
        margin-right: calc(@margin-md - @margin-xs - @scrollWidth);
        padding-right: @padding-xs;
        overflow-y: scroll;
      }
    }

    // &::before {
    //   position: absolute;
    //   top: 0;
    //   right: 0;
    //   left: 0;
    //   z-index: 2;
    //   height: 3px;
    //   background-color: @primary-color;
    //   content: ' ';
    // }
  }
  &-no-header {
    .@{dialog-prefix-cls}-content {
      padding-top: 16px;
    }
  }
  &-no-footer {
    .@{dialog-prefix-cls}-content {
      padding-bottom: 16px;
    }
  }

  &-close {
    position: absolute;
    // top: 0;
    // right: 0;
    top: calc((45px - 24px) / 2);
    right: @br-modal-header-close-pos;
    z-index: @zindex-popup-close;
    padding: 0;
    color: @modal-close-color;
    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: @modal-header-close-size;
      height: @modal-header-close-size;
      // font-size: @font-size-lg;
      font-size: @modal-header-close-size;
      font-style: normal;
      line-height: @modal-header-close-size;
      text-align: center;
      text-transform: none;
      text-rendering: auto;

      .@{iconfont-css-prefix} {
        vertical-align: bottom;
      }

      &:focus,
      &:hover {
        text-decoration: none;
        background: @primary-1;
        border-radius: @border-radius-base;

        .@{iconfont-css-prefix} {
          color: @primary-color-hover;
        }
      }
    }

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

  &-header {
    display: flex;
    flex: 0 0 45px;
    align-items: center;
    // padding: @modal-header-padding;
    padding: 0 @modal-header-padding-horizontal;
    color: @text-color;
    background: @modal-header-bg;
    // border-bottom: @modal-header-border-width @modal-header-border-style
    //   @modal-header-border-color-split;
    // border-radius: @border-radius-base @border-radius-base 0 0;
    &.hasShadow {
      z-index: 1;
      box-shadow: @br-box-shadow-sm;
    }
  }

  &-body {
    flex-grow: 1;
    padding: @padding-md;
    font-size: @font-size-base;
    line-height: @line-height-base;
    word-wrap: break-word;
    word-break: break-word;

    .customScrollbar();
  }

  &-footer {
    padding: @modal-footer-padding-vertical @modal-footer-padding-horizontal;
    // text-align: right;
    text-align: center;
    // background: @modal-footer-bg;
    background: @modal-header-bg;
    // border-top: @modal-footer-border-width @modal-footer-border-style
    //   @modal-footer-border-color-split;
    // border-radius: 0 0 @border-radius-base @border-radius-base;

    .@{ant-prefix}-btn + .@{ant-prefix}-btn:not(.@{ant-prefix}-dropdown-trigger) {
      margin-bottom: 0;
      margin-left: 8px;
    }
    &.hasShadow {
      z-index: 1;
      box-shadow: @br-box-shadow-sm;
    }
  }

  &-open {
    overflow: hidden;
  }
}

.@{dialog-prefix-cls}-centered {
  text-align: center;

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

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