/* ========================================
   BILINGUAL BOOKS STYLES
   ======================================== */

.book-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.book-split-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .book-split-layout {
    flex-direction: row;
    gap: 0;
  }
}

.book-page {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 30px;
  color: #f8fafc;
}

.book-lang-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: #333;
}

.book-content {
  font-size: 1.15rem;
  line-height: 1.8;
}

.book-paragraph {
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: inherit;
}

.book-paragraph:hover {
  background: rgba(255, 255, 255, 0.05);
}

.book-page.fullscreen-mobile {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 50;
  margin: 0 !important;
}

.btn-expand-mobile {
  position: sticky;
  top: 15px;
  float: right;
  margin-bottom: -36px;
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(5px);
  transition: background 0.2s;
}

.btn-expand-mobile:hover {
  background: rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
  .btn-expand-mobile {
    display: none !important;
  }
}


.book-paragraph.speaking {
  background: rgba(88, 204, 2, 0.2);
  color: #58CC02;
  font-weight: 700;
}

/* ============================================================
   BOOKS LIST — CARDS GRID
   ============================================================ */
.books-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.book-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-left-width: 5px;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-card:active {
  transform: scale(0.98);
}

.book-card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  font-size: 1.8rem;
}

.book-card-info {
  flex: 1;
  min-width: 0;
}

.book-card-info h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-info p {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

@media (min-width: 601px) {
  .book-card:hover {
    border-color: #58CC02;
    box-shadow: 0 4px 16px rgba(88, 204, 2, 0.18);
  }
}
/* ============================================================
   WORD POPUP
   ============================================================ */
.story-word-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.word-card-container {
  width: min(92vw, 520px);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border: 2px solid rgba(88, 204, 2, 0.25);
  border-radius: 18px;
  padding: 20px;
  color: #e8e8e8;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Word popup drag handle on mobile via ::before */
@media (max-width: 600px) {
  .story-word-popup {
    align-items: flex-end;
  }

  .word-card-container {
    width: 100%;
    max-height: 80vh;
    border-radius: 18px 18px 0 0;
    border-width: 2px 0 0;
    padding: 20px 16px;
  }

  .word-card-container::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 16px;
  }
}

/* ---- word card internals ---- */
.word-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.word-card-label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.word-card-title {
  color: #58CC02;
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
}

.word-card-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.word-card-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.word-card-section {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.word-card-section strong {
  color: #333;
}

.word-card-section p {
  margin: 3px 0 0;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.45;
}

.word-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.btn-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-word:hover { filter: brightness(1.12); }

.btn-word.listen {
  background: #1CB0F6;
  color: #333;
}

.btn-word.save {
  background: #FFC800;
  color: #131F24;
}

.btn-word.save.saved {
  background: #58CC02;
  color: #0f1a1f;
}

@media (max-width: 600px) {
  .btn-word {
    width: auto;
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.85rem;
  }
  .word-card-actions {
    gap: 6px;
    margin-top: 10px;
  }
}

/* ============================================================
   QUIZ OVERLAY
   ============================================================ */
.story-quiz-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10001;
}

.story-quiz-content {
  width: min(96vw, 700px);
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border: 2px solid rgba(88, 204, 2, 0.2);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.story-quiz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.story-quiz-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.3rem;
  font-weight: 800;
}

.quiz-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.quiz-item label {
  display: block;
  color: #e8e8e8;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.quiz-prompt {
  color: #bfdbfe;
  font-weight: 800;
  margin: 0 0 10px;
}

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

/* QUIZ OPTIONS — large mobile touch targets */
.quiz-option {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8e8;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
  display: block;
}

.quiz-option:hover:not([disabled]) {
  border-color: #1CB0F6;
  background: rgba(28, 176, 246, 0.1);
  transform: translateX(4px);
}

.quiz-option.selected {
  border-color: #1CB0F6 !important;
  background: rgba(28, 176, 246, 0.25) !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.3) !important;
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: #58CC02 !important;
  background: rgba(88, 204, 2, 0.22) !important;
  color: #d4f5a0 !important;
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.25) !important;
  transform: none;
}

.quiz-option.correct::after {
  content: ' ✓';
  float: right;
  color: #58CC02;
}

.quiz-option.wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.quiz-option.wrong::after {
  content: ' ✗';
  float: right;
  color: #ef4444;
}

.quiz-option[disabled]:not(.correct):not(.wrong) {
  opacity: 0.4;
  cursor: default;
}

.quiz-result {
  text-align: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: #FFC800;
  min-height: 28px;
  margin-top: 12px;
}

.story-quiz-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 20px;
}

/* quiz answer input fields */
.quiz-answer {
  width: 100%;
  border: 2px solid #2a3a42;
  border-radius: 12px;
  background: #131F24;
  color: #333;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 800;
  outline: none;
}

.quiz-answer.correct,
.ordered-answer.correct {
  border-color: #58CC02;
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.18);
}

.quiz-answer.wrong,
.ordered-answer.wrong {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.word-bank,
.ordered-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}

.ordered-answer {
  margin-top: 10px;
  padding: 10px;
  border: 2px dashed #334155;
  border-radius: 12px;
}

.word-bank button,
.ordered-answer button {
  border: none;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
}

.word-bank button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ============================================================
   BTN-EDITOR (used in quiz actions + video editor)
   ============================================================ */
.btn-editor {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  flex: 1;
  transition: filter 0.15s;
}

.btn-editor:hover { filter: brightness(1.1); }

.btn-editor.save {
  background: #58CC02;
  color: #333;
}

.btn-editor.cancel {
  background: #fff;
  color: #94a3b8;
}

.btn-editor.delete {
  background: #ef4444;
  color: #333;
}

/* ============================================================
   COMPLETION / FEEDBACK OVERLAY
   ============================================================ */
.feedback-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  z-index: 10020;
}

.feedback-content {
  width: min(92vw, 420px);
  background: #fff;
  border: 2px solid rgba(88, 204, 2, 0.28);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.feedback-emoji {
  font-size: clamp(2.5rem, 12vw, 4rem);
  line-height: 1;
  margin-bottom: 8px;
}

.feedback-text {
  color: #e8e8e8;
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  font-weight: 900;
}

.feedback-stars {
  font-size: 1.8rem;
  margin: 8px 0;
  line-height: 1.2;
}

.feedback-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}

.btn-feedback {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s;
}

.btn-feedback:hover { filter: brightness(1.1); }

.btn-feedback.primary {
  background: #1CB0F6;
  color: #333;
  border-bottom: 4px solid #1480B3;
}

.btn-feedback.secondary {
  background: #58CC02;
  color: #102016;
  border-bottom: 4px solid #3f9302;
}

.btn-feedback.ghost {
  background: transparent;
  color: #e8e8e8;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Mobile: slide up as bottom sheet */
@media (max-width: 600px) {
  .feedback-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .feedback-content {
    width: 100%;
    border-radius: 18px 18px 0 0;
    border-width: 2px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- small icon buttons ---- */
.btn-icon-small {
  background: #fff;
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-icon-small .material-symbols-rounded { font-size: 1.2rem; }

.btn-icon-small:hover {
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-icon-small.active {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #333;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-icon-small.delete:hover {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #333;
}

.btn-icon-small.recording {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #333;
  animation: micSmallPulse 1.2s infinite ease-in-out;
}

/* ============================================================
   ANNOTATION CANVAS
   ============================================================ */
.story-video-container {
  position: relative;
  width: 95%;
  max-width: 850px;
  margin: 10px auto;
  aspect-ratio: 16 / 9;
  background: #000;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: all 0.4s ease;
}

.story-video-container.expanded {
  width: 100%;
  max-width: 100%;
  margin: 0;
  aspect-ratio: auto;
  height: 75vh;
  border-radius: 0;
  box-shadow: none;
}

.btn-expand-video {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #333;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-expand-video:hover { background: rgba(0, 0, 0, 0.85); }

.annotation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: crosshair;
  border-radius: 12px;
}

.annotation-canvas.hidden {
  pointer-events: none;
  opacity: 0;
}

.annotation-toolbar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 20px;
}

.annotation-toolbar .color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.annotation-toolbar .color-dot:hover,
.annotation-toolbar .color-dot.active {
  transform: scale(1.3);
  border-color: #333;
}

.annotation-toolbar .btn-icon {
  background: rgba(255, 255, 255, 0.15);
}

.btn-draw-toggle.active {
  background: rgba(239, 68, 68, 0.25) !important;
  border: 2px solid #ef4444 !important;
}

/* ============================================================
   FLASHCARDS
   ============================================================ */
.flashcards-screen {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: #131F24;
}

.flashcard,
.empty-study {
  width: min(92vw, 560px);
  background: #1f3038;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.flashcard-word {
  color: #58CC02;
  font-size: clamp(2.4rem, 12vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
}

.flashcard-answer {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
  color: #dbeafe;
  text-align: left;
}

.flashcard-answer summary {
  color: #FFC800;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
}

.flashcard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.flashcard-actions button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: #333;
  font-weight: 900;
  cursor: pointer;
}

.flashcard-actions button:nth-child(1) { background: #ef4444; }
.flashcard-actions button:nth-child(2) { background: #1CB0F6; }
.flashcard-actions button:nth-child(3) { background: #58CC02; color: #102016; }

.flashcard-count {
  color: #94a3b8;
  font-size: 0.86rem;
  font-weight: 800;
}

.empty-study .material-symbols-rounded {
  color: #58CC02;
  font-size: 4rem;
}

.empty-study h2 {
  color: #333;
  margin: 10px 0 8px;
}

.empty-study p {
  color: #94a3b8;
  margin: 0;
}

/* ============================================================
   NOTEPAD MODAL
   ============================================================ */
.notepad-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.notepad-content {
  background: #fff;
  padding: 20px;
  border-radius: 24px;
  width: 94%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.notepad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.notepad-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1a2e;
}

.notepad-textarea {
  width: 100%;
  min-height: 180px;
  max-height: 40vh;
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}

.notepad-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.notepad-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notepad-lang-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: center;
}

.lang-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-chip.active {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}

.btn-mic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-mic.recording {
  animation: micPulse 1s ease-in-out infinite;
  background: #dc2626;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3);
}

/* ============================================================
   PRONUNCIATION PRACTICE MODAL
   ============================================================ */
.pron-practice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pron-practice-content {
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pron-practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pron-practice-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a2e;
}

.pron-practice-counter {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 700;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 20px;
  align-self: center;
}

.pron-practice-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 24px 20px;
  margin: 10px 0;
  line-height: 1.5;
  max-height: 40vh;
  overflow-y: auto;
}

.pron-practice-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 120px;
  justify-content: center;
}

.pron-btn-record {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #ef4444;
  color: #333;
  border: none;
  border-radius: 20px;
  padding: 16px 32px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.pron-btn-record .material-symbols-rounded { font-size: 2rem; }

.pron-btn-record:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.pron-btn-record.recording {
  background: #dc2626;
  animation: micRecordPulse 1.5s infinite;
}

.pron-playback-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.pron-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pron-btn.user    { background: linear-gradient(135deg, #f59e0b, #f97316); color: #333; }
.pron-btn.correct { background: linear-gradient(135deg, #10b981, #059669); color: #333; }
.pron-btn.retry   { background: #f1f5f9; color: #475569; }

.pron-practice-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.btn-pron.recording {
  color: #ef4444 !important;
  animation: pronPulse 0.8s infinite;
}

/* ============================================================
   VIDEO EDITOR MODAL
   ============================================================ */
.video-editor-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.video-editor-content {
  background: #fff;
  padding: 24px;
  border-radius: 24px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-editor-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.video-editor-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-editor-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.video-editor-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ============================================================
   STORIES BANNER (categories page)
   ============================================================ */
.stories-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  margin: 12px auto 20px;
  max-width: 700px;
  width: calc(100% - 32px);
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.1), rgba(28, 176, 246, 0.1));
  border: 2px solid rgba(88, 204, 2, 0.15);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stories-banner:hover {
  transform: translateY(-2px);
  border-color: #8b5cf6;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

.stories-banner .category-icon {
  font-size: 2.5rem;
  animation: storyBounce 2s ease-in-out infinite;
  flex-shrink: 0;
}

.stories-banner .category-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #333;
}

.stories-banner .category-desc {
  font-size: 0.85rem;
  color: #a0aec0;
}

/* ============================================================
   HOME SCREEN BUTTONS
   ============================================================ */
.home-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 4px;
}

.btn-stories {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
  font-size: 1rem !important;
}

.btn-stories:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4) !important;
}

/* ============================================================
   LAYOUT TOGGLE — SIDE-BY-SIDE / VIDEO-SIDE (desktop)
   ============================================================ */
.story-content-wrapper.side-by-side,
.story-content-wrapper.video-side {
  flex-direction: column;
}

@media (min-width: 769px) {
  .story-content-wrapper.side-by-side {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    height: 100%;
    overflow: hidden;
  }

  .story-content-wrapper.side-by-side .story-main-layout {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }

  .story-content-wrapper.side-by-side .story-video-container {
    width: 100%;
    height: auto;
    max-height: 35vh;
    margin: 0 auto 10px;
  }

  .story-content-wrapper.video-side {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    height: 100%;
    overflow: hidden;
  }
}

/* ============================================================
   TABLET ADJUSTMENTS (769px – 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .btn-icon-small {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .btn-icon-small .material-symbols-rounded { font-size: 1.1rem; }
}

/* ============================================================
   MOBILE — compact overrides (≤600px)
   ============================================================ */
@media (max-width: 600px) {
  /* Story scene: compact so text + nav always visible */
  .story-scene {
    min-height: 80px;
    max-height: 15vh;
  }

  .story-text-area {
    padding: 14px 16px;
  }

  .story-subtitle {
    font-size: 0.95rem;
    padding: 6px 12px;
    margin-bottom: 8px;
  }

  .story-content-text {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    line-height: 1.7;
  }

  /* Story cards */
  .story-card-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .story-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  /* Video */
  .story-video-container.expanded {
    height: 40vh;
  }

  /* Modals */
  .video-editor-content,
  .notepad-content,
  .pron-practice-content {
    padding: 16px;
    width: 95%;
  }

  /* Layout wrappers */
  .story-content-wrapper,
  .story-main-layout {
    height: auto;
    min-height: 0;
  }
}

/* ========================================
   BILINGUAL BOOKS STYLES
   ======================================== */

.book-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.book-split-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .book-split-layout {
    flex-direction: row;
    gap: 0;
  }
}

.book-page {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 30px;
}

.book-lang-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: #333;
}

.book-content {
  font-size: 1.15rem;
  line-height: 1.8;
}

.book-paragraph {
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: inherit;
}

.book-paragraph:hover {
  background: rgba(255, 255, 255, 0.05);
}

.book-page.fullscreen-mobile {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 50;
  margin: 0 !important;
}

.btn-expand-mobile {
  position: sticky;
  top: 15px;
  float: right;
  margin-bottom: -36px;
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(5px);
  transition: background 0.2s;
}

.btn-expand-mobile:hover {
  background: rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
  .btn-expand-mobile {
    display: none !important;
  }
}


.book-paragraph.speaking {
  background: rgba(88, 204, 2, 0.2);
  color: #58CC02;
  font-weight: 700;
}

/* FORCE FONT SIZES FOR POPUP TO PREVENT INHERITANCE BUG */
.word-card-section strong {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  display: block;
}
.word-card-section p {
  font-size: 0.95rem !important;
}
.word-card-label {
  font-size: 0.75rem !important;
}
.word-card-container {
  font-size: 1rem !important;
  z-index: 9999 !important;
}


/* =========================================
   VOCABULARY LIST MODAL & TOAST
   ========================================= */

.vocab-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  z-index: 10000;
  opacity: 1;
  transition: all 0.3s ease;
  animation: slideUpToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.vocab-toast.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.vocab-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vocab-modal-content {
  background: white;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vocab-modal-header {
  padding: 20px 24px;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.vocab-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1e293b;
}

.vocab-list-container {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f1f5f9;
}

.vocab-item-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

.vocab-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.vocab-item-word {
  font-size: 1.25rem;
  font-weight: 800;
  color: #3b82f6;
  text-transform: capitalize;
}

.vocab-item-translation {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.vocab-item-context {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid #94a3b8;
}

.vocab-ctx-es {
  color: #334155;
  font-size: 1rem;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.vocab-ctx-es strong {
  color: #ea580c;
  font-weight: 800;
}

.vocab-ctx-target {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0;
  font-style: italic;
  line-height: 1.5;
}


.story-word.highlighted {
  background-color: #fef08a !important; /* light yellow */
  color: #b45309 !important; /* dark orange text */
  border-radius: 4px;
  padding: 0 2px;
  transition: all 0.2s ease;
  transform: scale(1.1);
  display: inline-block;
}

@keyframes btnPulseOrange {
  0% { transform: scale(1); background-color: transparent; color: inherit; }
  50% { transform: scale(1.2); background-color: #f97316; color: white; border-radius: 50%; }
  100% { transform: scale(1); background-color: transparent; color: inherit; }
}
.pulse-orange {
  animation: btnPulseOrange 0.6s ease-out;
}


/* Book Banner Image */
.book-banner-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
  object-fit: cover;
  object-position: center;
  max-height: 120px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .book-banner-img {
    display: none !important;
  }
}
