.modx-browser-rte {
  background: $white;
}

.modx-browser-tree {
  background: $white;
  border-radius: $borderRadius;

  .x-window &,
  .modx-browser-rte & {
    border-right: 1px solid $borderColor;
    border-radius: 0;
    box-shadow: none;
  }
}

.modx-browser-view-ct {
  background: $white;
  border-radius: $borderRadius;
  font: $fontSmall;

  .x-window &,
  .modx-browser-rte & {
    border-radius: 0;
    box-shadow: none;
  }
}

.modx-browser-thumb-wrap {
  float: left;
  margin: 5px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  text-align: center;

  &.x-view-over {
    .modx-browser-placeholder {
      color: $darkGray;
    }

    .modx-browser-thumb {
      border: 1px dotted $darkGray;
    }
  }

  &.x-view-selected {
    .modx-browser-placeholder {
      color: $brandSelectedColor;
    }

    .modx-browser-thumb {
      border: 1px solid $brandSelectedColor;
    }
  }
}

.modx-browser-thumb {
  background: $white;
  border: 1px solid $borderColor;
  height: 100px;
  line-height: 100px;
  padding: 5px;
  width: 100px;

  img {
    max-width: 100%;
    vertical-align: middle;
    background-color: $silver;
    background-image: url($imgPath + 'modx-theme/transparency-pattern.png');
  }
}

.modx-browser-placeholder {
  font-size: 14px;
  color: $softGray;

  .details & {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 100%;
    font-size: 24px;
    overflow: hidden;
  }
}

.modx-browser-list-item {
  padding: 0 5px 0 5px;

  >span {
    background-position: center left !important;
    border-bottom: 1px solid $borderColor;
    clear: both;
    display: block;
    min-height: 16px;
    padding: 5px 0 5px 20px;
    position: relative;

    &:before {
      font-size: 14px;
      position: absolute;
      left: 2px;
    }

    span {
      display: inline-block;
      font: $fontSmall;
    }

    span.file-size {
      float: right;
      width: 13%;
    }

    span.image-size {
      float: right;
      width: 13%;
    }
  }

  &.x-view-over {
    >span {
      background: $lightestGray;
    }
  }

  &.x-view-selected {
    >span {
      background: $lightestGray;
      color: $brandSelectedColor;
    }
  }
}

.modx-browser-view-ct .loading-indicator {
  background-position: left;
  background-repeat: no-repeat;
  font-size: 11px;
  margin: 10px;
  padding-left: 20px;
}

.modx-browser-pathbbar {

  /* yeah, don't blame me that the toolbar is a table */
  table,
  tbody,
  tr,
  td {
    display: block;
  }

  .x-toolbar-left {

    .x-toolbar-left-row {

      /* we need 4 classes to override the !important height of extjs default theme */
      td.x-toolbar-cell {
        position: relative;

        &:before {
          @extend %pseudo-font;

          content: fa-content($fa-var-clipboard);
          font-size: 14px;
          opacity: .6;
          filter: alpha(opacity=60); /* for IE <= 8 */
          position: absolute;
          top: 50%;
          left: 0;
          text-align: center;
          width: 30px;
        }
      }

      .modx-browser-filepath {
        background: transparent;
        box-sizing: border-box;
        border-radius: 0;
        border: 0;
        border-top: 1px solid $lightGray;
        margin: 0 !important;
        padding-left: 30px; /* for the icon */
        width: 100%;
        height: 32px !important;
      }
    }
  }
}

.modx-browser-details-ct {
  background: $white;
  border-radius: $borderRadius;

  .x-window &,
  .modx-browser-rte & {
    border-left: 1px solid $borderColor;
    border-radius: 0;
    box-shadow: none;
  }
}

.modx-browser-detail-thumb {
  color: $black;
  cursor: default;
  padding: 5px;
  position: relative;

  &.preview {
    cursor: pointer;

    &:before {
      @extend %pseudo-font;

      content: fa-content($fa-var-search);
      font-size: 56px;
      margin-top: -28px; /* half of the height to center vertically with top 50% */
      opacity: 0;
      filter: alpha(opacity=0); /* for IE <= 8 */
      position: absolute;
      top: 50%;
      left: 0;
      text-align: center;
      width: 100%;
      text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
      transition: opacity .25s;
    }

    &:hover:before {
      opacity: .6;
      filter: alpha(opacity=60); /* for IE <= 8 */
    }
  }

  img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    background-color: $silver;
    background-image: url($imgPath + 'modx-theme/transparency-pattern.png');
  }
}

.modx-browser-details-info {
  border-top: 1px solid $borderColor;
  font: $fontSmall;
  padding: 15px;
  text-align: left;

  b {
    color: $darkestGray;
    display: block;
    margin-bottom: 2px;
  }

  span {
    display: block;
    margin-bottom: 10px;
  }
}

.modx-browser-fullview {
  text-align: center;

  img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    background-color: $silver;
    background-image: url($imgPath + 'modx-theme/transparency-pattern.png');
  }
}

@include grid-media($desktop) {
  .modx-browser {
    top: 15px !important;
    max-height: 100% !important;
    overflow-y: scroll;
  }

  .modx-browser-panel {
    width: 100% !important;
    min-height: 700px;
    margin: 15px 0 !important;
    background-color: $white !important;
  }

  .modx-browser-tree, .modx-browser-view-ct {
    width: 35% !important;
    max-width: 35% !important;
    padding: 0 5px;
    display: inline-block !important;
    position: relative !important;
    float: left;
    left: 0 !important;
  }

  .modx-browser-details-ct {
    width: 20% !important;
    max-width: 20% !important;
    padding: 0 5px;
    display: inline-block !important;
    position: relative !important;
    float: left;
    left: 0 !important;
  }

  .modx-browser-tree *, .modx-browser-view-ct *, .modx-browser-details-ct * {
    font-size: 12px !important;
  }

  .modx-browser-tree input, .modx-browser-view-ct input, .modx-browser-details-ct input {
    padding: 5px !important;
  }

  .modx-browser-tree .x-toolbar-ct tbody tr td {
    display: table-cell;
  }

  .modx-browser .x-panel-tbar-noheader, .modx-browser .x-toolbar, .modx-browser-view-ct .x-panel-tbar-noheader, .modx-browser-view-ct .x-panel-tbar, .modx-browser-view-ct .x-panel-tbar .x-toolbar, .modx-browser-view-ct .x-panel-body {
    width: 100% !important;
  }

  .modx-browser-view-ct .x-panel-tbar .x-toolbar-cell label {
    line-height: 2.2;
  }

  .modx-browser-thumb-wrap {
    width: 24%;
    margin: 5px;
    padding: 5px;
  }

  .modx-browser-thumb {
    max-width: 100%;
    height: 25px;
    line-height: 25px;
    overflow: hidden;
    padding: 0;
  }

  .modx-browser-thumb img {
    max-width: 100%;
  }

  .modx-browser-placeholder {
    height: 50px;
  }

  .modx-browser-details-info {
    padding: 5px;
  }
}