/**
 * @license Licensed under the Apache License, Version 2.0 (the "License"):
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 * @fileoverview CSS file for the Ardublockly application.
 *
 * There are a lot of '!important' tags in this file as a lot of the rules set
 * here go against the css rules from the Materialize framework.
 */
/******************/
/*  Font sources  */
/******************/
@font-face {
  font-family: "Droid Sans Mono";
  src: url("font/droid/DroidSansMono.ttf") format("truetype");
}


/**********/
/*  HTML  */
/**********/
html,
body {
  height: 100% !important;
  padding: 0;
  margin: 0;
}

body {
  background-color: #eeeeee;
  -moz-user-select: -moz-none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}


/*********************/
/*  Arduino Colours  */
/*********************/
.arduino_teal {
  background-color: #00979C;
}
.arduino_teal_dark {
  background-color: #006468;
  /* background-color: #00878F; from community logo */
}
.arduino_teal_light {
  background-color: #62AEB2;
}
.arduino_orange {
  background-color: #E47128;
}
.arduino_yellow {
  background-color: rgba(255, 204, 51, 1);
  /* background-color: #FFCC33; */
  /* background-color: #E5AD24; from community logo */
}
.arduino_green {
  background-color: #2E7D32;
}
.arduino_brown {
  background-color: #8C7965;
}


/********************/
/*  Navigation bar  */
/********************/
.nav-fixed {
  border-radius: 0;
  position: inherit;
  margin-bottom: 30px;
  z-index: 997 !important;
}
.nav-fixed .nav-wrapper.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media only screen and (min-width : 993px) {
  body {
    padding-top: 100px;
  }
  .nav-fixed {
    position: fixed;
    right: 0;
    left: 0;
    top: 0;
    margin-bottom: 0px;
    z-index: 997;
  }
}

/* Side nav Logo */
ul.side-nav li.logo {
  text-align: center;
  margin: 0px !important;
  padding: 0px 0px !important;
  border: none !important;
  height: 145px;
  background-color: transparent;
}
ul.side-nav li.logo:hover {
  background-color: transparent;
}
ul.side-nav li.side-menu-end {
  background-color: #eeeeee;
  border-radius: 0px 0px 25px 0px;
  border-left: 4px solid #ffffff;
  border-bottom: 4px solid #dddddd;
  border-right: 4px solid #dddddd;
  border-bottom: 4px solid #dddddd;
  line-height: 25px;
}

/************************************/
/*  Blocks, Arduino, and XML areas  */
/************************************/
.content {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: #ffffff;
}
.height_transition {
  transition: height 0.2s ease-out;
  -ms-transition: height 0.2s ease-out;
  -moz-transition: height 0.2s ease-out;
  -webkit-transition: height 0.2s ease-out;
}

#blocks_panel {
  padding: 0px;
  position: relative !important;
  min-height: 480px;
}
.blocks_panel_large {
  height: -moz-calc(100vh - 190px);     /* Firefox  */
  height: -webkit-calc(100vh - 190px);  /* WebKit   */
  height: -o-calc(100vh - 190px);       /* Opera    */
  height: calc(100vh - 190px);          /* Standard */
}
.blocks_panel_small {
  height: -moz-calc(100vh - 350px);     /* Firefox  */
  height: -webkit-calc(100vh - 350px);  /* WebKit   */
  height: -o-calc(100vh - 350px);       /* Opera    */
  height: calc(100vh - 350px);          /* Standard */
}
#content_blocks {
  margin: 0;
  padding: 0;
  min-height: 480px;
  height: -moz-calc(100vh - 190px);     /* Firefox  */
  height: -webkit-calc(100vh - 190px);  /* WebKit   */
  height: -o-calc(100vh - 190px);       /* Opera    */
  height: calc(100vh - 190px);          /* Standard */
}

#content_xml {
  resize: none;
  outline: none;
  border: none;
  padding: 0px 5px;
  font-family: monospace;
  font-size: smaller;
  overflow: scroll;
  font-style: 0.2em !important;
  min-height: 384px;
}
.content_xml_large {
  height: -moz-calc(100vh - 286px);     /* Firefox  */
  height: -webkit-calc(100vh - 286px);  /* WebKit   */
  height: -o-calc(100vh - 286px);       /* Opera    */
  height: calc(100vh - 286px);          /* Standard */
}
.content_xml_small {
  height: -moz-calc(100vh - 446px);     /* Firefox  */
  height: -webkit-calc(100vh - 446px);  /* WebKit   */
  height: -o-calc(100vh - 446px);       /* Opera    */
  height: calc(100vh - 446px);          /* Standard */
}

/* The materialize framework changes height of the div to show or hide */
/* the collapsible elements. */
#content_arduino,
#content_arduino_editor {
  resize: none;
  outline: none;
  border: none;
  padding: 0px 5px;
  font-size: 0.9rem;
  font-family: "Droid Sans Mono", monospace;
  overflow: auto;
  -moz-user-select: text;
  -khtml-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
  min-height: 388px;
}
#content_arduino_editor {
  border: 1px solid #dddddd;
  border-radius: 4px;
  padding: 6px 8px;
  background-color: #ffffff;
}
.source-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 8px;
}
.source-editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.source-editor-icon {
  min-width: 36px;
}
.content_arduino_large {
  height: -moz-calc(100vh - 280px);     /* Firefox  */
  height: -webkit-calc(100vh - 280px);  /* WebKit   */
  height: -o-calc(100vh - 280px);       /* Opera    */
  height: calc(100vh - 280px);          /* Standard */
}
.content_arduino_small {
  height: -moz-calc(100vh - 440px);     /* Firefox  */
  height: -webkit-calc(100vh - 440px);  /* WebKit   */
  height: -o-calc(100vh - 440px);       /* Opera    */
  height: calc(100vh - 440px);          /* Standard */
}

/****************/
/*  IDE output  */
/****************/
.ide_output_wrapper {
  width: 100%;
  margin: 0;
  padding: 0;
  position: fixed;
  bottom: -16px;
  z-index: 10;
}

.ide_output_collapsible {
  box-shadow: 0 0px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  border-left: 0;
  border-right: 0;
}
.ide_output_header_normal {
  background-color: #006468;
  color: #ffffff;
  -moz-transition: background-color 0.6s ease-in;;
  -o-transition: background-color 0.6s ease-in;
  -webkit-transition: background-color 0.6s ease-in;
}
.ide_output_header_highlight {
  background-color: #62AEB2;
  color: #ffffff;
  -moz-transition: background-color 0.6s ease-in;;
  -o-transition: background-color 0.6s ease-in;
  -webkit-transition: background-color 0.6s ease-in;
}
.ide_output_header_error {
  background-color: #E47128;
  color: #ffffff;
  -moz-transition: background-color 0.6s ease-in;;
  -o-transition: background-color 0.6s ease-in;
  -webkit-transition: background-color 0.6s ease-in;
}

.ide_output_actions {
  float: right;
  margin-right: 10px;
}

.ide_output_action {
  color: #ffffff;
  text-transform: none;
  padding: 0 10px;
  line-height: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.ide_output_action.serial-monitor-active {
  background-color: #1b5e20;
  border-color: #1b5e20;
}

.ide_output_action.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.ide-output-resizer {
  height: 8px;
  width: 100%;
  cursor: row-resize;
  background: #2a2a2a;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

#content_ide_output {
  resize: none;
  outline: none;
  border: none;
  padding: 0px 5px;
  font-family: monospace;
  overflow: auto;
  font-style: 0.2em !important;
  min-height: 160px;
  height: 160px;
  max-height: 70vh;
  -moz-user-select: text;
  -khtml-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
  background-color: #303030;
  color: #ffffff;
}
/* IDE output content text formatting */
#content_ide_output .arduino_dialog_success {
  color: #00979C;   /* arduino light teal */
  font-size: 1.2rem;
  margin: 16px 0px 8px 0px;
}
#content_ide_output .arduino_dialog_failure {
  color: #E47128;   /* arduino orange */
  font-size: 1.2rem;
  margin: 16px 0px 8px 0px;
}
#content_ide_output .arduino_dialog_out {
  color: #ffffff;
  font-size: 0.9rem;
}
#content_ide_output .arduino_dialog_out_error {
  color: #E47128;   /* arduino orange */
  font-size: 0.9rem;
  padding-top: 8px;
  display: block;
}

/* Spacer is used to not leave any content behind the collapsible header */
#ide_output_spacer {
  height: 40px;
}
@media only screen and (min-width: 0) {
  #ide_output_spacer {
    height: 20px;
  }
}
@media only screen and (min-width: 601px) {
  #ide_output_spacer {
    height: 30px;
  }
}
@media only screen and (min-width: 993px) {
  #ide_output_spacer {
    height: 40px;
  }
}


/*************/
/*  Buttons  */
/*************/
#ide_buttons_wrapper {
  position: absolute;
  right: 25px;
  top: -20px;
  height: 55px;
  width: 160px;
  z-index: 12;
}
#button_ide_large {
  position: absolute;
  right: 0px;
  top: 0px;
  width: 55px;
  height: 55px;
}
#button_ide_large i {
  font-size: 2.4rem !important;
  line-height: 55px;
}
#button_ide_middle {
  position: absolute;
  right: 72px;
  top: 10px;
  visibility: hidden;
  opacity: 0;
  -moz-transition: visibility 0.3s linear, opacity 0.3s linear;
  -webkit-transition: visibility 0.3s linear, opacity 0.3s linear;
  -o-transition: visibility 0.3s linear, opacity 0.3s linear;
  transition: visibility 0.3s linear, opacity 0.3s linear;
}
#button_ide_left {
  position: absolute;
  right: 126px;
  top: 10px;
  visibility: hidden;
  opacity: 0;
  -moz-transition: visibility 0.3s linear, opacity 0.3s linear;
  -webkit-transition: visibility 0.3s linear, opacity 0.3s linear;
  -o-transition: visibility 0.3s linear, opacity 0.3s linear;
  transition: visibility 0.3s linear, opacity 0.3s linear;
}
#button_ide_large:hover:before,
#button_ide_middle:hover:before,
#button_ide_left:hover:before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255, 0.25);
  transition: all .3s linear;
}

#button_load_xml {
  position: absolute;
  right: 36px;
  bottom: 36px;
  display: none;
}
#button_load_xml .mdi-action-extension {
  font-size: 2.1rem !important;
}

/* These floating buttons needs to be at a higher z index than card when */
/* floating and lower when clicked.  */
#button_ide_large:hover,
#button_ide_middle:hover,
#button_ide_left:hover,
#button_load_xml:hover {
  -webkit-box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  -moz-box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
#button_ide_large:active,
#button_ide_middle:active,
#button_ide_left:active,
#button_load_xml:active {
  -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

/* Toggle the toolbox on and off button */
.button_toggle_toolbox_on {
  position: absolute;
  margin: 0 !important;
  padding: 0 !important;
  left: 12px;
  top: 8px;
  text-align: center;
  font-size: 1.5rem !important;
  z-index: 5;
  border-color: #e0e0e0 !important;
  border-width: 1px !important;
  -webkit-border-radius: 4px 4px 4px 4px !important;
  -moz-border-radius: 4px 4px 4px 4px !important;
  border-radius: 4px 4px 4px 4px !important;
  background: rgba(98, 174, 178, .2) !important;  /* Arduino Light Teal */
  -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); 
  transition: background 0.3s linear, box-shadow 0.3s linear, border-width 0.3s linear;
  -ms-transition: background 0.3s linear, box-shadow 0.3s linear, border-width 0.3s linear;
  -moz-transition: background 0.3s linear, -moz-box-shadow 0.3s linear, border-width 0.3s linear;
  -webkit-transition: background 0.3s linear, -webkit-box-shadow 0.3s linear, border-width 0.3s linear;
}
.button_toggle_toolbox_off {
  position: absolute;
  margin: 0 !important;
  padding: 0px !important;
  left: 12px;
  top: 8px;
  text-align: center;
  font-size: 1.5rem !important;
  z-index: 5;
}


/*****************************/
/*  Spinner and new colours  */
/*****************************/
.ide_loader {
  position: absolute !important;
  right: 0px !important;
  top: 0px !important;
  width: 55px !important;
  height: 55px !important; 
  z-index: 5;
}
.spinner-orange {
  border-color: #E47128;
}
.active .spinner-layer.spinner-orange {
  /* durations: 4 * ARCTIME */
  -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.spinner-dark-teal {
  border-color: #00878F;
}
.active .spinner-layer.spinner-dark-teal {
  /* durations: 4 * ARCTIME */
  -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.spinner-yellow {
  border-color: rgba(255, 204, 51, 1);
}
.active .spinner-layer.spinner-yellow {
  /* durations: 4 * ARCTIME */
  -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.spinner-light-teal {
  border-color: #62AEB2;
}
.active .spinner-layer.spinner-light-teal {
  /* durations: 4 * ARCTIME */
  -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}
.spinner-purple {
  border-color: #8e24aa;
}
.active .spinner-layer.spinner-purple {
  /* durations: 4 * ARCTIME */
  -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
}


/************************/
/*  Modals and content  */
/************************/
/* Large modal section blocks */
.modal_section {
  margin: 24px 0px;
  width: 100%;
}
.ota_device_row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.ota_field {
  flex: 1 1 240px;
  min-width: 220px;
}
.ota_device_field {
  flex: 1 1 320px;
  min-width: 240px;
}
.ota_auth_row {
  margin-top: 16px;
}
.ota_auth_row input[disabled] {
  opacity: 0.6;
}

/* Blocks tick label as a title */
.modal_label_title {
  font-size: 1.6rem !important;
  color: black;
}

/* Blocks modal divider */
#blocks_menu_body .divider {
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Arduino output modal dialog */
#arduino_dialog_body {
  padding-top: 25px;
}
.arduino_dialog_out {}
.arduino_dialog_out_error {
  color: #E47128;   /* arduino orange */
  padding-top: 25px;
  display: block;
}
.arduino_dialog_success {
  color: #00979C;   /* arduino light teal */
}
.arduino_dialog_failure {
  color: #E47128;   /* arduino orange */
}

/* Footer buttons padding */
.modal_right_button {
  margin: 0px 0px 0px 48px !important;
}

/* Small modal responsive design */
.modal_small {
  height: auto !important;
  min-height: 200px;
}
.modal_small .modal-content {
  max-height: none !important;
  overflow: visible !important;
}
.modal_small .modal-content {
  margin-top: 0;
  padding-top: 12px;
  margin-bottom: 0;
  padding-bottom: 0;
}
.modal_small input {
  width: 100%;
}
@media only screen and (min-width: 0) {
  .modal_small {
    max-width: 75% !important;
    width: 75% !important;
  }
}
@media only screen and (min-width: 601px) {
  .modal_small {
    max-width: 55% !important;
    width: 55% !important;
  }
}
@media only screen and (min-width: 993px) {
  .modal_small {
    max-width: 35% !important;
    width: 35% !important;
  }
}


/*****************/
/*  Sketch name  */
/*****************/
.sketch_name_wrapper {
  display: inline-flex;
  align-items: center;
  padding-left: 5px;
  gap: 6px;
  max-width: 200px;
  width: 28vw;
  min-width: 140px;
}
.sketch_name_icon {
  display: inline-flex !important;
  font-size: 1.2rem !important;
  padding-top: 3px;
  order: 2;
}
.sketch_name {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 120px;
  box-sizing: border-box;
  line-height: 56px;
  height: 3rem !important;
  font-size: 1.5rem !important;
  order: 1;
  border-bottom: 0px solid #EEE !important;
  font-style: italic;
}
.sketch_name:focus {
    border-bottom: 1px solid #EEE !important;
}

nav .brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 280px;
  max-width: 50%;
  margin: 0;
  position: static !important;
  transform: none !important;
  padding-left: 4px;
}

@media only screen and (min-width: 0px) and (max-width: 600px) {
  .sketch_name {
    max-width: 200px;
  }
  /* Remove the "Ardublockly title only leaving the sketch name */
  .app_title {
    display: none;
  }
}
@media only screen and (min-width : 600px) {
  .sketch_name {
    max-width: 275px;
  }
}
@media only screen and (min-width : 993px) {
  .sketch_name {
    max-width: 350px;
  }
}


/************/
/*  Others  */
/************/
/* Edit logo for code and xml collapsibles */
.collapsible_logo {
  width: 3rem;
  font-size: 1.6rem;
  line-height: 3rem;
  font-weight: bold;
  display: block;
  float: left;
  text-align: center;
  margin-right: 1rem;
}

/* Colours for the new and deleted code highlighting */
.code_highlight_new {
  background-color: rgba(255, 204, 51, 0.5); /* Arduino yellow 50% */
}
.code_highlight_deleted {
  background-color: #FDBEBE;
}

/*****************************/
/*  Overwriting Blockly CSS  */
/*****************************/
/* Blockly text for the following components:  */
.blocklyTreeLabel,           /* Toolbox        */
.blocklyText,                /* Block          */
.goog-menuitem-content {     /* Drop down menu */
  font-family: "Roboto", sans-serif!important;
}

/* Entire Blockly area, Toolbox dranw on top */
.blocklySvg {
  border-width: 0 !important;
}

/* Toolbox */
.blocklyToolboxDiv {
  border-color: #e0e0e0 !important;
  border-width: 0px 1px 0px 0px !important;
  -webkit-border-radius: 0px 4px 4px 0px !important;
  -moz-border-radius: 4px 4px 0px 0px !important;
  border-radius: 0px 4px 4px 0px !important;
  border: none !important;
  margin: 0px !important;
  padding: 0px 0px 0px 0px !important;
  background: rgba(98, 174, 178, .2) !important;  /* Arduino Light Teal */
  -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  -moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden !important;
}
.blocklyTreeRoot {
  background: none !important;
  border: none !important;
  margin: 36px 0px 0px 0px !important;
  padding: 0px 1px !important;
  height: -moz-calc(100% - 37px);     /* Firefox  */
  height: -webkit-calc(100% - 37px);  /* WebKit   */
  height: -o-calc(100% - 37px);       /* Opera    */
  height: calc(100% - 37px);          /* Standard */
  overflow-x: hidden;
  overflow-y: auto;
}
.blocklyTreeRow {
  background: none !important;
  border: none !important;
  margin: 0px 0px !important;
  padding: 7px 16px 7px 0px !important;
  box-sizing: content-box !important;
}
.blocklyTreeSelected {
  background-color: #E47128 !important;  /* arduino orange */
}
.blocklyTreeRow:not(.blocklyTreeSelected):hover {
  background-color: rgba(255, 204, 51, 1) !important;  /* arduino yellow */
}
.blocklyTreeLabel {
}
.blocklyTreeSeparator{
  padding: 0px !important;
  margin: 0px !important;
}

/* Toolbox second column with blocks*/
.blocklyFlyoutBackground {
  fill: #DEEEEF !important;
  fill-opacity: 0.7 !important;
  -webkit-border-radius: 0px 4px 4px 0px !important;
  -moz-border-radius: 0px 4px 4px 0px !important;
  border-radius: 0px 4px 4px 0px !important;
}

/* Blockly scrollbars */
.blocklyScrollbarKnob {
  fill: #00878F !important;
  fill-opacity: 0.7 !important;
}
.blocklyScrollbarBackground {
  stroke-width: 0px !important;
  fill: none !important;
}

/* Edit select colour to Arduino yellow. (Edited out as already this colour)
.blocklyHighlightedConnectionPath,
.blocklySelected>.blocklyPath {
  stroke: rgba(255, 204, 51, 1) !important;
} */

/*********************************/
/*  Overwriting Materialize CSS  */
/*********************************/
/* Modify container to have a larger width in all resolutions */
.container {
  width: 90%;
  max-width: initial !important;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
@media only screen and (min-width : 601px) {
  .container {
    width: 95%;
  }
}
@media only screen and (min-width : 993px) {
  .container {
    width: 100%;
  }
}
@media only screen and (min-width : 1380px) {
  .container {
    width: 90%;
  }
}

/* Maximize horizontal space for mobile */
@media only screen and (min-width: 0px) and (max-width: 600px) {
  body {
    padding-top: 0px;
  }
  /* Expand to all visible horizontal space */
  .container {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  nav {
    margin: 0 !important;
    padding: 0px 12px !important;
  }
  /* remove space between cards and navigation bar */
  .col {
    margin-top: -8px;
  }
}

/* Increase the text size of the side menu */
ul.side-nav {
  padding: 0px !important;
  line-height: 64px !important;
}
ul.side-nav i {
  font-size: 1.8rem !important;
}
ul.side-nav .collapsible {
  margin: 0 !important;
}
/* Set the background effect in the side menu */
ul.side-nav {
  background-color: transparent;
  box-shadow: none !important;
  width: var(--side-nav-width);
}
ul.side-nav li {
  background-color: #eeeeee;
}
ul.side-nav li {
  background-color: #eeeeee;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  border-right: 2px solid #dddddd;
  border-left: 2px solid #ffffff;
}
ul.side-nav li ul li ul {
  cursor: pointer;
  border: none !important;
}
ul.side-nav li ul li ul li {
  border: none !important;
}

:root {
  --side-nav-width: 240px;
  --side-nav-expanded-width: 520px;
}
ul.side-nav.examples-expanded {
  width: var(--side-nav-expanded-width);
}
ul.side-nav.examples-expanded > li {
  width: var(--side-nav-width);
}

ul.side-nav .examples-collapsible {
  position: relative;
}
ul.side-nav .examples-collapsible .collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
ul.side-nav .examples-collapsible .collapsible-header i {
  transition: transform 0.2s ease-in-out;
}
ul.side-nav .examples-collapsible.active .collapsible-header i {
  transform: rotate(90deg);
}
ul.side-nav .examples-flyout {
  position: absolute;
  top: 0;
  left: var(--side-nav-width);
  min-width: calc(var(--side-nav-expanded-width) - var(--side-nav-width));
  width: calc(var(--side-nav-expanded-width) - var(--side-nav-width));
  max-height: 70vh;
  overflow-y: auto;
  background-color: #eeeeee;
  border-left: 2px solid #dddddd;
  border-right: 2px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 999;
}
ul.side-nav .examples-flyout .examples-list {
  margin: 0;
}
@media only screen and (max-width: 992px) {
  ul.side-nav.examples-expanded {
    width: var(--side-nav-width);
  }
  ul.side-nav.examples-expanded > li {
    width: auto;
  }
  ul.side-nav .examples-flyout {
    position: static;
    min-width: 0;
    width: auto;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: none;
  }
}

/* Add extra margin to the side menu button*/
.button-collapse {
  margin-right: 16px;
}

/* Increase the size of Materialize Modal in small resolutions */
@media only screen and (max-width : 600px) {
  .modal {
    width: 80% !important;
    max-width: 80% !important;
  }
}

/* Why the hell does button large has a predefined background colour !! */
.btn-large:hover {
  background-color: inherit;
}

/* Circle clipper (loading animation) thickness */
.circle-clipper .circle {
  border-width: 4px !important;
}

/* Materialize messes with these, so reset them here */
.blocklyHtmlInput {
  border: none !important;
  border-radius: 4px !important;
  font-family: sans-serif !important;
  height: 100% !important;
  margin: 0 !important;
  outline: none !important;
  padding: 0 1px !important;
  width: 100% !important;
  background-color: white !important;
}

/* Nav tweaks */
#nav-mobile { flex: 0 0 auto; margin-left: auto; }
.button-collapse { flex: 0 0 auto; margin-right: 8px; }
.nav-buttons-grid {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.nav-buttons-grid li { padding: 0; width: auto; }
.nav-buttons-grid li { float: none !important; margin: 0 !important; }
.nav-buttons-grid li a { display: inline-flex; align-items: center; gap: 6px; line-height: 24px; height: 24px; padding: 0 6px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-login a { display: inline-flex; align-items: center; gap: 6px; }
nav, .nav-fixed { min-height: 56px !important; }
.nav-fixed .nav-wrapper.container { min-height: 56px !important; align-items: center !important; padding-top: 0px; padding-bottom: 0px; }
nav .brand-logo { min-width: 220px; max-width: 45%; }

/* Server file browser */
.server-file-item,
.server-folder-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.server-file-item span,
.server-folder-item span {
  flex: 1 1 auto;
}
.server-rename-icon,
.server-delete-icon {
  cursor: pointer;
  color: #666666;
}
.server-drop-target {
  background-color: #e0f2f1;
}

  /* Modal overflow fixes */
  .login_modal.modal { overflow: visible !important; height: auto !important; max-height: none !important; width: 90% !important; max-width: 460px !important; }
  .login_modal .modal-content { max-height: none !important; overflow: visible !important; padding-bottom: 8px !important; }
  .login_modal .modal-footer { border-top: none !important; padding: 12px !important; }
  .login_api_test { margin-bottom: 12px; }

  .modal-close-x {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 22px;
    color: #666666;
  }
  .modal-close-x:hover { color: #000000; }

  #settings_dialog .modal-close-x { right: 40px; z-index: 2; cursor: pointer; pointer-events: auto; }
  #settings_dialog .modal-content { padding-right: 24px; }

  .ota-delete-btn { min-width: 0; padding: 0 6px; }

  .admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 6px 0;
  }
  .admin-upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .admin-upload-actions .btn {
    height: 2.3rem;
    line-height: 2.3rem;
    white-space: nowrap;
  }
  #admin_download_template {
    flex: 0 0 auto;
    min-width: 220px;
    padding: 0 1.2rem;
  }
  .admin-upload-file,
  .admin-upload-name {
    cursor: pointer;
  }
  .admin-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  .admin-upload-name {
    flex: 0 0 220px;
    max-width: 40%;
    margin: 0;
    height: 2.3rem;
  }
  .admin-upload-file {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
  }
  .admin-tenant-delete {
    cursor: pointer;
    color: #666666;
  }
  .admin-tenant-delete:hover {
    color: #000000;
  }
  .password-field {
    position: relative;
  }
  .password-toggle {
    position: absolute;
    right: 8px;
    top: 12px;
    cursor: pointer;
    color: #666666;
  }
  .password-toggle:hover {
    color: #000000;
  }
  .admin-password-toggle {
    cursor: pointer;
    color: #666666;
    margin-left: 6px;
  }
  .admin-password-toggle:hover {
    color: #000000;
  }
  .admin-pass-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
  }
  .admin-pass-wrap input {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    margin: 0;
  }
  .admin-filter .input-field {
    margin: 0 0 8px 0;
  }
  .admin-select-all {
    margin: 0 0 6px 0;
  }
  .admin-form-card {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 2px;
    background: #fafafa;
  }
  .admin-users-table-wrap {
    border: 1px solid #e0e0e0;
    max-height: 320px;
    overflow: auto;
  }
  .admin-users-table {
    width: 100%;
    table-layout: fixed;
    --admin-col-unit: 4rem;
    min-width: calc(var(--admin-col-unit) * 21);
  }
  /* Column sizing: base unit = 1x, use multipliers for readability. */
  .admin-users-table th:nth-child(1),
  .admin-users-table td:nth-child(1) {
    width: calc(var(--admin-col-unit) * 3);
  }
  .admin-users-table th:nth-child(2),
  .admin-users-table td:nth-child(2) {
    width: calc(var(--admin-col-unit) * 2);
  }
  .admin-users-table th:nth-child(3),
  .admin-users-table td:nth-child(3) {
    width: calc(var(--admin-col-unit) * 3);
  }
  .admin-users-table th:nth-child(4),
  .admin-users-table td:nth-child(4) {
    width: calc(var(--admin-col-unit) * 1);
  }
  .admin-users-table th:nth-child(5),
  .admin-users-table td:nth-child(5) {
    width: calc(var(--admin-col-unit) * 2);
  }
  .admin-users-table th:nth-child(6),
  .admin-users-table td:nth-child(6) {
    width: calc(var(--admin-col-unit) * 2);
  }
  .admin-users-table th:nth-child(7),
  .admin-users-table td:nth-child(7) {
    width: calc(var(--admin-col-unit) * 4);
  }
  .admin-users-table th:nth-child(8),
  .admin-users-table td:nth-child(8) {
    width: calc(var(--admin-col-unit) * 4);
  }
  .admin-users-table th,
  .admin-users-table td {
    padding: 6px 8px;
    vertical-align: middle;
  }
  .admin-users-table input,
  .admin-users-table select {
    margin: 0;
    height: 1.8rem;
    font-size: 0.9rem;
  }
  .admin-users-table tbody tr {
    cursor: pointer;
  }
  .admin-users-table tr.admin-row-deactivated {
    background-color: #f7d6d6 !important;
  }
  .admin-users-table tr.admin-row-deactivated td {
    background-color: #f7d6d6 !important;
  }
  .admin-users-table tr.admin-row-deactivated input,
  .admin-users-table tr.admin-row-deactivated select {
    background-color: #f7d6d6 !important;
  }
  .admin-users-table tr.admin-row-blocked {
    background-color: #fff3cd !important;
  }
  .admin-users-table tr.admin-row-blocked td {
    background-color: #fff3cd !important;
  }
  .admin-users-table tr.admin-row-blocked input,
  .admin-users-table tr.admin-row-blocked select {
    background-color: #fff3cd !important;
  }
  .admin-users-table tr.admin-row-blocked.admin-row-deactivated {
    background-color: #f6c68c !important;
  }
  .admin-users-table tr.admin-row-blocked.admin-row-deactivated td {
    background-color: #f6c68c !important;
  }
  .admin-users-table tr.admin-row-blocked.admin-row-deactivated input,
  .admin-users-table tr.admin-row-blocked.admin-row-deactivated select {
    background-color: #f6c68c !important;
  }
  .admin-users-table tr.admin-row-selected {
    background-color: #00979C !important;
    color: #ffffff !important;
  }
  .admin-users-table tr.admin-row-selected td {
    background-color: #00979C !important;
    color: #ffffff !important;
  }
  .admin-users-table tr.admin-row-selected input,
  .admin-users-table tr.admin-row-selected select {
    background-color: #00979C !important;
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.75) !important;
  }
  .admin-users-table tr.admin-row-selected input::placeholder {
    color: rgba(255, 255, 255, 0.85) !important;
  }
  .admin-users-table thead th.admin-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
  }
  .admin-users-table thead th.admin-sortable:hover {
    text-decoration: underline;
  }
  .admin-sort-indicator {
    margin-left: 6px;
    font-size: 0.85em;
    opacity: 0.7;
  }
  .admin-column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
  }
  .admin-column-resizer::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 4px;
    width: 1px;
    height: calc(100% - 8px);
    background: rgba(0, 0, 0, 0.2);
  }
  .admin-users-table.resizing {
    cursor: col-resize;
  }
  .admin-class-warning {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #b71c1c;
  }

  .build-dashboard-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .build-dashboard-controls .input-field {
    margin: 0;
    min-width: 180px;
  }
  .build-dashboard-actions {
    display: flex;
    gap: 8px;
  }
  .build-dashboard-table-wrap {
    border: 1px solid #e0e0e0;
    max-height: 360px;
    overflow: auto;
  }
  .build-dashboard-table {
    width: 100%;
    min-width: 1200px;
    table-layout: auto;
  }
  .build-dashboard-table th,
  .build-dashboard-table td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .build-dashboard-table td {
    font-size: 0.9rem;
  }
  .ota-dashboard-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .ota-dashboard-controls .input-field {
    margin: 0;
    min-width: 200px;
  }
  .ota-dashboard-actions {
    display: flex;
    gap: 8px;
  }
  .ota-dashboard-table-wrap {
    border: 1px solid #e0e0e0;
    max-height: 360px;
    overflow: auto;
  }
  .ota-dashboard-table {
    width: 100%;
    min-width: 800px;
    table-layout: auto;
  }
  .ota-dashboard-table th,
  .ota-dashboard-table td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
  }
  .ota-tenant-select {
    min-width: 160px;
  }
  .build-id {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
  }
  .build-status {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .build-status-queued {
    background: #fff3cd;
    color: #8a6d3b;
  }
  .build-status-running {
    background: #e0f7fa;
    color: #006064;
  }
  .build-status-success {
    background: #e8f5e9;
    color: #2e7d32;
  }
  .build-status-failed {
    background: #ffebee;
    color: #b71c1c;
  }
  .build-status-canceled {
    background: #eceff1;
    color: #455a64;
  }
  .build-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #555555;
  }
  .build-action:hover {
    background: #e0e0e0;
  }
  .build-action-stop {
    color: #b71c1c;
  }
  .build-action-requeue {
    color: #006064;
  }
  .build-cache-section {
    margin-top: 12px;
  }
  .build-cache-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
  }
  .build-cache-actions {
    display: flex;
    gap: 8px;
  }
  .build-cache-table-wrap {
    border: 1px solid #e0e0e0;
    max-height: 240px;
    overflow: auto;
  }
  .build-cache-table {
    width: 100%;
    min-width: 720px;
    table-layout: auto;
  }
  .build-cache-table th,
  .build-cache-table td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .build-cache-id {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
  }
  .system-stats-section {
    margin-top: 12px;
  }
  .system-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
  }
  .system-stats-actions {
    display: flex;
    gap: 8px;
  }
  .system-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 12px 0;
  }
  .system-stat-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 10px;
    min-width: 160px;
    flex: 1 1 180px;
    background: #fafafa;
  }
  .system-stat-card-wide {
    flex: 2 1 360px;
    min-width: 260px;
  }
  .system-stat-label {
    font-size: 0.75rem;
    color: #607d8b;
    margin-bottom: 4px;
  }
  .system-stat-value {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
    color: #263238;
    word-break: break-word;
  }
  .system-stats-table-wrap {
    border: 1px solid #e0e0e0;
    max-height: 220px;
    overflow: auto;
  }
  .system-stats-table {
    width: 100%;
    min-width: 520px;
    table-layout: auto;
  }
  .system-stats-table th,
  .system-stats-table td {
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .build-settings-section {
    margin-top: 12px;
  }
  .build-settings-section h6 {
    margin: 0 0 16px 0;
  }
  .build-settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-top: 6px;
  }
  .build-settings-grid .input-field {
    margin: 0;
    min-width: 200px;
    flex: 1 1 220px;
  }
  .build-settings-help {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #607d8b;
  }
  .build-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .build-settings-actions p {
    margin: 0;
  }

  .program-management .collection {
    margin-top: 0;
  }
  .program-user-list-wrap {
    border: 1px solid #e0e0e0;
    max-height: 260px;
    overflow: auto;
  }
  .program-user-actions,
  .program-file-actions {
    margin: 0 0 6px 0;
  }
  .program-download-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px 0;
  }
  .program-download-controls select {
    height: 2.2rem;
  }
  .program-user-actions input[type="checkbox"],
  .program-file-actions input[type="checkbox"] {
    position: static;
    opacity: 1;
    pointer-events: auto;
  }
  .program-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
  }
  .program-user-item label,
  .program-file-item label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    flex: 1 1 auto;
    padding-left: 0 !important;
  }
  .program-user-item label:before,
  .program-user-item label:after,
  .program-file-item label:before,
  .program-file-item label:after {
    display: none !important;
  }
  .program-user-item input[type="checkbox"],
  .program-file-item input[type="checkbox"] {
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    margin: 0 6px 0 0;
  }
  .program-user-item.active {
    background-color: #e0f2f1;
  }
  .program-user-item.program-user-selected {
    background-color: #00979C !important;
    color: #ffffff !important;
  }
  .program-user-item.program-user-selected .program-user-meta,
  .program-user-item.program-user-selected .program-user-email {
    color: #ffffff !important;
  }
  .program-user-email {
    flex: 1 1 auto;
  }
  .program-file-item.program-file-selected {
    background-color: #00979C !important;
    color: #ffffff !important;
  }
  .program-file-item.program-file-selected .program-file-name {
    color: #ffffff !important;
  }
  .program-user-meta {
    font-size: 0.8rem;
    color: #666666;
    margin-left: auto;
  }
  .program-folder-item,
  .program-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .program-file-name {
    flex: 1 1 auto;
  }
  .program-file-download {
    cursor: pointer;
    color: #666666;
  }
  .program-file-download:hover {
    color: #000000;
  }
  .program-file-open {
    cursor: pointer;
    color: #666666;
  }
  .program-file-open:hover {
    color: #000000;
  }
  .program-bulk-card {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    margin-top: 10px;
    border-radius: 2px;
    background: #fafafa;
  }
  .program-management .col.m7 {
    display: flex;
    flex-direction: column;
  }
  .program-bulk-right {
    align-self: flex-end;
    width: 100%;
    max-width: 320px;
  }
  .program-user-detail {
    margin: 8px 0;
  }
  .program-management .divider {
    margin: 8px 0;
  }
  .program-files-row {
    margin-top: 8px;
  }
  .program-upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .program-upload-actions .btn {
    height: 2.3rem;
    line-height: 2.3rem;
  }
  .program-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  .program-upload-name {
    flex: 0 0 220px;
    max-width: 50%;
    margin: 0;
    height: 2.3rem;
    cursor: pointer;
  }
  .program-upload-file {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
  }

/* Disable modal overlay that blocks input focus */
.lean-overlay,
.modal-overlay {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}




/* Settings: PlatformIO editor */
.platformio_textarea {
  font-family: "Courier New", Courier, monospace;
  min-height: 400px;
  height: 400px;
  max-height: 70vh;
  overflow: auto;
  resize: vertical;
  white-space: pre;
}

#platformio_details summary {
  cursor: pointer;
  font-weight: 400;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.platformio_toggle_icon {
  transition: transform 0.2s ease-in-out;
}

#platformio_details[open] .platformio_toggle_icon {
  transform: rotate(90deg);
}

.settings_inline_buttons {
  margin-top: 8px;
}






