/* ==========================================================================
   Unit 1 Accommodation Interactive Mind Map - Stylesheet
   ========================================================================== */

:root {
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Quicksand', 'Noto Sans TC', sans-serif;

  /* Theme Colors */
  --bg-main: #fbf8f1;
  --text-dark: #1e293b;
  --text-muted: #64748b;

  /* Quadrant Colors */
  --blue-primary: #2563eb;
  --blue-border: #3b82f6;
  --blue-bg: #eff6ff;
  --blue-pill: #2563eb;

  --green-primary: #16a34a;
  --green-border: #22c55e;
  --green-bg: #f0fdf4;
  --green-pill: #16a34a;

  --purple-primary: #7c3aed;
  --purple-border: #8b5cf6;
  --purple-bg: #f5f3ff;
  --purple-pill: #7c3aed;

  --orange-primary: #ea580c;
  --orange-border: #f97316;
  --orange-bg: #fff7ed;
  --orange-pill: #ea580c;

  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* --- Floating Background Decor --- */
.bg-decor {
  position: fixed;
  z-index: 0;
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}
.sun-bg {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 54px;
  animation: pulseSun 4s ease-in-out infinite alternate;
}
.cloud-1 {
  top: 30px;
  left: 36%;
  font-size: 38px;
  animation: floatCloud 8s ease-in-out infinite alternate;
}
.cloud-2 {
  top: 35px;
  left: 60%;
  font-size: 34px;
  animation: floatCloud 10s ease-in-out infinite alternate-reverse;
}
.cloud-3 {
  top: 60px;
  left: 12%;
  font-size: 30px;
  opacity: 0.5;
  animation: floatCloud 12s ease-in-out infinite alternate;
}

@keyframes pulseSun {
  0% { transform: translateX(-50%) scale(1) rotate(0deg); }
  100% { transform: translateX(-50%) scale(1.1) rotate(8deg); }
}
@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(25px); }
}

/* --- App Container --- */
.app-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  position: relative;
  z-index: 1;
}

/* --- Top Bar Header --- */
.top-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 20px 26px;
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
  border: 2.5px solid #e2e8f0;
  margin-bottom: 24px;
}

/* Left Column: Nav Controls + Sticky Note Tips */
.top-bar-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  flex: 1;
}

.top-bar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Right Column: Hero Graphic Card */
.top-bar-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-graphic-card {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  width: fit-content;
  text-transform: uppercase;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Controls Group */
.controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
}

.search-box input {
  padding: 8px 32px 8px 38px;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  width: 250px;
  transition: all 0.2s ease;
  background: #ffffff;
}

.search-box input:focus {
  border-color: var(--blue-border);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  width: 290px;
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
}

.speed-toggle, .view-switch {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

/* --- Unit Selector Dropdown --- */
.unit-selector-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 5px 14px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  transition: all 0.2s ease;
}

.unit-selector-box:hover {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.unit-select-icon {
  font-size: 16px;
}

.unit-select-dropdown {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
}

.quiz-scope-selector {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.scope-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scope-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.speed-btn, .view-btn, .action-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.speed-btn.active, .view-btn.active {
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.action-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  color: #334155;
  box-shadow: var(--shadow-sm);
}

.action-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.action-btn.highlight {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 700;
}
.action-btn.highlight:hover {
  background: #fde68a;
}

/* --- Dictation Quiz Panel Drawer --- */
.dictation-panel {
  background: #ffffff;
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.quiz-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-badge {
  background: #fef3c7;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.quiz-title h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: #78350f;
}

.quiz-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-item {
  font-size: 14px;
  color: #475569;
}
.stat-item strong {
  font-family: var(--font-heading);
  font-size: 18px;
  color: #d97706;
}

.close-quiz-btn {
  background: #f1f5f9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  font-weight: bold;
}
.close-quiz-btn:hover { background: #e2e8f0; }

.quiz-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-prompt {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.play-audio-large-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.play-audio-large-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

.quiz-hint-text {
  font-size: 14px;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.quiz-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-form input {
  flex: 1;
  min-width: 260px;
  padding: 12px 18px;
  font-size: 16px;
  font-family: var(--font-body);
  border: 2.5px solid #cbd5e1;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.quiz-form input:focus {
  border-color: #2563eb;
}

.quiz-submit-btn {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.quiz-submit-btn:hover { background: #15803d; }

.quiz-hint-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
}
.quiz-hint-btn:hover { background: #e2e8f0; }

.quiz-feedback {
  font-weight: 700;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 10px;
  display: none;
}

.quiz-feedback.success {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.quiz-feedback.error {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* --- Mind Map / Unit Content Wrapper --- */
.mindmap-wrapper {
  position: relative;
  width: 100%;
}

/* --- Top Bar Hero (Illustration + Sticky Note Tips inside Header) --- */
.top-bar-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding-top: 6px;
}

.hero-graphic-card {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.cloud-title-box {
  background: #ffffff;
  border: 3.5px solid #2c3e50;
  border-radius: 30px;
  padding: 14px 24px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
  white-space: nowrap;
  animation: floatHub 5s ease-in-out infinite alternate;
}

@keyframes floatHub {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.cloud-title-box h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.2;
  color: #1e293b;
}

.cloud-title-box .en-title {
  color: #2563eb;
  font-size: 22px;
  font-weight: 700;
}

.cloud-title-box .cn-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 19px;
  font-weight: 900;
  color: #e74c3c;
  letter-spacing: 4px;
}

.hero-svg-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.house-illustration {
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.12));
}

.house-svg {
  display: block;
}

.backpack-icon {
  margin-top: -10px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  transition: transform 0.3s ease;
  cursor: pointer;
}

.backpack-icon:hover {
  transform: scale(1.15) rotate(-5deg);
}

/* --- Sticky Note inside Top Bar Right Column --- */
.hero-sticky-note {
  position: relative;
  width: 100%;
  background: #fef9c3;
  border: 2px solid #fde047;
  border-radius: 16px;
  padding: 12px 20px 12px 42px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-sticky-note .pin {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 18px;
}

.hero-sticky-note .note-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 2px;
}

.hero-sticky-note .note-content {
  font-size: 13px;
  color: #713f12;
  line-height: 1.45;
}

/* --- Quadrants Grid Layout --- */
.quadrants-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 36px 48px;
  position: relative;
  z-index: 2;
}

/* Quadrant Container Styling */
.quadrant {
  background: #ffffff;
  border-radius: 28px;
  padding: 24px 20px 20px;
  position: relative;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

/* Custom Colored Outer Borders & Background Accents */
.quadrant.blue-theme {
  border: 3.5px solid var(--blue-border);
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

.quadrant.green-theme {
  border: 3.5px solid var(--green-border);
  background: linear-gradient(180deg, #f8fafc 0%, #f0fdf4 100%);
}

.quadrant.purple-theme {
  border: 3.5px solid var(--purple-border);
  background: linear-gradient(180deg, #f8fafc 0%, #f5f3ff 100%);
}

.quadrant.orange-theme {
  border: 3.5px solid var(--orange-border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff7ed 100%);
}

/* Top Center Header Capsule Pill */
.quadrant-header-pill {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 30px;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  z-index: 4;
}

.blue-theme .quadrant-header-pill { background: var(--blue-pill); border: 2.5px solid #1d4ed8; }
.green-theme .quadrant-header-pill { background: var(--green-pill); border: 2.5px solid #15803d; }
.purple-theme .quadrant-header-pill { background: var(--purple-pill); border: 2.5px solid #6d28d9; }
.orange-theme .quadrant-header-pill { background: var(--orange-pill); border: 2.5px solid #c2410c; }

.pill-text {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.count-tag {
  background: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
}

/* Cards Grid inside Quadrant */
.cards-wrapper.grid-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 10px;
}

/* Vocab Card Styling */
.vocab-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px 8px;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blue-theme .vocab-card { border-color: #bfdbfe; }
.green-theme .vocab-card { border-color: #bbf7d0; }
.purple-theme .vocab-card { border-color: #ddd6fe; }
.orange-theme .vocab-card { border-color: #fed7aa; }

.vocab-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.blue-theme .vocab-card:hover { border-color: var(--blue-primary); }
.green-theme .vocab-card:hover { border-color: var(--green-primary); }
.purple-theme .vocab-card:hover { border-color: var(--purple-primary); }
.orange-theme .vocab-card:hover { border-color: var(--orange-primary); }

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

/* Card Icon Wrapper */
.card-icon-wrapper {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-icon {
  width: 38px;
  height: 38px;
}

/* Text elements */
.word-en {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.2;
}

.word-ipa {
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-body);
}

.word-cn {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  transition: opacity 0.2s ease;
}

/* Audio button inside card */
.audio-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #f1f5f9;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vocab-card:hover .audio-btn {
  opacity: 1;
  background: #e2e8f0;
}

/* --- Backstage Flashcard Quiz Mode --- */
body.flashcard-mode .word-cn {
  visibility: hidden;
  position: relative;
}

body.flashcard-mode .word-cn::after {
  content: '???';
  visibility: visible;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #94a3b8;
  font-weight: 700;
}

body.flashcard-mode .vocab-card.flipped .word-cn {
  visibility: visible;
}
body.flashcard-mode .vocab-card.flipped .word-cn::after {
  display: none;
}

/* --- Active Speaking Pulse Effect --- */
.vocab-card.speaking {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25) !important;
  animation: cardPulse 1s infinite alternate;
}

@keyframes cardPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

/* --- Audio Toast --- */
.audio-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.audio-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.speaking-animation {
  display: flex;
  align-items: center;
  gap: 3px;
}
.speaking-animation span {
  width: 3px;
  height: 12px;
  background: #38bdf8;
  border-radius: 3px;
  animation: barBounce 0.8s ease-in-out infinite alternate;
}
.speaking-animation span:nth-child(2) { animation-delay: 0.2s; }
.speaking-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes barBounce {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* --- Word Detail Popup Modal --- */
.word-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.word-modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 28px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 3px solid #e2e8f0;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-modal-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
}
.close-modal-btn:hover { background: #e2e8f0; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.modal-icon {
  width: 60px;
  height: 60px;
  background: #eff6ff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-icon svg {
  width: 44px;
  height: 44px;
}

.modal-title-group h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: #1e293b;
}

.modal-ipa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
}

.modal-ipa {
  font-size: 14px;
  color: #64748b;
}

.modal-audio-btn {
  background: #dbeafe;
  color: #1d4ed8;
  border: none;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-audio-btn:hover { background: #bfdbfe; }

.modal-audio-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.modal-audio-btn.secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.modal-cn {
  font-size: 16px;
  font-weight: 700;
  color: #2563eb;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.detail-section h4 {
  font-size: 13px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.example-en {
  font-size: 15px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.example-cn {
  font-size: 14px;
  color: #64748b;
  line-height: 1.4;
}

.highlight-box {
  background: #fef3c7;
  border: 1.5px solid #fde047;
  padding: 14px 16px;
  border-radius: 14px;
}
.highlight-box h4 { color: #854d0e; margin-bottom: 4px; }
.highlight-box p { color: #713f12; font-weight: 500; font-size: 14px; }

/* --- Grid View & Responsive Overrides --- */
@media (max-width: 1200px) {
  .cards-wrapper.grid-layout {
    grid-template-columns: repeat(3, 1fr);
  }
  .quadrants-grid {
    gap: 28px;
  }
}

@media (max-width: 1100px) {
  .top-bar {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 20px;
  }
  .top-bar-right {
    justify-content: center;
    margin-bottom: 4px;
  }
}

@media (max-width: 992px) {
  .quadrants-grid {
    grid-template-columns: 1fr;
  }
  .cards-wrapper.grid-layout {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-graphic-card {
    flex-direction: column;
    gap: 12px;
  }
  .top-bar-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .cards-wrapper.grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
  .search-box input {
    width: 100%;
  }
}

/* ==========================================================================
   IELTS Band Score Badge & Filter Styling
   ========================================================================== */
.band-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
}

.band-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  font-family: var(--font-heading);
  white-space: nowrap;
}

.band-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.band-btn:hover {
  border-color: #94a3b8;
  color: #1e293b;
}

.band-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.band-btn.band-btn-5.active {
  background: #16a34a;
  border-color: #16a34a;
}

.band-btn.band-btn-6.active {
  background: #d97706;
  border-color: #d97706;
}

.band-btn.band-btn-7.active {
  background: #9333ea;
  border-color: #9333ea;
}

/* Vocab Card Band Badge */
.band-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.2px;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 2;
}

.band-badge.band-5 {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.band-badge.band-6 {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.band-badge.band-7 {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

/* Dimmed Card State when Filtering */
.vocab-card.dimmed {
  opacity: 0.25;
  filter: grayscale(60%);
  transform: scale(0.96);
}

.vocab-card.dimmed:hover {
  opacity: 0.8;
  filter: grayscale(0%);
  transform: translateY(-2px);
}

/* Modal Band Tag */
.modal-title-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-band-tag {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 8px;
  display: inline-block;
}

.modal-band-tag.band-5 {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.modal-band-tag.band-6 {
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #fde68a;
}

.modal-band-tag.band-7 {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1.5px solid #d8b4fe;
}

/* ==========================================================================
   Sub-Unit Tabs Bar & 10th "+N More" Card Styling
   ========================================================================== */
.sub-unit-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scrollbar-width: thin;
}

.sub-unit-tab-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sub-unit-tab-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
}

.sub-unit-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Redesigned Minimal "More Action Card" */
.more-action-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2.5px dashed #0284c7;
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
  user-select: none;
  min-height: 100px;
  gap: 4px;
}

.more-action-card:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #0369a1;
  border-style: solid;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.2);
}

.more-action-card:active {
  transform: translateY(-1px) scale(0.99);
}

.more-card-count {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: #0284c7;
  line-height: 1;
  letter-spacing: -0.5px;
}

.more-card-text {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.more-card-arrow {
  font-size: 14px;
  color: #0284c7;
  font-weight: 900;
  transition: transform 0.2s ease;
  display: inline-block;
}

.more-action-card:hover .more-card-arrow {
  transform: translateX(4px);
  color: #0369a1;
}

/* Single Quadrant Expanded Mode Layout */
.quadrants-grid.single-quadrant-mode {
  display: block;
  width: 100%;
}

.quadrant.expanded-full {
  width: 100%;
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
}

.quadrant.expanded-full .cards-wrapper.grid-layout {
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .quadrant.expanded-full .cards-wrapper.grid-layout {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 992px) {
  .quadrant.expanded-full .cards-wrapper.grid-layout {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .quadrant.expanded-full .cards-wrapper.grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Floating Action Button (FAB) at Bottom Right */
.floating-back-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 22px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  backdrop-filter: blur(8px);
  z-index: 999;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-back-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.floating-back-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ==========================================================================
   User Profile, Auth, Learned Status & Gated Feature Styles
   ========================================================================== */

/* Brand & Header Row Layout */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.user-profile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge-guest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.btn-google-login:hover {
  background: #f8fafc;
  border-color: #0ea5e9;
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.15);
}

.user-logged-in-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  padding: 5px 14px 5px 6px;
  border-radius: 24px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #16a34a;
}

.user-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
}

.user-progress-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #86efac;
  margin-left: 4px;
}

.btn-logout {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s;
  margin-left: 4px;
}

.btn-logout:hover {
  color: #ef4444;
}

/* Learned Word Cards Styling (Green Background & Checkmark) */
.vocab-card.is-learned {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%) !important;
  border: 2.5px solid #6ee7b7 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
  position: relative;
}

.vocab-card.is-learned::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #10b981;
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
  border: 2.5px solid #ffffff;
  z-index: 5;
}

/* Status Filter Group */
.status-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
}

.status-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-right: 2px;
}

.status-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.status-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.status-btn.active {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
}

.status-btn.active .lock-tag {
  display: none;
}

.status-btn .lock-tag {
  font-size: 11px;
  opacity: 0.85;
}

/* Modal Checkmark Toggle Button */
.modal-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px dashed #e2e8f0;
  display: flex;
  justify-content: center;
}

.modal-learn-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.modal-learn-btn:hover {
  border-color: #10b981;
  color: #059669;
  background: #ecfdf5;
  transform: translateY(-2px);
}

.modal-learn-btn.is-learned {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.modal-learn-btn.is-learned:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
}

.modal-learn-btn.is-guest {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.modal-learn-btn.is-guest:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* Login Prompt Modal Styles */
.login-prompt-card {
  max-width: 440px;
  text-align: center;
  padding: 32px 28px;
}

.login-prompt-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-prompt-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: #1e293b;
  margin-bottom: 8px;
}

.login-prompt-header p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 24px;
}

.gsi-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 40px;
}

.demo-login-box {
  margin-top: 16px;
}

.demo-login-box .divider {
  position: relative;
  text-align: center;
  margin: 16px 0;
}

.demo-login-box .divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e2e8f0;
}

.demo-login-box .divider span {
  position: relative;
  background: #ffffff;
  padding: 0 10px;
  font-size: 12px;
  color: #94a3b8;
}

.demo-login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.demo-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

/* Cloud Sync Status Badge */
.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  transition: all 0.25s ease;
}

.cloud-status-badge.synced {
  background: #ecfdf5;
  color: #059669;
  border-color: #6ee7b7;
}

.cloud-status-badge.local {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}








