@import "../mixins";
@import "../variables";
@import "../react-jPlayer";

.jp-sleek.jp-jplayer.jp-state-no-volume-support {
  .jp-gui .jp-controls {
    .hideElement(~'.jp-repeat', 400px);
    .hideElement(~'.jp-download', 480px);
    .hideElement(~'.jp-title', 700px);
  }
  &:not(.jp-state-full-screen) .jp-gui .jp-controls {
    .hideElement(~'.jp-poster', 530px);
  }
}

.jp-sleek.jp-state-video:not(.jp-state-no-volume-support) {
  .jp-gui .jp-controls {
    .hideElement(~'.jp-volume-container', 354px);
    .hideElement(~'.jp-repeat', 450px);
    .hideElement(~'.jp-download', 530px);
    .hideElement(~'.jp-title', 700px);
  }
  &:not(.jp-state-full-screen) .jp-gui .jp-controls {
    .hideElement(~'.jp-poster', 530px);
  }
}

.jp-sleek.jp-jplayer.jp-state-audio:not(.jp-state-no-volume-support) {
  .jp-gui .jp-controls {
    .hideElement(~'.jp-full-screen', 400px);
    .hideElement(~'.jp-repeat', 450px);
    .hideElement(~'.jp-download', 530px);
    .hideElement(~'.jp-title', 750px);
  }
  &:not(.jp-state-full-screen) .jp-gui .jp-controls {
    .hideElement(~'.jp-poster', 580px);
  }
}

.jp-sleek {
  font-family:"Source Sans Pro", sans-serif;

  .jp-state-video:not(.jp-state-idle)& .jp-poster,
  .jp-state-video.jp-state-playing& .jp-poster {
    display: none;
  }

  .jp-state-video& .jp-media-container {
    position: relative;

    .jp-poster {
        max-height: 100%;
        max-width: 100%;
    }
  }
  .jp-state-video& .jp-media-container {
    overflow: hidden;
    display: table;
    margin: 0 auto;

    video {
      display: block;
    }
    .jp-poster {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);   
    }
  }
  .jp-gui {
    position: fixed;
    bottom: 0;
    width: 100%;
    height:42px;
    background-color: #e5e5e5;

    :not(.jp-state-full-screen)& {
      z-index: 100;
    }
    
    .jp-state-no-browser-support& {
      height: auto;
      .jp-controls {
        display: none;
      }
    }
    .jp-no-browser-support {
      display: inline-block;
      margin-left: 10px;
      font-size: 14px;
      padding: 4px;
      h4 {
        font-weight: bold;
        font-size: 16px;
        margin-top: 5px;
        margin-bottom: 6px;
      }
    }
    .jp-controls {
      height: inherit;
      position:relative;
      font-size:24px;
      white-space: nowrap;
      display: table;
      border-spacing: 5px 0;
      margin: 0 auto;

      button {
        font-size: inherit;
      }

      .jp-title {
        font-size: 12px;
        font-weight:bold;
        max-width: 230px;
        min-width: 230px;
        text-overflow: ellipsis;
        overflow: hidden;
        display: inline-block;
        vertical-align: middle;
      }

      .jp-state-audio& .jp-title {
        margin-left:10px;
      }
      .jp-state-audio& .jp-poster {
        max-height: 100%;
        height: 100%;
        vertical-align: middle;
      }

      > * {
        vertical-align: middle;
        height: inherit;
        display: table-cell;
      }

      .jp-repeat {
        margin-left: 12px;
        margin-right: 12px;
      }

      .jp-progress {
        background-color:@backgroundColour;
        width:500px;
        min-width: 180px;
        max-width: 500px;
        font-size: 20px;
        position: relative;
        .jp-current-time,
        .jp-duration {
          .time;
        }
        .jp-duration {
          right: 0;
          position: absolute;
        }
        .jp-seek-bar {
          .jp-current-time,
          .jp-duration {
            top: 50%;
            transform: translateY(-50%);
          }
          cursor:pointer;
          height:100%;
          .jp-play-bar {
            background-color:@foregroundColour;
            height:100%;
            position:absolute;
          }
          .jp-buffer-bar {
            height: 100%;
            width: 100%;
            position:absolute;
            display: block;
          }
        }
      }

      .jp-volume-container {
        min-width: 42px;
        position: relative;

        &:hover .jp-volume-slider .jp-volume-bar-container {
          .jp-volume-bar {
            display: block;
            bottom: 10%;
          }
          height: 100px;
          transition-duration: 0.3s;
          outline: solid 1px #cfcfcf;
        }

        .jp-mute {
          height: inherit;
        }

        .jp-state-no-volume-support& {
          display: none;
        }
        
        .jp-volume-slider {
          position: absolute;
          top: 0;
          height: 100%;

          .jp-volume-bar-container {
            background-color: #e5e5e5;
            position: absolute;
            height: 0;
            width: 24px;
            left: 8px;
            bottom: 100%;
            transition-duration: 0.3s;

            .jp-volume-bar {
              background-color:@backgroundColour;
              cursor: pointer;
              border-radius: 1px; 
              display: none;
              transform: translateX(-50%) rotate(180deg);
              width: 8px;
              height: 80px;
              position: absolute;
              bottom: 100%;
              left: 50%;
              .jp-volume-bar-value {
                background-color:@foregroundColour;
                border-radius: inherit; 
              }
            }
          }
        }
      }
    }
  }
}
