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

// Gapfill activity components
// Shared by: typinggapfill (tgapfill), listeninggapfill (lgapfill),
// speakinggapfill (sgapfill), passagegapfill (pgapfill)

// Shared gapfill character inputs
.item-container {
  input.single-character,
  input.single-character-mtext {
    width: 26px;
    margin-left: 2px;
    text-align: center;
    background: rgba(243, 244, 253, 0.61);
    border: 1px solid $primary-border-dark;
    border-radius: 5px;
    padding: 5px 5px;
    font-size: 15px;
    font-weight: 500;
    line-height: 21px;
    letter-spacing: 0;
  }

  input.single-character.ml_gapfill_char_correct {
    background-color: palegreen;
  }

  .single-character-mtext {
    color: $info-text;
    background-color: $info-bg;
    border-color: $info-border;
  }

  .ml_gapfill_char_correct {
    background-color: palegreen;
  }
}

// ============================================
// Listening Gapfill
// ============================================

.lgapfill_listen_cont {
  text-align: center;

  .animatesoundbtn {
    position: relative;
    padding: 20px;
    background: $primary-light;
    width: 80px;
    border-radius: 8px;

    &:hover,
    &:active,
    &:focus {
      background: $primary-light-hover;
    }
  }
}

.minilesson_lgapfill_player_box {
  .lgapfill_prompt {
    position: relative;
    margin-top: 10px;
  }

  .lgapfill_reply {
    margin-top: 10px;
    position: relative;
  }

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

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

  .lgapfill_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;
    }
  }

  .lgapfill_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;
    }
  }

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

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

  .lgapfill_controls {
    margin-top: 5px;
    background-color: $white;
    text-align: center;
    border-radius: 0 0 8px 8px;
    padding-bottom: 36px;
  }

  .lgapfill_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;
  }

  .lgapfill_correct {
    background-color: lightgreen;
  }

  .lgapfill_incorrect {
    background-color: lightpink;
  }

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

  .lgapfill_check_btn {
    &,
    &:hover,
    &:focus,
    &:active {
      width: 96px;
      height: 36px;
      border-radius: 8px;
      background: $primary;
      color: $white;
    }
  }

  .lgapfill_skip_btn {
    &,
    &:hover,
    &:active,
    &:focus {
      background: $white;
      border-color: $primary;
      border-radius: 10px;
      color: $primary;
      margin-left: 10px;
    }
  }

}

// ============================================
// Typing Gapfill
// ============================================

.minilesson_tgapfill_player_box {

  .tgapfill_check_btn {
    &,
    &:hover,
    &:focus,
    &:active {
      width: 96px;
      height: 36px;
      border-radius: 8px;
      background: $primary;
      color: $white;
      border-color: $primary;
    }
  }

  .tgapfill_prompt {
    position: relative;
    margin-top: 10px;
  }

  .tgapfill_reply {
    margin-top: 10px;
    position: relative;
  }

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

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

  .tgapfill_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;
    }
  }

  .tgapfill_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;
    }
  }

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

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

  .tgapfill_controls {
    margin-top: 5px;
    background-color: $white;
    text-align: center;
    border-radius: 0 0 8px 8px;
    padding-bottom: 36px;
  }

  .tgapfill_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;
  }

  .tgapfill_correct {
    background-color: lightgreen;
  }

  .tgapfill_incorrect {
    background-color: lightpink;
  }

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

  .tgapfill_skip_btn {
    &,
    &:hover,
    &:active,
    &:focus {
      background: $white;
      border-color: $primary;
      border-radius: 10px;
      color: $primary;
      margin-left: 10px;
    }
  }

}

// ============================================
// Speaking Gapfill
// ============================================

.sgapfill_listen_cont {
  text-align: center;
}

.minilesson_sgapfill_player_box {

  .form-input-phrase-online {
    position: relative;
    top: -6px;
  }

  .sgapfill_prompt {
    position: relative;
    margin-top: 10px;
  }

  .sgapfill_reply {
    margin-top: 10px;
    position: relative;
  }

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

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

  .sgapfill_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;
    }
  }

  .sgapfill_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;
    }
  }

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

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

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

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

  .sgapfill_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;
  }

  .sgapfill_missing_input.ml_gapfill_char_correct {
    background-color: palegreen;
  }

  .sgapfill_correct {
    background-color: lightgreen;
  }

  .sgapfill_incorrect {
    background-color: lightpink;
  }

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

  .sgapfill_skip_btn {
    &,
    &: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;
    }
  }

  .sgapfill_missing_inputmtext,
  .sgapfill_missing_input {
    padding: 9px;
    border-bottom: 2px solid $primary-border-dark;
    margin: 3px;
  }

}

// ============================================
// Passage Gapfill
// ============================================

.pgapfill_gap_wrapper {
  display: inline-block;
  vertical-align: middle;

  .character-input {
    display: inline-block;
    line-height: initial !important;
    height: auto;
    padding: 6px 4px;
    border: 1px inset $gapfill-input-border;
  }

  &.psg_gapfill_correct .pgapfill_gap_input {
    background-color: lightgreen !important;
  }

  &.pgapfill_gap_reviewing .pgapfill_gap_input {
    background-color: lightgray;
  }

  &.psg_gapfill_correct .correctIcon {
    color: $green;
  }

  &.psg_gapfill_wrong .wrongIcon {
    color: $red;
  }

  &:not(.psg_gapfill_wrong) .wrongIcon,
  &:not(.psg_gapfill_correct) .correctIcon {
    display: none;
  }
}

.pgapfill_passage {
  line-height: 2.0;
}

.pgapfull_monospace {
  font-family: "Roboto Mono", monospace;
  font-size: 1.2rem;

  .fa {
    font-size: 1rem;
  }
}

.minilesson_pgapfill_box {
  .pgapfill_controls {
    position: relative;
    margin-top: 10px;
    height: 35px;
    background-color: $white;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .pgapfill_hint_btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);

    &,
    &:hover,
    &:active,
    &:focus {
      background: $white;
      border-color: $primary;
      border-radius: 10px;
      color: $primary;
      margin-left: 10px;
    }
  }

  .pgapfill_finish_btn {
    &,
    &:hover,
    &:focus,
    &:active {
      width: 96px;
      height: 36px;
      border-radius: 8px;
      background: $primary;
      color: $white;
    }
  }
}

// ============================================
// Responsive
// ============================================

@media (max-width: 480px) {
  .sgapfill_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;
  }
}
