/* ══════════════════════════════════════════════
   SPEAKING CSS
   ══════════════════════════════════════════════ */
#speakingSection { display: none; max-width: 1000px; margin: 0 auto; }
#speakingSection.active { display: block; }

/* YouGlish Shadowing — reuses the .spk-* button and score styles */
#youglishShadowSection { display: none; max-width: 860px; margin: 0 auto; }
#youglishShadowSection.active { display: block; }
.ygs-search { display: flex; gap: 8px; margin-bottom: 8px; }
.ygs-search input { flex: 1; padding: 10px 12px; font-size: 1em; border: 1px solid var(--border-strong); border-radius: 8px; }
.ygs-status { min-height: 1.3em; font-size: 0.88em; color: var(--muted); margin-bottom: 10px; }
.ygs-status.error { color: #dc2626; }
.ygs-widget { margin-bottom: 16px; }
.ygs-target-label { font-size: 0.8em; font-weight: 700; color: var(--text-2); text-transform: uppercase; margin-bottom: 4px; }
.ygs-target { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 1.05em; border: 1px solid var(--border-strong); border-radius: 8px; resize: vertical; }
.ygs-ipa { font-family: monospace; color: var(--success-text); margin: 6px 0 16px; min-height: 1.2em; }
.ygs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.ygs-saved { margin-top: 28px; }
.ygs-link-title { font-weight: 700; color: var(--text); margin-bottom: 8px; }
.ygs-link-sentences { max-height: 260px; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--border); }
.ygs-link-sentence { display: flex; gap: 10px; width: 100%; text-align: left; font-weight: 400; border: none; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 8px 6px; }
.ygs-link-sentence span { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.ygs-link-sentence.active { background: var(--primary-soft); color: var(--primary-text); }
.ygs-saved h2 { font-size: 1.1em; margin: 0 0 10px; }
.ygs-clip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.ygs-clip-body { flex: 1; min-width: 0; }
.ygs-clip-query { font-weight: 700; color: var(--text); }
.ygs-clip-caption { font-size: 0.88em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ygs-clip button, .ygs-clip a { flex-shrink: 0; padding: 6px 10px; font-size: 0.85em; border-radius: 8px; }

/* Layout for Practice Mode */
.spk-practice-layout {
  display: flex; gap: 24px; flex-wrap: wrap; margin-top: 10px;
}
.spk-main-panel {
  flex: 2; min-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px; display: flex; flex-direction: column;
}
.spk-sidebar-panel {
  flex: 1; min-width: 250px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; max-height: 700px; overflow-y: auto;
}

/* Progress Header */
.spk-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; font-weight: 600; color: var(--text);
}
.spk-progress-bar-bg {
  width: 120px; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden;
}
.spk-progress-bar-fill {
  height: 100%; background: #059669; width: 0%; transition: width 0.3s ease;
}

/* Main Sentence Display */
.spk-sentence-display {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 150px; max-height: 400px; overflow-y: auto;
  margin-bottom: 30px; border: 1px solid var(--border);
  border-radius: 12px; padding: 30px; text-align: left;
}
.spk-sentence-text {
  font-size: 1.8em; font-weight: 700; color: var(--text); line-height: 1.4;
}

/* Controls */
.spk-controls {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 24px;
}
.spk-btn {
  padding: 10px 20px; border-radius: 20px; font-weight: 600; font-size: 0.95em;
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.2s;
  border: 1px solid transparent;
}
.spk-btn-listen { background: #0f766e; color: white; }
.spk-btn-listen:hover { background: #0d9488; }

.spk-btn-record { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.spk-btn-record:hover { background: var(--surface-2); border-color: var(--border-strong); }
.spk-btn-record.recording { background: var(--danger-soft); border-color: #ef4444; color: #dc2626; animation: spk-pulse 1.5s infinite; }

@keyframes spk-pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }

.spk-btn-playback { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.spk-btn-playback.ready { background: var(--surface); border-color: var(--border); color: var(--text-2); cursor: pointer; }
.spk-btn-playback.ready:hover { background: var(--surface-2); }

.spk-btn-score { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; opacity: 0.6; }
.spk-btn-score.ready { background: var(--warn-soft); border: 1px solid var(--warn-border); color: var(--warn-text); cursor: pointer; opacity: 1; }
.spk-btn-score.ready:hover { background: var(--warn-soft); }
.spk-btn-score.scoring { background: var(--warn-soft); color: var(--warn-text); cursor: wait; opacity: 1; }

/* Score Panel */
.spk-score-panel {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 24px; animation: spk-fadein 0.3s ease;
}
@keyframes spk-fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spk-score-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.spk-score-circle {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.1em; font-weight: 800; flex-shrink: 0;
  border: 3px solid currentColor;
}
.spk-score-circle.high { color: #059669; background: var(--success-soft); border-color: #059669; }
.spk-score-circle.mid  { color: #d97706; background: var(--warn-soft); border-color: #d97706; }
.spk-score-circle.low  { color: #dc2626; background: var(--danger-soft); border-color: #dc2626; }
.spk-score-title { font-size: 1.1em; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.spk-score-subtitle { font-size: 0.85em; color: var(--muted); }
.spk-score-words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.spk-score-word {
  padding: 4px 10px; border-radius: 20px; font-size: 0.88em; font-weight: 600;
}
.spk-score-word.correct { background: var(--success-soft); color: var(--success-text); }
.spk-score-word.wrong   { background: var(--danger-soft); color: var(--danger-text); }
.spk-score-word.missing { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.spk-score-transcript { font-size: 0.82em; color: var(--muted); font-style: italic; }
.spk-score-transcript-label { font-weight: 600; color: var(--text-2); font-style: normal; margin-right: 4px; }

/* IPA Box */
.spk-ipa-box {
  background: var(--success-soft); border: 1px solid var(--success-border); border-radius: 12px;
  padding: 20px; text-align: center; margin-bottom: 30px;
}
.spk-ipa-label { font-size: 0.8em; font-weight: 700; color: var(--success-text); margin-bottom: 8px; text-transform: uppercase; }
.spk-ipa-text { font-family: monospace; font-size: 1.1em; color: var(--success-text); }

/* Bottom Nav */
.spk-bottom-nav {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); padding-top: 20px; margin-top: auto;
}
.spk-nav-btn {
  background: transparent; border: none; color: var(--muted); font-weight: 600;
  cursor: pointer; padding: 8px; transition: color 0.2s;
}
.spk-nav-btn:hover { color: var(--text); }
.spk-nav-btn.primary { color: #0f766e; }
.spk-nav-btn.primary:hover { color: #0d9488; }
.spk-nav-btn:disabled { color: var(--muted); cursor: not-allowed; }

/* Sidebar Timeline */
.spk-sidebar-title { font-size: 1.2em; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.spk-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.spk-timeline::before {
  content: ''; position: absolute; left: 11px; top: 10px; bottom: 10px;
  width: 2px; background: var(--surface-3); z-index: 1;
}
.spk-step {
  display: flex; gap: 16px; padding: 12px 0; cursor: pointer; position: relative; z-index: 2;
  opacity: 0.6; transition: opacity 0.2s;
}
.spk-step:hover { opacity: 0.8; }
.spk-step.active { opacity: 1; }

.spk-step-circle {
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--border-strong); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.spk-step.active .spk-step-circle { border-color: #0f766e; border-width: 4px; }
.spk-step.done .spk-step-circle { background: #0f766e; border-color: #0f766e; }

.spk-step-content {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 12px; margin-top: -8px; flex: 1; transition: all 0.2s;
}
.spk-step.active .spk-step-content { background: var(--surface-2); border-color: var(--border); }

.spk-step-text { font-size: 0.9em; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.spk-step-time { font-size: 0.75em; color: var(--muted); display: flex; align-items: center; gap: 4px; }
