.podcast-box-player {
  --podcast-box-player-color: #3a3a3a;

  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-flow: row;
  justify-content: flex-start;
  border-top: 1px solid rgba(#555, .1);

  @media (max-width: 767px) {
    padding: 10px 0;
  }

  &-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex-flow: row;
    justify-content: flex-start;
    width: 35%;

    .podcast-box-player-thumbnail {
      margin-right: 10px;
      width: 100%;
    }

    .podcast-box-player-title {
      padding: 0;
      color: var(--podcast-box-player-color);
      font-weight: bold;
      margin-left: 5px;
      display: block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex: 1;
      margin-bottom: 7px;
    }

    .episode-podcast {
      display: flex;
      align-items: center;

      i{
        width: auto;
        height: auto;
        font-size: 16px;
      }

      &-title {
        color: var(--podcast-box-player-color);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

    }

    .podcast-box-player-episode {
      overflow: hidden;

      a{
        line-height: 1;
      }
    }

    @media (max-width: 991px) {
      width: 100%;
      justify-content: center;
    }

  }

  &-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    &-tools {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      padding: 0 30px;

      & > * {
        margin: 0 5px;
      }

      @media (max-width: 767px) {
        padding: 0;

        .podcast-box-player-prev, .podcast-box-player-next {
          &.hover {
            color: #f6931f;
          }
        }
      }
    }

    @media (max-width: 767px) {
      padding: 0;
    }
  }

  &-title {
    padding: 0 0 15px;
    text-align: left;
  }

  /*---------------- Volume control -----------------*/
  &-volume {
    display: flex;
    position: relative;

    .volume-icon {
      display: flex;

      .dashicons-controls-volumeoff {
        display: none;
      }

      &.muted {
        .dashicons-controls-volumeoff {
          display: block;
        }

        .dashicons-controls-volumeon {
          display: none;
        }
      }
    }

    .volume-bar {
      display: none;
      box-shadow: -2px 2px 5px #555;
      align-items: center;
      flex: 1;
      width: 90px;
      margin-left: 5px;
      position: absolute;
      transform: rotate(-90deg);
      top: -70px;
      left: -35px;
      background: #fff;
      padding: 5px;
      border-radius: 10px;

      &-seek {
        position: absolute;
        width: 91%;
        height: 0;
        background: #DADEE3;
        outline: none;
        appearance: none;

        &::-webkit-slider-thumb {
          width: 17px;
          height: 17px;
          background: #FFFFFF;
          cursor: pointer;
          box-shadow: 1px 1px 3px #555;
          position: relative;
          z-index: 9;
          border: none;
          border-radius: 50%;
          top: 0;
        }

      }

      &-slide {
        left: 0;
        width: 100%;
        pointer-events: none;
      }
    }

    &.active {
      .volume-bar {
        display: flex;
      }
    }

  }


  /*---player toggle---*/
  .podcast-box-player-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 5%;
    margin-left: auto;
    margin-right: 30px;
    @media (max-width: 767px) {
      position: absolute;
      right: 15px;
      margin: 0;
      bottom: 50%;
      transform: translateY(50%);
    }
  }

  @media (max-width: 767px) {
    flex-wrap: wrap;
    flex-flow: column;
    padding: 7px 10px;

    .podcast-box-player-controls {
      width: 100%;
      justify-content: flex-start;
      padding-top: 3px;

      & > .podcast-box-player-url {
        display: block;

        .podcast-box-player-thumbnail {
          max-width: 40px;
          margin-right: 9px;
        }
      }

      &-tools {
        flex: 1;
      }
    }
  }

  /*---icons---*/
  .dashicons {
    width: auto;
    height: auto;
    font-size: 30px;
    transition: all .3s ease;
    cursor: pointer;

    &:hover {
      background: #1ABAFF;
      color: #fff;
      border-radius: 5px;
    }
  }

  /*---player progress---*/
  .podcast-box-player-progress-wrap {
    display: flex;
    align-items: center;

    span {
      color: var(--podcast-box-player-color);
    }

  }

  .podcast-box-player-progress {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0 10px;
    flex: 1;

    &-seek {
      position: absolute;
      width: 100%;
      height: 0;
      outline: none;
      appearance: none;
      z-index: 1;

      &::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        background: #FFFFFF;
        cursor: pointer;
        box-shadow: 1px 1px 3px #555;
        position: relative;
        z-index: 9;
        border: none;
        border-radius: 50%;
        left: -1px;
      }

      &::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #FFFFFF;
        cursor: pointer;
        box-shadow: 1px 1px 3px #555;
        position: relative;
        z-index: 9;
        border: none;
        border-radius: 50%;
        left: -1px;
      }

    }

    &-bar {
      left: 0;
      width: 100%;
      pointer-events: none;
    }

  }

  .mejs-offscreen, .mejs-container {
    display: none !important;
  }

  /*---------------- fullwidth player ------------------*/
  &.full-width {
    --podcast-box-player-color: #fff;

    bottom: 0;
    z-index: 999;
    position: fixed;
    width: 100%;
    background: #212838;

    .podcast-box-player-controls {
      width: 25%;

      @media (max-width: 767px) {
        width: 100%;
      }
    }

    &.collapsed {

      position: absolute;
      display: flex;
      visibility: hidden;

      .podcast-box-player-toggle {
        display: block;
        position: fixed;
        right: -1rem;
        background: inherit;
        bottom: 0;
        padding: 5px 7px;
        margin-right: 15px;
        visibility: visible;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        @media (max-width: 767px) {
          transform: translateY(0);
          bottom: 0;
          padding: 5px 5px 35px;
          top: inherit;
          height: 10px;
          width: auto;
        }

        &:before {
          content: '\f522';
        }

        &:hover {
          border-bottom-left-radius: 0px;
          border-bottom-right-radius: 0px;
        }
      }
    }

    &.init-hide {
      display: none;
    }

    .dashicons {
      color: #fff;
    }

    .podcast-box-player-thumbnail-wrap {
      max-width: 70px;
      max-height: 70px;
      margin-right: 10px;

      @media (max-width: 767px) {
        display: none;
      }
    }

    .podcast-box-player-progress-wrap {
      width: 30%;

      @media (max-width: 767px) {
        width: 90%;
        margin-top: 5px;
      }

    }

    .podcast-box-player-progress {

    }

    @media (max-width: 767px) {
      .episode-podcast {
        display: none;
      }
    }

  }

  /*---------------- shortcode player ------------------*/
  &.shortcode {
    padding-bottom: 20px;
    border: 1px solid;
    border-radius: 5px;
    flex-flow: column;
    width: 100%;
    max-width: 350px;
    margin: auto;

    .podcast-box-player-episode {
      margin: 10px 0 15px 0;
    }

    .podcast-box-player-controls-tools {
      padding: 0;

      & > * {
        margin: 0 3px;
      }
    }

    .podcast-box-player-thumbnail {
      margin: 15px 0 5px;
      width: 120px;
      border-radius: 5px;
    }

    .podcast-box-player-details {
      width: 100%;
      padding: 0 15px;
      display: block;
      text-align: center;
    }

    button {
      font-size: 30px !important;
      color: #212838;

      &.dashicons-controls-play {
        font-size: 35px !important;
      }
    }

    .podcast-box-player-progress-wrap {
      width: 90%;
      margin-top: 10px;
    }

  }

  /*---------------- popup player ------------------*/
  &.popup {
    padding: 0 15px 30px;

    .open-in-parent {
      text-decoration: none;
    }

    .podcast-box-loader, .podcast-box-loader:after{
      width: 15px;
      height: 15px;
    }
  }


  &.hide, &.hidden, &.init-hide {
    display: none !important;
  }

}

.podcast-play-pause {

  .dashicons-controls-pause {
    display: none;
  }

  &.seeking {
    .dashicons-controls-pause, .dashicons-controls-play {
      display: none;
    }

    .podcast-box-loader {
      display: flex;
    }
  }

  &.active {
    .dashicons-controls-pause {
      display: block;
    }
    .dashicons-controls-play {
      display: none;
    }
  }

}

/*--- player loader ---*/
$loader_color: #2D62D3;

.podcast-box-loader {
  position: relative;
  text-indent: -9999em;
  border-top: 5px solid rgba($loader_color, 0.2);
  border-right: 5px solid rgba($loader_color, 0.2);
  border-bottom: 5px solid rgba($loader_color, 0.2);
  border-left: 5px solid $loader_color;
  transform: translateZ(0);
  animation: podcast_player_loader 1.1s infinite linear;
  display: none;
  overflow: hidden;

  &, &:after {
    border-radius: 50%;
    width: 26px;
    height: 26px;
    margin: 0 2px;
  }
}

@-webkit-keyframes podcast_player_loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes podcast_player_loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
