@import '_functions';

//Selector is by Tag on purpose ! Because we want to hide the content even before the element is initialized and has .smart-window class
smart-window:not([opened]) {
  opacity: 0;
}

/* smart-window */
.smart-window {
  &:not(.smart-container) {
    position: absolute;
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    min-width: var(--smart-window-min-width);
    min-height: var(--smart-window-header-height);
    box-shadow: var(--smart-elevation-24);
    z-index: calc(var(--smart-editor-drop-down-z-index) - 1);
    display: block;
    overflow: hidden;
  }

  >.smart-container:not(.smart-window) {
    max-height: inherit;
  }

  .smart-content-container {
    display: flex;
    flex-direction: column;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    height: 100%;
    outline: none;
    max-height: inherit;

    >.smart-header-section {
      display: flex;
      justify-content: space-between;
      cursor: move;
      overflow: hidden;
      align-items: center;
      touch-action: none;

      width: 100%;
      font-family: inherit;
      font-size: inherit;
      user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      -moz-user-select: none;
      border-color: var(--smart-border);
      color: var(--smart-surface-color);
      line-height: initial;
      height: var(--smart-window-header-height);
      min-height: var(--smart-window-header-height);
      background: var(--smart-window-header-background);
      padding: var(--smart-window-header-padding);

      .smart-buttons-container {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;

        button {
          position: relative;
          margin-left: 1px;
          margin-right: 1px;
          cursor: pointer;
          height: var(--smart-window-header-button-size);
          width: var(--smart-window-header-button-size);
          padding: 0;
          min-height: 0;
          background: transparent;
          color: inherit;
          border: none;
          outline: none;

          &:active {
            outline: none;
            background-color: initial;
          }
        }
      }
    }

    >.smart-content {
      width: 100%;
      height: calc(100% - var(--smart-window-header-height));
      display: flex;
      align-items: center;
      overflow-y: auto;
      padding: var(--smart-window-content-padding);
      background: var(--smart-background);
      flex-direction: column;

      /* There's an issue with display:flex/grid and align-items: center */
      @media not all and (min-resolution: .001dpcm) {
        align-content: start;
      }
    }

    >.smart-footer {
      width: 100%;
      min-height: var(--smart-window-footer-height);
      font-family: inherit;
      font-size: inherit;
      user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      -moz-user-select: none;
      border-color: var(--smart-border);
      color: var(--smart-surface-color);
      line-height: initial;
      position: relative;
      background-color: initial;
      display: flex;
      justify-content: center;
      height: var(--smart-window-footer-height);
      background: var(--smart-window-footer-background);
      padding: var(--smart-window-footer-padding);

      &:empty {
        display: none;
      }
    }

    &.smart-window-resizing-left,
    &.smart-window-resizing-right,
    &.smart-window-resizing-left>.smart-header-section,
    &.smart-window-resizing-right>.smart-header-section {
      cursor: e-resize;
    }

    &.smart-window-resizing-top,
    &.smart-window-resizing-bottom,
    &.smart-window-resizing-top>.smart-header-section,
    &.smart-window-resizing-bottom>.smart-header-section {
      cursor: ns-resize;
    }

    &.smart-window-resizing-top-left,
    &.smart-window-resizing-bottom-right,
    &.smart-window-resizing-top-left>.smart-header-section,
    &.smart-window-resizing-bottom-right>.smart-header-section {
      cursor: se-resize;
    }

    &.smart-window-resizing-top-right,
    &.smart-window-resizing-bottom-left,
    &.smart-window-resizing-top-right>.smart-header-section,
    &.smart-window-resizing-bottom-left>.smart-header-section {
      cursor: sw-resize;
    }
  }

  .smart-header-section {
    .smart-buttons-container {
      button {
        &:after {
          position: absolute;
          top: 0;
          font-family: var(--smart-font-family-icon);
          font-size: var(--smart-window-header-icon-size);
          width: 100%;
          height: 100%;
          text-align: center;
          display: flex;
          align-items: center;
          justify-content: center;
          pointer-events: none;
        }

        &:first-of-type {
          margin-left: initial;
        }

        &:last-of-type {
          margin-right: initial;
        }

        &.hover {
          color: initial;
          background-color: initial;
        }
      }
    }

    .smart-close-button:after {
      content: var(--smart-icon-close);
    }

    .smart-collapse-button:after {
      content: var(--smart-icon-arrow-down);
    }

    .smart-maximize-button:after {
      content: var(--smart-icon-window-maximize);
    }

    .smart-pin-button:after {
      content: var(--smart-icon-window-pin);
    }

    .smart-minimize-button:after {
      content: var(--smart-icon-window-minimize);
    }
  }

  &:focus,
  &[focus] {
    outline: none;
    border-color: var(--smart-primary);
    box-shadow: var(--smart-elevation-24);

    .smart-content-container {
      >.smart-header-section {
        background-color: var(--smart-primary);
        color: var(--smart-primary-color);
      }
    }
  }

  &[ontop] {
    z-index: var(--smart-editor-drop-down-z-index);
  }

  &:not([animation='none']) {
    transition: width 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), height 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), top 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), left 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), min-height 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: scale(1);

    .smart-header-section {
      .smart-collapse-button:after {
        transition: transform 0.15s linear;
      }

      .smart-pin-button:after {
        transition: transform 0.15s linear;
      }
    }

    &.no-transition,
    &.no-transition.smart-visibility-hidden {
      transition: none;
    }

    &.smart-visibility-hidden,
    &.smart-visibility-hidden[maximized] {
      transition: width 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), height 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), top 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), left 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), transform 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), min-height 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
      transform: scale(0);
    }


    &[dragged] {
      opacity: 0.5;
      z-index: calc(1 + var(--smart-editor-drop-down-z-index));
      transition: none;
    }

    &[minimized] {
      transition: width 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), height 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), top 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), left 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), animation 0.2s cubic-bezier(0.4, 0.0, 0.6);
    }
  }

  &.smart-visibility-hidden {
    transform: scale(0);
  }

  &.smart-tabs-window {

    &[collapsed][header-position="left"],
    &[collapsed][header-position="right"],
    &[maximized][collapsed][header-position="right"],
    &[maximized][collapsed][header-position="left"] {
      width: var(--smart-window-header-height);
      min-width: initial;
      height: var(--smart-window-default-height);
    }

    &[dragged] {
      pointer-events: none;
      /* Need a way to detect what's under the header while dragging. That's why pointer-events is used ! */

      .smart-tabs-header-section,
      .smart-tab-label-container {
        cursor: move;
      }
    }

    .smart-content-container {
      >.smart-content {
        width: 100%;
        height: calc(100% - var(--smart-window-header-height));
        overflow: hidden;
        padding: 0;
        background-color: var(--smart-background);
      }

      >.smart-header-section.smart-hidden,
      >.smart-footer.smart-hidden {
        display: none;
      }
    }

    &[dragged],
    &[focus],
    &[active] {
      .smart-content-container>.smart-header-section {
        background-color: var(--smart-primary);
        color: var(--smart-primary-color);
      }
    }

    smart-tabs {
      width: 100%;
      height: 250px;
      min-height: 100%;
      border: initial;
      outline: none;
      padding: 0;

      .smart-tabs-header-items {
        /*width: calc(100% - var(--smart-tabs-header-controls-size));*/
        width: 100%;
      }

      .smart-tabs-header-items {
        width: 100%;
      }

      &[vertical] .smart-tabs-header-items {
        width: auto;
        height: 100%;
      }
    }

    .smart-tabs .smart-header {
      border: none;
    }

    .smart-tabs-content-section {
      margin: initial;
      border: none;
    }

    &[auto-hide] {
      overflow: visible;
      height: auto;
      min-height: 0;

      .smart-tabs-content-section,
      .smart-content-container>.smart-header-section {
        display: none;
      }

      .smart-tabs {
        min-width: 0;
        height: auto;
        min-height: 0;
      }

      .smart-content-container {
        >.smart-content {
          overflow: visible;
        }
      }

      .smart-window {
        width: auto;
        height: auto;
      }

      &[tab-position="left"],
      &[tab-position="right"],
      &[tab-text-orientation="horizontal"][tab-position="left"],
      &[tab-text-orientation="horizontal"][tab-position="right"],
      &[tab-position="left"] smart-tabs,
      &[tab-position="right"] smart-tabs,
      &[tab-text-orientation="horizontal"][tab-position="left"] smart-tabs,
      &[tab-text-orientation="horizontal"][tab-position="right"] smart-tab,
      &[tab-text-orientation="vertical"][tab-position="left"],
      &[tab-text-orientation="vertical"][tab-position="right"],
      &[tab-text-orientation="vertical"][tab-position="left"] smart-tabs,
      &[tab-text-orientation="vertical"][tab-position="right"] smart-tabs {
        width: auto;
        min-width: 0;
      }
    }

    &[tab-position="hidden"] {
      .smart-content-container {
        >.smart-content {
          height: 100%;
        }
      }
    }

    smart-tab-item {
      user-select: text;
      -webkit-user-select: text;
    }
  }

  &[minimized] {
    max-width: var(--smart-window-min-width);
    min-height: var(--smart-window-header-height);
    cursor: default;

    .smart-content-container {
      >.smart-header-section {
        cursor: default;
      }

      >.smart-content {
        padding: initial;
      }
    }

    .smart-minimize-button {
      &:after {
        content: var(--smart-icon-arrow-up-alt);
        transform: rotate(-45deg);
        margin-top: -1px;
      }
    }
  }

  &[maximized] {
    .smart-content-container {
      >.smart-header-section {
        cursor: initial;
      }
    }

    .smart-header-section {
      .smart-maximize-button:after {
        content: var(--smart-icon-window-restore);
        font-size: 100%;
      }
    }

    &.smart-visibility-hidden {
      transform: scale(0);
    }
  }

  &[pinned] {
    .smart-content-container {
      >.smart-header-section {
        cursor: default;
      }
    }

    .smart-header-section {
      .smart-pin-button:after {
        content: var(--smart-icon-window-pin);
        transform: rotate(-45deg);
      }
    }
  }

  &[disabled] {
    .smart-header-section {
      >.smart-buttons-container button {
        cursor: initial;
      }
    }
  }

  &[collapsed] {
    height: var(--smart-window-header-height);

    .smart-header-section {
      .smart-collapse-button:after {
        transform: rotate(180deg) translateY(1px);
      }
    }

    .smart-content-container {

      &.smart-window-resizing-top-left,
      &.smart-window-resizing-top-right,
      &.smart-window-resizing-bottom-left,
      &.smart-window-resizing-bottom-right,
      &.smart-window-resizing-top-left>.smart-header-section,
      &.smart-window-resizing-top-right>.smart-header-section,
      &.smart-window-resizing-bottom-left>.smart-header-section,
      &.smart-window-resizing-bottom-right>.smart-header-section {
        cursor: initial;
      }
    }

    &.smart-window-snapped-left,
    &.smart-window-snapped-right,
    &.smart-window-snapped-top {
      height: var(--smart-window-header-height);
    }

    &[header-position="top"],
    &[header-position="bottom"] {

      &.smart-window-snapped-left,
      &.smart-window-snapped-right,
      &.smart-window-snapped-top {
        height: var(--smart-window-header-height);
      }
    }

    &[header-position="left"],
    &[header-position="right"] {
      .smart-content-container {

        >.smart-header-section,
        >.smart-footer {
          min-width: var(--smart-window-header-height);
        }
      }

      &.smart-window-snapped-left,
      &.smart-window-snapped-right,
      &.smart-window-snapped-top {
        height: 100%;
        width: var(--smart-window-header-height);
        min-width: initial;
      }
    }

    &[maximized] {
      height: var(--smart-window-header-height);

      &[header-position="left"],
      &[header-position="right"] {
        .smart-content-container {

          >.smart-header-section,
          >.smart-footer {
            min-width: var(--smart-window-header-height);
          }
        }
      }
    }
  }

  &[active] {
    .smart-content-container {
      >.smart-header-section {
        background-color: var(--smart-primary);
        color: var(--smart-primary-color);
      }
    }
  }

  &[dragged] {
    opacity: 0.5;
    z-index: calc(1 + var(--smart-editor-drop-down-z-index));
    transition: none;

    .smart-content-container {
      user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      -moz-user-select: none;

      >.smart-header-section {
        background-color: var(--smart-primary);
        color: var(--smart-primary-color);
      }
    }
  }

  &[resized] {
    .smart-content-container {
      user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      -moz-user-select: none;
    }
  }

  &[resize-indicator] {
    .smart-content-container {
      &:before {
        width: 10px;
        height: 10px;
        font-family: var(--smart-font-family-icon);
        content: var(--smart-icon-minus);
        position: absolute;
        top: calc(100% - 13px);
        left: calc(100% - 10px);
        transform: rotate(-45deg) scaleX(2);
        font-size: 10px;
      }

      &:after {
        width: 10px;
        height: 10px;
        font-family: var(--smart-font-family-icon);
        content: var(--smart-icon-minus);
        position: absolute;
        top: calc(100% - 9px);
        left: calc(100% - 8px);
        transform: rotate(-45deg);
        font-size: 10px;
      }
    }

    &[resize-mode="top"],
    &[resize-mode="left"] {
      .smart-content-container {
        &:before {
          top: 0;
          left: 5px;
        }

        &:after {
          top: 4px;
          left: 5px;
        }
      }
    }

    &[collapsed] {
      .smart-content-container {

        &:before,
        &:after {
          content: '';
        }
      }
    }
  }

  //HEADER AND FOOTER
  &[header-position="none"] {
    .smart-content-container {
      >.smart-header-section {
        display: none;
      }

      >.smart-content {
        height: 100%;
      }
    }
  }

  &[header-position="bottom"] {
    .smart-content-container {
      flex-direction: column-reverse;
    }
  }

  &[header-position="left"] {
    .smart-content-container {
      flex-direction: row;

      .smart-header-section {
        flex-direction: column;

        .smart-collapse-button {
          &:after {
            transform: rotate(275deg) translateY(1px);
          }
        }

        >.smart-header {
          writing-mode: vertical-lr;
        }
      }

      >.smart-header-section,
      >.smart-footer {
        width: var(--smart-window-header-height);
        min-width: var(--smart-window-header-height);
        height: 100%;
      }
    }

    &[collapsed] {
      .smart-content-container {
        .smart-header-section {
          .smart-collapse-button {
            &:after {
              transform: rotate(90deg) translateY(1px);
            }
          }
        }
      }
    }
  }

  &[header-position="right"] {
    .smart-content-container {
      flex-direction: row-reverse;

      .smart-header-section {
        flex-direction: column;

        .smart-collapse-button {
          &:after {
            transform: rotate(90deg) translateY(1px);
          }
        }

        >.smart-header {
          writing-mode: vertical-lr;
        }
      }

      >.smart-header-section,
      >.smart-footer {
        width: var(--smart-window-header-height);
        min-width: var(--smart-window-header-height);
        height: 100%;
      }
    }

    &[collapsed] {
      .smart-content-container {
        .smart-header-section {
          .smart-collapse-button:after {
            transform: rotate(275deg) translateY(1px);
          }
        }
      }
    }
  }

  &[header-position="left"],
  &[header-position="right"] {
    min-width: var(--smart-window-header-height);
    min-height: var(--smart-window-min-width);

    &.smart-window-snapped-left,
    &.smart-window-snapped-right {
      height: 100%;
      width: 50%;
    }

    &.smart-window-snapped-top {
      height: 100%;
      width: 100%;
    }

    &[minimized],
    &[minimized] {
      max-width: var(--smart-window-header-height);
    }

    .smart-content-container {
      >.smart-content {
        height: 100%;
      }

      >.smart-header-section {
        .smart-buttons-container {
          display: flex;
          justify-content: center;
          flex-direction: column;
          height: initial;

          button {
            margin-left: initial;
            margin-top: 1px;

            &:first-of-type {
              margin-top: initial;
            }
          }
        }
      }
    }
  }

  &[footer-position="none"] {
    .smart-content-container {
      >.smart-footer {
        display: none;
      }
    }
  }

  &[footer-template] {
    .smart-content-container {
      >.smart-content {
        height: calc(100% - var(--smart-window-header-height) - var(--smart-window-footer-height));
      }
    }
  }

  &[footer-template="null"] {
    .smart-content-container {
      >.smart-content {
        height: calc(100% - var(--smart-window-header-height));
      }
    }
  }

  //WINDOW-SNAPPED
  &.smart-window-snapped-top,
  &.smart-window-snapped-left,
  &.smart-window-snapped-right {
    height: 100%;
    z-index: 9999;
    box-shadow: none;
    border: var(--smart-border-width) solid var(--smart-border);


    &[ontop] {
      z-index: 10000;
      box-shadow: none;
    }
  }

  &.smart-window-snapped-left,
  &.smart-window-snapped-right {
    width: 50%;
  }

  &.smart-window-snapped-top {
    width: 100%;
  }

  //DIALOG, ALERT, PROMPT, MULTILINE-PROMPT, PROGRESS, WAIT
  &.smart-dialog-window,
  &.smart-alert-window,
  &.smart-prompt-window,
  &.smart-multiline-prompt-window,
  &.smart-progress-window {
    .smart-content-container {
      >.smart-footer {
        .smart-button {
          width: var(--smart-window-footer-button-width);
          height: 100%;
          text-align: center;
          vertical-align: middle;
          cursor: pointer;
          text-transform: var(--smart-button-text-transform);
          font-weight: 500;
          letter-spacing: .08929em;
          overflow: hidden;
          border-color: var(--smart-border);
          border-top-left-radius: var(--smart-border-top-left-radius);
          border-top-right-radius: var(--smart-border-top-right-radius);
          border-bottom-left-radius: var(--smart-border-bottom-left-radius);
          border-bottom-right-radius: var(--smart-border-bottom-right-radius);
          border-width: var(--smart-border-width);
          border-style: solid;
 
          &.primary {
            color: var(--smart-primary-color);
            border-color: var(--smart-primary);
            background-color: var(--smart-primary);
          }
          
          &:focus {
            color: var(--smart-ui-state-color-focus);
            border-color: var(--smart-ui-state-focus);
            background-color: var(--smart-ui-state-focus);
            opacity: var(--smart-button-opacity-focus);
          }
        }
      }
    }
  }

  //.smart-dialog-window
  &.smart-dialog-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    .smart-content-container {
      >.smart-footer {
        button {
          &:first-child {
            margin-right: 10px;
          }
        }
      }
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }

  //.smart-alert-window
  &.smart-alert-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    .smart-content-container {
      >.smart-footer {
        button {
          &:first-child {
            margin-right: 10px;
          }
        }
      }
    }

    .smart-cancel-button {
      display: none;
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }

  //.smart-prompt-window
  &.smart-prompt-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    .smart-content-container {
      >.smart-content {
        flex-direction: column-reverse;
        align-items: flex-start;
      }

      >.smart-footer button {
        &:first-child {
          margin-right: 10px;
        }
      }
    }

    smart-text-box {
      width: 100%;
      margin-top: 5px;
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }

  //.smart-multiline-prompt-window
  &.smart-multiline-prompt-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    smart-multiline-text-box {
      width: 100%;
      margin-top: 5px;
    }

    .smart-content-container {
      >.smart-content {
        flex-direction: column-reverse;
        align-items: flex-start;
      }

      >.smart-footer button {
        &:first-child {
          margin-right: 10px;
        }
      }
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }

  //.smart-progress-window
  &.smart-progress-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    smart-progress-bar {
      .smart-value {
        border: initial;
      }

      &.smart-visibility-hidden {
        transition: none;
      }
    }

    .smart-content-container {
      >.smart-content {
        user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        -moz-user-select: none;
      }

      >.smart-footer {
        smart-progress-bar {
          width: 100%;
          height: 100%;
          box-shadow: initial;
          background-color: var(--smart-surface);
          transition: opacity 0.25s ease-in, visibility 0.25s cubic-bezier(0.0, 0.0, 0.2, 1);

          >.smart-container {
            border: initial;
          }

          &.smart-visibility-hidden {
            opacity: 0.5;
            transition: opacity 0.25s ease-out, visibility 0.25s cubic-bezier(0.0, 0.0, 0.2, 1);
          }
        }

        button.smart-button {
          position: absolute;
          width: calc(100% - 13px);
          height: calc(100% - 13px);
          top: 6.5px;
          left: 6.5px;
          text-align: center;
          background-color: rgba(224, 224, 224, 0.5);

          &.smart-visibility-hidden {
            top: 100%;
          }
        }
      }
    }

    &.smart-visibility-hidden {
      smart-progress-bar {
        transform: scale(0);
      }
    }

    &:not([animation='none']) {
      .smart-content-container {
        >.smart-footer {
          button {
            transition: top 0.25s cubic-bezier(0.0, 0.0, 0.2, 1), visibility 0.25s cubic-bezier(0.0, 0.0, 0.2, 1);

            &.smart-visibility-hidden {
              transition: top 0.25s cubic-bezier(0.0, 0.0, 0.2, 1), visibility 0.25s cubic-bezier(0.0, 0.0, 0.2, 1);
            }
          }
        }
      }
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }

  /* .smart-wait-window */
  &.smart-wait-window {
    width: var(--smart-window-default-width);
    height: var(--smart-window-default-height);
    top: calc(50% - var(--smart-window-default-height) / 2);
    left: calc(50% - var(--smart-window-default-width) / 2);

    .smart-content-container {
      >.smart-header-section {
        cursor: default;
      }

      >.smart-content {
        smart-progress-bar {
          width: 100%;
          height: 75%;
        }
      }
    }

    &[collapsed],
    &[collapsed][maximized] {

      &[header-position="left"],
      &[header-position="right"] {
        height: var(--smart-window-default-height);
      }
    }
  }
}

smart-window.smart-window {

  &[collapsed],
  &[collapsed][maximized] {

    &[header-position="left"],
    &[header-position="right"] {
      width: var(--smart-window-header-height);
      min-width: initial;
      height: var(--smart-window-default-height);
    }
  }
}

.smart-modal {
  position: absolute;
  opacity: 0.5;
  background-color: var(--smart-disabled);
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
}

.smart-window-resize-feedback {
  position: absolute;
  z-index: 10000;
  pointer-events: none;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  border: 2.5px solid black;
  box-sizing: border-box;
}

smart-docking-layout {
  .smart-window-resize-feedback {
    border: 2.5px solid lightgray;
  }
}

//SNAPPING HIGHLIGHTER
.smart-window-snap-right-feedback,
.smart-window-snap-left-feedback,
.smart-window-snap-top-feedback,
.smart-window-snap-bottom-feedback {
  position: absolute;
  height: calc(100% - 10px);
  top: 5px;
  bottom: 5px;
  opacity: 0.65;
  box-shadow: 0 0 1px 1px #8a8a8a;
  border-radius: 2px;
  transition: all 0.05s cubic-bezier(0.4, 0.0, 0.6, 1);
  animation: scaleIn 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform: scale(1);
  pointer-events: none;

  &.smart-visibility-hidden {
    transition: animation 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), visibility 0.2s cubic-bezier(0.4, 0.0, 0.6, 1), top 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), left 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    animation: scaleOut 0.2s cubic-bezier(0.4, 0.0, 0.6, 1);
    transform: scale(0);
  }
}

.smart-window-snap-right-feedback {
  width: 50%;
  left: calc(50% - 5px);
  transform-origin: right;
}

.smart-window-snap-left-feedback {
  width: 50%;
  left: 5px;
  transform-origin: left;
}

.smart-window-snap-top-feedback {
  width: calc(100% - 10px);
  left: 5px;
  transform-origin: top;
}

.smart-window-snap-bottom-feedback {
  width: calc(100% - 10px);
  left: 5px;
  transform-origin: top;
}

//ANIMATIONS
@keyframes scaleIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(0);
  }
}

@keyframes scaleInRight {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(0.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@import 'rtl/_window';