// maximum supported file structure nesting level
$max-nesting-level: 14;

.specs {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;

  .empty-well code {
    display: block;
    line-height: 1.8;
    margin-top: 5px;
  }

  header {
    height: 42px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
  }

  .search {
    padding: 8px 5px 7px 15px;
    margin-right: 15px;
    display: inline-block;
    position: relative;
    width: calc(100% - 160px);

    label {
      position: absolute;
      left: 22px;
      top: 47%;
      max-width: 100%;
      color: #757575;
      transform: translate(0, -50%);
    }

    .clear-filter {
      color: #b3b3b3;
      display: none;
      position: absolute;
      right: 10px;
      text-decoration: none;
      top: 50%;
      transform: translate(0, -50%);
    }

    &.show-clear-filter .clear-filter {
      display: block;
    }

    .filter {
      padding-left: 30px;
      padding-right: 25px;
      border-radius: 0;
      border: 0;
      border-bottom: 2px solid transparent;
      width: 100%;
      height: 26px;
      line-height: 30px;
      background-color: #f5f5f5;
      transition: border-color 0.25s ease;

      &:focus {
        outline: none;
        border-bottom: 2px solid #ddd;
        box-shadow: none;
        background-color: #f5f5f5;
      }
    }
  }

  .all-tests {
    margin-left: auto;
    font-size: 13px;
    color: #637eb9;

    &:hover, &:focus {
      color: #38589c;
      text-decoration: none;
    }

    &.active {
      pointer-events: none;
      color: #4c4e63;
      text-decoration: none;

      &:hover {
        pointer-events: none;
        color: #4c4e63;
        text-decoration: none;
      }
    }

    &:disabled {
      cursor: not-allowed;
      color: #ddd;
    }

    i {
      font-size: 8px;
      position: relative;
      top: -1px;
    }
  }

  table tr:first-child td {
    border-top: 0;
  }

  .specs-list {
    @include list-columns(100%);
    margin-bottom: 0;
    overflow: auto;
  }

  .file, .folder {
    .file-name,
    .folder-name {
      display: flex;
      align-items: center;

      i {
        font-size: 12px;
        margin-right: 5px;
        flex-shrink: 0;
      }
    }

    @for $i from 0 through $max-nesting-level {
      &.level-#{$i} {
        .file-name,
        .folder-name {
          padding-left: 20px * $i;
        }
      }
    }
  }

  .folder {
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: #636363;
    font-family: $font-sans;

    &.level-0 {
      >div>.folder-name {
        padding: 5px 10px 5px 20px;
        background-color: #F9F9F9;
        font-weight: normal;
        text-transform: uppercase;
        border-bottom: 1px solid #eee;
        border-top: 1px solid #eee;
        color: #777;
        line-height: 18px;
        font-family: $font-sans;
        display: flex;
        flex-direction: row;

        i {
          font-size: 14px;
          margin-right: 0;
        }

        .all-tests {
          i {
            font-size: 8px;
          }
        }

        span {
          font-size: 10px;
          margin-left: 10px;
        }
      }
    }
  }

  .file {
    border-bottom: 1px dotted #eeeeee;
    display: flex;

    &.active {
      pointer-events: none;
      background-color: #F5FBF7;

      > .file-name-wrapper {
        color: #4c4e63 !important;
        text-decoration: none;
      }
    }

    &:hover, &:focus {
      background-color: #f8f8f8;
      cursor: pointer;

      > .file-open-in-ide {
        display: flex;
      }
    }

    > .file-name-wrapper {
      color: #637eb9;
      flex-grow: 1;
      font-family: $font-sans;
      font-size: 15px;
      font-weight: 400;
      padding: 4px 0;

      &:hover, &:focus {
        color: #38589c;
        text-decoration: none;
      }
    }

    > .file-open-in-ide {
      align-items: center;
      color: #727474;
      display: none;
      font-family: $font-sans;
      font-size: 13px;
      font-weight: 400;
      padding: 4px 10px;

      &:hover {
        background-color: rgba(186, 186, 186, 0.2);
        text-decoration: none;
      }
    }
  }

  .list-as-table>.file {
    &>div:first-child {
      @include responsive-width(75%);
    }

    &>div:last-child {
      @include responsive-width(25%);
      text-align: right;
      color: #bdc0c5;
    }
  }
}

// overwrite file opener styles
[data-reach-dialog-content] {
  font-size: 1em;
  padding-top: 1em;

  h1 {
    font-size: 1.75em;
  }
}
