// UI Dialog
// @description :
// @author      : Adarsh Pastakia
// @copyright   : 2016 Sigma Frameworks
// @license     : MIT

.ui-dialog-container {
  &.ui-dragging {
    pointer-events: all;
  }

  .ui-dialog-wrapper {
    z-index: $z-index-floating - 1;

    &.ui-modal {
      z-index       : $z-index-floating;
      pointer-events: all;
      background    : rgba($black, .1);
      @include position(absolute, 0);
      @include flex-column(center, center);

      .ui-dialog {
        position: relative;
        @include flex(0 1 auto);
      }
    }
  }

  .ui-dialog {
    position      : absolute;
    min-width     : 300px;
    min-height    : 200px;
    pointer-events: all;
    border        : 1px solid $primary;
    border-radius : $base-border-radius;
    background    : $base-bg;
    @include flex-column($align: stretch, $justify : flex-start);
    @include box-shadow(0 0 30px 5px $base-shadow-dark);

    .ui-header {
      button {
        font-size: .8em;
        padding  : .2rem .4rem;
      }
    }

    .ui-resizer {
      font-size: 1.25em;
      position : absolute;
      z-index  : 10;
      right    : 0;
      bottom   : 0;
      cursor   : nwse-resize;
      opacity  : .3 !important;

      &:active,
      &:hover {
        opacity: .6 !important;
      }
    }

    &.ui-maximize {
      position: absolute !important;
      top     : 1em !important;
      right   : 1em !important;
      bottom  : 3em !important;
      left    : 1em !important;
      width   : auto !important;
      height  : auto !important;

      .ui-resizer {
        display: none;
      }

      .ui-maximize span:before {
        content: $fi-ui-dialog-restore;
      }
    }

    &.ui-minimize {
      display: none;
    }

    &.ui-active {
      z-index: 5;

      > :not(.ui-header) {
        opacity: 1;
      }
    }

    &.ui-inactive {
      z-index     : 1;
      border-color: rgba($primary,.5);

      > :not(.ui-header) {
        opacity: .65;
      }

      > .ui-header {
        opacity: .65;
      }
    }

    &.ui-dragging {
      > :not(.ui-header) {
        opacity: .5;
      }
    }
  }

  .ui-dialog.ui-alert {
    min-width : 20em;
    min-height: 0;
    // @include box-shadow(0 0 20px 5px rgba($black, .5), 0 0 2px 0 $primary inset);
    .ui-message-bar {
      @include flex-row();
      padding: 1em 1.5em;

      span {
        font-size: 1.5em;
        @include flex(0 0 auto);
      }

      p {
        padding: .25em .5em;
        @include flex(1 1 0em);
      }
    }

    .ui-button-bar {
      border-top: 1px solid rgba($base-border-color, .1);
      @include flex-row($justify: center);
      padding   : .5em 1em;

      button {
        @include flex(0 0 auto);
        min-width    : 5em;
        padding      : .2em .5em;
        margin       : .2em .4em;
        font-size    : .9em;
        background   : none;
        color        : $primary;
        border       : 1px solid rgba($primary,.1);
        border-radius: $base-border-radius;

        &.default {}

        &:hover {
          background: rgba($primary, .1);
        }
      }
    }
  }
}
