@use '@uppy/core/src/_variables.scss' as *;
@use '@uppy/core/src/_utils.scss' as *;

.uppy-Dashboard-FileCard {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $zIndex-5;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: $white;
  // For Safari, otherwise there is no border-radius in FileCard.
  border-radius: 5px;
  box-shadow: 0 0 10px 4px rgba($black, 0.1);

  .uppy-DashboardContent-bar {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
  }

  .uppy-Dashboard-FileCard-actions {
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
  }
}

.uppy-Dashboard-FileCard-inner {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 1;
  height: 100%;
  // For Firefox in order for flex-shrink: 1 to work properly! (https://github.com/philipwalton/flexbugs/issues/41#issuecomment-111590394)
  min-height: 0;
}

.uppy-Dashboard-FileCard-preview {
  position: relative;

  // center the nested image/preview
  display: flex;
  flex-grow: 0;
  flex-shrink: 1;
  align-items: center;
  justify-content: center;
  height: 60%;
  // For Firefox in order for flex-shrink: 1 to work properly!
  min-height: 0;
  border-bottom: 1px solid $gray-200;

  [data-uppy-theme='dark'] & {
    background-color: $gray-800;
    border-bottom: 0;
  }
}

.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg {
  // For IE11, otherwise image aspect ration will get screwed.
  flex: 0 0 auto;
  max-width: 90%;
  max-height: 90%;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 3px 20px rgba($black, 0.15);
}
// ...uppy-Dashboard-FileCard-preview|

.uppy-Dashboard-FileCard-edit {
  @include blue-border-focus;

  position: absolute;
  top: 10px;
  padding: 7px 15px;
  color: $white;
  font-size: 13px;
  background-color: rgba($black, 0.5);
  border-radius: 50px;
  inset-inline-end: 10px;

  &:hover {
    background-color: rgba($black, 0.8);
  }
}

.uppy-Dashboard-FileCard-info {
  flex-grow: 0;
  flex-shrink: 0;
  height: 40%;
  padding: 30px 20px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

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

.uppy-Dashboard-FileCard-fieldset {
  max-width: 640px;
  margin: auto;
  margin-bottom: 12px;
  padding: 0;
  font-size: 0;
  border: 0;
}

.uppy-Dashboard-FileCard-label {
  display: inline-block;
  width: 22%;
  color: $gray-700;
  font-size: 12px;
  vertical-align: middle;

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

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

.uppy-Dashboard-FileCard-input {
  display: inline-block;
  width: 78%;
  vertical-align: middle;
}
// ...uppy-Dashboard-FileCard-fieldset|
// ...uppy-Dashboard-FileCard-info|

.uppy-Dashboard-FileCard-actions {
  display: flex;
  flex-grow: 0;
  flex-shrink: 0;
  align-items: center;
  height: 55px;
  padding: 0 15px;
  background-color: $gray-50;
  border-top: 1px solid $gray-200;

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

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

.uppy-Dashboard-FileCard-actionsBtn {
  margin-inline-end: 10px;
}
// ...uppy-Dashboard-FileCard-actions|

// ...uppy-Dashboard-FileCard-inner|
// ...uppy-Dashboard-FileCard|
