/* Preview Container */

#previewContainer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  z-index: 30;
  opacity: 0.0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  box-sizing: border-box;
  pointer-events: none;
}

#previewContainer.fade-in {
  transition: 0.5s opacity;
  opacity: 1;
}

#videoPreview, #imagePreview {
  display: none;
  max-width: 90vw;
  max-height: calc(88vh - 12vmin);
  border-radius: 10px;
  border: 1vmin solid white;
  background-color: white;
}

.icon-button img, #videoPreview, #imagePreview, .finalize-container {
  filter: drop-shadow(0 0 2px #333);
}

.video-preview #videoPreview {
  display: block;
}

.image-preview #imagePreview {
  display: block;
}

/* Top Bar */

.top-bar {
  position: relative;
  flex: 1 0 0;
}

.preview-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-button {
  padding: 4vmin;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.icon-button img {
  display: block;
  height: 7.5vmin;
}

#toggleMuteButton, #closePreviewButton {
  position: absolute;
  z-index: 1;
}

#toggleMuteButton {
  left: 0;
  bottom: 0;
  display: none;
}

.video-preview #toggleMuteButton {
  display: block;
}

#closePreviewButton {
  top: 0;
  right: 0;
}

/* Bottom Bar */

.bottom-bar {
  display: flex;
  justify-content: center;
  position: relative;
  margin: 0 5vmin;
}

.style-reset {
  background: none;
  border: none;
  outline: none;
  box-shadow: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.style-reset:focus { outline:0; }

#actionButton {
  padding: 0.3em 0.5em 0.3em 0.5em;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Nunito', sans-serif;
  text-align: right;
  color: white;
  background-color: #AD50FF;
  border-radius: 0.5em;
  font-size: 5vmin;
  min-width: 3.25em;
}

.show-with-download-button {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.show-alone {
  margin-bottom: 2vmin;
}

#actionButton img {
  height: 0.8em;
  margin-left: 0.4em;
}

.disabled-download.video-preview #openSafariText {
  display: block;
  font-size: 5vmin;
}

.disabled-download.image-preview #tapAndHoldText {
  display: block;
  font-size: 7.5vmin;
}

#openSafariText, #tapAndHoldText {
  display: none;
  padding: 0.3em 0.5em 0.3em 0.5em;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Nunito', sans-serif;
  text-align: center;
  color: white;
  filter: drop-shadow(0px 1px 2px #333);
}

#previewContainer:not(.downloaded) .show-after-download {
  display: none;
}

.finalize-container {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: calc(50% + 13vmin);
  width: 25vmin;
  text-align: center;
  opacity: 0;
  transition: 0.3s opacity;
}

.finalize-waiting .finalize-container {
  opacity: 1;
}

#finalizeText {
  color: white;
  font-family: 'Nunito', sans-serif;
  color: white;
  font-size: 3.5vmin;
  margin-bottom: 0.5vmin;
  font-style: italic;
}

#finalizeProgressBar {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:  #B5B8D0;
  border-radius: 0.75vmin;
  overflow: hidden;
  width: 100%;
  height: 1.5vmin;
  display: block;
}

#finalizeProgressBar::-webkit-progress-bar {
  background: #B5B8D0;
  border-radius: 0.75vmin;
}

#finalizeProgressBar::-webkit-progress-value {
  border-radius: 0.75vmin;
  background: white;
  transition: 2s width;
}

#finalizeProgressBar::-moz-progress-bar {
  border-radius: 0.75vmin;
  background: white;
}
