/*
 * TunePad
 *
 * Michael S. Horn
 * Northwestern University
 * michael-horn@northwestern.edu
 * Copyright 2020, Michael S. Horn
 *
 * This project was funded by the National Science Foundation (grant DRL-1612619).
 * Any opinions, findings and conclusions or recommendations expressed in this
 * material are those of the author(s) and do not necessarily reflect the views
 * of the National Science Foundation (NSF).
 */

.recording-studio.dialog {
  margin-top: 65px;
  padding: 15px 40px;
  padding-bottom: 85px;
  max-height: 80vh;
  overflow-y: auto;
  height: 100%;
  width: 80%;
  min-width: 750px;
  max-width: 1024px;
}

.recorder {
  background-color: #535562;
  margin: 30px auto;
  max-width: 700px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  box-shadow: 5px 5px 5px #0003;
}

.recorder.hidden {
  display: none;
}

.recorder .left-column {
  padding: 20px 25px 10px 25px;
  border-right: 1px solid #444;
  display: flex;
  flex-direction: column;
}

.recorder .right-column {
  padding: 20px 25px 10px 25px;
  border-left: 1px solid #888;
  display: flex;
  flex-direction: column;
}

.recorder .button-row {
  display: flex;
  margin-bottom: 10px;
  max-width: 100%;
}

.expander {
  flex: 1;
}

.dialog.recording-studio .recorder button {
  background-color: #fff1;
  font-size: 12px;
  color: #d2d3d6;
  border: 1px solid #fff5;
  border-radius: 4px;
  outline: none;
  width: 90px;
  height: 33px;
  font-weight: bold;
  font-family: var(--main-font);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  user-select: none;
  margin: 0;
}

.dialog.recording-studio .recorder button:hover {
  background-color: #778;
}

.dialog.recording-studio .recorder button:active {
  background-color: #aaa;
}

.dialog.recording-studio .recorder button:disabled {
  color: #889;
}

.dialog.recording-studio .recorder button .fas {
  margin-right: 8px;
}

.dialog.recording-studio .recorder button.hidden {
  display: none;
}

#record-button, #upload-button, #stop-button {
  width: 125px;
  margin: 0 0 10px 0;
}

#reset-button {
  margin-left: 10px;
}

#eq-container {
  height: 125px;
  margin-bottom: 15px;
}

#waveform-container {
  background-color: #414251;
  height: 125px;
  max-width: 470px;
  min-width: 300px;
  margin-bottom: 15px;
}

#waveform-container .info-text {
  font: 14px monospace;
  fill: white;
  text-anchor: end;
  user-select: none;
  border: 1px solid #777;
}

#waveform-container .playhead {
  opacity: 0;
  transition: opacity 0.2s;
}

#waveform-container.playing .playhead {
  opacity: 1;
}

#waveform-container.recording .playhead {
  opacity: 1;
}

#waveform-container .clip-handle {
  opacity: 0;
  transition: opacity 0.5s;
}

#waveform-container:hover .clip-handle {
  opacity: 1;
}

#waveform-container .clip-handle:active circle {
  fill: white;
}

#effects-container {
  display: flex;
  overflow-y: hidden;
  height: auto;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

#effects-container.hidden {
  display: none;
}

#effects-container .ui-dial {
  display: flex;
  flex-direction: column;
  width: 70px;
  margin: 4px;
}

#effects-container .ui-dial .dial-track,
#effects-container .ui-dial .dial-track-fill {
  stroke: #f0c229;
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}

#effects-container .ui-dial .label,
#effects-container .ui-dial .value {
  color: #fff6;
  font-family: var(--main-font);
  font-weight: 700;
  font-size: 12px;
  user-select: none;
  line-height: 1.2em;
}

#effects-container .ui-dial .label { order: 2; }
#effects-container .ui-dial .value { order: 3; }

#effects-container .ui-dial .dial-pointer {
  stroke: #fff9;
  stroke-width: 4px;
}

#effects-container #crush-dial {
  display: none;
}

#stop-button .fa-circle {
  color: #c00;
  animation-name: pulse;
  animation-duration: 1.5s;
  animation-iteration-count: infinite;
}

#loop-button, #reverse-button {
  border: none;
  box-shadow: none;
  background-color: transparent;
  width: 100px;
}

#loop-button:active, #reverse-button:active {
  color: white;
}

#loop-button.checked .fa-square,
#reverse-button.checked .fa-square {
  display: none;
}

#loop-button .fa-check-square,
#reverse-button .fa-check-square {
  display: none;
  margin: 0;
}

#loop-button .fa-square { margin: 0;}

#loop-button.checked .fa-check-square,
#reverse-button.checked .fa-check-square {
  display: inline;
  margin: 0;
}

#loop-button i.fas, #reverse-button i.fas {
  position: relative;
  top: 2px;
  margin: 0;
}


#edit-name {
  background-color: #414251;
  color: white;
  font-size: 14px;
  height: 33px;
  outline: none;
  padding-left: 10px;
  border: 1px solid #fff7;
  width: 75%;
  max-width: 85vw;
  border-radius: 3px;
  margin-right: 5px;
}

#edit-name:hover {
  border: 1px solid white;
}



.recording-studio .sample-list {
  padding: 0;
  list-style: none;
}

.recording-studio h2.dialog-title { font-size: 20px; }

.recording-studio .sample-item {
  display: flex;
  flex-direction: column;
  color: #446;
}

.recording-studio .sample-item .sample-summary {
  padding-left: 5px;
  display: flex;
  height: 55px;
  line-height: 55px;
  font-size: 13px;
  border-top: 1px solid #e7e7e7;
}

.recording-studio .sample-item .use-it {
  display: block;
  font-size: 14px;
  font-weight: normal;
  text-align: left;
  line-height: 1.2em;
  padding: 1em 0 2em 75px;
}

.recording-studio .sample-item .use-it .code-snippet {
  font-family: monospace;
  border: 1px solid black;
  border-radius: 4px;
  background-color: #0001;
  padding: 1.2em;
  line-height: 1.5em;
  margin: 1em;
  max-width: 440px;
}

.recording-studio .sample-item .use-it.hidden {
  display: none;
}

.recording-studio .sample-item:hover {
  background-color: #f2f2f2;
}

.recording-studio .sample-item.selected {
  background-color: #ddd;
}

.recording-studio .sample-name {
  margin: 0 15px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  font-size: 15px;
  font-weight: normal;
}

.recording-studio .sample-id {
  flex: 1;
  text-align: left;
  font-size: 15px;
  font-weight: normal;
}

.recording-studio .sample-duration {
  color: #888;
  margin-right: 12px;
  font-weight: normal;
}

.recording-studio .sample-item button {
  background-color: transparent;
  width: 45px;
  height: 42px;
  border: none;
  outline: none;
}

.recording-studio .sample-item .sample-name {
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.recording-studio .sample-badge {
  margin-top: 10px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: lightseagreen;
  background-image: url("../images/instruments/sampler.svg");
  background-size: 25px 25px;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  font-size: 125%;
  line-height: 38px;
}

.recording-studio .sample-badge i.fa-play { margin-left: 2px; }

.recording-studio .sample-badge.loading {
  background-image: none;
  padding-left: 0;
  color: white;
  animation: spin 1s infinite;
}
.recording-studio .sample-badge.playing { padding-left: 0; background-image: none; color: white; }
.recording-studio .sample-item:hover .sample-badge { background-image: none; color: white; }
.recording-studio .sample-item:hover .sample-badge:hover { color: #fffb; }
.recording-studio .sample-item:hover .sample-badge:active { color: #fff9; }

.recording-studio .zero-sound-message {
  color: #888;
  padding: 20px;
  font-size: 14px;
}

.recording-studio .sample-item .sample-menu-button {
  width: 30px;
  margin: 0;
  position: relative;
}

.recording-studio .sample-item .sample-menu-button:hover {
  color: #2f9aef;
}

.recording-studio .sample-item .add-sample-button {
  width: 130px;
  color: #888;
  border: 1px solid #888;
  height: 35px;
  font-size: 14px;
  margin-top: 10px;
  margin-left: 10px;
}
.recording-studio .sample-item .add-sample-button i{
  height: 1em;
}
.recording-studio .sample-item .add-sample-button:hover {
  background-color: #0001;
}

.recording-studio .sample-item .add-sample-button:active {
  background-color: #0002;
}

.recording-studio .sample-item .drop-menu {
  top: 30px;
  right: 0;
  width: 200px;
  left: unset;
}

@media only screen and (max-width: 600px){
  .recording-studio.dialog{
    min-width: 300px;
    min-height: 250px;
    padding: 5px 7px;
    height: 80vh;
    width: 90vw;
    overflow-y: auto;
  }
  .recorder{
    min-width: 285px;
    max-width: 89vw;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    border-radius: 10px;
  }

  .recorder .left-column, .recorder .right-column{
    padding: 5px;
    max-width: 85vw;
    border-left: none;
  }

  .recorder .left-column{
    display: grid;
    width: 100%;
    grid-template-columns: 0.5fr 0.5fr;
    grid-template-rows: 0.65fr 0.35fr;
    grid-template-areas:
      "eq record-btn"
      "eq upload-btn";
    border-right: 1px;
  }

  .recorder .left-column #eq-container{
    max-width: 90vw;
    padding: 10px 0 0 0px;
    grid-area: eq;
    align-self: center;
    justify-self: start;
  }

  .recorder .left-column #record-button, .recorder .left-column #stop-button{
    grid-area: record-btn;
    align-self: end;
    justify-self: start;
  }

  .recorder .left-column #upload-button{
    grid-area: upload-btn;
    align-self: end;
    justify-self: start;
  }

  .dialog.recording-studio .recorder button{
    font-size: 10px;
    font-weight: 700;
    padding-left: 5px;
    padding-right: 5px;
    min-width: 25px;
  }

  .recording-studio .sample-item .sample-summary{
    padding-left: 5px;
    width: 100%;
  }
  .recording-studio .sample-badge{
    
  }
  .recording-studio .sample-name{
    margin: 0 5px;
    font-size: 14px;
    max-width: 85px;
  }
  .recording-studio .sample-item .sample-menu-button{
    display: none;
  }
  .recording-studio .sample-item .add-sample-button{
    width: 70px;
    margin-left: 5px;
    padding: 2px 3px;
    font-size: 11px;
    font-weight: 700;
  }
  .recording-studio .sample-item .add-sample-button .fas{
    display: none;
  }

  .recording-studio .zero-sound-message {
    line-height: 120%;
  }
}

@media only screen and (max-width: 320px){
  .recording-studio .sample-item .add-sample-button{
    width: 55px;
    padding: 1px 2px;
    line-height: 1;
  }
  .button-row #trim-button, .button-row #reset-button, .button-row #play-button{
    font-size: 10px;
    font-weight: 900;
  }
  .dialog.recording-studio .recorder button{
    width: 25%;
  }
  .dialog.recording-studio .recorder button .fas{
    margin-right: 5px;
  }
}