#editor {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #000000;
    font-size: 22px;
}

#blockly {
    display: none;
    min-width: 570px;
    overflow: auto;
    resize: horizontal;
    padding-right: 10px;
}

#blockly:after {
    border-top: 0.5em solid transparent;
    border-left: 0.5em solid transparent;
    border-right: 0.5em solid #888;
    border-bottom: 0.5em solid #888;
    position: absolute;
    right: 0;
    bottom: 0;
    content: '';
    cursor: ew-resize;
}

/* Re-usable, generic rules */
.hidden {
    display: none !important;
}

.experimental {
    display: none !important;
}

.vbox {
  display: flex;
  display: -webkit-flex;
  display: -ms-flexbox;
  flex-direction: column;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
}

.hbox {
  display: flex;
  display: -webkit-flex;
  display: -ms-flexbox;
}

.flex1 {
  flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
}

.flex3 {
  flex: 3;
  -webkit-flex: 3;
  -ms-flex: 3;
}

/* Whole page layout */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body, input {
  font-family: "Segoe UI Light", "Segoe UI", "Segoe WP Light", "Segoe WP",
    "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
  font-size: 1rem;
}

h2 {
  margin-top: 0;
}

#main {
  margin: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  background: #F2F2F2;
}

#editor {
  position: relative;
  margin: 0;
}

/* Script info box */
#script-box {
  padding-right: 1rem;
  margin-left: auto;
  margin-right: 1rem;
  justify-content: center;
}

#script-name {
  font-size: 1.75rem;
  border: #808080 1px solid;
  color: #1a354c;
  overflow: hidden;
  width: 100%;
  margin-right: 1rem;
  min-width: 10rem;
  max-width: 15rem;
  background-color: white;
  line-height: 2.5rem;
  max-height: 2.5rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
}

.small-icons > *:not(:first-child) {
  display: inline-block;
  cursor: pointer;
}

.zoomer,
.saved-state {
  cursor: pointer !important;
}

.small-icons {
    width: 54px;
    min-width: 54px;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.status-icon{
  width: 37px;
  height: 37px;
  border: 6px solid #FFCC33;
  border-radius: 50%;
  margin: .2rem;
  text-align: center;
  font-size: 1.4rem;
  line-height: 2.4rem;
  padding: 0 !important;
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Symbola", sans-serif;
  color: #336699;
  background: #FFFFFF;
}

html[data-useragent*='MSIE 10.0'] .small-icons .status-icon {
  line-height: 2.15rem;
}


.small-icons .win-status-icon {
  line-height: 2.2rem;
}

.small-icons .holder {
  width: 56px;
  min-width: 56px;
  color: #336699;
  text-decoration: none;
  text-align: center;
  padding: 0px !important;
}

/* Popups */
.popup {
  width: 500px;
  border: 5px solid #666;
  position: relative;
  background-color: white;
  z-index: 999;
}

.popup::after {
  content: "";
  display: block;
  width: 0;

  position: absolute;
  top: -20px;
  right: 10px;

  border-style: solid;
  border-width: 0 20px 20px;
  border-color: #666 transparent;
}

.popup-inner {
  padding: 1rem;
}

#popup-edit input {
  border: 0;
}

/* Toolbox and commands */
#merge-commands {
  margin-left: 3em;
}

#merge-commands > * {
  cursor: pointer;
}

#merge-commands > .label {
  color: #a40000;
  font-weight: bold;
}

#commands a {
  text-align: center;
  padding-left: 0.75em;
  padding-right: 0.75em;
}

#log {
  overflow: auto;
  width: 500px;
  max-height: 500px;
}

.status {
  white-space: pre-wrap;
}

.status:first-letter {
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Symbola", sans-serif;
}

.status:not(:first-letter) {
  font-weight: bold;
}

.status.error {
  color: #a40000;
}

.status:not(.error) {
  color: #4e9a06;
}

/* Buttons */
.roundbutton {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  color: #336699;
  text-decoration: none;
  background-image: url("../img/triangle.svg");
  background-position-x: -1px;
  background-size: 100%;
  background-repeat: no-repeat;
  min-width: 90px;
  max-width: 90px;
  max-height: 113px;
}

.disabled div.roundsymbol {
  border-color: #AAA;
}

.disabled i {
  color: #AAA;
}

.disabled div.roundlabel {
  color: #AAA;
}

.roundsymbol {
  width: 4rem;
  height: 4rem;
  border: 6px solid #FFCC33;
  border-radius: 50%;
  margin: .2rem;
  margin-bottom: 0;
  text-align: center;
  font-size: 2.6rem;
  line-height: 4.4rem;
  padding: .1em;
  font-family: "Segoe UI Emoji", "Segoe UI Symbol", "Symbola", sans-serif;
  color: #336699;
  background: #FFFFFF;
}

.winroundsymbol {
  line-height: 3.7rem;
}

.svg-connecting {
  position: relative;
  z-index: 101;
}

/*
 * There is a Chrome bug that clips the circular border when animated.
 * To overcome it we keep an identical stationary div for background colours
 * and configure the animated div to have transparent border and background.
 */
.loader-background {
  border: 6px solid #CCCCCC;
  z-index: 99;
}
.loader {
  border-color: transparent;
  background-color: transparent;
  border-top: 6px solid #FFCC33db;
  position: absolute;
  top: 1px;
  z-index: 100;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
  -webkit-transform: translate3D(0, 0, 0); /* Somehow this helps with the Chrome bug */
}

.roundbutton:focus, .roundbutton:active {
  background-image: url("../img/triangle2.svg");
}

.roundlabel {
  padding-top: .3rem;
  padding-bottom: .3rem;
  font-size: 80%;
  text-align: center;
  color: #336699;
  text-shadow:   -1px -1px #f2f2f2, 1px -1px #f2f2f2, -1px 1px #f2f2f2, 1px 1px #f2f2f2;
}

body:not(.hasFota) .fota {
  display: none;
}

body.hasFota .notfota {
  display: none;
}

.modal{
  display: none;
  position: fixed;
  z-index: 101;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgb(0,0,0);
  background-color: rgba(0,0,0,0.4);
}

.modal-content{
  background-color: #f2f2f2;
  margin: 10% auto;
  padding: 10px;
  padding-left: 20px;
  border: 2px solid #FFCC33;
  width: 80%;
  border-radius: 7px;
}

.close{
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus{
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Misc */
a.command, a.command:visited {
  color: black;
  font-weight: bold;
  text-decoration: none;
}

a.command:hover {
  text-decoration: underline;
}

/* Some overrides for narrow displays */
@media (max-width: 890px) {
    .roundbutton {
        display: inline;
        min-width: 48px;
    }
    
    .loader {
      top: 7px;
    }

    #commands a {
        padding: .4em;
    }

    .small-icons {
        min-width: 120px;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        flex-direction: row;
    }

    .small-icons .holder {
        padding: 0.2em !important;
    }

  .roundsymbol {
    width: 2rem;
    height: 2rem;
    line-height: 2.05rem;
    font-size: 1.3rem;
    margin: 0;
  }

  .roundlabel {
    padding-top: 0;
    display: none;
  }

  #script-name {
    font-size: 1.2rem;
    font-weight: bold;
  }

  #script-box > label {
    font-size: 0.8rem;
  }

  .blocklyTreeRow {
    padding-right: .3em !important;
  }

  .blocklyTreeIcon {
    width: 6px !important;
  }

  .blocklyTreeLabel {
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
    #toolbox {
        flex-direction: column;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
    }

    #script-box {
        margin: .4rem;
        text-align: left;
        width: 100%;
    }

    #script-name {
        line-height: 1rem;
    }
    
    #script-box > label {
        font-size: 0.5rem;
    }
    
    #commands {
        overflow-x: scroll;
    }
}

.snippet-selection:hover {
    background: #FFCC33;
    cursor: pointer;
}

.snippet-table {
    width: 100%;
}

.snippet-table th {
    text-align: left;
    padding-right: 48px;
}

.snippet-table td {
    border-bottom: 1px dotted #CCC;
}

.snippet-name {
    display: none;
}

.snippet-button {
    text-decoration: none;
    background: none;
    color: inherit;
    border: none;
    border-radius: 5px;
    padding: 2px;
    font: inherit;
    cursor: pointer;
    outline: inherit;
}
.snippet-button:focus {
    box-shadow: 0px 0px 5px 3px #FFCC33;
}


.blocklySvg {
    background-image: url('../img/experimental.png');
    background-repeat: repeat;
}

.load-form {
    display: none;
}

div.expandable {
    background: #eee;
    border: 1px solid #aaa;
    border-radius: 9px;
    position: relative;
    padding: 12px;
}

div.expandable-always-visible {
    text-align: center;
}
div.expandable-always-visible button {
    width: 100%;
}
div.expandable-always-visible button i {
    color: black !important;
}
div.expandable-always-visible button:hover {
    color: #326699;
    font-weight: 500;
    color: #000000;
    /* text-decoration: underline; */
    background-color: #e8e8e8;
}
div.expandable-always-visible button:hover i {
    color: black !important;
}

div.expandable-content {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

div.load-drag-target {
    height: 160px;
    background: #e0e0e0;
    border: 1px solid #aaa;
    border-radius: 9px;
    position: relative;
}
div.load-drag-target > p {
  margin: 0px;
  padding: 0px;
}

div.load-form {
    padding-top: 20px;
    height: 160px;
}

.load-form input {
    margin-bottom: 20px;
}

.load-drag-target p {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

.load-drag-target a, .load-drag-target a.visited {
    color: #336699;
    font-weight: bold;
}

.is-dragover {
    background: #ccc !important;
}

/* Buttons drop-down-like menu */
.buttons_menu_container {
    position: absolute;
    margin: auto 10px auto auto;
    display: -webkit-box;
    display: -moz-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    padding-right: 1em;
    z-index: 999;
    background-color: #f2f2f2;
    border: 1px solid #ffffff;
    border-radius: 0.5rem;
}
.buttons_menu_item {
    margin-top: .5em;
    margin-bottom: .5em;
    margin-left: 0.75em;
    margin-right: 0.75em;
}
.buttons_menu_item a {
    padding: 0 !important;
}
.buttons_menu_rhs {
    margin: auto;
}

@media (max-width: 480px) {
    .buttons_menu_container {
        left: 50% !important;
        -webkit-transform: translate(-50%, 0);
        -moz-transform: translate(-50%, 0);
        -ms-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
        width: fit-content;
    }
}

/* Switches in the Options menu */
.menu-switch-label {
    padding: 0;
}
.menu-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
    top: 2px;
}
.menu-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.menu-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 12px;
}
.menu-switch-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #ffcd33;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .menu-switch-slider {
    background-color: #336699;
}
.menu-switch-input:focus~.menu-switch-slider {
    box-shadow: 0px 0px 5px 3px #FFCC33;
}
input:checked + .menu-switch-slider:before {
    /* Width 30px - 2px (borders) - 12px box*/
    -webkit-transform: translateX(14px);
    -ms-transform: translateX(14px);
    transform: translateX(14px);
}

/* Modals */
.modal-div:focus {
    outline: 0;
}
.modal-title {
    margin: 28px 0px 22px 0px;
    text-transform: capitalize;
}
.modal-title:first-of-type {
    margin-top: 0;
}


/* WebUSB */
.modal-overlay-container {
    position: absolute;
    background-color: rgba(255,255,255,0.6);
    margin: auto auto;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 99;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: none;
    line-height: 25px;
    font-family: "Segoe UI Light","Segoe UI","Segoe WP Light","Segoe WP","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
}

.modal-msg-overlay-container {
  text-align: center;
}

#modal-msg-overlay{
  text-align: left;
  display: inline-block;
  position: relative;
  top: 19%;
  margin: 0 auto;
  padding: 24px;
  
}

#modal-msg-text{
  padding: 20px 20px 10px 20px;
}

.modal-overlay {
    background: white;
    padding: 2em;
    font-size: 1rem;
    margin: 0 auto;
    border: 6px solid #FFCC33;
    border-radius: 15px;
}

.modal-overlay hr {
  display: block;
  width: 60%;
  border-top: solid #ffde81 1px;
  border-bottom: none;
  margin-top: 16px;
  margin-bottom: 16px;
}

.modal-overlay code {
  margin: 16px 0px;
  padding: 12px;
  border-radius: 8px;
  background-color: #fafafa;
  display: block;
  text-align: left;
}

#modal-overlay-title {
  margin: 0 0 20px 0;
  padding: 0;
  font-size: 1.4rem;
}

#modal-msg-title{
  color:#336699;
  font-weight: bold;
}

.modal-close{
  color:#336699;
  content: "\00D7";
  text-align: right;
  font-size: 40px;
  float:right;
  cursor: pointer;
  font-weight: normal;
  top: -10px;
}

.modal-close:hover{
  color:#febf2e;
}

.modal-msg-links {
  text-align: center;
  padding-top: 10px;
  line-height: 1rem;
}

.modal-msg-links a {
  padding: 0px 10px;
}

#serial-buttons {
    display: flex;
}

#serial-buttons > div {
    display: none;
    cursor: pointer;
    background-color: #336699;
    padding: .5em;
    color: #fff;
    font-size: 1em;
    width: 50%;
    border: thin solid #aaa;
}

/* File system */
.fs-file-list table {
    width: 100%;
    width: -moz-available;
    width: -webkit-fill-available;
    background: #e0e0e0;
    border: 1px solid #aaa;
    margin: 5px 2px 5px 1px;
    border-radius: 5px;
    padding: 5px;
}

.fs-file-list table thead {
    font-weight: bold;
}

.fs-file-list table tbody {
    min-height: 2em;
}

.save-button {
    font-size: 15px;
    border-radius: 9px;
    height: 3.0em;
    outline:none;
    cursor:pointer;
    background-color: #f3f3f3;
    border: 1px solid #aaaaaa;
}

.save-button:hover {
    background-color: #336699;
    color: #ffffff;
}

.save-button:hover i {
    color: #ffffff !important;
}

.save-button:focus {
    box-shadow: 0px 0px 5px 3px #FFCC33;
}

.save-buttons-container {
    display: inline-block;
    width: 100%;
    text-align: center;
}
.save-button.hex,
.save-button.py {
    padding: 10px 20px;
    margin: 10px 0px;
}
.save-button.hex {
    width: 49%;
    min-width: 250px;
    background-color: #326699;
    color: white;
    border: none;
    float: right;
}
.save-button.hex i {
    color: white !important;
}
.save-button.hex:hover, 
.save-button.hex:hover i {
    background-color: #FFCC33;
    color: black !important;
    border: none;
}

.save-button.hex:focus {
    box-shadow: 0px 0px 5px 3px #FFCC33;
}

.save-button.py {
    width: 49%;
    min-width: 250px;
    background-color: white;
    color: black;
    float: left;
}
.save-button.py i {
    color: #303030 !important;
}
.save-button.py:hover {
    background-color: #eee;
    color: black;
}

.save-button.py:focus {
    box-shadow: 0px 0px 5px 3px #FFCC33;
}

@media (max-width: 480px) {
    .save-button.py,
    .save-button.hex {
        float: unset;
    }
}

.save-button.show {
    background: none;
    border: none;
    color: black;
}

.save-button.add {
    padding: 0 20px;
}

.save-button.remove {
    width: 4em;
    height: 2em;
    margin-left: 5px;
    float: right;
}

.save-button.remove:hover {
  background-color: #D71D1D;
}

.save-button.save {
    width: 4em;
    height: 2em;
    float: right;
}

.button-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 1rem;
  color: #326699;
  text-decoration: underline;
  cursor: pointer;
}

#file-upload-link {
  font-weight: bold ;
}

.disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.65;
    filter: alpha(opacity=65);
    -webkit-box-shadow: none;
    box-shadow: none;
}

.fs-space-table {
    table-layout: fixed;
    width: 100%;
    padding: 0px;
    margin: 0px;
    margin-bottom: 10px;
    border-collapse:separate;
    border: 1px solid #aaa;
    border-radius: 8px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.fs-space-table > tbody > tr> td {
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0px 6px;
    height: 20px;
    font-size: 13px;
}
.fs-space-table-first {
    border-radius: 6px 0px 0px 6px;
}
#fs-space-modules {
    width: auto;
    color: white;
    min-width: 2%;
    background-color: #569092;
}
#fs-space-main {
    width: auto;
    min-width: 2%;
    color: white;
    background-color: #8365c1;
}
#fs-space-other {
    width: auto;
    min-width: 2%;
    color: white;
    background-color: #9a9797;
}
#fs-space-free {
    width: auto;
    min-width: 2%;
}

/* Language selection drop down menu */
.lang-choice{
    text-decoration: none;
    color: black;
}
.lang-choice:hover{
    font-weight: bold;
    cursor: pointer;
}

/* Tree style list */
ul.tree, ul.tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 6px;
    margin-bottom: 6px;
}
ul.tree ul {
    margin-left: 16px;
}
ul.tree li {
    margin: 0;
    padding: 0 7px;
    line-height: 20px;
    border-left: 1px solid rgb(100,100,100);
}
ul.tree li:last-child {
    border-left: none;
}
ul.tree li:before {
    position: relative;
    top: -0.3em;
    height: 1em;
    width: 12px;
    border-bottom: 1px solid rgb(100,100,100);
    content: "";
    display: inline-block;
    left: -7px;
}
ul.tree li:last-child:before {
    border-left: 1px solid rgb(100, 100, 100);
}
.is-selected {
    font-weight: bold;
}

#webusb-flashing-loader {
  border: .2em solid #eee;
  border-top: .2em solid #336699;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  animation: spin 2s linear infinite;
  margin: auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#command-connecting {
  display: none;
}

#webusb-flashing-complete {
    font-size: 2em;
    color: #336699;
}

#addFile{
  position: relative;
  margin: 28px 0px 22px 0px;
  height: 29px;
}

#addFileHeader{
  float:left;
  position: absolute;
  bottom: 0px;
  margin-bottom: 0px;
}

#addFileHeader .modal-title{
  margin: 0px 0px 0px 0px;
}

#addFileHelp{
  float: right;
  line-height: 29px;
  right: 0px;
  cursor: pointer;
}

#addFileHelp span{
  font-family: "Segoe UI Light","Segoe UI","Segoe WP Light","Segoe WP","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
}

#save-py{
  margin: 0px 0px 0px 0px;
}

#save-hex{
  margin: 0px 0px 0px 0px;
}

#fileHelpPara{
  display:none;
  margin-bottom: 10px;
}

/* Hide disconnect initially */
#command-disconnect {
  display: none;
}

#command-flash {
  display: none;
}

/* ACE errors */
.parser_warning {
    background: rgba(255, 50, 50, 0.6);
    position: absolute;
    min-width: 0.3em
}
