/* ============================================
   Let's Speak English — Page-specific Styles
   ============================================ */

/* ============================================
   1. SPALSH SCREEN
   ============================================ */
#splash-page {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-5);
}

#splash-page .app-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  font-size: 36px;
  color: var(--text-inverse);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.2);
}

#splash-page h1 {
  margin-bottom: var(--space-2);
}

#splash-page .subtitle {
  margin-bottom: var(--space-10);
}

#splash-page .progress-area {
  width: 240px;
  max-width: 80%;
}

#splash-page .progress-label {
  margin-top: var(--space-3);
}

/* ============================================
   2. SCENE SELECT PAGE
   ============================================ */
#scene-page .page-header {
  padding: var(--space-4) var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top) + var(--space-4));
}

#scene-page .page-header h1 {
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.2px;
}

.chip-row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-page);
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-10);
}

.scene-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms var(--ease-standard);
}

.scene-card:active {
  transform: scale(0.97);
}

.scene-card .scene-icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
  line-height: 1;
}

.scene-card .scene-name {
  font-size: var(--fs-body-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.scene-card .scene-desc {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: var(--lh-relaxed);
  flex: 1;
}

.scene-card .scene-difficulty {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--fw-medium);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.diff-easy {
  background: #FFF1E0;
  color: #C16A00;
}

.diff-medium {
  background: #E8F5E9;
  color: #2E7D32;
}

.diff-hard {
  background: #FFEBEE;
  color: #C62828;
}

/* ============================================
   3. CONVERSATION PREP PAGE
   ============================================ */
#prep-page {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10) var(--space-5);
}

#prep-page .back-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--space-3));
  left: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#prep-page .scene-icon-large {
  font-size: 64px;
  margin-bottom: var(--space-4);
  line-height: 1;
}

#prep-page .scene-difficulty {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--fw-medium);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

#prep-page .role-info {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  text-align: left;
  width: 100%;
}

#prep-page .role-info p {
  font-size: var(--fs-body-small);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

#prep-page .role-info strong {
  color: var(--text-primary);
}

#prep-page .btn-primary {
  margin-top: auto;
}

/* ============================================
   4. CONVERSATION VIEW
   ============================================ */
#conv-page {
  background: var(--bg-page);
}

.conv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 var(--space-5);
  padding-top: env(safe-area-inset-top);
  background: var(--glass-heavy-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  z-index: 10;
  flex-shrink: 0;
}

.conv-topbar .conv-back-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  margin-right: var(--space-1);
}

.conv-topbar .conv-back-btn:active {
  background: rgba(0, 0, 0, 0.04);
}

.conv-topbar .conv-title {
  font-size: var(--fs-caption-strong);
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-topbar .conv-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.conv-topbar .conv-turn {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}

.conv-topbar .conv-end-btn {
  font-size: var(--fs-caption);
  color: var(--error);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-stack);
  padding: 8px 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}

.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0 120px 0;
  -webkit-overflow-scrolling: touch;
}

.conv-messages-inner {
  padding: 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Bubbles */
.bubble {
  max-width: 80%;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  position: relative;
  animation: fadeInUp 200ms var(--ease-enter) both;
}

.bubble-ai {
  align-self: flex-start;
  background: var(--bg-chat-ai);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.bubble-user {
  align-self: flex-end;
  background: var(--bg-chat-user);
  border-bottom-right-radius: 4px;
  color: var(--text-inverse);
}

.bubble .bubble-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.bubble .play-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bubble .bubble-time {
  font-size: 11px;
  opacity: 0.6;
}

/* Feedback area */
.feedback-area {
  align-self: flex-end;
  width: calc(80% + 32px);
  margin-top: -8px;
  margin-bottom: 8px;
  animation: fadeInUp 200ms var(--ease-enter) both;
}

.feedback-toggle {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  -webkit-tap-highlight-color: transparent;
}

.feedback-content {
  display: none;
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  line-height: var(--lh-relaxed);
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.feedback-content.open {
  display: block;
}

/* Bottom bar */
.conv-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: var(--space-4) var(--space-5);
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-4));
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: auto;
}

.conv-bottombar * {
  pointer-events: auto;
}

.record-btn {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms var(--ease-standard);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  z-index: 21;
  -webkit-user-select: none;
  user-select: none;
}

.record-btn:active {
  transform: scale(0.92);
}

.record-btn.recording {
  background: var(--error);
  box-shadow: none;
  animation: pulse 1.5s infinite;
}

.record-btn.disabled {
  background: #C7C7CC;
  box-shadow: none;
  cursor: not-allowed;
}

.conv-status {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  min-height: 18px;
}

.conv-status.recording {
  color: var(--error);
}

/* Waveform */
.waveform {
  display: none;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.waveform.active {
  display: flex;
}

.waveform .bar {
  width: 3px;
  height: 8px;
  background: var(--error);
  border-radius: 2px;
  animation: waveAnim 0.5s ease-in-out infinite alternate;
}

.waveform .bar:nth-child(1) { animation-delay: 0s; height: 12px; }
.waveform .bar:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.waveform .bar:nth-child(3) { animation-delay: 0.2s; height: 8px; }
.waveform .bar:nth-child(4) { animation-delay: 0.15s; height: 22px; }
.waveform .bar:nth-child(5) { animation-delay: 0.05s; height: 14px; }

@keyframes waveAnim {
  from { height: 6px; }
  to { height: 22px; }
}

/* Thinking indicator */
.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.thinking-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: dotBounce 1s ease-in-out infinite;
}

.thinking-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* ============================================
   5. EVALUATION PAGE
   ============================================ */
#eval-page {
  padding: var(--space-8) var(--space-5);
  padding-top: calc(env(safe-area-inset-top) + var(--space-8));
}

.eval-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.eval-score-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  text-align: center;
  margin-bottom: var(--space-5);
}

.eval-grade {
  font-size: 48px;
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.eval-grade.grade-a { color: var(--success); }
.eval-grade.grade-b { color: var(--accent); }
.eval-grade.grade-c { color: var(--warning); }
.eval-grade.grade-d { color: var(--error); }

.eval-stars {
  font-size: 24px;
  margin-bottom: var(--space-2);
}

.eval-number {
  font-size: var(--fs-title);
  color: var(--text-secondary);
}

.eval-dimension {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  animation: fadeInUp 300ms var(--ease-enter) both;
}

.eval-dimension:nth-child(2) { animation-delay: 100ms; }
.eval-dimension:nth-child(3) { animation-delay: 200ms; }
.eval-dimension:nth-child(4) { animation-delay: 300ms; }
.eval-dimension:nth-child(5) { animation-delay: 400ms; }

.eval-dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.eval-dim-name {
  font-size: var(--fs-heading);
  font-weight: var(--fw-semibold);
}

.eval-dim-score {
  font-size: var(--fs-body);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
}

.eval-dim-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.eval-dim-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 600ms var(--ease-standard);
}

.eval-dim-fill.high { background: var(--success); }
.eval-dim-fill.mid { background: var(--accent); }
.eval-dim-fill.low { background: var(--warning); }

.eval-dim-comment {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.eval-section {
  margin-bottom: var(--space-5);
}

.eval-section-title {
  font-size: var(--fs-caption-strong);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}

.eval-strength {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-body-small);
  color: var(--success);
  margin-bottom: var(--space-2);
}

.eval-improve {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-body-small);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.eval-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
