html {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
}

html * {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;

  background-color: var(--color-stone-500);
}

@font-face {
  font-family: Digital7;
  src: url(./assets/fonts/Digital-7MonoItalic.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap
}

.full-screen-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

.v-separator {
  display: inline-block;
  background-color: var(--color-stone-400);
  width: 1px;
  height: 36px;
  margin: 2px 8px;
}

.label-small {
  font-size: 13px;
}

.btn {
  font-weight: bold;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 1px 1px 0 0 var(--color-stone-600);
  background-color: var(--color-stone-400);
  display: inline-flex;
  text-align: center;
  justify-content: center;
}
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn.disabled:hover {
  opacity: 0.6;
}
.btn.disabled:active {
  opacity: 0.6;
  background-color: var(--color-stone-400);
}

.btn.toggled {
  box-shadow: 1px 1px 0 0 var(--color-stone-300);
  background-color: var(--color-stone-600);
}

.btn.btn-tool {
  width: 24px;
  height: 24px;
  margin-right: 2px;
}

.btn-small {
  font-weight: normal;
  font-size: 13px;
  padding: 4px 8px;
}

.btn:hover {
  opacity: 0.8;
}

.btn:active {
  background-color: var(--color-stone-500);
}

.btn-effects:hover {
  background-color: var(--color-stone-300);
}

.btn-toggle {
  padding: 1px 4px;
  cursor: pointer;
  box-shadow: 1px 1px 0 0 var(--color-stone-600);
  background-color: var(--color-stone-400);
  display: inline-flex;
  text-align: center;
  justify-content: center;
  font-size: 12px;
}

.btn-toggle:hover {
  background-color: var(--color-stone-300);
}

.btn-toggle.on {
  box-shadow: -1px -1px 0 0 var(--color-stone-600);
  background-color: var(--color-stone-500);
}


.main-container {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.audio-container {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 1200px;
  align-self: baseline;
  margin: 1px 2px 0 0;
}

.inner-container {
  display: flex;
}

.tracks-area {
  flex-grow: 1;
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  background-color: var(--color-stone-600);
  background-image: linear-gradient(to right, grey 1px, transparent 1px);
}

/* -- MAIN MENU -- */

.main-menu {
  display: flex;
  gap: 3px;
  background-color: var(--color-stone-300);
  margin-bottom: 3px;
  padding: 4px;
  box-shadow: 0px 0px 2px 1px var(--color-stone-300);
}

.menu {
  font-size: 12px;
  padding: 1px 9px;
  margin: 1px 0;
  color: var(--color-stone-700);
}

.menu:hover {
  cursor: pointer;
  background-color: var(--color-stone-400);
}

.menu.active {
  background-color: var(--color-stone-500);
  color: white;
  box-shadow: inset 1px 1px 0 0 var(--color-stone-200);
}

.sub-menu {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background-color: var(--color-stone-400);
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.4);
  padding: 2px;
  z-index: 999;
}

.sub-menu .sub-menu-items {
  box-shadow: -1px -1px 0 0 var(--color-stone-200);
}

.sub-menu .sub-menu-items .separator {
  height: 1px;
  background-color: var(--color-stone-300);
  margin: 2px 4px;
}

.sub-menu .sub-menu-items .item {
  margin: 4px 4px;
  padding: 4px 6px 2px 6px;
  font-size: 11px;
  line-height: 16px;
}

.sub-menu .item:hover {
  cursor: pointer;
  background-color: var(--color-stone-200);
}

.sub-menu .item.disabled {
  color: var(--color-stone-300);
  cursor: default;
}

.sub-menu .item.disabled:hover {
  background-color: var(--color-stone-400);
}


.main-controls {
  display: flex;
  align-items: center;
  padding: 4px;
  gap: 8px;
  background-color: var(--color-stone-300);
  border-bottom: solid 1px var(--color-stone-800);
}

.button-group {
  display: flex;
  gap: 2px;
}

.actions-container {
  width: 160px;
  flex-shrink: 0;
  background-color: var(--color-stone-600);
  margin-top: 20px;
}

.actions-container .remove-track {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='size-6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0' /%3E%3C/svg%3E%0A");
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tracks-container {
  flex-grow: 1;
  position: relative;
}

.edit-tools-container {
  height: 30px;
  padding: 2px 0 0 160px;
  display: flex;
  gap: 14px;
}

.timeline-container {
  height: 20px;
}

.track-actions {
  flex-grow: 0;
  width: 100%;
  height: 120px;
  border-right: solid 1px grey;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--color-stone-400);
  box-shadow: inset 1px 1px 0px 0px var(--color-stone-300);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  margin-bottom: 2px;
  overflow: hidden;
}

.track-actions .track-title {
  font-size: 12px;
  font-weight: bold;
  border-bottom: solid 1px var(--color-stone-500);
  padding-bottom: 4px;
  margin-bottom: 4px;
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
}

.track-actions .track-title:hover,
.track-actions .track-title:not([readonly="true"]) {
  background-color: var(--color-stone-200);
  filter: opacity(0.4);
}

.track-actions .top {
  display: flex;
  gap: 6px;
}

.track-audio {
  flex-grow: 1;
  height: 120px;
  padding: 2px;
  box-shadow: inset -1px 1px 0px 0px var(--color-stone-500);
  margin-bottom: 2px;
}

.track-audio.selected {
  background-color: rgba(0, 0, 0, 0.2);
}

.audio-snippet {
  position: absolute;
  border: solid 1px rgba(255, 204, 42, 0.9);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  overflow: hidden;
  margin-top: -1px;
  display: flex;
  flex-direction: column;
  /* 255, 204, 42 */
  /* 65, 57, 34 */
  background-color: rgba(65, 57, 34, 0.6);
}

.audio-snippet .header {
  background-color: rgba(255, 204, 42, 0.7);
  padding: 0 4px;
  cursor: move;
}

.audio-snippet.selected .header {
  font-weight: bold;
  color: #000;
}

.audio-snippet .header .snippet-name {
  font-size: 10px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.audio-snippet.selected {
  box-shadow: 0 0 1px 1px rgba(255, 204, 42, 0.9);
}

.audio-snippet.dragging {
  opacity: 0.5;
}

.user-cursor {
  display: inline-block;
  height: 100%;
  width: 2px;
  background-color: orange;
  position: absolute;
  left: 0;
  z-index: 100;
}

.user-cursor::before {
  content: ' ';
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='orange' class='size-6'%3E%3Cpath fill-rule='evenodd' d='M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-.53 14.03a.75.75 0 0 0 1.06 0l3-3a.75.75 0 1 0-1.06-1.06l-1.72 1.72V8.25a.75.75 0 0 0-1.5 0v5.69l-1.72-1.72a.75.75 0 0 0-1.06 1.06l3 3Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A");
  position: absolute;
  top: -18px;
  left: -9px;
  width: 20px;
  height: 20px;
}

.play-cursor {
  display: inline-block;
  height: 100%;
  width: 1px;
  background-color: red;
  position: absolute;
  left: 0;
  z-index: 200;
}

/* Sinked in area */
.sinked-in {
  background-color: var(--color-stone-700);
  border-bottom: solid 2px var(--color-stone-50);
  border-right: solid 2px var(--color-stone-50);
  border-top: solid 2px black;
  border-left: solid 2px black;
}

/* Cursor inputs */
.play_pos,
.selection_start_pos,
.selection_end_pos {
  background-color: var(--color-stone-700);
  color: white;
  text-align: center;
  outline: none;
}

.play_pos {
  color: white;
  font-size: 36px;
  padding: 0 6px;
  width: 156px;
  height: 39px;

  border-bottom: solid 2px var(--color-stone-50);
  border-right: solid 2px var(--color-stone-50);
  border-top: solid 2px black;
  border-left: solid 2px black;
}

.play_pos .timeinput-ms {
  font-size: 18px;
}

.selection_start_pos,
.selection_end_pos {
  color: var(--color-stone-200);
  font-size: 16px;
  padding: 2px 2px 0 2px;
  width: 120px;
  height: 18px;

  border-bottom: solid 1px var(--color-stone-50);
  border-right: solid 1px var(--color-stone-50);
  border-top: solid 1px black;
  border-left: solid 1px black;
}

.cursor-selection {
  display: flex;
  flex-direction: column;
  gap: 3px;
}




/* Forms */

input {
  outline: none;
}

.form input[type="text"],
select {
  background-color: var(--color-stone-600);
  color: #fff;
  padding: 1px 8px;
  border-radius: 4px;
}

.form select {
  cursor: pointer;
}

.range-wrapper.playback-speed {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input.range-selector {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--color-stone-400);
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 0 var(--color-stone-600);
}

input.range-selector.dark {
  background-color: var(--color-stone-500);
  box-shadow: inset -1px -1px 0px 0px var(--color-stone-200);
}

input.range-selector.dark::-webkit-slider-thumb {
  background-color: var(--color-amber-400);
  box-shadow: -1px -1px 0 0 var(--color-yellow-200);
}

input.range-selector:hover {
  opacity: 1;
}

input.range-selector::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--color-orange-500);
  border-radius: 100%;
  cursor: pointer;
  box-shadow: -1px -1px 0 0 var(--color-yellow-200);
}

input.range-selector::-moz-range-thumb {
  width: 25px;
  height: 25px;
  background: #04AA6D;
  cursor: pointer;
}

.range-wrapper .range-val {
  min-width: 40px;
}

.form input:read-only {
  color: var(--color-stone-400);
}

.properties-container {
  width: 360px;
}

.property-form {
  font-size: 14px;
  contain: content;
  background-color: var(--color-stone-400);
  box-shadow: 0px 0px 1px 1px var(--color-stone-300);
  padding: 2px 2px 2px 1px;
}

.property-form .header {
  padding: 4px 6px 2px 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  background-color: var(--color-amber-200);
}

.property-form .content {
  margin: 8px;
}

fieldset {
  border-top: solid 1px var(--color-stone-500);
}

legend {
  font-size: 12px;
  color: var(--color-stone-600);
  padding-right: 8px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.form-row.disabled label {
  color: var(--color-stone-500);
}

.form-row label {
  display: inline-block;
  width: 120px;
}


.link {
  color: var(--color-amber-200);
  text-decoration: underline;
}

.link:hover {
  text-decoration: none;
}


/* Modals */
.modal-wrapper {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;

  min-width: 400px;
  display: flex;
  flex-direction: column;
  background-color: var(--color-stone-400);
  overflow: hidden;
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.4);
}

.modal {
  width: 100%;
  height: 100%;
  box-shadow: 0 0 1px 1px var(--color-stone-300);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-grow: 0;
  background-color: var(--color-stone-200);
  padding: 2px 6px;
  margin: 1px;
}

.modal .modal-header .modal-title {
  font-size: 14px;
  font-weight: bold;
  flex-grow: 1;
}

.modal .modal-header .modal-actions {
  flex-grow: 0;
}

.modal .modal-header .modal-actions .close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor' class='size-6'%3E%3Cpath fill-rule='evenodd' d='M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A");
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.modal .modal-header .modal-actions .close:hover {
  background-color: var(--color-stone-300);
}

.modal .modal-body {
  flex-grow: 1;
  padding: 12px;
  font-size: 13px;
}

.modal .modal-footer {
  flex-grow: 0;
  padding: 12px;
  display: flex;
  justify-content: end;
  gap: 10px;
}

.modal .modal-footer .btn.action {
  background-color: var(--color-stone-200);
  padding: 4px 16px;
}

.modal .modal-footer .btn.action.primary {
  font-weight: bold;
}

.modal .modal-footer .btn.action.secondary {
  font-weight: normal;
}


/* Audio Controls */

.btn.audio-play {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor' class='size-6'%3E%3Cpath fill-rule='evenodd' d='M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: 22px;
  background-position: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.btn.audio-stop {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor' class='size-6'%3E%3Cpath fill-rule='evenodd' d='M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: 22px;
  background-position: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.btn.audio-pause {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor' class='size-6'%3E%3Cpath fill-rule='evenodd' d='M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: 22px;
  background-position: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.lcd-display {
  font-family: Digital7, monospace;
}


/* TimeInput component */
.timeinput {
  display: flex;
  justify-content: center;
  align-items: baseline;
  padding-top: 4px;
}

.timeinput input {
  width: 100%;
  height: 100%;
  outline: none;
  margin: 0;
  width: 34px;
}

.timeinput span {
  height: 100%;
  line-height: 100%;
}

.timeinput input::-webkit-outer-spin-button,
.timeinput input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timeinput input[type="number"] {
  -moz-appearance: textfield;
}

.timeinput .min-wrapper {
  text-align: right;
}

.timeinput .sec {}

.timeinput .ms-wrapper {}


/* Volume meter */
.volume-output-wrapper {
  gap: 3px;
}

.volume-output {
  background-color: var(--color-stone-700);
  padding: 4px;
  width: 300px;
  height: 18px;
  position: relative;

  border-bottom: solid 1px var(--color-stone-50);
  border-right: solid 1px var(--color-stone-50);
  border-top: solid 1px black;
  border-left: solid 1px black;
}

.volume-meter {
  background-image: linear-gradient(to bottom, #66666650 3px, transparent 1px);
}

.volume-meter::before {
  content: ' ';
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  position: absolute;
  top: 4px;
  left: 4px;
  background-image: linear-gradient(to right, green 0%, yellow 80%, red 100%);
  background-repeat: no-repeat;
  /* filter: drop-shadow(0px 0px 7px #ffffff99); */
}

.volume-meter::after {
  width: calc(100% - 6px);
  height: 100%;
  content: ' ';
  position: absolute;
  top: 0px;
  left: 0px;
  z-index: 2;
  margin-left: 3px;
  background-image: linear-gradient(to left, var(--color-stone-700) 2px
      /* space between leds*/
      , transparent 1px);
  background-repeat: repeat-x;
  background-size: 5px 100%;
  background-color: transparent;
}

.volume-output .curtain {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background-color: var(--color-stone-700);
}

/* TOOLS Buttons */

.btn-group {
  display: flex;
}

.btn-tool {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  /* background-repeat: no-repeat no-repeat; */
  /* background-position: center center; */
  /* background-size: 20px 20px; */
  color: var(--color-gray-600);
}

.btn-tool.selected {
  color: black;
  background-color: var(--color-stone-300);
}

.btn-tool:hover {
  color: var(--color-gray-900);
}

.record-modal-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  background-color: var(--color-stone-300);
}


/* Tooltip component */

[hover-tooltip] {
  position: relative;
}

[hover-tooltip]:hover::before {
  content: attr(hover-tooltip);
  font-size: 11px;
  font-weight: normal;
  text-align: center;
  position: absolute;
  display: block;
  white-space: nowrap;
  left: 50%;
  max-width: 200px;
  bottom: calc(100% + 4px);
  transform: translate(-50%);
  animation: fade-in 300ms ease;
  background: #000;
  border-radius: 4px;
  padding: 4px;
  color: #fff;
  z-index: 1;
}


/* Effect settings forms */

.settings-form {}

.settings-form input[type="text"],
.settings-form input[type="number"],
.settings-form select {
  background-color: var(--color-stone-600);
  color: #fff;
  padding: 1px 8px;
  border-radius: 4px;
}
