.media-file-mode {
  a {
    border-bottom: none;
  }

  img {
    margin-right: 1em;
  }
}

span.media-file-mode {
  margin-right: 1em;
}

.media-item {
  position: relative;
  border: 1px solid var(--media-item-border);
  margin: 9px;
  padding: 10px 12px 6px;
  width: 320px;
  min-width: 320px;
  min-height: 140px;
  word-wrap: break-word;

  &:hover,
  &:active {
    background: var(--media-item-active-background);
  }

  p {
    margin: 0 0 0.5em;
  }

  object {
    margin-top: 0.5em;
  }

  ul {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  audio {
    width: 100%;
    margin-top: 0.5em;
  }

  &.media-private {
    border-color: var(--media-item-border-private);

    & img.media-private {
      padding-right: 0.5em;
    }
  }
}

tr.media-private img.media-private {
  padding-right: 0.5em;
}

a.media-icon {
  display: block;
  border-bottom: none;
  margin: 0 auto;
}

.media-icon img {
  display: block;
}

.media-icon-square {
  width: 48px;
  height: auto;
  max-height: 48px;
}

a.media-flag {
  border-bottom: none;
}

.media-flag img {
  float: left;
  margin-right: 0.5em;
}

.media-link {
  font-size: 1.1em;
}

.media-action-box {
  position: relative;
  margin: 3em 3em 1em 1em;
  display: inline-block;
  vertical-align: top;
}

li.media-action {
  display: block;
  position: absolute;
  top: 4px;
  right: 8px;
  height: 16px;

  a {
    border: none;

    &.attach-media {
      margin-right: 5px;
    }
  }

  form {
    display: inline;
  }

  input {
    border: none;
  }
}

td.media-action {
  padding: 0.4em 0 0.4em 0.5em;
}

#entry-sidebar .media-item {
  width: 100%;
  min-height: 0;
  padding: 4px;
  margin: 0.33em 0;
  min-width: inherit;
}

.folders-group {
  display: flex;
  flex-wrap: wrap;

  .media-item {
    min-height: 70px;

    p {
      margin-bottom: 0;
    }
  }
}

div.media-items-bloc {
  // div to avoid styling table
  display: flex;
  flex-wrap: wrap;
}

.media-folder {
  background: var(--media-folder-background);
  border-color: var(--media-folder-border);
  border-left-width: 8px;

  .media-link {
    font-size: 1.125em;
    color: var(--media-folder-link);
    border-bottom: none;
  }
}

tr.media-folder {
  background: var(--media-folder-background);

  .media-link {
    margin-left: 0;
  }
}

.media-folder-up {
  border-color: var(--media-folderup-border);
  padding-bottom: 6px;
}

.medias-delete,
.medias-select {
  text-align: right;
}

.media-recent {
  margin-right: 2em;
}

#media-fav-dir {
  border-bottom: none;

  img {
    vertical-align: middle;
  }
}

/* upload multiple */

.enhanced_uploader {
  .choose_files,
  .cancel,
  .clean,
  .start {
    margin-right: 0.4em;
  }

  #upfile {
    visibility: hidden;
    width: 0;
    height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
  }

  .button.choose_files {
    display: inline-block;
  }

  .max-size {
    display: block;
  }

  .one-file {
    display: none;
  }

  p.clear {
    padding-top: 1em;
    margin-bottom: 1em;
  }
}

.button.clean,
.button.cancel,
.button.choose_files {
  display: none;
}

label span.one-file {
  display: inline;
}

#add-file-f p.clear {
  margin-top: 1em;
  margin-bottom: 0;
  clear: both;
}

.files {
  list-style-type: none;
  margin-left: 0;
  padding-left: 0;
  border-bottom: 1px solid var(--media-files-border);

  li {
    margin-left: 0;
    padding-left: 0;
  }
}

.upload-msg {
  font-weight: bold;

  &.upload-error {
    color: var(--upload-error-color);
  }
}

.upload-files {
  padding: 0 0.5em;
  margin: 1em 0;
}

.upload-file {
  margin: 0;
  padding: 0.3em 0;
  border-top: 1px solid var(--upload-file-border);
  position: relative;
}

.upload-fileinfo {
  margin-left: 0;

  input {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
  }

  span {
    padding-right: 8px;
  }

  .upload-filecancel {
    display: block;
    padding-right: 0;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    background: url('cancel.png') no-repeat left top;
    background-color: transparent;
    text-indent: -1000px;
    cursor: pointer;
    float: left;
  }
}

.upload-filemsg {
  font-weight: bold;
  color: var(--upload-filemsg-color);

  &.upload-error {
    color: var(--upload-error-color);
  }
}

.upload-progress {
  padding: 0.3em 0;

  div {
    width: 0;
    height: 1.2em;
    font-weight: bold;
    line-height: 1.2em;
    text-align: right;
    background: url(loader.png) repeat-x left top;
    background-color: var(--upload-progress-background);
    color: var(--upload-progress-color);
    border-radius: 3px;
  }
}

div.template-upload {
  clear: both;
}

.queue-message {
  font-weight: bold;
}
