@use '../../abstracts/variables' as *;

// -----------------------------------------------------------------------------
// Fluency: pronunciation/speaking assessment activity
// Template: templates/fluency.mustache
// -----------------------------------------------------------------------------

.minilesson_fluency_box {

  .startmodule_image_container {
    background: $fluency-icon-bg;
  }

  .item-feedback-container:empty {
    height: 0;
    margin-bottom: 0px;
  }

  .item-feedback-container {
    display: flex;
    background-color: $white;
    height: 50px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 1.1rem;
    padding: 2px;
    margin-bottom: 50px;
  }

  .item-results-container {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 1.1rem;
    padding: 2px;

    .fa-star {
      color: gold;
      font-size: 1.5em;
    }

    .fa-star-o {
      color: $gray;
      font-size: 1.5em;
    }
  }

  .form-container {
    margin: 20px auto 22px;
    min-height: 50px;
  }

  .item-results {
    align-self: center;
    width: 80%;
    margin: auto;
    border: 1px solid $grey-500;
    background-color: $white;
    border-radius: 10px;
    padding: 6px;
    font-style: italic;
  }

  .fluency_prompt {
    position: relative;
    margin-top: 10px;
    font-size: 1.3em;
    color: $text;
  }

  .fluency_reply {
    margin-top: 10px;
    position: relative;

    .fluency_prompt_hint {
      font-size: 1.3em;
      color: $text;

      &.rtl {
        direction: rtl;
      }

    }
  }

  .fluency_game {
    min-height: 250px;
    padding: 10px;
    border-top: 1px solid darkgray;
    border-bottom: 1px solid darkgray;
    background-color: $bubble-blue;
  }

  .fluency_speech {
    position: relative;
    font-family: arial;
    font-size: 16px;
    background: $error-bubble;
    color: $black;
    border-radius: 10px;
    padding: 20px;
  }

  .fluency_right {
    background-color: $white;

    &:after {
      content: '';
      border: 20px solid transparent;
      border-left-color: $white;
      border-right: 0;
      position: absolute;
      right: -20px;
      top: 50%;
      margin-top: -20px;
    }
  }

  .fluency_teacher_left {
    background-color: $bubble-green;

    &:after {
      content: '';
      border: 20px solid transparent;
      border-right-color: $bubble-green;
      border-left: 0;
      position: absolute;
      left: -20px;
      top: 50%;
      margin-top: -20px;
    }
  }

  .fluency_speech-icon-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    font-size: 50px !important;
    height: 50px;
  }

  .fluency_speech-icon-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    font-size: 50px !important;
    height: 50px;
  }

  .fluency_controls {
    margin-top: 5px;
    background-color: $white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  .fluency_speakbtncontainer {
    height: 75px;
    text-align: center;
    display: none;
  }

  .fluency_results {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 75px;
    background-color: $bubble-blue;
    font-weight: bold;
    color: $white;
    text-align: center;
    z-index: 999;
  }

  .fluency_correct {
    background-color: lightgreen;
  }

  .fluency_incorrect {
    background-color: lightpink;
  }

  .fluency_targetWord {
    padding: 3px;
    border-radius: 5px;
    margin: 5px;
  }

  .fluency_skip_btn {
    border: 1px;
    border-style: solid;
    border-color: $primary;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    margin: auto;
    background-color: $white;
    color: $primary;

    &:hover,
    &:active,
    &:focus {
      border: 1px;
      border-style: solid;
      border-color: $primary;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 500;
      margin: auto;
      background-color: $white;
      color: $primary;
    }
  }
}

// Elements outside fluency_box
.fluency_listen_cont {
  text-align: center;

  .fluency_listen_btn {
    background: $primary;
    border-radius: 8px;
    border: 1.5px solid $white;
    color: $white;
    border-color: $primary;
    box-shadow: $main-shadow;
    outline: 0;

    &:hover,
    &:active,
    &:focus {
      background: $primary;
      border-radius: 8px;
      border: 1.5px solid $white;
      color: $white;
      border-color: $primary;
      box-shadow: $main-shadow;
      outline: 0;
    }
  }
}

.btn.fluency_listen_btn.audioself {
  color: $white;
}

// Word/letter results
div.fluencywordresult {
  flex-wrap: nowrap;
  gap: 3px;
  margin: 5px;
}

span.fluencyletterresult {
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid transparent;
  background-color: $grey-50;
  cursor: default;

  &.letter_missing {
    background-color: $warning-bg;
    color: $gray;
  }

  &.letter_fair {
    background-color: $warning-bg;
    color: $warning-text;
  }

  &.letter_good {
    background-color: $success-bg-lightest;
    color: $success-dark;
  }

  &.letter_wrong {
    background-color: $fluency-error-bg;
    color: $error-bright;
  }
}

// Phonemes bar
.ml_fluencyphonemesbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 10px;
  margin-top: 5px;
  background-color: $grey-200;
  border-radius: 5px;

  span {
    flex-grow: 1;
    height: 100%;
  }
}

span.fluencyphoneme {

  &.letter_missing {
    background-color: $gray;
  }

  &.letter_fair {
    background-color: $orange;
  }

  &.letter_good {
    background-color: $green;
  }

  &.letter_wrong {
    background-color: $red;
  }
}

// Star rating
.fluency_star_rating {
  background: $white;
  border: 1px solid $primary-border;
  border-radius: 40px;
  padding: 10px;
  letter-spacing: 10px;
}

// Mobileaccesshide (deep nested variant)
.fluencyaudiobox .minilesson_fluency_box .fluency_mainstage .fluency_controls .fluency_skip_btn .mobileaccesshide {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

// Responsive
@media (max-width: 480px) {
  .fluency_skip_btn .mobileaccesshide {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}