/* Gap fill player: same look as the multiple choice player (/multi/exercise.php), with typed gaps. */

#mainDiv {
  color: #212529;
}

#mainDiv h1 {
  color: #212529;
  text-align: left;
}

#description {
  margin-bottom: 0;
  color: #212529;
  white-space: pre-line;
}

.q-help {
  margin-top: 4px;
  color: #6c757d;
  font-size: 15px;
  line-height: 1.4;
}

.q-empty {
  color: #6c757d;
}

/* ---------- Sentence cards ---------- */

#gapContainer .q-row {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px 18px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f7f9fb;
}

#gapContainer .q-num {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 3px 10px 0 0;
  border-radius: 50%;
  background: #1875d0;
  color: #fff;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

#gapContainer .q-sentence {
  min-width: 0;
  color: #212529;
  font-family: "Open Sans", sans-serif;
  font-size: 20px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

/* ---------- The gap ---------- */

#gapContainer .gap-input {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  height: 34px;
  min-height: 34px;
  margin: 0 4px;
  padding: 2px 10px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  color: #212529;
  font-family: inherit;
  font-size: 20px;
  line-height: 28px;
  text-align: center;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: none;
}

#gapContainer .gap-input:focus {
  outline: none;
  border-color: #1875d0;
  box-shadow: 0 0 0 3px rgba(24, 117, 208, 0.25);
}

#gapContainer .gap-input.is-correct {
  border-color: #e6f4ec;
  background: #e6f4ec;
  color: #146c3a;
}

#gapContainer .gap-input.is-wrong {
  border-color: #fbe9e9;
  background: #fbe9e9;
  color: #212529;
}

#gapContainer .gap-input.is-shown {
  border-color: #e8f1fb;
  background: #e8f1fb;
  color: #0a345c;
  font-style: italic;
}

#gapContainer .q-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0 6px 0 2px;
  vertical-align: middle;
}

#gapContainer .q-result:empty {
  display: none;
  margin: 0;
}

#gapContainer .q-result svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* ---------- Actions bar ---------- */

#gapActions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px;
  border-top: 1px solid #e9ecef;
  background: #fff;
}

#gapActions .q-check,
#gapActions .q-reset {
  width: auto;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
  box-shadow: none;
}

#gapActions .q-check,
#gapActions .q-check:hover {
  border: 1px solid #135ba2;
  background: #1875d0;
  color: #fff;
}

#gapActions .q-reset,
#gapActions .q-reset:hover {
  border: 1px solid #8aa4be;
  background: #fff;
  color: #0a345c;
}

#gapActions .q-check:focus,
#gapActions .q-reset:focus {
  outline: 3px solid #1875d0;
  outline-offset: 2px;
}

#gapActions [hidden] {
  display: none;
}

#gapActions .q-score {
  margin: 0;
  color: #212529;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 600px) {
  #gapContainer .q-row {
    padding: 12px;
  }

  #gapContainer .q-sentence {
    font-size: 18px;
  }

  #gapContainer .gap-input {
    min-width: 70px !important;
    font-size: 18px;
  }
}
