@import './../../../@uppy/core/src/_utils.scss';
@import './../../../@uppy/core/src/_variables.scss';
@import './../../../@uppy/informer/src/style.scss';
@import './../../../@uppy/status-bar/src/style.scss';
@import './../../../@uppy/provider-views/src/style.scss';

// Component-specific css imports
@import './components/FileItem/index.scss';
@import './components/FileCard/index.scss';

// Transitions //

.uppy-transition-slideDownUp-enter {
  opacity: 0.01;
  transform: translate3d(0, -105%, 0);
  transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.uppy-transition-slideDownUp-leave {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active {
  opacity: 0.01;
  transform: translate3d(0, -105%, 0);
}

// Modal open/close animations

@keyframes uppy-Dashboard-fadeIn {
  from { opacity: 0;  }
  to { opacity: 1;  }
}

@keyframes uppy-Dashboard-fadeOut {
  from { opacity: 1;  }
  to { opacity: 0;  }
}

@keyframes uppy-Dashboard-slideDownAndFadeIn {
  from { transform: translate3d(-50%, -70%, 0); opacity: 0; }
  to { transform: translate3d(-50%, -50%, 0); opacity: 1; }
}

  @keyframes uppy-Dashboard-slideDownAndFadeIn--small {
    from { transform: translate3d(0, -20%, 0); opacity: 0; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
  }

@keyframes uppy-Dashboard-slideUpFadeOut {
  from { transform: translate3d(-50%, -50%, 0); opacity: 1; }
  to { transform: translate3d(-50%, -70%, 0); opacity: 0; }
}

  @keyframes uppy-Dashboard-slideUpFadeOut--small {
    from { transform: translate3d(0, 0, 0); opacity: 1; }
    to { transform: translate3d(0, -20%, 0); opacity: 0; }
  }

// End Transitions //

.uppy-Dashboard--modal {
  z-index: $zIndex-2;
}

  .uppy-Dashboard--modal[aria-hidden=true] {
    display: none;
  }

  .uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose > .uppy-Dashboard-inner {
    animation: uppy-Dashboard-slideDownAndFadeIn--small 0.3s cubic-bezier(0, 0, .2, 1);

    @media #{$screen-medium} {
      animation: uppy-Dashboard-slideDownAndFadeIn 0.3s cubic-bezier(0, 0, .2, 1);
    }
  }

  .uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose > .uppy-Dashboard-overlay {
    animation: uppy-Dashboard-fadeIn 0.3s cubic-bezier(0, 0, .2, 1);
  }

  .uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing > .uppy-Dashboard-inner {
    animation: uppy-Dashboard-slideUpFadeOut--small 0.3s cubic-bezier(0, 0, .2, 1);

    @media #{$screen-medium} {
      animation: uppy-Dashboard-slideUpFadeOut 0.3s cubic-bezier(0, 0, .2, 1);
    }
  }

  .uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing > .uppy-Dashboard-overlay {
    animation: uppy-Dashboard-fadeOut 0.3s cubic-bezier(0, 0, .2, 1);
  }

// Added to body to prevent the page from scrolling when Modal is open
.uppy-Dashboard-isFixed {
  overflow: hidden;
  height: 100vh;
}

.uppy-Dashboard--modal .uppy-Dashboard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba($black, 0.5);
  z-index: $zIndex-2;
}

.uppy-Dashboard-inner {
  position: relative;
  background-color: $gray-50;
  max-width: 100%;
  max-height: 100%;
  outline: none;
  border: 1px solid $gray-200;
  border-radius: 5px;

  .uppy-size--md & {
    min-height: auto;
  }

  @media #{$screen-medium} {
    width: 750px;
    height: 550px;
  }

  .uppy-Dashboard--modal & {
    z-index: $zIndex-3;
  }

  [data-uppy-theme="dark"] & {
    background-color: $black;
  }
}

.uppy-Dashboard-innerWrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 5px;
  opacity: 0;
}

  .uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap {
    opacity: 1;
  }

.uppy-Dashboard--modal .uppy-Dashboard-inner {
  position: fixed;
  top: 35px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: none;

  @media #{$screen-medium} {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 5px 15px 4px rgba($black, 0.15);
  }
}

.uppy-Dashboard-close {
  @include clear-focus;
  display: block;
  position: absolute;
  top: -33px;
  right: -2px;
  cursor: pointer;
  color: rgba($white, 0.9);
  font-size: 27px;
  z-index: $zIndex-5;

  &:focus{
    color: lighten($blue, 25%);
  }

  @media #{$screen-medium} {
    font-size: 35px;
    top: -10px;
    right: -35px;
  }
}

.uppy-Dashboard-AddFiles {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100%;
  position: relative;
  text-align: center;

  [data-uppy-drag-drop-supported="true"] & {
    margin: 7px;
    height: calc(100% - 14px); // to accomodate for the 7px margin
    border-radius: 3px;
    border: 1px dashed $gray-250;
  }

  .uppy-Dashboard-AddFilesPanel & {
    border: none;
    height: calc(100% - 14px - 40px); // to accomodate for the 7px margin and 40px topbar height
  }

  .uppy-Dashboard--modal & {
    border-color: $gray-300;
  }
}

.uppy-Dashboard-AddFiles-info {
  padding-top: 15px;
  padding-bottom: 15px;
  margin-top: auto;

  // hide on short note and “powered by” on short screens
  // such as CodePen, or inline dashboard with height < 400px
  display: none;

  .uppy-size--height-md & {
    display: block;
  }

  .uppy-size--md & {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    padding-top: 30px;
    padding-bottom: 0;
  }

  [data-uppy-num-acquirers="0"] & {
    margin-top: 0;
  }
}

.uppy-Dashboard-browse {
  @include clear-focus;
  cursor: pointer;
  color: rgba($blue, 0.9);

  &:hover, &:focus {
    border-bottom: 1px solid $blue;
  }

  [data-uppy-theme="dark"] & {
    color: rgba($highlight--dark, 0.9);
  }

  [data-uppy-theme="dark"] &:hover,
  [data-uppy-theme="dark"] &:focus {
    border-bottom: 1px solid $highlight--dark;
  }
}

.uppy-Dashboard-browseBtn {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  margin-bottom: 5px;
  width: 100%;

  .uppy-size--md & {
    font-size: 15px;
    width: auto;
    margin: auto;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 13px 44px;
  }
}

.uppy-Dashboard-AddFiles-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 2px;
  padding: 2px 0;
  width: 100%;

  .uppy-size--md & {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 600px;
    overflow-y: visible;
    margin-top: 15px;
    padding-top: 0;
    flex: none;
  }
}

.uppy-DashboardTab {
  width: 100%;
  text-align: center;
  border-bottom: 1px solid $gray-200;

  [data-uppy-theme="dark"] & {
    border-bottom: 1px solid $gray-800;
  }

  .uppy-size--md & {
    display: inline-block;
    width: initial;
    margin-bottom: 10px;
    border-bottom: none;
  }
}

.uppy-DashboardTab-btn {
  @include clear-focus;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  color: $gray-700;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 15px;
  line-height: 1;
  text-align: center;

  .uppy-size--md & {
    width: 86px;
    margin-right: 1px;
    flex-direction: column;
    padding: 10px 3px;
    border-radius: 5px;
  }

  [data-uppy-theme="dark"] & {
    color: $white;
  }
}

  .uppy-DashboardTab-btn::-moz-focus-inner {
    border: 0;
  }

  .uppy-DashboardTab-btn:hover {
    background-color: $gray-100--highlighted;

    [data-uppy-theme="dark"] & {
      background-color: $gray-700;
    }
  }

  .uppy-DashboardTab-btn:active,
  .uppy-DashboardTab-btn:focus {
    background-color: $highlight;

    [data-uppy-theme="dark"] & {
      background-color: $gray-800;
    }
  }


  .uppy-DashboardTab-btn svg {
    max-width: 100%;
    max-height: 100%;
    display: inline-block;
    vertical-align: text-top;
    overflow: hidden;
    transition: transform ease-in-out .15s;
    margin-right: 10px;

    .uppy-size--md & {
      margin-right: 0;
    }
  }

.uppy-DashboardTab-name {
  font-size: 14px;
  font-weight: 500;

  .uppy-size--md & {
    font-size: 11px;
    line-height: 15px;
    margin-top: 8px;
    margin-bottom: 0;
  }
}

// On SVG sizing: https://sarasoueidan.com/blog/svg-style-inheritance-and-FOUSVG/
.uppy-DashboardTab svg {
  width: 23px;
  height: 23px;
  vertical-align: middle;

  .uppy-size--md & {
    width: 30px;
    height: 30px;
  }
}

.uppy-Dashboard-input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

.uppy-DashboardContent-bar {
  flex-shrink: 0;
  height: 40px;
  width: 100%;
  padding: 0 10px;
  z-index: $zIndex-4;
  // For when both 'Cancel' and '+ Add more' buttons are present
  display: flex;
  align-items: center;
  justify-content: space-between;

  // For .uppy-DashboardContent-title's position: absolute
  position: relative;

  border-bottom: 1px solid $gray-200;
  background-color: $gray-50;

  .uppy-size--md & {
    height: 50px;
    padding: 0 15px;
  }

  [data-uppy-theme="dark"] & {
    background-color: $gray-900;
    border-bottom: 1px solid $gray-800;
  }
}

  .uppy-DashboardContent-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    line-height: 40px;
    font-weight: 500;
    // MUST be present for title to be visible in IE11
    width: 100%;
    max-width: 170px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-x: hidden;
    margin: auto;

    .uppy-size--md & {
      font-size: 14px;
      line-height: 50px;
      max-width: 300px;
    }

    [data-uppy-theme="dark"] & {
      color: $gray-200;
    }

    .status-label {
      margin-left: 10px;
    }
  }

  .uppy-DashboardContent-back {
    @include reset-button;
    @include highlight-focus;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    color: $blue;
    padding: 7px 6px;
    margin-left: -6px;

    .uppy-size--md & {
      font-size: 14px;
    }

    [data-uppy-theme="dark"] & {
      color: $highlight--dark;
    }
  }

  .uppy-DashboardContent-addMore {
    @include reset-button;
    @include highlight-focus;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    color: $blue;
    width: 29px;
    height: 29px;
    padding: 7px 8px;
    margin-right: -5px;

    .uppy-size--md & {
      font-size: 14px;
      width: auto;
      height: auto;
      margin-right: -8px;
    }

    [data-uppy-theme="dark"] & {
      color: $highlight--dark;
    }
  }

    .uppy-DashboardContent-addMore svg {
      vertical-align: baseline;
      margin-right: 4px;

      .uppy-size--md & {
        width: 11px;
        height: 11px;
      }
    }

    .uppy-DashboardContent-addMoreCaption {
      display: none;

      .uppy-size--md & {
        display: inline;
      }
    }
  // ...uppy-DashboardContent-addMore|
// ...uppy-DashboardContent-bar|

.uppy-DashboardContent-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: darken($white, 4%);
  overflow: hidden;
  z-index: $zIndex-5;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.uppy-Dashboard-AddFilesPanel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: $gray-50;
  background: linear-gradient(0deg, $gray-50 35%, rgba($gray-50, 0.85) 100%);
  box-shadow: 0 0 10px 5px rgba($black, 0.15);
  overflow: hidden;
  z-index: $zIndex-5;
  border-radius: 5px;
  display: flex;
  flex-direction: column;

  [data-uppy-theme="dark"] & {
    background-color: $gray-800;
    background: linear-gradient(0deg, $gray-900 35%, rgba($gray-900, 0.85) 100%);
  }
}

  .uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files {
    filter: blur(2px);
  }

// Progress bar placeholder

.uppy-Dashboard-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12%;
}

.uppy-Dashboard-progressBarContainer.is-active {
  z-index: $zIndex-4;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.uppy-Dashboard-filesContainer {
  @include clearfix;
  position: relative;
  overflow-y: hidden;
  margin: 0;
  flex: 1;
}

.uppy-Dashboard-files {
  margin: 0;
  padding: 0 0 10px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;

  .uppy-size--md & {
    padding-top: 10px;
  }
}

.uppy-Dashboard-dropFilesHereHint {
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  padding-top: 90px;
  border: 1px dashed $blue;
  border-radius: 3px;
  z-index: 2000;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2V1zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0v1zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a.999.999 0 0 1 1.414 0l7 7z' fill='%232275D7' fill-rule='nonzero'/%3E%3C/svg%3E");
  background-position: 50% 50%;
  background-repeat: no-repeat;
  color: #707070;
  font-size: 16px;
}

.uppy-Dashboard.uppy-Dashboard--isDraggingOver {
  .uppy-Dashboard-dropFilesHereHint {
    visibility: visible;
  }
  .uppy-DashboardContent-bar,
  .uppy-Dashboard-files,
  .uppy-Dashboard-progressindicators {
    opacity: 0.15;
  }
  .uppy-Dashboard-AddFiles {
    opacity: 0.03;
  }
}

.uppy-Dashboard-dropFilesIcon {
  display: none;
  margin-bottom: 15px;

  .uppy-size--md.uppy-size--height-md & {
    display: block;
  }
}

.uppy-Dashboard-AddFiles-title {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 500;
  color: $black;
  margin-top: 15px;
  margin-bottom: 5px;
  text-align: left;
  padding: 0 15px;
  width: 100%;

  .uppy-size--md & {
    font-size: 25px;
    margin-top: 5px;
    font-weight: 400;
    text-align: center;
    max-width: 480px;
  }

  [data-uppy-num-acquirers="0"] & {
    text-align: center;
  }

  [data-uppy-theme="dark"] & {
    color: $gray-200;
  }

  button {
    font-weight: 500;
  }

  .uppy-size--md & button {
    font-weight: 400;
  }
}

.uppy-Dashboard-note {
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  color: $gray-600;
  max-width: 350px;
  margin: auto;
  padding: 0 15px;

  .uppy-size--md & {
    font-size: 15px;
    line-height: 1.35;
    max-width: 600px;
  }

  [data-uppy-theme="dark"] & {
    color: $gray-300;
  }
}

a.uppy-Dashboard-poweredBy {
  display: inline-block;
  text-align: center;
  font-size: 11px;
  color: $gray-500;
  text-decoration: none;
  margin-top: 8px;
}

.uppy-Dashboard-poweredByIcon {
  stroke: $gray-500;
  fill: none;
  margin-left: 1px;
  margin-right: 1px;
  position: relative;
  top: 1px;
  opacity: 0.9;
  vertical-align: text-top;
}

.uppy-DashboardItem-previewIcon {
  width: 25px;
  height: 25px;
  z-index: $zIndex-1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  .uppy-size--md & {
    width: 38px;
    height: 38px;
  }

  svg {
    width: 100%;
    height: 100%;
  }
}

.uppy-DashboardItem-previewIconWrap {
  height: 76px;
  max-height: 75%;
  position: relative;
}

.uppy-DashboardItem-previewIconBg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(rgba($black, 0.1) 0px 1px 1px);
}

.uppy-Dashboard-upload {
  position: relative;
  width: 50px;
  height: 50px;

  .uppy-size--md & {
    width: 60px;
    height: 60px;
  }
}

.uppy-Dashboard-upload .UppyIcon {
  position: relative;
  top: 1px;
  width: 50%;
}

.uppy-Dashboard-uploadCount {
  position: absolute;
  top: -12px;
  right: -12px;
  background-color: $green;
  color: $white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 8px;

  .uppy-size--md & {
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 9px;
  }
}
