@import 'part:@lyra/base/theme/variables-style';

@keyframes progressGlow {
  0% {
    box-shadow: 0 0 3px var(--progress-bar-bg);
  }

  100% {
    box-shadow: 0 0 15px var(--progress-bar-bg);
  }
}

:root {
  --height: 2.5em;
  --media-width: var(--height);
  --padding: var(--medium-padding);
}

.root {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  user-select: none;
  height: 2.5em;
  position: relative;
  clear: both;
}

.heading {
  min-width: 0; /* making ellipsis work */
  margin-right: var(--small-padding);
  flex-grow: 1;
  overflow: hidden;
}

.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title {
  composes: ellipsis;
  font-size: 1em;
  line-height: var(--height);
  color: inherit;
  font-weight: 400;
  text-transform: none;
  padding: 0;
  margin: 0;
  max-width: 100%;

  @nest .hasSubtitle & {
    line-height: 1.3em;
  }
}

.subtitle {
  composes: ellipsis;
  color: inherit;
  margin: 0;
  padding: 0;
  padding-bottom: 0.25em;
  height: 1em;
  font-size: 0.7em;
  font-weight: 300;
  line-height: 1.5em;
}

.media {
  position: relative;
  background-color: var(--gray-lighter);
  flex-basis: 2.5rem;
  min-width: 2.5rem;
  margin-right: var(--small-padding);
  font-size: 0.5em;
  overflow: hidden;
  border: 1px solid color(var(--gray-lighter) lightness(-3%));
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  @nest .placeholder & {
    width: 2.5rem;
    height: 2.5rem;
  }

  @nest & img {
    display: block;
    width: 2.5rem;
    height: 2.5rem;
  }

  @nest & svg {
    font-size: 1.5rem;
    color: var(--gray);
  }
}

.mediaString {
  composes: absoluteCenter from 'part:@lyra/base/theme/layout/positioning-style';
  padding: 5px;
  font-size: var(--font-size-tiny);
  color: var(--gray);
}

.placeholder {
  composes: root;
  composes: hasSubtitle;

  @nest & .heading {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
  }

  @nest & .title {
    width: 80%;
    color: transparent;
    background-color: var(--preview-placeholder-color);
  }

  @nest & .subtitle {
    width: 40%;
    color: transparent;
    background-color: var(--preview-placeholder-color);
  }

  @nest & .media {
    border-color: transparent;
    color: transparent;
    background-color: var(--preview-placeholder-color);
  }
}

.animation {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: -1;
}

.status {
  vertical-align: middle;
  line-height: 2.5rem;
  margin-left: auto;
  color: var(--gray-darker-transparent);
}

.progress {
  position: absolute;
  background-color: color(var(--progress-bar-bg) a(5%));
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.progressBar {
  height: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: color(var(--progress-bar-bg) a(20%));
  z-index: 1;
}

.progressBar::after {
  position: absolute;
  height: 2px;
  bottom: 0;
  left: 0;
  width: 100%;
  content: '';
  background-color: var(--progress-bar-bg);
  box-shadow: 0 0 3px var(--progress-bar-bg);
  z-index: 2;
}
