img,
canvas {
  max-width: 100%;
}

.helpicon {
  color: #999;
  font-size: 0.9em;
}

.hidden {
  display: none;
}

.ui-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0.5;
}

/* Make jQuery UI colors match with Bootstrap */
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default,
.ui-button,
html .ui-button.ui-state-disabled:hover,
html .ui-button.ui-state-disabled:active {
  color: black;
  background-color: #eee;
  border-color: #ccc;
}
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
  color: black;
  background-color: #eee;
  border-color: #ccc;
}

h3.ui-accordion-header {
  font-weight: bold;
}

textarea {
  resize: vertical;
}

/* normal cursor when hovering over navbar */
.navbar a {
  cursor: default;
}

.navbar {
  z-index: 4;
  position: fixed;
  left: 0px;
  top: 0px;
  border: none;
  width: 100%;
}

.navbar button {
  margin: 0px;
  border-radius: unset;
  border: none;
  background-color: #333;
  width: 50px;
}

.navbar-toggle .icon-bar {
  width: 30px;
}

.navbar-inverse {
  background-color: unset;
}

.navbar-toggle {
  padding: 10px;
}

.navbar-toggle .icon-bar + .icon-bar {
  margin-top: 12px;
}

.navbar-header {
  padding-left: 0px !important;
}

.navbar-collapse {
  background-color: #333;
  border: none;
  width: calc(100vw - 50px);
  position: fixed;
  top: 0px;
  max-height: 100vh;
}

.navbar-brand {
  display: none;
  cursor: default;
}

.nav > li {
  width: 49%;
  display: inline-block;
}

.nav > li:hover,
.navbar-brand:hover {
  background-color: #222;
}

.nav > li.open {
  width: 100%;
}

#header-mobile {
  background-color: #333;
  width: 100%;
  height: 50px;
  margin-top: -20px;
}

#header-mobile h1 {
  font-size: 12pt;
  font-weight: normal;
  color: white;
  padding: 17px;
}

body > .container-fluid > .row {
  margin-top: 20px;
}

input#btn_frequency_auto,
input#btn_key_colors_auto {
  margin-top: 3px;
}

#txt_name {
  font-size: 1.4em;
  background-color: unset;
}

#col-tuning-table {
  padding-left: 0px;
  padding-right: 0px;
}

#tuning-table {
  margin-bottom: 4px;
}

.table-condensed > tbody > tr > td,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > td,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > thead > tr > th {
  padding: 3px 5px;
}

tr.bg-playnote td {
  background-color: #dff0d8 !important;
}

#tuning-table td,
#tuning-table th {
  text-align: center;
}

p.social-icons {
  text-align: center;
  font-size: 1.5em;
}
.social-icons .socicon-twitter {
  color: #4da7de;
}

div#qwerty-indicator {
  padding: 1em;
  display: none;
}

#btn_panic {
  display: none;
}

div#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: white;
  z-index: 10;
  display: table;
}

div#splash-center {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
}
div#splash-center img {
  max-width: 70vw;
  height: auto;
  box-shadow: #aaa 0px 0px 40px;
}

#modal_load_preset_scale optgroup + optgroup {
  margin-top: 1em;
}

/* Virtual keyboard */

#virtual-keyboard {
  background-color: white;
  position: fixed;
  top: 50px;
  left: 0;
  width: 100vw;
  min-width: 500px; /* this stops the keys getting too close together for portrait mobile users */
  height: calc(100vh - 50px);
  display: none;
  z-index: 2;
}
#virtual-keyboard td {
  text-align: center;
  vertical-align: middle;
  border: 1px solid grey;
  font-size: 0.6em;
  user-select: none;
  cursor: pointer;
}
#virtual-keyboard td p {
  pointer-events: none;
  word-break: break-word;
  line-height: 1.1em;
  color: #888;
}

#virtual-keyboard .key:hover {
  background: linear-gradient(
    0deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 0, 0, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}
#virtual-keyboard .key.active {
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 255, 0, 0.5) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}

/*
 * Fullscreen variant for jQueryUI modal widget
 */
.fullscreen-modal {
  top: 0px !important;
  left: 0px !important;
  width: 100vw !important;
  height: 100vh !important;
  position: fixed;
}
.fullscreen-modal .ui-dialog-buttonpane {
}

/*
 * JQUERY MODAL UI MOBILE-ONLY FIXES
 */
@media (max-width: 420px), /* OR */ (max-height: 420px) {
  .ui-dialog {
    top: 0px !important;
    left: 0px !important;
    width: 100vw !important;
    max-height: 100vh !important;
    position: fixed;
    overflow-x: scroll;
  }
}

/*
 * NON-MOBILE
 */
@media (min-width: 768px) {
  body > .container-fluid > .row {
    margin-top: 0px;
  }

  div#qwerty-indicator {
    display: block;
  }

  .col-main {
    /* main columns of the Scale Workshop UI */
    height: calc(100vh - 70px);
    overflow-y: auto;
  }

  #btn_panic {
    display: unset;
  }

  #virtual-keyboard {
    font-size: 0.9em;
    height: calc(100vh - 50px);
  }

  #tuning-table td.key-color,
  #tuning-table th.key-color {
    border-left: 1px solid #ddd;
  }

  .navbar {
    border-radius: 0px;
  }

  .navbar {
    z-index: 4;
    position: relative;
    left: unset;
    top: unset;
    background-color: #222;
    border: none;
  }

  .navbar-header {
    padding-left: 0px !important;
  }

  .navbar-collapse {
    background-color: unset;
    position: unset;
  }

  .navbar-brand {
    display: block;
  }

  .nav > li {
    width: unset;
    display: block;
  }

  .nav > li.open {
    width: unset;
  }
}
@media (min-width: 992px) {
  .col-sub {
    /* main columns of the Scale Workshop UI */
    height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .navbar {
    border-radius: 0px;
  }
}
@media (max-width: 991px) {
  #col-tuning-table {
    margin-top: 1em;
    padding-left: 0px;
    padding-right: 0px;
  }
}

#modal_midi_settings {
  user-select: none;
}
#modal_midi_settings .form-group {
  margin-top: 20px;
}
#modal_midi_settings .settings .row {
  display: flex;
  margin: 0;
}
#modal_midi_settings .device {
  display: flex;
  align-items: center;
}
#modal_midi_settings .checkbox-wrapper {
  padding: 0 10px;
}
#modal_midi_settings .device input[type='checkbox'] {
  margin: 0;
}
#modal_midi_settings .device h4 {
  flex-grow: 1;
  font-size: unset;
}
#modal_midi_settings .device h4 label {
  margin: 0;
  font-weight: unset;
}
#modal_midi_settings .channels {
  display: flex;
  flex-wrap: wrap;
}
#modal_midi_settings .channels label, #modal_midi_settings .settings label {
  font-weight: unset;
}
#modal_midi_settings .device + .device {
  margin-top: 2em;
}
#modal_midi_settings .channel {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  align-items: center;
}
#modal_midi_settings .channel input[type='checkbox'] {
  margin: 0;
}
