/* NetTango Copyright (C) Michael S. Horn, Uri Wilensky, and Corey Brady. https://github.com/NetLogo/NetTango */

.nt-container {
  display: grid;
}

.nt-workspace-wrapper {
  background: #eee;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  grid-area: 1 / 1;
}

.nt-workspace {
  width: 100%;
  background: white;
  position: relative;
}

.nt-menu-wrapper {
  border-radius: 10px;
  overflow: hidden;
  min-width: min-content;
  padding-left: 0.2em;
  position: sticky;
  top: 0;
}

.nt-menu {
  min-width: 150px;
  padding: 0;
  overflow-y: auto;
}

.nt-menu-drag-over {
  opacity: 0.25;
  background: #555;
}

.nt-drop-spot {
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
  font-weight: bold;
  padding-top: 0.5em;
  border-bottom: 2px solid #00000000;
  user-select: none;
}

.nt-chain {
  margin: 0;
  width: fit-content;
  height: fit-content;
  position: absolute;
}

.nt-clause > .nt-block {
  grid-column: 2;
}

.nt-arrow {
  display: none;
  color: grey;
  background: transparent;
  min-height: 6px;
  min-width: 6px;
  position: absolute;
  right: -15px;
  margin-top: -8px;
  font-size: 15px;
  transform: rotate(180deg);
}

.nt-block-standalone > .nt-arrow,
.nt-block-last > .nt-arrow {
  margin-top: 0;
}

/* top of chain arrow */
.nt-chain > .nt-arrow {
  margin-top: -16px;
}

/* empty clause arrow without divider text */
.nt-clause-empty > .nt-clause-divider > .nt-arrow {
  margin-top: 22px;
}

/* block's first clause is empty arrow */
.nt-block-header + .nt-clause-empty > .nt-clause-divider > .nt-arrow {
  margin-top: 15px;
}

/* empty clause arrow with divider text */
.nt-clause-empty > .nt-clause-divider > .nt-clause-divider-text + .nt-arrow {
  margin-top: 15px;
}

.nt-allowed-drop > .nt-arrow,
.nt-allowed-drop > .nt-clause-divider > .nt-arrow {
  display: block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    color: #3AA;
  }
  50% {
    color: #1DD;
  }
  100% {
    color: #3AA;
  }
}

.nt-cap {
  touch-action: none;
}

.nt-cap-top {
  border-left: 1px solid;
  border-top: 1px solid;
  border-right: 1px solid;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-color: inherit;
  min-height: 9px;
}

.nt-cap-bottom {
  border-left: 1px solid;
  border-bottom: 1px solid;
  border-right: 1px solid;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  border-color: inherit;
  min-height: 9px;
}

.nt-notch {
  touch-action: none;
}

.nt-notch-top {
  display: grid;
  grid-template-columns: 25px 12px auto;
  grid-template-rows: 7px 2px;
}

.nt-notch-top > .nt-notch-filler {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}

.nt-notch-top > .nt-notch-left {
  border-top: 1px solid;
  border-left: 1px solid;
  border-top-left-radius: 10px;
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  border-color: inherit;
}

.nt-notch-top > .nt-notch-middle {
  border-bottom: 1px solid;
  border-left: 1px solid;
  border-right: 1px solid;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  background-color: white;
  border-color: inherit;
}

.nt-notch-top > .nt-notch-right {
  border-top: 1px solid;
  border-right: 1px solid;
  border-top-right-radius: 10px;
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  border-color: inherit;
}

.nt-notch-bottom {
  display: grid;
  grid-template-columns: 25px 12px auto;
  grid-template-rows: 9px 6px 34px;
}

.nt-notch-bottom > .nt-notch-filler {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.nt-notch-bottom > .nt-notch-left {
  border-bottom: 1px solid;
  border-left: 1px solid;
  border-bottom-left-radius: 10px;
  grid-column: 1 / 2;
  border-color: inherit;
}

.nt-notch-bottom > .nt-notch-middle {
  border-bottom: 1px solid;
  border-left: 1px solid;
  border-right: 1px solid;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  grid-row: 2 / 3;
  grid-column: 2 / 3;
  margin-top: -1px;
  border-color: inherit;
}

.nt-notch-bottom > .nt-notch-right {
  border-bottom: 1px solid;
  border-right: 1px solid;
  border-bottom-right-radius: 10px;
  grid-column: 3 / 4;
  border-color: inherit;
}

.nt-clause {
  border-color: inherit;
  display: grid;
  grid-template-rows: min-content min-content auto min-content;
  grid-template-columns: min-content auto;
}

.nt-clause-empty {
  min-height: 2.5em;
}

.nt-clause-footer {
  border-left: 1px solid;
  border-right: 1px solid;
  border-color: inherit;
  min-height: 0.5em;
}

.nt-clause-empty > .nt-notch-bottom {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
}

.nt-clause-empty > .nt-clause-drop {
  background-color: rgba(0, 0, 0, 0);
  border-left: 1px solid;
  border-color: inherit;
  grid-row: 3 / 4;
  grid-column: 2 / 3;
  min-height: 1.5em;
}

.nt-clause-empty > .nt-notch-top {
  grid-row: 4 / 5;
  grid-column: 2 / 3;
}

.nt-clause-empty > .nt-notch-top > .nt-notch-left {
  border-left: 0;
  border-top-left-radius: 0;
}

.nt-clause-empty > .nt-notch-bottom {
  grid-template-rows: 9px 6px 0;
}

.nt-clause-empty > .nt-notch-bottom > .nt-notch-left {
  border-left: 0;
  border-bottom-left-radius: 0;
}

.nt-clause-empty > .nt-notch-bottom > .nt-notch-clause-filler {
  border-left: 1px solid;
  border-color: inherit;
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

.nt-block.nt-block-clause-drag-over {
  border-top: 3px solid cyan !important;
}

.nt-block-clause-drag-over > .nt-notch-bottom > .nt-notch-left,
.nt-block-clause-drag-over > .nt-notch-bottom > .nt-notch-middle,
.nt-block-clause-drag-over > .nt-notch-bottom > .nt-notch-right {
  border-bottom: 3px solid cyan !important;
}

.nt-block-clause-drag-over > .nt-notch-bottom > .nt-notch-middle {
  border-left: 3px solid cyan !important;
  border-right: 3px solid cyan !important;
  margin-top: -3px;
}

.nt-clause-divider {
  min-height: 0.6em;
  border-right: 1px solid;
  border-color: inherit;
  grid-row: 1 / 2;
  grid-column: 2 / 3;
}

.nt-block > .nt-block-header + .nt-clause > .nt-clause-divider {
  padding-top: 0;
  min-height: 0;
}

.nt-clause-divider-text:not(:empty) {
  padding: 0.4em;
}

.nt-clause-left-bar {
  border-left: 1px solid;
  border-color: inherit;
  min-width: 0.6em;
  grid-row: 1 / 5;
  grid-column: 1 / 2;
}

.nt-clause-blocks {
  grid-row: 2 / 5;
  grid-column: 2 / 3;
  border-color: inherit;
}

.nt-fragment {
  height: 40px;
  background-color: rgba(0, 0, 0, 0);
  display: none;
}

.nt-fragment.show {
  display: block;
}

.nt-block-with-clauses {
  padding-bottom: 0.6em;
  border-right: 0px;
}

.nt-block {
  background: rgba(0, 0, 0, 0);
  border-width: 0;
  border-style: solid;
  font-size: 14px;
  padding: 0;
  user-select: none;
  white-space: nowrap;
  min-width: 10em;
  height: fit-content;
  touch-action: none;
}

.nt-clause-blocks > .nt-block,
.nt-block-first,
.nt-block-middle {
  border-bottom: 1px solid;
  border-color: inherit;
}

.nt-block-clause-standalone,
.nt-block-clause-first {
  border-top: 1px solid;
}

.nt-block-header {
  border-width: 0 1px 0 1px;
  border-style: solid;
  border-color: inherit;
  padding-left: 0.6em;
  padding-right: 0.6em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  display: grid;
  grid-template-columns: 1fr auto;
  flex-direction: row;
  align-items: center;
  align-content: center;
  min-height: 1.5em;
  line-height: 1.5em;
}

.nt-chain > .nt-block-first > .nt-block-header {
  padding-top: 0;
}

.nt-chain > .nt-block-last:not(.nt-block-with-clauses) > .nt-block-header {
  padding-bottom: 0;
}

.nt-chain > .nt-block-standalone > .nt-block-header {
  padding-top: 0;
}

.nt-chain > .nt-block-standalone:not(.nt-block-with-clauses) > .nt-block-header {
  padding-bottom: 0;
}

.nt-block-action {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nt-block-params {
  grid-column: 2;
  display: flex;
  flex-direction: row;
  width: min-content;
}

.nt-block-properties {
  grid-column: 1 / 3;
  padding-left: 0.6em;
}

.nt-block-properties-hidden {
  display: none;
}

.nt-toggle {
  font-size: 0.9em;
  line-height: 1.5em;
  margin: 0 1em;
  display: inline;
}

.nt-block-drag {
  visibility: hidden;
  position: absolute;
  z-index: 1;
}

.nt-block-dragging {
  opacity: 0.25;
}

.nt-block-clause-first.nt-drag-over,
.nt-block-clause-standalone.nt-drag-over,
.nt-block-clause-middle.nt-drag-over,
.nt-block-clause-last.nt-drag-over,
.nt-block-first.nt-drag-over,
.nt-block-middle.nt-drag-over {
  border-bottom: 3px solid cyan !important;
}

.nt-fragment.nt-drag-over + .nt-notch-top > .nt-notch-left,
.nt-fragment.nt-drag-over + .nt-notch-top > .nt-notch-right {
  border-top: 3px solid cyan !important;
}
.nt-fragment.nt-drag-over + .nt-notch-top > .nt-notch-middle {
  border-top: 0;
  border-left: 3px solid cyan !important;
  border-right: 3px solid cyan !important;
  border-bottom: 3px solid cyan !important;
}

.nt-block-standalone.nt-drag-over + .nt-notch-bottom > .nt-notch-left,
.nt-block-standalone.nt-drag-over + .nt-notch-bottom > .nt-notch-right,
.nt-block-last.nt-drag-over + .nt-notch-bottom > .nt-notch-left,
.nt-block-last.nt-drag-over + .nt-notch-bottom > .nt-notch-right {
  border-bottom: 3px solid cyan !important;
}
.nt-block-standalone.nt-drag-over + .nt-notch-bottom > .nt-notch-middle,
.nt-block-last.nt-drag-over + .nt-notch-bottom > .nt-notch-middle {
  border-top: 0;
  border-left: 3px solid cyan !important;
  border-right: 3px solid cyan !important;
  border-bottom: 3px solid cyan !important;
  margin-top: -3px;
}

.nt-property {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-content: center;
  min-height: 2em;
  line-height: 2em;
}

.nt-property-name {
  flex: auto;
}

.nt-attribute-value {
  background: white;
  border: 1px solid #eee;
  border-radius: 9px;
  margin-left: 0.5em;
  padding: 0 0.5em;
  line-height: 1.5em;
  height: 1.5em;
}

.nt-block.clause-block {
  height: fit-content;
  padding-bottom: 0.5em;
  padding-left: 0.5em;
}

.nt-block.clause-block > .nt-block {
  margin-left: 0.8em;
}

.nt-menu-slot-wrapper {
  padding: 0.3em;
  border-bottom: 2px solid #00000000;
}

.nt-menu-slot {
  border: 1px solid #000;
  border-radius: 10px;
  font-size: 14px;
  padding: 0.2em 0.5em;
  width: min-content;
  height: 2em;
  min-width: 4em;
  line-height: 2em;
  background: white;
  user-select: none;
  white-space: nowrap;
  touch-action: none;
}

.nt-menu-slot-over {
  border-bottom-color: cyan !important;
}

.nt-menu-slot-at-limit {
  opacity: 0.25;
}

.nt-group-blocks-hidden {
  display: none;
}

.nt-info-dialog {
  visibility: hidden;
  border-radius: 10px;
  background-color: white;
  border: 2px solid rgba(0, 0, 0, 0.4);
  padding: 10px;
  min-width: 400px;
  max-width: 500px;
  max-height: 1000px;
  overflow: hidden;
  color: #555;
  line-height: 120%;
  position: absolute;
  z-index: 10;
}

.nt-info-dialog.show {
  visibility: visible;
}

.nt-info-dialog-code {
  max-width: 500px;
  max-height: 1000px;
  overflow: auto;
}

.nt-info-dialog-note {
  font-family: Poppins, sans-serif;
  font-size: small;
  margin: 0.5em;
}

.nt-info-dialog-header {
  font-family: Poppins, sans-serif;
  font-size: medium;
  margin: 0;
}

/* Backdrop for the parameter popup menu */
.nt-attribute-backdrop {
  visibility: hidden;
  z-index: 10;
  grid-area: 1 / 1;
}

/* Toggle this class - hide and show the popup */
.nt-attribute-backdrop.show {
  visibility: visible;
  animation: fadeIn 0.1s;
}

.nt-attribute-dialog {
  border-radius: 10px;
  background-color: white;
  border: 2px solid rgba(0, 0, 0, 0.4);
  margin-left: auto;
  margin-right: auto;
  padding: 20px;
  max-width: 400px;
  color: #555;
  line-height: 120%;
  position: relative;
}

.nt-attribute-dialog.small {
  border-radius: 5px;
  max-width: 300px;
  padding: 15px;
}

.nt-param-close {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 5px;
  right: 5px;
  color: #555;
  outline: none;
  border: none;
  font-size: 25px;
  background-color: transparent;
  border-radius: 20px;
  vertical-align: top;
}

.nt-param-table {
  display: table;
  width: 100%;
}

.nt-param-row {
  display: table-row;
  margin: 8px 0;
  width: 100%;
}

.nt-param-name, .nt-param-value, .nt-param-label {
  display: table-cell;
  padding-top: 5px;
  padding-bottom: 5px;
  text-align: left;
}

.nt-param-label {
  width: 100px;
  font-size: 16px;
  margin-left: 16px;
}

.nt-param-input {
  width: 80%;
  font-size: 16px;
  line-height: 150%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.nt-param-unit {
  margin-right: 10px;
}

.nt-param-confirm {
  border: none;
  background-color: #6b9bc3;
  font-size: 18px;
  color: white;
  margin-top: 12px;
  margin-right: 5px;
  padding: 8px 15px;
  border-radius: 5px;
}

.nt-param-confirm:active { color: #ccc; }

.nt-param-cancel {
  font-size: 18px;
  border: none;
  background-color: #aaa;
  color: white;
  margin-top: 12px;
  padding: 8px 15px;
  border-radius: 5px;
}

.nt-select-option {
  /* background-color: #efefef; */
  font-size: 15px;
  color: #333;
  padding: 5px;
  line-height: 150%;
}

.nt-select-option:hover { background-color: #eee; }
.nt-select-option.selected { background-color: rgba(107, 155, 195, 0.5); }
.nt-select-option:active { background-color: rgba(107, 155, 195, 1.0); color: white; }

.nt-range-value {
  display: flex;
  flex-direction: row;
}

.nt-range-input {
  flex-grow: 3;
  margin-right: 10px;
}

.nt-range-number {
  flex-shrink: 3;
  margin-left: 10px;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

.nt-container input[type=range] {
  /*-webkit-appearance: none;*/
  border: 1px solid white;
  width: 100%;
}

.nt-container input[type=range]::-webkit-slider-runnable-track,
.nt-container input[type=range]::-moz-range-track {
  width: 220px;
  height: 4px;
  background: #ddd;
  border: none;
  border-radius: 50%;
}

.nt-container input[type=range]::-webkit-slider-thumb,
.nt-container input[type=range]::-moz-range-thumb,
.nt-container input[type=range]::-ms-thumb {
  -webkit-appearance: none;
  border: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: goldenrod;
  margin-top: -4px;
}

.nt-container input[type=range]:focus {
  outline: none;
}


/*hide the outline behind the border*/
.nt-container input[type=range]:-moz-focusring{
    outline: 1px solid white;
    outline-offset: -1px;
}

.nt-container input[type=range]::-ms-track {
    width: 220px;
    height: 5px;

    /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
    background: transparent;

    /*leave room for the larger thumb to overflow with a transparent border */
    border-color: transparent;
    border-width: 6px 0;

    /*remove default tick marks*/
    color: transparent;
}
.nt-container input[type=range]::-ms-fill-lower {
    background: #777;
    border-radius: 10px;
}
.nt-container input[type=range]::-ms-fill-upper {
    background: #ddd;
    border-radius: 10px;
}

.nt-container input[type=range]:focus::-ms-fill-lower {
    background: #888;
}
.nt-container input[type=range]:focus::-ms-fill-upper {
    background: #ccc;
}


/*
 * EXPRESSION BUILDER
 */
.nt-expression {
  display: inline-block;
  padding: 0;
  color: #555;
  border: 3px solid transparent;
  line-height: 150%;
  font-size: 16px;
  height: 1.6em;
}

.nt-expression-root {
  padding: 1em 0;
}

.nt-expression:hover {
  cursor: default;
}

.nt-expression.highlight {
  background-color: rgba(150, 200, 255, 0.2);
  border: 3px solid rgba(150, 200, 255, 0.4);
}

.editable:hover {
  text-decoration: underline;
}

.nt-expression.empty {
  border: 1px solid rgba(150, 200, 255, 0.4);
  border-radius: 0.2em;
  width: 4em;
  padding: 0 0.2em;
  text-align: right;
}

.nt-expression.empty.warn {
  background-color: rgba(255, 0, 0, 0.2);
}

.nt-expression.empty:hover {
  text-decoration: none;
}

.nt-expression-text {
  padding: 0 0.2em;
  display: inline;
}

.nt-expression-text.literal {
  font-weight: bold;
  color: #222;
}

.nt-expression-text.variable {
  font-style: italic;
  color: #222;
}

.nt-expression-text.parenthesis {
  padding: 0 0 0 0.1em;
}

.nt-number-input {
  font-size: 16px;
  border: 1px solid rgba(150, 200, 255, 0.4);
  border-radius: 0.2em;
  width: 3em;
  padding: 0 0.2em;
  height: 1.6em;

}

.nt-pulldown-menu {
  position: absolute;
  min-width: 8em;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.25em;
  padding: 0.5em 0.5em;
  z-index: 1;
  margin: 0;
  background-color: white;
  display: block;
  text-align: left;
  font-size: 90%;
}

.nt-pulldown-menu a {
  color: black;
  text-decoration: none;
  display: block;
  padding: 0.1em 1em;
}

.nt-pulldown-menu a.selected {
  background-color: rgba(150, 200, 255, 0.5);
}

.nt-pulldown-menu a.clear {
  color: #a00;
}

.nt-pulldown-menu a:hover {
  background-color: rgba(150, 200, 255, 0.2);
}
