﻿/* DOCUMENTATION
.recorder--audio : component for audio recorder
.recorder--video : component for video recorder

.recorder--viewer : only for .recorder--video, show the video
.recorder--timer : show timer

.recorder--controls : control bar
    .recorder--control : define style on button for control bar
        &.start
        &.suspend
        &.redo
        &.play
        &.pause
        &.save
        &.disabled

HTML EXEMPLE
<section class="recorder--video">
    <section class="recorder--viewer">
        <div class=".recorder--timer">00:00</div>
    </section>
    <section class="recorder--controls">
        <button class="recorder-control start"></button>
        <button class="recorder-control suspend"></button>
    </section>
</section>
END DOCUMENTATION */

// RECORDER COMPONENT
.recorder {
  &--activation {
    p {
      text-align: center;
      margin: 10px;
    }
    &__auth {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 300px;
      background-color: $light-grey;
    }
  }
  &--controls {
    display: flex;
    justify-content: space-around;
    margin: 20px 75px 0;
    align-items: flex-end;
  }
  &--control {
    width: 150px;
    height: inherit !important; // remove height on default buttons
    background: none !important;
    text-align: center;
    padding: 10px;
    i {
      display: block;
      margin: auto;
      width: 40px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-radius: 4px;
      border: 1px solid transparent;
    }
    span {
      display: inline-block;
      color: $dark-grey;
      line-height: inherit;
    }
    i.redo::before {
      content: "\e954" !important;
    }
  }
  &--viewer {
    text-align: center;
    margin-top: 10px;
    p {
      margin: 10px 0;
    }
    video {
      width: 100%;
    }
  }
  &--timer {
    display: inline-block;
    font-size: 20px;
    font-weight: bold;
    .rec {
      display: inline-block;
      vertical-align: middle;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background-color: $red;
      margin-right: 5px;
      -webkit-animation: pulsate-fwd 0.75s ease-in-out infinite both;
      animation: pulsate-fwd 0.75s ease-in-out infinite both;
    }
  }
  &--video {
    position: relative;
    .recorder {
      &--timer {
        position: absolute;
        left: 0;
        background-color: rgba(black, 0.5);
        color: white;
        padding: 10px 25px;
        border-radius: 0 0 10px 0;
      }
    }
    select {
      min-width: 240px;
      align-self: center;
    }
  }
  &--audio {
    border: 1px solid $light-grey;
    max-width: 500px;
    margin: 25px auto;
    padding: 25px;
    .recorder--controls {
      margin: 25px 25px 0;
    }
    .recorder--timer.recording i {
      color: $red;
    }
  }
}
@media screen and (max-width: 640px) {
  .recorder {
    &--controls {
      flex-wrap: wrap;
      margin: 10px 0 0 !important;
    }
    &--control {
      width: inherit; // Reinit the width to let the flex calculate on its own
    }
    &--viewer {
      p {
        display: none;
      }
    }
  }
}
