@use '../../../css/_config/_mixins';
@use '../../../css/_config/_vars';

.wrap {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.scrollableOuter {
  overflow: auto;
  width: 100%;
  height: 100%;
  padding: 0 20px 50px;
  background: var(--color-primary-background);

  :global(.cq-800) & {
    padding: 0 30px 50px;
  }
}

.scrollableInner {
  background: var(--color-primary-background);
}

.measure {
  height: 0;
}

.header,
.entry {
  display: grid;
  align-items: center;
  gap: 13px;
  font-size: 12px;

  :global(.cq-800) & {
    gap: 15px;
  }
}

.header {
  position: sticky;
  top: 90px;
  padding: 0 20px 8px;
  margin: 0 -5px 20px;
  background: var(--color-primary-background);
  z-index: 3;
  font-weight: bold;

  :global(.cq-800) & {
    padding: 0 25px 8px;
  }

  > * {
    border-radius: 2px;
    color: var(--color-opacity-05);

    @include mixins.focus-self-outline;
  }

  &:after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: var(--color-opacity-015);

    .scrollableOuterVirtual & {
      :global(.env-local) & {
        background: var(--color-core);
        opacity: 0.6;
      }
    }
  }
}

.entry {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;

  @include mixins.focus-self-outline;

  :global(.cq-800) & {
    padding: 6px 19px;
  }

  .wrap.wrapNoArtwork &,
  .wrap.wrapAlbumTracks & {
    padding: 10px 14px;

    :global(.cq-800) & {
      padding: 10px 19px;
    }
  }

  &:hover {
    background: var(--color-secondary-card);
    border: 1px solid var(--color-secondary-border);
  }

  a {
    &:hover {
      text-decoration: underline;
    }
  }
}

.sortIcon {
  display: inline-block;
  position: relative;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
}

//
// GROUPS
//

.groupRow {
  padding: 60px 15px 18px;
  font-size: 16px;
  line-height: 16px;
  font-weight: bold;

  :global(.cq-800) & {
    padding: 60px 20px 18px;
  }

  .header + &,
  .measure + & {
    padding-top: 11px;
  }
}

//
// DISCS
//

.discRow {
  display: flex;
  align-items: center;
  padding: 40px 15px 11px;
  opacity: var(--opacity-05);
  font-size: 12px;
  font-weight: bold;

  :global(.cq-800) & {
    padding: 40px 20px 11px;
  }

  .header + &,
  .measure + & {
    padding-top: 11px;
  }
}

.discIcon {
  width: 18px;
  height: 14px;
  padding: 0 2px;
  margin-right: 24px;

  :global(.cq-800) & {
    margin-right: 26px;
  }
}

//
// COLUMNS
//

.colorPrimary {
  color: var(--color-core) !important;
}

.colCenter span {
  display: inline-block;
  min-width: 18px;
  text-align: center;
}

.trackNumber,
.trackNumberPermanent {
  font-weight: bold;
  color: var(--color-opacity-05);
}
.trackNumber {
  .entry:hover & {
    display: none;
  }
}

.playingIcon,
.playingPausedIcon {
  width: 18px;
  height: 16px;
  padding: 0 1px;
  color: var(--color-core);

  .entry:hover & {
    display: none;
  }
}
.playingPausedIcon {
  padding: 3px 4px;
}

.playIcon,
.pauseIcon {
  display: none;
  width: 18px;
  height: 16px;
  padding: 3px 4px;
  // color: var(--color-core);

  .entry:hover & {
    display: block;
  }
}

.thumb {
  overflow: hidden;
  width: 36px;
  height: 36px;
  background: var(--color-opacity-01);
  background-image: vars.$thumbnail;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 3px;

  &.thumbFolder {
    background: var(--color-core);
    background: linear-gradient(to bottom, var(--color-core) 0%, var(--color-primary-background) 400%);
    color: var(--color-primary-background);
  }

  img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.thumbIcon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}

.title {
  .entry.entryPlaying & {
    font-weight: 500;
    color: var(--color-core);
  }
}

.smallText {
  font-size: 11px;
}

.artist,
.album,
.kind,
.country,
.genre,
.totalTracks,
.codec,
.bitrate,
.duration,
.releaseDate,
.addedAt,
.lastPlayed {
  .entry & {
    color: var(--color-opacity-05);
  }

  .entry:hover & {
    color: var(--color-text);
  }
}

// .kind,
// .country,
// .genre {
//   text-transform: capitalize;
// }

.isFavourite,
.userRating {
  .entry & {
    font-size: 0;
    line-height: 0;
    color: var(--color-opacity-04);
  }
  .entry:hover & {
    color: var(--color-text);
  }
}

.codec,
.bitrate,
.duration,
.userRating,
.isFavourite {
  &:last-child {
    text-align: right;
  }
}
