@import '../../../../@theme/styles/themes';
@import 'bootstrap/scss/mixins/breakpoints';
@import '@nebular/theme/styles/global/breakpoints';

@include nb-install-component() {
  height: 100%;

  nb-card {
    box-shadow: none;
    border-width: 0;
    margin: 0;
    height: 100%;
  }

  .body {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .track-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex: 1;
    padding: nb-theme(card-padding);
  }

  .cover {
    border-radius: nb-theme(card-border-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 10rem;
    height: 10rem;
  }

  .details {
    text-align: center;
    padding-top: 1.5rem;

    span {
      color: nb-theme(text-hint-color);
    }
  }

  .progress-wrap {
    position: relative;
    height: 1rem;
  }

  .progress-foreground {
    background-color: nb-theme(color-primary-default);
    height: 2px;
    position: absolute;
    left: 0;
    margin-top: calc(0.75rem - 1px);
    width: 100px;
  }

  .progress {
    appearance: none;
    width: 100%;
    background: transparent;
    height: 1.5rem;
    outline: none;
    position: absolute;

    @include install-thumb() {
      width: 1rem;
      height: 1rem;
      border-radius: 50%;
      background: nb-theme(color-primary-default);
      cursor: pointer;
      margin-top: calc(-0.5rem + 1px);
      border: none;
    }

    @include install-track() {
      width: 100%;
      height: 2px;
      cursor: pointer;
      background: nb-theme(border-basic-color-3);
    }
  }

  .timing {
    padding-top: 0.5rem;
    margin: 0 0.5rem;
    display: flex;
    justify-content: space-between;
    color: nb-theme(text-hint-color);

    .current {
      @include nb-ltr(order, 0);
      @include nb-rtl(order, 1);
    }
    .remaining {
      @include nb-ltr(order, 1);
      @include nb-rtl(order, 0);
    }
  }

  .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    @include nb-rtl(flex-direction, row-reverse);
    padding: 1rem;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
  }

  .control-button {
    color: nb-theme(text-hint-color);

    &.on {
      color: nb-theme(color-primary-default);
    }

    nb-icon {
      font-size: 1.5em;
    }
  }

  .volume {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    position: relative;
    max-width: 400px;

    .progress-wrap {
      height: 2.25rem;
      margin: 0;
      width: 80%;

      .progress-foreground {
        left: auto;
        margin-top: calc(1rem + 1px);
        z-index: 0;
        max-width: 99.5%;
      }

      .progress {
        height: 2.25rem;
        overflow: visible;

        @include install-thumb() {
          width: 1.5rem;
          height: 1.5rem;
          background-color: nb-theme(background-basic-color-1);
          box-shadow: 0 0.125rem 0.5rem 0 nb-theme(border-basic-color-3);
          border: 1px solid nb-theme(border-basic-color-3);
          margin-top: -0.75rem;
          position: relative;
          z-index: 10;
        }
      }
    }
  }

  .volume-icon {
    font-size: 1em;
    color: nb-theme(text-hint-color);
  }

  &.collapsed {
    $player-height: 4.5rem;

    border: none;
    height: $player-height;

    .header {
      display: none;
    }

    .body {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 0;
      overflow: visible;
    }

    .footer {
      display: none;
    }

    .track-info {
      height: $player-height;
      flex-direction: row;
      padding: 0;
      flex: none;

      .cover {
        height: $player-height;
        width: $player-height;
        flex: none;
      }

      .details {
        margin-left: 0.875rem;
        text-align: left;
        padding: 0;

        h4 {
          margin-bottom: 0.125rem;
        }
      }
    }

    .progress-wrap {
      width: calc(100% - 6rem);
      align-self: flex-start;
      position: absolute;
      left: 0;
      margin-top: calc(-0.75rem + 1px);
      margin-left: calc(#{$player-height} + 0.75rem);
    }

    .timing {
      display: none;
    }

    .controls {
      padding: 0 1rem 0 0;
      max-width: inherit;
      width: inherit;
      margin: 0;

      button {
        display: none;
      }
      .play-button,
      .skip-forward-button {
        display: block;
        font-size: 1.3rem;
      }

      @include media-breakpoint-down(is) {
        .play-button,
        .skip-forward-button {
          padding: 0.5rem;
        }
      }

      @include media-breakpoint-down(xs) {
        .skip-forward-button {
          display: none;
        }
      }
    }

    .volume {
      display: none;
    }

    .track-info .details {
      @include media-breakpoint-down(is) {
        span {
          display: inline-block;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }
  }

  @include media-breakpoint-between(lg, lg) {
    .controls {
      padding: 0.5rem;
    }

    .control-button.size-medium {
      padding: nb-theme(button-ghost-small-padding);
    }
  }
}
