@import '../style/theme/color';
@import '../style/theme/shadow';
@import '../style/theme/corner';
@import '../style/core/_font';
@import '../style/core/z-index';

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0 !important;
  left: 0;
  z-index: $devui-z-index-modal;
  outline: 0;
  overflow-y: auto;
  display: block;
  display: -ms-flexbox;
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.devui-body-scrollblock .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0 auto;

  .maximize {
    -webkit-transition: none;
    transition: none;
    transform: none;
    width: 100vw;
    top: 0;
    left: 0;
    max-height: 100vh;
    height: 100vh;
  }

  &.place-at-center {
    margin: auto;
  }

  &.place-at-top {
    margin-bottom: auto;
  }

  &.place-at-bottom {
    margin-top: auto;
  }
}

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0 !important;
  left: 0;
  z-index: calc(#{$devui-z-index-modal} - 1);
  background-color: $devui-feedback-overlay-backdrop;
}

.modal-maximized {
  -webkit-transition: none;
  transition: none;
  transform: none;
  width: 100vw !important;
  top: 0 !important;
  left: 0 !important;
  max-height: 100vh;
  height: 100vh;
}

:host ::ng-deep .modal-content {
  position: relative;
  border-radius: $devui-border-radius-card;
  border: none;
  background-color: $devui-fullscreen-overlay-bg;
  background-clip: padding-box;
  outline: 0;
  box-shadow: $devui-shadow-length-fullscreen-overlay $devui-shadow;

  .modal-body {
    padding-top: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    padding-left: 20px;
    color: $devui-text-weak;
  }

  .modal-footer {
    border-top: none;
    text-align: center;
    padding: 0 20px 20px;

    button {
      margin: 0 4px;
      width: auto;

      &.pull-left {
        padding-left: 5px;
        padding-right: 5px;
        position: relative;
        left: -5px;
      }
    }

    button + button {
      margin-bottom: 16px;
    }
  }
}

:host ::ng-deep .d-btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  white-space: nowrap;
  font-size: $devui-font-size-card-title;
  line-height: 1.42857143;
  border-radius: $devui-border-radius;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

:focus {
  outline: none;
}

::ng-deep .devui-body-scrollblock-modal {
  width: 100%;
  position: fixed;
  overflow-y: scroll;
}
