:root {
  --bg-dark: #202124;
  --bg-panel: #3C4043;
  --bg-slide: #FFFFFF;
  --text-primary: #f8fafc;
  --text-secondary: #9aa0a6;
  --accent-blue: #8ab4f8;
  --accent-success: #1e8e3e;
  --accent-error: #d93025;
  --danger-red: #ea4335;
  --border-color: #dadce0;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#meet-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
}

/* Video Gallery (Top Right) */
.video-gallery {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.video-box {
  width: 200px;
  height: 112px; /* 16:9 aspect ratio */
  background-color: var(--bg-panel);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  border: 2px solid transparent;
}

.video-box.tutor-video {
  /* Emulate active speaker outline occasionally, but keep it subtle */
  border-color: var(--accent-blue);
}

.tutor-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-video .avatar {
  background: var(--accent-blue);
  color: #202124;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
}

.name-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0,0,0,0.6);
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
}

.name-tag .volume-icon {
  font-size: 14px;
  color: var(--accent-blue);
}

.mic-off {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  padding: 4px;
  font-size: 14px;
}

/* Main Presentation Area */
.presentation-area {
  flex-grow: 1;
  background-color: var(--bg-slide);
  color: #202124;
  border-radius: 8px;
  margin-bottom: 70px; /* Space for control bar */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.slide-content {
  width: 100%;
  max-width: 850px;
  padding: 40px;
  display: flex;
  flex-direction: column;
}

/* Control Bar */
.control-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.center-controls {
  display: flex;
  gap: 12px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.center-controls .icon-btn {
  background: var(--bg-panel);
  width: 44px;
  height: 44px;
}

.center-controls .icon-btn:hover {
  background: #4d5154;
}

.center-controls .icon-btn.active {
  background: var(--danger-red);
}

.center-controls .icon-btn.active:hover {
  background: #d93025;
}

.center-controls .icon-btn.active-blue {
  background: var(--accent-blue);
  color: var(--bg-dark);
}

.center-controls .icon-btn.active-blue:hover {
  background: #a8c7fa;
}

.center-controls .icon-btn.end-call {
  background: var(--danger-red);
  padding-left: 24px;
  padding-right: 24px;
  border-radius: 22px;
  width: auto;
}

.center-controls .icon-btn.end-call:hover {
  background: #d93025;
}

.left-controls, .right-controls {
  display: flex;
  align-items: center;
  color: white;
  font-size: 14px;
}

.left-controls .divider {
  margin: 0 10px;
}

/* Internal Slide Styling - Content */
h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
  color: #202124;
  font-weight: 700;
}

.subtitle {
  color: #5f6368;
  font-size: 1.2rem;
  margin-bottom: 30px;
}

.btn-primary {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1557b0;
}

.btn-submit-construct {
  background: #1e8e3e;
}

.btn-submit-construct:hover {
  background: #137333;
}

.btn-audio {
  background: #f1f3f4;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 15px;
}

.btn-audio:hover {
  background: #e8f0fe;
}

/* Quiz Specific Styling */
.quiz-header {
  border-bottom: 2px solid #1a73e8;
  padding-bottom: 10px;
  margin-bottom: 30px;
}

.situation-tag {
  color: #1a73e8;
  font-weight: 600;
  font-size: 1.1rem;
}

.taigi-question-block {
  margin-bottom: 40px;
}

.question-hanzi {
  font-size: 2.5rem;
  font-weight: 700;
  color: #202124;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.question-roman {
  font-size: 1.3rem;
  color: #1a73e8; /* Emphasize romanization */
  font-weight: 500;
  margin-bottom: 10px;
}

.question-context {
  font-size: 1.1rem;
  color: #5f6368;
  background: #f1f3f4;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option-row {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.option-row:hover {
  background: #f8f9fa;
  border-color: #1a73e8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.option-marker {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a73e8;
  margin-right: 20px;
  min-width: 24px;
}

.option-content {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.option-hanzi {
  font-size: 1.5rem;
  font-weight: 600;
  color: #202124;
}

.option-roman {
  font-size: 1.1rem;
  color: #5f6368;
}

.option-row.correct {
  background: #e6f4ea;
  border-color: var(--accent-success);
}

.option-row.incorrect {
  background: #fce8e6;
  border-color: var(--accent-error);
}

.option-row.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.feedback-banner {
  margin-top: 25px;
  padding: 16px 24px;
  border-radius: 6px;
  font-size: 1.15rem;
  font-weight: 500;
  display: none;
  align-items: flex-start;
  gap: 10px;
}

.feedback-banner.show-correct {
  display: flex;
  background: #e6f4ea;
  color: #137333;
  border-left: 4px solid #137333;
}

.feedback-banner.show-error {
  display: flex;
  background: #fce8e6;
  color: #c5221f;
  border-left: 4px solid #c5221f;
}

.next-action {
  margin-top: 25px;
  display: flex;
  justify-content: flex-end;
}

/* --- NEW TYPES CSS (Construct & Fill Blank) --- */

.sentence-container {
  font-size: 1.8rem;
  font-weight: 600;
  color: #202124;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.blank-space {
  display: inline-block;
  min-width: 120px;
  border-bottom: 3px solid #1a73e8;
  height: 44px;
}

.blank-filled {
  color: #1a73e8;
  border-bottom: none;
  padding: 0 15px;
  background: #e8f0fe;
  border-radius: 4px;
}

.construct-area {
  min-height: 70px;
  border-bottom: 2px dashed #dadce0;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 15px;
  align-items: center;
}

.placeholder-text {
  color: #9aa0a6;
  font-size: 1.2rem;
  font-style: italic;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.word-chip {
  background: white;
  border: 2px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 600;
  color: #202124;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s;
  user-select: none;
}

.word-chip:hover {
  background: #f8f9fa;
  border-color: #1a73e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.word-chip.used {
  opacity: 0.3;
  pointer-events: none;
  background: #f1f3f4;
  border-color: #dadce0;
  box-shadow: none;
  transform: none;
}

/* Premium Intro Screen Elements */
@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(26, 115, 232, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-play-btn {
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  color: white;
  border: none;
  padding: 16px 36px;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
  transition: all 0.3s ease;
  animation: pulse-ring 2s infinite;
}

.intro-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.6);
}

.intro-play-btn.playing {
  animation: none;
  background: #e8f0fe;
  color: #1a73e8;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.intro-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-bottom: 25px;
}

/* Premium Start Screen */
.start-screen-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 30px;
  animation: fadeInUp 0.5s ease-out;
  height: 100%;
}

.start-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.start-right-col {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 450px;
}

.start-hero-header {
  margin-bottom: 40px;
}

.start-info-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0,0,0,0.03);
  text-align: left;
}

/* Premium End Screen */
.end-screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  animation: fadeInUp 0.6s ease-out;
  height: 100%;
}

.result-header {
  text-align: center;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-icon {
  font-size: 72px;
  margin-bottom: 15px;
  animation: bounceRotate 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-icon.perfect { color: #fbbc04; }
.result-icon.good { color: #34a853; }
.result-icon.keep-going { color: #ea4335; }

@keyframes bounceRotate {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-title {
  font-size: 2.2rem;
  color: #202124;
  margin: 0;
  font-weight: 800;
  letter-spacing: 2px;
}

.result-card {
  background: white;
  border-radius: 24px;
  padding: 35px 40px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0,0,0,0.04);
  margin-bottom: 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* SVG Circle Chart */
.score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circular-chart {
  display: block;
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.circle-bg {
  fill: none;
  stroke: #f1f3f4;
  stroke-width: 3.2;
}

.circle {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  animation: progress 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.circular-chart.blue .circle {
  stroke: #1a73e8;
}

@keyframes progress {
  0% { stroke-dasharray: 0 100; }
}

.score-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.score-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a73e8;
  line-height: 1.1;
}

.score-label {
  font-size: 0.95rem;
  color: #5f6368;
  font-weight: 600;
}

.tutor-feedback-box {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #f8f9fa;
  padding: 24px;
  border-radius: 18px;
  width: 100%;
  position: relative;
}

.feedback-avatar {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.feedback-bubble {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 65px;
}

.feedback-tag {
  font-size: 0.9rem;
  color: #1e8e3e;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.feedback-msg {
  font-size: 1.15rem;
  color: #202124;
  line-height: 1.5;
  font-weight: 600;
}

.retry-btn {
  padding: 16px 45px;
  font-size: 1.25rem;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #202124;
  color: white;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}

.retry-btn:hover {
  background: #3c4043;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #202124;
  margin: 0 0 15px 0;
  font-size: 1.3rem;
}

.card-title .material-icons {
  color: #fbbc04;
  font-size: 1.6rem;
}

.card-desc {
  color: #5f6368;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.feature-item:hover {
  transform: translateX(5px);
  background: #f1f3f4;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.feature-icon.bg-blue { background: #e8f0fe; color: #1a73e8; }
.feature-icon.bg-green { background: #e6f4ea; color: #137333; }
.feature-icon.bg-purple { background: #f3e8fd; color: #9334e6; }

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feature-text strong {
  color: #202124;
  font-size: 1.05rem;
}

.feature-text span {
  color: #5f6368;
  font-size: 0.9rem;
}

.start-pulse-btn {
  padding: 16px 48px;
  font-size: 1.3rem;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  width: fit-content;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulse-ring 2.5s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

.start-pulse-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.5);
}
