@import "../../style/mixins/index";

@include b(dialog) {
  border: 2px solid $--x-dialog-primary;
  background: #fff;
  border-radius: 4px;
  border-top-width: 0;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4);
  position: absolute;
  z-index: 10;
  left: 0;
  top: 0;
  min-width: 100px;
  min-height: 100px;
  font-size: 14px;
  box-sizing: border-box;
  pointer-events: initial;
  display: flex !important;
  flex-direction: column;
  @include m(maximized) {
    overflow: hidden;
  }
  @include when(maximized) {
    width: 100vw !important;
    height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
  }
  @include when(lighter) {
    border-color: $--x-dialog-lighter;
    @include e(header) {
      background: $--x-dialog-lighter;
    }
  }
  @include when(auto-height) {
    top: 50%;
    transform: translateY(-50%);
  }

  @include e(header) {
    background: $--x-dialog-primary;
    height: 30px;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: space-between;
    color: #fff;
    padding: 0 10px;
    flex: 0 0 auto;
  }
  @include e(footer) {
    flex: 0 0 auto;
    text-align: right;
    box-sizing: border-box;
    padding: 10px;
  }
  @include e(title-icon) {
    margin-top: -1px;
    margin-right: 5px;
  }
  @include e(tools) {
    .x-icon {
      padding: 5px;
      cursor: pointer;
      box-sizing: content-box !important;

      &:hover {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
      }
    }
  }
  @include e(body) {
    padding: 8px;
    box-sizing: border-box;
    flex: 1;
    overflow: auto;
    @include when(no-padding) {
      padding: 0;
    }
  }
  @include e(wrapper) {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    pointer-events: none;
  }
  @include e(modal) {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: initial;
  }
}

html[class^=x-dialog-body-], html[class*=" x-dialog-body-"] {
  overflow: hidden !important;

  body {
    overflow: hidden !important;
  }
}
