@use "sass:color";

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

.uppy-Dashboard-Item-fileInfo {
  padding-inline-end: 5px;

  .uppy-Dashboard--singleFile & {
    padding-inline-end: 10px;
  }

  .uppy-size--md.uppy-Dashboard--singleFile & {
    padding-inline-end: 15px;
  }
}

.uppy-Dashboard-Item-name {
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  // Must be present
  // [Practical check] Firefox, '384048411015659...2309520384n.png' filename
  word-wrap: anywhere;
  word-break: break-all;

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

  .uppy-size--md.uppy-Dashboard--singleFile & {
    font-size: 14px;
    line-height: 1.4;
  }
}

.uppy-Dashboard-Item-fileName {
  display: flex;
  align-items: baseline;

  button {
    margin-left: 5px;
  }
}

.uppy-Dashboard-Item-author {
  color: $gray-600;
  vertical-align: bottom;
  font-size: 11px;
  font-weight: normal;
  display: inline-block;
  line-height: 1;
  margin-bottom: 5px;

  a {
    color: $gray-600;
  }
}

.uppy-Dashboard-Item-status {
  color: $gray-600;
  font-weight: normal;
  font-size: 11px;
  line-height: 1;

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

.uppy-Dashboard-Item-statusSize {
  display: inline-block;
  text-transform: uppercase;
  vertical-align: bottom;
  margin-bottom: 5px;
}

.uppy-Dashboard-Item-reSelect {
  color: $blue;
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
}

.uppy-Dashboard-Item-errorMessage {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: color.adjust($red, $lightness: -15%, $space: hsl);
  background-color: color.adjust($red, $lightness: 45%, $space: hsl);
  padding: 5px 6px;
}

.uppy-Dashboard-Item-errorMessageBtn {
  font-size: 11px;
  text-decoration: underline;
  color: color.adjust($red, $lightness: -15%, $space: hsl);
  cursor: pointer;
  font-weight: 500;
}

// Error message desktop / large screen
.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage {
  display: none;

  .uppy-size--md & {
    display: block;
    border-top: 1px solid color.adjust($red, $lightness: 35%, $space: hsl);
    padding: 6px 8px;
    line-height: 1.4;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
  }
}

// Error message mobile / small screen
.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage {
  display: inline-block;
  position: static;
  border: 1px solid color.adjust($red, $lightness: 35%, $space: hsl);
  border-radius: 3px;

  .uppy-size--md & {
    display: none;
  }
}
