/* =========================================================
   TOEIC POPUP – TTS BUTTON (SCOPED)
   Chỉ áp dụng trong popup chọn voice
========================================================= */

/* ===== Base button ===== */
.mon-tts-scope .tts-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;

  width: 40px;
  height: 40px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  outline: none;
  border-radius: 50%;

  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

/* Icon image */
.mon-tts-scope .tts-btn img {
  width: 28px;
  height: 28px;
  display: block;
  pointer-events: none;
  transition: transform 0.15s ease;
}

/* =========================================================
   HOVER / FOCUS (CẢM GIÁC PRO)
========================================================= */
.mon-tts-scope .tts-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.mon-tts-scope .tts-btn:hover img {
  transform: scale(1.15);
}

/* Mobile / keyboard focus */
.mon-tts-scope .tts-btn:active {
  transform: scale(0.92);
  box-shadow: none;
}

.mon-tts-scope .tts-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.35);
}

/* =========================================================
   STATE: LOADING
========================================================= */
.mon-tts-scope .tts-btn.is-loading {
  pointer-events: none;
}

.mon-tts-scope .tts-btn.is-loading img {
  animation: tts-spin 1s linear infinite;
  opacity: 0.6;
}

/* =========================================================
   STATE: PLAYING
========================================================= */
.mon-tts-scope .tts-btn.is-playing img {
  animation: tts-pulse 0.9s ease-in-out infinite;
}

/* =========================================================
   STATE: DONE
========================================================= */
.mon-tts-scope .tts-btn.is-done img {
  animation: tts-done 0.4s ease-out;
}

.mon-tts-scope .tts-btn.is-loading:hover,
.mon-tts-scope .tts-btn.is-playing:hover {
  background: none;
  box-shadow: none;
}

.mon-tts-scope .tts-btn.is-loading img,
.mon-tts-scope .tts-btn.is-playing img {
  transform: none;
}

/* =========================================================
   KEYFRAMES
========================================================= */
@keyframes tts-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes tts-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes tts-done {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1); }
}
