.jstb_fullscreen {
  background-image: url(../../../images/zoom_in.png);
}

/* Mobile device support */
#disable-wiki-fullscreen-editor-bar {
  display: none;
  position: fixed;
  width: 100%;
  height: 64px;
  top: 0;
  background-color: #628db6;
  z-index: 100;
  cursor: pointer;
  color: white;
  font-weight: bold;
}

html:has(.jstBlock.fullscreen) {
  overflow: hidden !important;

  & > body > :is(.ui-menu, .table-generator) {
    z-index: 100;
  }

  #header {
    display: none !important;
  }

  /* Mobile device support */
  @media screen and (max-width: 899px) {
    #disable-wiki-fullscreen-editor-bar {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
#main:has(.jstBlock.side-by-side) ~ #ajax-indicator {
  display: none !important;
}
.jstBlock.fullscreen:not(.side-by-side) {
  .jstEditor {
    textarea.wiki-edit,
    .wiki-preview {
      width: 100% !important;
    }
  }
}
.jstBlock.fullscreen {
  position: fixed !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
  background-color: #fff;
  padding: 5px 10px 10px !important;
  display: flex !important;
  flex-direction: column;
  z-index: 100;
  margin: 0 !important;

  .jstb_fullscreen {
    background-image: url(../../../images/zoom_out.png);
  }

  /* Move exit-fullscreen button to top right of the screen */
  @media screen and (min-width: 900px) {
    .jstTabs.tabs {
      width: 100%;
      ul {
        width: calc(100% - 40px) !important;
      }
    }

    .jstb_fullscreen {
      position: fixed;
      right: 10px;
    }
  }

  .jstEditor {
    flex: 1 1 auto;
    height: calc(100% - 32px);

    textarea.wiki-edit,
    .wiki-preview {
      height: 100% !important;
      box-sizing: border-box !important;
      resize: none !important;
      overflow: auto !important;
      min-height: 0 !important;
    }
  }

  &.side-by-side {
    .jstTabs {
      li:has(a.tab-edit),
      li:has(a.tab-preview) {
        pointer-events: none;
      }
    }

    .jstEditor {
      display: flex;
      flex-direction: row !important;

      textarea.wiki-edit,
      .wiki-preview {
        width: 50%;
        display: block !important;
        left: 0 !important;
        position: static !important;
      }

      textarea.wiki-edit {
        flex: 0 0 auto !important;
      }

      .wiki-preview {
        flex: 1 1 auto;
        border-left: 1px solid #dfe8f1;
        padding-left: 2px;
        margin-left: 0;
      }
    }
  }

  .jstTabs {
    .tab-elements {
      text-align: left;
    }

    .tab-edit,
    .tab-preview {
      display: none;
    }

    .tab-preview-side-by-side {
      display: flex;
      align-items: flex-end;

      &:before {
        content: none !important;
      }

      & > div {
        display: flex;
        align-items: center;
      }

      label {
        margin: 0 5px;
        width: auto;
        font-weight: normal;
      }

      input[type="checkbox"] {
        margin-left: 0 !important;
      }
    }

    li:has(a.tab-preview.selected) + li.tab-preview-side-by-side {
      display: none;
    }
  }
}

.wiki-fullscreen-resize-bar {
  position: static !important;
  cursor: e-resize;
  width: 5px !important;
  border-radius: 3px;
  flex: 0 0 auto !important;

  &:hover {
    background-color: #759fcf99;
  }
}

.jstEditor.resizing {
  cursor: e-resize;

  textarea {
    cursor: e-resize;
  }
}

/* Mobile device support */
@media screen and (max-width: 899px) {
  .jstBlock.fullscreen {
    /* 64px is #disable-wiki-fullscreen-editor-bar height in mobile view */
    height: calc(100vh - 64px) !important;
    margin-top: 64px !important;
  }
}

.tab-preview-side-by-side {
  display: none;
}
