/* 
 * Anh ngữ T-IELTS Nha Trang - Custom Stylesheet
 * Computer-delivered IELTS Experience & Center Branding
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  --primary-color: #f59e0b;
  --primary-dark: #d97706;
  --secondary-color: #0f172a;
  --accent-red: #dc2626;
  --accent-red-dark: #991b1b;
}

body {
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  background-color: #020617;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', 'Outfit', sans-serif;
}

.passage-text {
  font-family: 'Merriweather', Georgia, Cambria, serif;
  line-height: 1.8;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Split Pane for IELTS Computer Exam */
.test-room-container {
  height: calc(100vh - 120px);
}

@media (max-width: 1024px) {
  .test-room-container {
    height: auto;
    min-height: 80vh;
  }
}

/* Highlighted text styling */
.highlighted-text {
  transition: all 0.2s ease;
  cursor: pointer;
}
.highlighted-text:hover {
  filter: brightness(0.92);
}

/* Question Palette pills */
#question-palette-pills button {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* Pulse animation for timer */
@keyframes warningPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.timer-urgent {
  animation: warningPulse 1s infinite;
}

/* Print view for Official Test Report */
@media print {
  body {
    background: white !important;
  }
  #main-header, #main-footer, #toast-container, button {
    display: none !important;
  }
  #view-result {
    display: block !important;
  }
  #result-report-card {
    box-shadow: none !important;
    border: 2px solid #000 !important;
  }
}

/* ==================== 3D FLASHCARD VOCABULARY ==================== */
.flip-card {
  perspective: 1200px;
}
.flip-card-inner {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  position: relative;
}
.rotate-y-180 {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card-back {
  transform: rotateY(180deg);
}

/* ==================== IELTS COMPUTER HIGHLIGHT & JUMP STYLES ==================== */
mark.hl-yellow, .highlight-yellow {
  background-color: #fde047 !important;
  color: #0f172a !important;
  border-radius: 2px;
  padding: 1px 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
}

mark.hl-green, .highlight-green {
  background-color: #86efac !important;
  color: #0f172a !important;
  border-radius: 2px;
  padding: 1px 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
}

#floating-highlight-bar {
  animation: fadeInPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

@keyframes fadeInPop {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Auto Jump Pulse for Questions */
@keyframes qJumpPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.question-jump-active {
  animation: qJumpPulse 0.8s ease-in-out;
  border-color: #dc2626 !important;
  background-color: #fffbeb !important;
}

/* ==================== IELTS PRIME TEST ROOM EXACT STYLING ==================== */
.exam-v2 {
  --v2-blue: #0b66b2;
  --v2-red: #dc2626;
  --v2-selected: #cfe8f8;
  --v2-border: #cbd0d4;
  --v2-bar: #f4f5f2;
}

.exam-v2-header {
  height: 58px;
  background: #ffffff;
  border-top: 4px solid #dc2626;
  border-bottom: 1px solid #e2e8f0;
}

.exam-part-banner {
  background: #f3f4ef;
  border-bottom: 1px solid #d6d8d3;
}

/* IELTS Prime Resizer */
.resizer {
  cursor: col-resize;
  user-select: none;
}
.resizer:hover, .resizer.is-dragging {
  background-color: #94a3b8 !important;
}

/* IELTS Prime Bottom Navigation Bar */
.v2-bottom-nav {
  height: 60px;
  min-height: 60px;
  width: 100%;
  max-width: 100%;
  background: #f4f7f9;
  border-top: 1px solid #cbd0d4;
}

.part-preview-btn {
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 14px !important;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #475569;
  border-bottom: 3px solid transparent !important;
  transition: all 0.15s ease;
}

.part-preview-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.part-preview-btn.is-active {
  color: #dc2626;
  background: #ffffff;
  box-shadow: inset 0 3px 0 #dc2626;
  border-bottom-color: transparent !important;
}

/* IELTS Prime Question Nav Item */
.q-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 28px;
}

.q-nav-bar {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.q-nav-item.is-answered .q-nav-bar {
  background: #31a24c;
}

.q-nav-mark {
  width: 22px !important;
  height: 13px !important;
  display: grid;
  place-items: center;
  color: transparent;
  background: transparent !important;
  font-size: 10px;
  line-height: 1;
  border: none;
  cursor: pointer;
}

.q-nav-mark:hover {
  color: #cbd5e1;
}

.q-nav-mark.is-marked {
  color: #dc2626 !important;
}

.q-nav-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-nav-num:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.q-nav-item.is-current .q-nav-num {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
  border-color: #dc2626;
}

.q-nav-item.is-answered .q-nav-num {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* IELTS Prime Authentic Exam Content & Widgets (.exam-v2 & .tinymce-content) */
.exam-v2 .tinymce-content {
  font-size: 15.5px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #161616;
}
.exam-v2 .tinymce-content li {
  list-style: disc inside;
  padding-left: 1em;
  margin-top: 4px;
}
.exam-v2 .tinymce-content ul ul {
  padding-left: 1.5em;
}
.exam-v2 .tinymce-content ul ul li {
  list-style: circle inside;
}
.exam-v2 .tinymce-content p {
  margin: 0 !important;
  margin-top: 10px !important;
  text-indent: 0px !important;
}
.exam-v2 .tinymce-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}
.exam-v2 .tinymce-content td,
.exam-v2 .tinymce-content th {
  border: 1px solid #d6d8dc;
  padding: 6px 10px;
}
.exam-v2 .tinymce-content th {
  background-color: #f8fafc;
  color: #111;
  font-weight: 700;
}
.exam-v2 .tinymce-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 8px 0;
}

.exam-v2 .question-group-item {
  margin: 0 0 28px !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.exam-v2 .question-group-item > h2 {
  color: #dc2626 !important;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.exam-v2 .question-card {
  position: relative;
  padding: 10px 10px 14px;
  margin-top: 8px !important;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.exam-v2 .question-card:hover {
  background: #fafafa;
}
.exam-v2 .question-bookmark-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  color: #94a3b8;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
}
.exam-v2 .question-bookmark-btn:hover {
  color: #f59e0b;
  background: #fef3c7;
}
.exam-v2 .question-bookmark-btn.is-marked {
  color: #dc2626 !important;
}

.exam-v2 .v2-question-number {
  color: #111;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
}
.exam-v2 .is-active-question .v2-question-number,
.exam-v2 .question-item:focus-within .v2-question-number,
.exam-v2 .question-card:focus-within .v2-question-number {
  border: 1.5px solid #dc2626 !important;
  background: #fef2f2;
  color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

/* Inline Text Inputs (.preview-input) */
.exam-v2 input[type="text"].preview-input {
  min-height: 30px;
  height: 30px;
  min-width: 120px;
  padding: 2px 10px;
  border: 1.5px solid #475569;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transition: all 0.15s ease;
  margin: 2px 4px;
}
.exam-v2 input[type="text"].preview-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
  outline: none;
  background: #fffbeb;
}
.exam-v2 input[type="text"].preview-input::placeholder {
  color: #94a3b8;
  font-weight: 700;
  opacity: 1;
  text-align: center;
}

/* Radio & Checkbox Inputs (.preview-input) */
.exam-v2 .answer-config-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  background: #ffffff;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
  margin-bottom: 4px;
}
.exam-v2 .answer-config-item:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1;
}
.exam-v2 .answer-config-item:has(input:checked),
.exam-v2 .answer-config-item.is-selected {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  font-weight: 600;
}
.exam-v2 input[type="radio"].preview-input,
.exam-v2 input[type="checkbox"].preview-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid #475569 !important;
  border-radius: 50% !important;
  background: #fff !important;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.exam-v2 input[type="radio"].preview-input:checked,
.exam-v2 input[type="checkbox"].preview-input:checked {
  border-color: #dc2626 !important;
  background: #fff !important;
}
.exam-v2 input[type="radio"].preview-input:checked::after,
.exam-v2 input[type="checkbox"].preview-input:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
}

/* Table Grid Radio (.answer-table) */
.exam-v2 .answer-table-wrap {
  border: 2px solid #1e293b;
  border-radius: 6px;
  padding: 4px;
  background: #fff;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.exam-v2 .answer-table {
  border: 0 !important;
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
}
.exam-v2 .answer-table th,
.exam-v2 .answer-table td {
  padding: 0 !important;
  border: 0 !important;
  border-right: 1.5px solid #cbd5e1 !important;
  border-bottom: 1.5px solid #cbd5e1 !important;
  background: transparent !important;
}
.exam-v2 .answer-table th:last-child,
.exam-v2 .answer-table td:last-child {
  border-right: 0 !important;
}
.exam-v2 .answer-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
.exam-v2 .answer-table th {
  color: #0f172a !important;
  font-weight: 800;
  height: 28px;
  background: #f8fafc !important;
}
.exam-v2 .answer-table .answer-table-label {
  padding: 5px 12px 5px 6px;
  min-height: 28px;
}
.exam-v2 .answer-table .answer-table-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0;
  cursor: pointer;
}
.exam-v2 .answer-table th:not(:first-child),
.exam-v2 .answer-table td:not(:first-child) {
  width: 42px;
  min-width: 42px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
}
.exam-v2 .answer-table td:not(:first-child):hover {
  background: #f1f5f9 !important;
}
.exam-v2 .answer-table td:has(input:checked) {
  background: #fef3c7 !important;
}

/* Drag & Drop / Click-to-Match Drop Zones & Option Pools */
.exam-v2 .drop-zone {
  border: 1.5px dashed #64748b;
  border-radius: 6px;
  padding: 4px 12px;
  min-height: 30px;
  background: #f8fafc;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.exam-v2 .drop-zone-wide {
  width: 92%;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}
.exam-v2 .drop-zone:not(.drop-zone-wide) {
  min-width: 9rem;
  max-width: 100%;
}
.exam-v2 .drop-zone:hover,
.exam-v2 .drop-zone.drag-over {
  background: #fef2f2;
  border-color: #dc2626;
}
.exam-v2 .drop-zone[data-value]:not([data-value=""]) {
  background: #fffbeb;
  border-style: solid;
  border-color: #f59e0b;
  color: #b45309;
}
.exam-v2 .drop-zone .drop-zone-number {
  color: #64748b;
  font-weight: 700;
}
.exam-v2 .match-options {
  order: 2;
  border-top: 1px solid #e2e8f0 !important;
  margin-top: 14px !important;
  padding-top: 12px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.exam-v2 .option-item {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: grab;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.exam-v2 .option-item:hover {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}
.exam-v2 .option-item.is-picked-option {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* ==================== IELTS PRIME EXAM LIBRARY CATALOG UI ==================== */
:root {
  --prime-primary: 217 119 6; /* Amber 600 */
  --prime-accent: 220 38 38;  /* Red 600 */
}

/* Thẻ đề thi 3D (2 phần: trên = ảnh minh họa 3:2, dưới = thông tin đề + nút Luyện tập) */
.exam3d {
  position: relative;
}
.exam3d-inner {
  transition: box-shadow 0.35s ease, transform 0.25s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 14px rgba(15, 23, 42, 0.06);
}
.exam3d:hover .exam3d-inner {
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.16), 0 6px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.exam-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}
.exam-card-media {
  aspect-ratio: 3 / 2;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}
.exam-card-folder {
  max-width: 100%;
}
.exam3d-accent img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.exam3d:hover .exam3d-accent img {
  transform: scale(1.06);
}

/* Popup preview nổi theo con trỏ khi di chuột lên ảnh bìa đề thi */
#exam-preview-float {
  opacity: 0;
  transition: opacity 0.14s ease;
  pointer-events: none;
}
#exam-preview-float.show {
  opacity: 1;
}

/* Node cây ngân hàng đề thi (Sidebar) */
.exam-node {
  transition: background-color 0.15s ease, color 0.15s ease;
}
.exam-node:hover {
  background: #d97706;
  color: #ffffff !important;
}
.exam-node.is-active {
  background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.28);
  font-weight: 700;
}
.exam-node:hover .exam-icon,
.exam-node.is-active .exam-icon {
  color: #ffffff !important;
}
.exam-node:hover .exam-count,
.exam-node.is-active .exam-count {
  background: rgba(255, 255, 255, 0.24) !important;
  color: #ffffff !important;
}

/* Nút Luyện tập (hover đảo nền trắng + viền chủ đạo như IELTS Prime) */
.btn-invert-hover {
  background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
  color: #ffffff;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.btn-invert-hover:hover {
  background: #ffffff !important;
  color: #d97706 !important;
  border: 1px solid #d97706 !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.18);
}

/* Thẻ Header Banner thư viện đề thi (.folder-header) */
.folder-header {
  background-image: url('../images/tielts-cards/header-banner-tielts.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-color: transparent;
  border-radius: 1.5rem;
  width: 100%;
  aspect-ratio: 1819 / 415;
  min-height: 92px;
  align-items: flex-end;
}
.folder-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 1rem;
  padding: 0.5rem 0.95rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}
.folder-title {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.folder-count {
  color: #475569;
  font-weight: 600;
}
.hdr-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

/* Hình minh họa chân cột cây thư mục (.folder-tree-footer) */
.folder-tree-footer {
  margin: 1.5rem 0.25rem 0.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(217, 119, 6, 0.2);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  line-height: 0;
}
.folder-tree-footer img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 555 / 368;
}

/* Nút Xem thêm đề thi (.load-more-btn) */
.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
  color: #ffffff;
  border: 0;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
  transition: filter 0.2s, transform 0.15s;
}
.load-more-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.load-more-btn:active {
  transform: translateY(1px);
}

/* ==================== MOBILE RESPONSIVE ENHANCEMENTS ==================== */

/* Utility: Hide Scrollbar while keeping touch scroll active */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  transition: all 0.15s ease;
  min-width: 52px;
  padding: 4px 6px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
}
.mobile-nav-item i {
  font-size: 17px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.mobile-nav-item.is-active,
.mobile-nav-item:hover {
  color: #dc2626;
}
.mobile-nav-item.is-active i {
  transform: translateY(-1px) scale(1.1);
  color: #dc2626;
}

/* Mobile Off-canvas Drawer Navigation */
#mobile-nav-drawer {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  will-change: transform;
}
#mobile-nav-drawer.drawer-closed {
  transform: translateX(100%);
  pointer-events: none;
  opacity: 0;
}
#mobile-nav-drawer.drawer-open {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

/* Responsive Overrides for Screens <= 768px */
@media (max-width: 768px) {
  /* Prevent text clipping and overflow on phone screens */
  body {
    padding-bottom: 68px; /* Offset for sticky mobile bottom nav */
  }
  
  /* Disable body bottom padding inside the fullscreen test room */
  body:has(#view-test-room:not(.hidden)) {
    padding-bottom: 0 !important;
  }

  /* Catalog Folder Header Banner on Mobile: Never squash or clip text */
  .folder-header {
    aspect-ratio: auto !important;
    min-height: auto !important;
    border-radius: 1rem !important;
    padding: 0.85rem !important;
    background-size: cover;
  }
  .folder-header-chip {
    width: 100% !important;
    padding: 0.6rem 0.75rem !important;
    border-radius: 0.75rem !important;
    gap: 0.5rem !important;
  }
  .folder-header .hdr-group {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 0.4rem 0.6rem !important;
  }
  .folder-header .hdr-group .relative {
    width: 100% !important;
  }

  /* Exam Test Room on Mobile: Fullscreen, clean tab switcher between Passage & Questions */
  #view-test-room {
    height: 100vh !important;
    max-height: 100dvh !important;
  }
  .exam-v2-header {
    height: 52px !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .exam-title-block #test-title-header {
    max-width: 120px !important;
    font-size: 11px !important;
  }

  /* In mobile test room, pane can be toggled full-width without cramping */
  .mobile-pane-hidden {
    display: none !important;
  }
  .mobile-pane-visible {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* IELTS Prime Bottom Nav on Mobile */
  .v2-bottom-nav {
    height: 56px !important;
    min-height: 56px !important;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
  }
  .q-nav-item {
    min-width: 24px !important;
  }
  .q-nav-num {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
  }
  .q-nav-bar {
    width: 18px !important;
    height: 2.5px !important;
  }

  /* Admin Modal on Mobile */
  #admin-dashboard-modal .bg-white {
    height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
}

/* Responsive Image Protections */
img {
  max-width: 100%;
  height: auto;
}




