:root {
  --mb-8: 8px;
  --primary-hover: hsl(207, 73%, 65%);

  /* --primary: hsl(207, 73%, 57%);
  --primary: hsl(202, 85%, 61%);
  --primary-hover: hsl(207, 73%, 65%);
  --secondary: hsl(235, 71%, 65%);
  --accent: hsl(0, 64%, 55%);
  --accent-light: hsl(0, 69%, 67%); */
  --accent-light: hsl(0, 60%, 60%);

  --gray-50: hsl(210, 40%, 98%);
  --gray-100: hsl(210, 40%, 96%);
  --gray-200: hsl(214, 32%, 91%);
  --gray-300: hsl(213, 27%, 84%);
  --gray-400: hsl(215, 20%, 65%);
  --gray-500: hsl(215, 16%, 47%);
  --gray-600: hsl(215, 19%, 35%);
  --gray-700: hsl(215, 25%, 27%);
  --gray-800: hsl(217, 33%, 17%);
  --gray-900: hsl(222, 84%, 5%);

  --white: hsl(0, 0%, 100%);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}
#nihonez-primary {
  background-color: var(--accent-bg);
}
.one-col-page-container {
  min-height: 95vh;
}

.header {
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 16px;
  color: var(--text-dark);
}

.lesson-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(
    135deg,
    var(--primary-1) 0%,
    var(--tertiary-dark) 100%
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
}
.title {
  color: var(--text-dark);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-medium);
  font-weight: 500;
}

.dictation-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  justify-content: space-around;
  gap: 2rem;
}

.exercise-section {
  width: 68%;
  background-color: var(--background);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 80vh;
  gap: 0.5rem;
}

.transcript-section {
  /* width: 30%; */
  flex: 1;
  background-color: var(--background);
}

/* Mode Selection */
.mode-select {
  margin-left: auto;
}

.mode-select select {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--card);
  font-size: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
  color: var(--text-medium);
}

.mode-select select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Score Display */
.score-display {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 0.75rem;
}

.score-item {
  flex: 1;
  padding: 8px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--card);
  border: none;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

.score-item.correct {
  /* border-color: var(--secondary-2);
  color: var(--secondary-2);
  box-shadow: 0 0 0 1px var(--secondary); */
}
.progress-navigation {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
}
.progress-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-dark);
  padding: 0;
}
.progress-nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f9ff;
  color: var(--text-dark);
}

.progress-nav-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  background: var(--background);
  color: var(--text-dark);
}
.progress-nav-btn:disabled:hover {
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.score-item.correct .stat-value {
  color: var(--secondary-2);
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-medium);
  font-weight: 700;
}

/* Audio Section */
.audio-section {
  padding: 1rem 0;
  /* border: 1px solid var(--gray-200);
  border-radius: 12px; */
}

/* Input Section */
/* Word mode specific styling */
.input-section {
  margin-top: auto;
}
#sentence-display {
  display: none;
}
#sentence-display.shadowing-sentence-display {
  display: block;
}

.word-mode-active #sentence-display {
  display: block;
}
.word-mode-active #user-input {
  height: 50px;
}

/* Context display */
.context-display {
  /* margin: 16px 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center; */
  margin: 0.5rem 0 0.5rem 0;
}

.context-content {
  display: flex;
  /* justify-content: center; */
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.context-description {
  /* background: var(--accent-bg); */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-icon {
  font-size: 16px;
  opacity: 0.7;
}
.context-text {
  color: #64748b;
  font-style: italic;
  font-size: 12px;
  font-weight: 400;
}

.number-label {
  background: var(--primary-dark);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.speaker-label {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 16px;
}

/* Sentence */

.sentence-display {
  font-size: 20px;
  line-height: 1.6;
  text-align: center;
  color: var(--text-dark);
  font-weight: 500;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  font-family: "Hiragino Kaku Gothic Pro", "MS Gothic", "Yu Gothic", "YuGothic",
    sans-serif;
  font-weight: 500;
}

.missing-word {
  display: inline-block;
  min-width: 100px;
  padding: 8px 16px;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  background: var(--accent-bg);
  margin: 0 8px;
  font-weight: 600;
}

.missing-word.filled {
  border-style: solid;
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.missing-word.correct {
  border: 2px solid #22c55e !important;
  background: #22c55e !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3) !important;
}
.missing-word-container {
  position: relative;
  display: inline-block;
}

.missing-word-count {
  position: absolute;
  top: -4px;
  right: 0px;
  background: var(--primary-dark);
  color: white;
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

#user-input {
  font-family: "Hiragino Kaku Gothic Pro", "MS Gothic", "Yu Gothic", "YuGothic",
    sans-serif;
  width: 100%;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--card);
  transition: all 0.2s ease;
  resize: vertical;
  min-height: 2.5rem;
  max-height: 4rem;
  resize: none;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-medium);
}

#user-input::placeholder {
  color: #9ca3af;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  opacity: 0.8;
  font-size: 14px;
}

#user-input:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Word mode styling */
#user-input.word-mode {
  text-align: center;
  font-size: 1.25rem;
  height: 2rem;
  /* max-height: 2rem; */
  border-radius: 25px;
}

#user-input.has-warning {
  border-color: #f59e0b;
  background-color: #fef3c7;
}

/* Add these to your CSS file */
#user-input.correct {
  border: 2px solid #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
}

#user-input.incorrect {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Make the transitions smooth */
#user-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Result Section */

.transcript-section {
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: fit-content;
}
.transcript-header {
  /* background: linear-gradient(to right, var(--primary), var(--secondary)); 
   padding: 1rem 1.5rem;
  color: white; */

  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.transcript-content.collapsed {
  /* display: block; */
}

.transcript-header:hover {
  background-color: var(--card);
}

.transcript-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.transcript-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: var(--background);
  display: none;
}

.transcript-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--border);
}

.transcript-item:hover {
  cursor: pointer;
  background-color: var(--accent-bg);
}

.transcript-item.active {
  border-left: 4px solid var(--primary-dark);
}

.transcript-item.playing {
  background: #fff7ed;
  border-color: #fed7aa;
}

.transcript-item.completed-full {
  border-left: 4px solid #22c55e;
}

.transcript-item.completed-word {
  border-right: 4px solid #3b82f6;
}

.transcript-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  /* border-bottom: 1px solid #f1f5f9; */
}

.transcript-row.description {
  padding: 8px 0;
  border-bottom: none;
}

.transcript-row.description .transcript-text {
  color: #64748b;
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  padding-left: 0;
}

.transcript-row.description::before {
  content: "📝";
  font-size: 14px;
  margin-right: 8px;
  opacity: 0.6;
}
.transcript-row .transcript-number-label {
  border: 2px dashed var(--border);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dark);
  text-align: center;
  margin: 0 auto;
}

.transcript-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.transcript-item .item-speaker {
  font-weight: 600;
  color: var(--primary-dark);
  margin-right: 4px;
}
/*  */

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: #1e293b;
  color: white;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: tooltip-fade 0.2s ease forwards;
}

[data-tooltip]:hover::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  animation: tooltip-fade 0.2s ease forwards;
}

@keyframes tooltip-fade {
  to {
    opacity: 1;
  }
}

/* Scrollbar Styling */
.transcript-content::-webkit-scrollbar {
  width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Feedback */
.feedback-message {
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.feedback-message.correct {
  background: hsl(160, 90%, 80%);
  border: 1px solid #059669;
}

.feedback-message.incorrect {
  background: hsl(0, 93%, 94%);
  border: 1px solid #fecaca;
}

.feedback-message.show {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.correct-answer {
  margin-top: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--gray-50), var(--white));
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--gray-700);
  display: none;
  box-shadow: var(--shadow-sm);
}

.correct-answer.show {
  display: block;
  animation: slideIn 0.3s ease;
}

.correct-answer-label {
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Button */

/* Primary button (Check Answer) */
#show-answer {
  display: none;
}
.button-group {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.button-group-left,
.button-group-right {
  display: flex;
  gap: 12px;
}
.btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--card);
  color: var(--primary);

  border: 1px solid var(--border);
}

.btn-primary:hover {
  background: var(--border);

  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-hover);
}

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--gray-600);
}
.btn-secondary:hover {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--gray-700);
  transform: translateY(-1px);
}
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--gray-200) !important;
  color: var(--gray-400) !important;
  border-color: var(--gray-200) !important;
}

/* Shake effect */
/* Shake animation for wrong answers */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-8px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(8px);
  }
}

/* Smooth transition for next question */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation classes */
.shake {
  animation: shake 0.5s ease-in-out;
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

/* Native audio */
.native-audio {
  width: 100%;
  height: 50px;
  border-radius: 8px;
  outline: none;
}

/* .native-audio::-webkit-media-controls-panel {
  background-color: var(--gray-50);
  border-radius: 8px;
}

.native-audio:focus {
  box-shadow: 0 0 0 2px var(--primary);
} */

.time-input input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 3px;
  font-size: 14px;
  font-family: monospace; /* Better for time display */
  text-align: center;
}

.time-input input[type="text"]:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
  outline: none;
}

.time-input input[type="text"]:invalid {
  border-color: #dc3232;
}

.time-input input[type="text"]::placeholder {
  color: #999;
  font-family: monospace;
}

/* Shadowing Exercise Styles */
/* Shadowing Exercise Styles */

/* Recording Section */
.recording-input-section {
  margin-top: auto;
}

.recording-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.record-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  min-width: 180px;
  justify-content: center;
}

.record-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.record-btn:disabled {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.3);
}

.record-icon {
  font-size: 20px;
}

.record-text {
  font-size: 16px;
}

/* Recording Status */
.recording-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-weight: 600;
  animation: pulse 2s infinite;
}

.recording-indicator {
  font-size: 16px;
  animation: blink 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* User Audio Section */
.user-audio-section {
  margin: 0.5rem 0;
  padding: 1.5rem;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.user-audio-header h4 {
  margin: 0 0 1rem 0;
  color: var(--text-dark);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-audio-header h4::before {
  content: "🎤";
  font-size: 1.2rem;
}

.user-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-audio-player {
  width: 100%;
}

.user-audio-player audio {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

.user-transcript {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  /* min-height: 60px; */
}

.user-transcript-content {
  color: var(--text-medium);
  font-style: italic;
  line-height: 1.5;
  min-height: 24px;
  padding: 0.5rem 0;
  font-family: "Hiragino Kaku Gothic Pro", "MS Gothic", "Yu Gothic", "YuGothic",
    sans-serif;
}

/* When transcript has content */
.user-transcript-content:not(:empty) {
  color: var(--text-dark);
  font-style: normal;
  font-weight: 500;
}

/* Accuracy Score */
.accuracy-score {
  margin-top: 0.5rem;
}

.accuracy-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--background);
  border: 1px solid var(--border);
}

.accuracy-display.excellent {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e;
  color: #15803d;
}

.accuracy-display.good {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: #3b82f6;
  color: #1d4ed8;
}

.accuracy-display.fair {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #d97706;
}

.accuracy-display.low {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #ef4444;
  color: #dc2626;
}

.accuracy-emoji {
  font-size: 24px;
}

.accuracy-percent {
  font-size: 24px;
  font-weight: 700;
}

.accuracy-message {
  font-size: 14px;
  font-weight: 600;
  margin-left: auto;
}

.no-speech {
  color: var(--text-medium);
  font-style: italic;
  padding: 12px;
  text-align: center;
}

/* Shadowing Mode Specific */
.shadowing-mode .sentence-display {
  /* display: block !important;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 24px;
  line-height: 1.8;
  text-align: center;
  color: var(--text-dark);
  font-weight: 500;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 1.5rem; */
  /* font-family: "Hiragino Kaku Gothic Pro", "MS Gothic", "Yu Gothic", "YuGothic",
    sans-serif; */
  /* font-weight: 500; */
  /* color: var(--primary); */
  font-weight: 600;
}

/* .shadowing-mode .sentence-display ruby {
  ruby-align: center;
} */

.shadowing-mode .sentence-display rt {
  /* font-size: 0.6em; */
  /* color: var(--text-medium); */
}

/* Button adjustments for shadowing */
#next-sentence-shadowing {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#next-sentence-shadowing:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Recording indicators in transcript */
.transcript-item.has-recording {
  border-right: 4px solid #f59e0b;
  position: relative;
}

.transcript-item.has-recording::after {
  content: "🎤";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.transcript-item.completed-full.has-recording {
  border-left: 4px solid #22c55e;
  border-right: 4px solid #f59e0b;
}

/* Manual Assessment for iOS */
.manual-assessment {
  text-align: center;
  padding: 16px;
}

.manual-score-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.manual-score-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.manual-score-btn.excellent {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
  border: 1px solid #22c55e;
}

.manual-score-btn.good {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  border: 1px solid #3b82f6;
}

.manual-score-btn.fair {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
  border: 1px solid #f59e0b;
}

.manual-score-btn.low {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  border: 1px solid #ef4444;
}

.manual-score-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Processing Animation */
.user-transcript-content.processing {
  position: relative;
  color: var(--primary) !important;
  font-weight: 600 !important;
}

.user-transcript-content.processing::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: 8px;
  animation: processingDots 1.5s infinite;
}

@keyframes processingDots {
  0%,
  20% {
    box-shadow: 0 0 0 var(--primary), 12px 0 0 transparent, 24px 0 0 transparent;
  }
  40% {
    box-shadow: 0 0 0 transparent, 12px 0 0 var(--primary), 24px 0 0 transparent;
  }
  60%,
  100% {
    box-shadow: 0 0 0 transparent, 12px 0 0 transparent, 24px 0 0 var(--primary);
  }
}

/* Processing Button State */
.record-btn:disabled {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.3);
  position: relative;
  overflow: hidden;
}

.record-btn:disabled::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: processingSweep 1.5s infinite;
}

@keyframes processingSweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
@media (max-width: 768px) {
  .record-btn {
    min-width: 160px;
    padding: 14px 20px;
    font-size: 14px;
  }

  .user-audio-section {
    padding: 1rem;
  }

  .accuracy-display {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .accuracy-message {
    margin-left: 0;
  }

  .shadowing-mode .sentence-display {
    font-size: 20px;
    padding: 20px;
  }
}

.shadowing-mode #context-display {
  display: none !important;
}

/* Start section */
/* Safari Start Section Styling */
#safari-start-section {
  display: none;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-light-1),
    hsl(207, 100%, 99%)
  );
  border: 2px solid var(--primary-light);
  border-radius: 16px;
  margin: 1rem 0;
  box-shadow: 0 4px 12px hsla(207, 85%, 62%, 0.1);
}

.safari-start-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px hsla(207, 85%, 62%, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
}

.safari-start-btn:hover {
  background: linear-gradient(135deg, var(--primary-1), var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px hsla(207, 85%, 62%, 0.4);
}

.safari-start-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px hsla(207, 85%, 62%, 0.3);
}

.safari-start-btn.playing {
  background: linear-gradient(135deg, var(--secondary-1), var(--secondary-2));
  box-shadow: 0 2px 8px var(--secondary-box-shadow);
}

.safari-start-btn.playing:hover {
  background: linear-gradient(
    135deg,
    var(--secondary-light),
    var(--secondary-1)
  );
  box-shadow: 0 4px 16px var(--secondary-box-shadow);
}

.safari-start-text {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
} /* Safari Start Section Styling */
#safari-start-section {
  display: none;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, hsl(202, 85%, 96%), hsl(202, 85%, 98%));
  border: 2px solid hsl(202, 85%, 90%);
  border-radius: 16px;
  margin: 1rem 0;
  box-shadow: 0 4px 12px hsla(202, 85%, 61%, 0.1);
}

.safari-start-btn {
  background: linear-gradient(135deg, hsl(202, 85%, 61%), hsl(202, 85%, 55%));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px hsla(202, 85%, 61%, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
}

.safari-start-btn:hover {
  background: linear-gradient(135deg, hsl(207, 73%, 65%), hsl(207, 73%, 60%));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px hsla(202, 85%, 61%, 0.4);
}

.safari-start-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px hsla(202, 85%, 61%, 0.3);
}

.safari-start-text {
  color: hsl(202, 85%, 45%);
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
}

/* Tablet and Mobile - Transcript moves below */
@media (max-width: 921px) {
  .dictation-container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .exercise-section {
    width: 100%;
    min-height: auto;
  }

  .transcript-section {
    width: 100%;
    order: 2;
  }

  .lesson-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .title {
    font-size: 20px;
  }
  .mode-select select {
    width: 150px;
  }

  .page-subtitle {
    font-size: 14px;
  }

  /* Sentence display */
  .sentence-display {
    font-size: 18px;
    padding: 16px;
  }

  /* User input */
  #user-input {
    font-size: 16px;
    padding: 16px;
  }

  /* Transcript adjustments for mobile */
  .transcript-content {
    max-height: 300px;
  }

  .transcript-item {
    padding: 12px;
  }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
  .one-col-page-container {
    padding: 1rem 0;
  }
  .exercise-section {
    padding: 1rem;
  }
  .header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px 12px;
    align-items: start;
  }

  /* Icon - top left */
  .lesson-icon {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* Title and subtitle wrapper - top right */
  .header > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .title {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .page-subtitle {
    font-size: 14px;
  }

  /* Mode select - spans both columns, goes below */
  .mode-select {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100%;
    margin-left: 0;
  }

  .mode-select select {
    width: 100%;
  }

  .header {
    gap: 6px 10px;
  }

  .lesson-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .title {
    font-size: 20px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .mode-select {
    width: 100%;
    margin-left: 0;
  }

  .audio-section {
    padding: 0 0 8px 0;
  }
  .lesson-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .number-label {
    font-size: 8px;
  }
  .speaker-label {
    font-size: 14px;
  }

  .sentence-display {
    font-size: 14px;
    padding: 8px;
  }

  .btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  .score-item {
    padding: 4px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 10px;
  }
  .progress-navigation {
    margin-top: 8px;
  }

  .progress-nav-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}
