/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.bottom-box-pane {
  display: flex;
  height: 100%; /* direct child of SplitterLayout */
  flex-flow: column nowrap;
}

.bottom-sourceview-wrapper,
.bottom-assemblyview-wrapper {
  position: relative; /* containing block for status overlay */
  display: flex;
  min-height: 0;
  flex: 1;
  flex-flow: column;
  background: var(--grey-20);
}

.bottom-box .layout-splitter {
  position: relative; /* containing block for absolute ::before */
  width: 1px;
  border: none;
  background-color: var(--grey-30) !important;
}

/* Provide 3px extra grabbable surface on each side of the splitter */
.bottom-box .layout-splitter::before {
  position: absolute;
  z-index: 1;
  display: block;
  content: '';
  inset: 0 -3px;
}

.bottom-box-bar {
  display: flex;
  overflow: hidden;
  height: 24px;
  flex-flow: row;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--grey-30);
  background: var(--grey-10);
  line-height: 18px;
}

.bottom-box-title {
  overflow: hidden;
  margin: 0 8px;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-box-header-trailing-buttons {
  display: flex;
  height: 100%;
  flex-flow: row nowrap;
  align-items: center;
}

.bottom-close-button,
.bottom-assembly-button {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

.bottom-close-button {
  background-image: url(../../../res/img/svg/close-dark.svg);
}

.bottom-assembly-button {
  background-image: url(../../../res/img/svg/asm-icon.svg);
}

.codeLoadingOverlay,
.sourceCodeErrorOverlay,
.assemblyCodeErrorOverlay {
  /**
   * Put the overlay on top of everything in .bottom-main, but centered
   * horizontally and vertically. We center using margin: auto, and enforce
   * maximum sizes so that the line numbers and timings are still visible.
   */

  position: absolute;
  display: flex;
  width: max-content;
  min-width: 200px;
  max-width: min(500px, 100%);
  height: min-content;
  flex-flow: row;
  align-items: center;
  padding: 15px;
  border-radius: 10px;
  margin: auto;
  background-color: rgb(240 240 240 / 0.8);
  gap: 15px;
  inset: 0;
  overflow-wrap: break-word;
}

/* Use ::before to add a loading spinner image */
.codeLoadingOverlay::before {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: url(../../../res/img/spinner.png) center center / 32px 32px
    no-repeat;
  content: '';
}

/* Use ::before to add an alert icon */
.sourceCodeErrorOverlay::before,
.assemblyCodeErrorOverlay::before {
  display: block;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  background: url(../../../res/img/svg/error.svg) center center / 32px 32px
    no-repeat;
  content: '';
  filter: brightness(70%) drop-shadow(0 1px rgb(255 255 255 / 0.5));
}

.codeErrorOverlay {
  padding-left: 20px;
}
