/* ════════════════════════════════════════════════════════
   LISTENING — The English Toolbox   Accent: Orange #F97316
════════════════════════════════════════════════════════ */

/* ── Mode Cards (accent override) ── */
.listening-mode-btns .tense-mode-btn:hover  { border-color: #F97316; }
.listening-mode-btns .tense-mode-btn.active { border-color: #F97316; background: rgba(249,115,22,.08); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }

/* ── Level tabs override ── */
#listening-home .level-tab.active { border-color: #F97316; color: #F97316; }

/* ── Player ── */
.listening-player {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  margin-bottom: 18px;
}

.listening-speakers {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}
.listening-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  opacity: .5;
  transition: opacity .2s, border-color .2s, background .2s;
}
.listening-speaker.active {
  opacity: 1;
  border-color: #F97316;
  background: rgba(249,115,22,.08);
}
.ls-avatar {
  font-size: 1.4rem;
}
.ls-name {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-primary);
}
.ls-name-sub {
  font-size: .72rem;
  color: var(--text-secondary);
}

/* ── Sound wave animation ── */
.sound-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  margin-left: 6px;
}
.sound-wave .bar {
  width: 3px;
  background: #F97316;
  border-radius: 2px;
  animation: soundWave .6s ease-in-out infinite alternate;
}
.sound-wave .bar:nth-child(1) { height: 6px;  animation-delay: 0s; }
.sound-wave .bar:nth-child(2) { height: 14px; animation-delay: .15s; }
.sound-wave .bar:nth-child(3) { height: 8px;  animation-delay: .3s; }

@keyframes soundWave {
  0%   { transform: scaleY(.4); }
  100% { transform: scaleY(1); }
}

.sound-wave-hidden .bar { animation: none; transform: scaleY(.3); opacity: .3; }

/* ── Controls ── */
.listening-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.l-btn-play {
  background: #F97316; color: #fff; border: none;
  border-radius: var(--r-md); padding: 12px 28px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  font-family: var(--font-body); transition: background .15s;
  display: flex; align-items: center; gap: 8px;
}
.l-btn-play:hover:not(:disabled) { background: #EA580C; }
.l-btn-play:disabled { opacity: .5; cursor: not-allowed; }

.l-btn-secondary {
  background: none; color: var(--text-secondary);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 10px 18px; font-weight: 600; font-size: .88rem;
  cursor: pointer; font-family: var(--font-body); transition: border-color .15s, color .15s;
}
.l-btn-secondary:hover { border-color: #F97316; color: #F97316; }

.listening-status {
  text-align: center;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── Questions (reuse reading patterns with orange accent) ── */
.l-question { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.l-q-text   { font-weight: 600; font-size: .9rem; margin-bottom: 10px; color: var(--text-primary); }
.l-q-opts   { display: flex; flex-direction: column; gap: 7px; }
.l-opt {
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; font-size: .86rem;
  transition: border-color .15s, background .15s;
  color: var(--text-primary); text-align: left; background: none; width: 100%;
  font-family: var(--font-body);
}
.l-opt:hover    { border-color: #F97316; background: rgba(249,115,22,.05); }
.l-opt.selected { border-color: #F97316; background: rgba(249,115,22,.08); }
.l-opt.correct  { border-color: #10B981; background: rgba(16,185,129,.1); color: #065F46; }
.l-opt.wrong    { border-color: #EF4444; background: rgba(239,68,68,.08); color: #991B1B; }

.l-explanation {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(249,115,22,.05);
  border-radius: var(--r-sm);
  border-left: 3px solid #F97316;
}

.l-score-box { text-align: center; padding: 24px; background: var(--card-bg); border-radius: var(--r-lg); border: 2px solid var(--border); margin-top: 16px; }
.l-score-num   { font-size: 2.4rem; font-weight: 800; color: #F97316; }
.l-score-label { font-size: .88rem; color: var(--text-secondary); margin-bottom: 14px; }

/* ── Transcript ── */
.listening-transcript {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-top: 14px;
}
.transcript-line {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.transcript-line:last-child { margin-bottom: 0; }
.transcript-name {
  font-weight: 700;
  color: #F97316;
  margin-right: 6px;
}
.transcript-name.speaker-b { color: #0EA5E9; }

/* ── Cloze Test ── */
.cloze-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cloze-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  transition: all .2s;
}
.cloze-dot.active { border-color: #F97316; color: #F97316; background: rgba(249,115,22,.1); }
.cloze-dot.done   { border-color: #10B981; color: #fff; background: #10B981; }

.cloze-sentence {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 16px;
}
.cloze-sent-label {
  font-size: .78rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 12px;
}
.cloze-sent-text {
  font-size: 1.05rem;
  line-height: 2.4;
  color: var(--text-primary);
}

.cloze-input-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.cloze-input {
  border: none;
  border-bottom: 2.5px dashed #F97316;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-align: center;
  padding: 2px 4px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.cloze-input:focus {
  border-color: #EA580C;
  background: rgba(249,115,22,.06);
}
.cloze-input.correct {
  border-style: solid;
  border-color: #10B981;
  color: #065F46;
  background: rgba(16,185,129,.08);
}
.cloze-input.wrong {
  border-style: solid;
  border-color: #EF4444;
  color: #991B1B;
  background: rgba(239,68,68,.06);
}
.cloze-correction {
  font-size: .82rem;
  color: #065F46;
  font-weight: 600;
  font-style: italic;
}

/* ── Connected Speech ── */
.conn-question {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 14px;
}
.conn-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.conn-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conn-pill {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: .92rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  text-align: left;
  transition: border-color .15s, background .15s;
  font-style: italic;
}
.conn-pill:hover:not(:disabled):not(.correct):not(.wrong) {
  border-color: #F97316;
  background: rgba(249,115,22,.04);
}
.conn-pill.selected { border-color: #F97316; background: rgba(249,115,22,.08); }
.conn-pill.correct  { border-color: #10B981; background: rgba(16,185,129,.1); color: #065F46; }
.conn-pill.wrong    { border-color: #EF4444; background: rgba(239,68,68,.08); color: #991B1B; }

.conn-feedback {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.conn-feedback.correct { background: rgba(16,185,129,.08); border: 1px solid #10B981; }
.conn-feedback.wrong   { background: rgba(239,68,68,.06); border: 1px solid #EF4444; }
.conn-feedback-icon { font-size: 1.3rem; flex-shrink: 0; }
.conn-feedback-body { flex: 1; }
.conn-phenomenon {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.conn-explanation {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Actions row ── */
.l-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ── Card left border colors (reuse reading pattern) ── */
.listening-grid .reading-card.level-B1 { border-left-color: #10B981; }
.listening-grid .reading-card.level-B2 { border-left-color: #F59E0B; }
.listening-grid .reading-card.level-C1 { border-left-color: #EF4444; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .listening-speakers { gap: 14px; }
  .listening-speaker { padding: 6px 10px; }
  .listening-controls { flex-direction: column; align-items: center; }
  .l-btn-play { width: 100%; justify-content: center; }
}
