@import "ui-variables";

.nuclide-debugger-container {
  display: flex;
}

.nuclide-debugger-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.nuclide-debugger-root select.form-control {
  color: @text-color;
  background-color: @button-background-color;
  border-color: @button-border-color;
}

.nuclide-debugger-root .control-bar {
  display: flex;
  flex-direction: row-reverse;
}

.nuclide-debugger-root-close-button {
  background: transparent;
  border: none;
  padding: 0;
  position: absolute;
  top: 2.5em;
  right: 0.5em;
  z-index: 1;
}

.nuclide-debugger-root .inspector {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nuclide-debugger-container-old-enabled {
  display: flex;
  flex-grow: 1;
}

.nuclide-debugger-container-new {
  flex-grow: 1;
  flex-basis: 0;
  overflow: auto;
  padding-right: 0.5em;
}

.nuclide-debugger-webview-hidden {
  height: 0;
  overflow: hidden;
}

/*
Hack for flexbox + vertical scaling with webview shadow dom.
Use flexbox cross-axis stretch to fill the vertical space.
*/

.nuclide-debugger-vfill-parent() {
  display: flex;
  flex-direction:row;
  align-children: stretch;
  align-items: stretch;
}

.nuclide-debugger-vfill-child() {
  flex: 1 0 auto;
}

.nuclide-debugger-webview {
  background-color: #fff;
  .nuclide-debugger-vfill-parent();
  .nuclide-debugger-vfill-child(); // child relative to .inspector

  &::shadow object {
    .nuclide-debugger-vfill-child();
    // The object element is generated with inline style height:100%.
    height: auto !important;
  }
}

/* General debugger UI */
.nuclide-debugger-section-content {
  max-height: 20em;
  overflow-y: auto;
}

/* Watch Expressions */
@leftMargin: 0.5em;

.nuclide-debugger-expression-value-list {
  margin: 0 @leftMargin;
}

.nuclide-debugger-expression-value-row {
  align-items: center;
  display: flex;
  flex-direction: row;
  font-family: Menlo, Monaco, Consolas, monospace;
  justify-content: space-between;
  min-height: 23px; // Match height of AtomInput to prevent list items from jumping around.
  overflow: auto;
}

.nuclide-debugger-expression-value-content {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
}

.nuclide-debugger-watch-expression-xout {
  cursor: pointer;
  opacity: 0;
}

.nuclide-debugger-watch-expression-row:hover {
  background-color: @background-color-highlight;

  .nuclide-debugger-watch-expression-xout {
    opacity: 0.5;
  }
}

.nuclide-debugger-watch-expression-xout.nuclide-debugger-watch-expression-xout:hover {
  opacity: 1;
}

.nuclide-debugger-watch-expression-input {
  // Vertically align listed watch expressions with input.
  margin-left: -@leftMargin;
}

.nuclide-debugger-watch-expression-add-new-input {
  margin-top: 0.5em;
}

/* Call stack */
.nuclide-debugger-callstack-item {
  display: flex;
  justify-content: space-between;
}

.nuclide-debugger-callstack-name {
  font-family: Menlo, Monaco, Consolas, monospace;
}

/* Stepping controls */
.nuclide-debugger-stepping-component {
  display: flex;
  flex-wrap: wrap;
}

.nuclide-debugger-stepping-buttongroup {
  margin-right: 1em;
}

.nuclide-debugger-exception-checkbox {
  cursor: pointer;
  margin-right: 0.5em;
  margin-top: 4px;
}

.nuclide-debugger-exception-fragment {
  margin: 5px 0 0 0.5em;
}

/* Thread list */

.nuclide-debugger-thread-list-table {
  border-collapse: separate;
  table-layout: fixed;
  width: 100%;
}

.nuclide-debugger-thread-list-table-row-odd {
  background-color: @background-color-highlight;
}

.nuclide-debugger-thread-list-table > thead {
  font-weight: bold;
}

.nuclide-debugger-thread-list-item {
  cursor: pointer;
}

.nuclide-debugger-thread-list-item:hover {
  color: @text-color-highlight;
}

.nuclide-debugger-thread-list-item-selected {
  color: @text-color-highlight;
  font-weight: bold;
}

.nuclide-debugger-thread-list-item-current-indicator {
  padding: 0.4em 4px;
  width: 5%;
}

.nuclide-debugger-thread-list-item-id {
  width: 15%;
}

.nuclide-debugger-thread-list-item-address {
  width: 55%;
  font-family: Menlo, Monaco, Consolas, monospace;
}

.nuclide-debugger-thread-list-item-stop-reason {
  width: 25%;
}

.nuclide-debugger-thread-list-item-id,
.nuclide-debugger-thread-list-item-address,
.nuclide-debugger-thread-list-item-stop-reason {
  overflow: hidden;
  margin-left: 4px;
  text-overflow: ellipsis;
  padding: 0.4em 0;
}

.nuclide-debugger-thread-list-header {
  background-color: transparent;
  font-weight: bold;
}

.nuclide-debugger-thread-switch-alert {
    padding: 1px 4px;
    font-weight: bold;
    color: @text-color-warning;
}
