/* =========================================================================
 * Inline tutor button. Idle opacity is user-controlled via a slider in the
 * extension popup (0.05 = very subtle, 1.0 = fully visible). Default 0.2.
 * The value is applied via the --sh-idle-opacity CSS custom property, set
 * on document.documentElement in content.ts on inject and whenever storage
 * changes.
 * ========================================================================= */

:root {
  --sh-idle-opacity: 0.2;
}

.statshelpr-btn-tutor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  margin-left: 4px;
  background: transparent;
  color: #888;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
  opacity: var(--sh-idle-opacity, 0.2);
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

/* Hover reveal — scales with the user's idle preference: half-way between
   idle and full when the parent question is hovered. */
.question_holder:hover .statshelpr-btn-tutor,
.display_question:hover .statshelpr-btn-tutor,
.question-container:hover .statshelpr-btn-tutor,
.QuestionItem:hover .statshelpr-btn-tutor,
.item-body:hover .statshelpr-btn-tutor,
[data-testid="question-container"]:hover .statshelpr-btn-tutor,
[data-testid="quiz-question"]:hover .statshelpr-btn-tutor {
  opacity: calc((var(--sh-idle-opacity, 0.2) + 1) / 2);
}

.statshelpr-btn-tutor:hover:not(:disabled) {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  border-color: rgba(0, 0, 0, 0.3);
}

.statshelpr-btn-tutor.loading {
  opacity: 1;
  cursor: progress;
  background: transparent;
  border-color: transparent;
}

.statshelpr-btn-tutor.success {
  opacity: 1;
  background: #137333;
  color: white;
  border-color: #137333;
  font-size: 9px;
  font-weight: 700;
}

.statshelpr-btn-tutor.error {
  opacity: 1;
  background: #c5221f;
  color: white;
  border-color: #c5221f;
  font-size: 10px;
  font-weight: 700;
}

.statshelpr-btn-tutor:disabled { cursor: progress; }

.statshelpr-tutor-wrap {
  display: inline-block;
}

/* =========================================================================
 * Spinner (inside the loading button)
 * ========================================================================= */

.statshelpr-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-top-color: #555;
  border-radius: 50%;
  animation: statshelpr-spin 0.7s linear infinite;
}

@keyframes statshelpr-spin {
  to { transform: rotate(360deg); }
}

/* =========================================================================
 * Visual marker on the selected answer choice — also subtle. Just a tiny
 * left-border accent on the chosen row; no background flash.
 * ========================================================================= */

.statshelpr-suggested,
.answer.statshelpr-suggested,
.answer_row.statshelpr-suggested {
  position: relative;
  border-left: 2px solid rgba(19, 115, 51, 0.5);
  padding-left: 6px !important;
  transition: border-color 0.2s;
}
