/* ============================================================
   XB Course Generator - Professional Lesson Page Styles
   Targets custom xb-* template classes from child theme overrides
   ============================================================ */

:root {
  --xb-primary: #4f46e5;
  --xb-primary-light: #818cf8;
  --xb-primary-dark: #3730a3;
  --xb-primary-bg: #eef2ff;
  --xb-sidebar-width: 310px;
  --xb-sidebar-bg: #f8fafc;
  --xb-text: #1e293b;
  --xb-text-muted: #64748b;
  --xb-border: #e2e8f0;
  --xb-success: #10b981;
  --xb-radius: 10px;
  --xb-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --xb-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --xb-header-height: 52px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.xb-lesson-page {
  display: flex;
  min-height: 100vh;
  background: #fff;
  position: relative;
}
.xb-sidebar {
  width: var(--xb-sidebar-width);
  min-width: var(--xb-sidebar-width);
  background: var(--xb-sidebar-bg);
  border-right: 1px solid var(--xb-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 50;
  transition: margin-left .3s ease, opacity .3s ease;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.xb-sidebar::-webkit-scrollbar { width: 5px; }
.xb-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.xb-sidebar::-webkit-scrollbar-track { background: transparent; }

.xb-sidebar.is-hidden {
  margin-left: calc( var(--xb-sidebar-width) * -1 );
  opacity: 0;
  pointer-events: none;
}
.xb-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 49;
}
.xb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER BAR
   ============================================================ */
.xb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--xb-header-height);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}
.xb-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  flex-shrink: 0;
  font-size: 16px;
}
.xb-header-btn:hover { background: rgba(255,255,255,.25); color: #fff; }
.xb-header-title {
  flex: 1;
  min-width: 0;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xb-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.xb-header-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xb-header-progress-text {
  font-size: 13px;
  color: rgba(255,255,255,.9);
  font-weight: 500;
  white-space: nowrap;
}
.xb-header-progress-text span { font-weight: 700; }
.xb-header-progress-bar {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: 3px;
  overflow: hidden;
}
.xb-header-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width .4s ease;
}
.xb-ml-auto { margin-left: auto; }

/* Visibility helpers */
.xb-d-none { display: none !important; }
.xb-d-xl-none { /* shown by default, hidden at >= 1200 */ }
.xb-d-xl-flex { display: none !important; }
@media (min-width: 1200px) {
  .xb-d-xl-none { display: none !important; }
  .xb-d-xl-flex { display: flex !important; }
}

/* ============================================================
   SIDEBAR HEADER
   ============================================================ */
.xb-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--xb-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.xb-sidebar-header-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--xb-text);
  letter-spacing: .3px;
}
.xb-sidebar-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--xb-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s;
}
.xb-sidebar-close:hover { background: #f1f5f9; }

/* ============================================================
   SIDEBAR TOPICS (Accordion)
   ============================================================ */
.xb-sidebar-topics {
  flex: 1;
}
.xb-topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: #fff;
  border-bottom: 1px solid var(--xb-border);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.xb-topic-header:hover { background: var(--xb-primary-bg); }
.xb-topic.is-active > .xb-topic-header {
  background: var(--xb-primary-bg);
  border-left: 3px solid var(--xb-primary);
}
.xb-topic-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.xb-topic-chevron {
  font-size: 14px;
  color: var(--xb-text-muted);
  flex-shrink: 0;
  transition: transform .25s ease;
}
.xb-topic-title {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--xb-text);
  text-transform: uppercase;
  letter-spacing: .5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xb-topic-badge {
  background: var(--xb-primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
}
.xb-topic-body {
  background: var(--xb-sidebar-bg);
  padding: 4px 0;
  overflow: hidden;
}
.xb-topic-body.is-collapsed {
  display: none;
}
/* Chevron rotation when collapsed */
.xb-topic-body.is-collapsed ~ .xb-topic-header .xb-topic-chevron,
.xb-topic:not(.is-active) > .xb-topic-header .xb-topic-chevron {
  /* JS handles this via toggling class on .xb-topic-header */
}
.xb-topic-header.is-collapsed .xb-topic-chevron {
  transform: rotate(-90deg);
}

/* ============================================================
   SIDEBAR ITEMS (Lessons, Quizzes, Assignments)
   ============================================================ */
.xb-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 20px;
  text-decoration: none !important;
  color: var(--xb-text) !important;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.xb-sidebar-item:hover {
  background: #f1f5f9;
  color: var(--xb-text) !important;
}
.xb-sidebar-item.is-active {
  background: var(--xb-primary-bg);
  border-left: 3px solid var(--xb-primary);
}
.xb-sidebar-item.is-active .xb-item-title {
  color: var(--xb-primary);
  font-weight: 600;
}

/* Item Icons */
.xb-item-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  font-size: 14px;
}
.xb-icon-lesson    { background: #dbeafe; color: #2563eb; }
.xb-icon-video     { background: #fee2e2; color: #dc2626; }
.xb-icon-quiz      { background: #fef3c7; color: #d97706; }
.xb-icon-assignment { background: #d1fae5; color: #059669; }

/* Item Title */
.xb-item-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--xb-text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Item Status (right side) */
.xb-item-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.xb-item-duration {
  font-size: 11px;
  color: var(--xb-text-muted);
  font-weight: 500;
}
.xb-lock-icon {
  font-size: 13px;
  color: #cbd5e1;
}

/* Completion checkmark */
.xb-check {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  transition: all .2s;
}
.xb-check.is-done {
  background: var(--xb-success);
  border-color: var(--xb-success);
}
.xb-check.is-done::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.xb-check.xb-check-fail {
  border-color: #ef4444;
  background: #fef2f2;
}
.xb-check.xb-check-pending {
  border-color: #f59e0b;
  background: #fffbeb;
}

/* ============================================================
   LESSON BODY (video + tabs + content)
   ============================================================ */
.xb-lesson-body {
  flex: 1;
  padding: 0;
}

/* Lesson Title */
.xb-lesson-title-wrap {
  padding: 20px 28px 0;
}
.xb-lesson-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--xb-text);
  margin: 0 0 16px;
  line-height: 1.3;
}

/* Video Player */
.xb-video-wrap {
  max-width: 720px;
  margin: 0 auto 20px;
  padding: 0 28px;
}
.xb-video-wrap .tutor-video-player {
  border-radius: var(--xb-radius);
  overflow: hidden;
  box-shadow: var(--xb-shadow-md);
  background: #000;
}
.xb-video-wrap .tutor-ratio-16x9,
.xb-video-wrap .plyr__video-embed {
  border-radius: var(--xb-radius);
}

/* ============================================================
   TABS
   ============================================================ */
.xb-tabs {
  display: flex;
  border-bottom: 2px solid var(--xb-border);
  padding: 0 28px;
  gap: 0;
  background: #fff;
}
.xb-tab-link {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--xb-text-muted);
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
}
.xb-tab-link:hover {
  color: var(--xb-primary);
}
.xb-tab-link.is-active {
  color: var(--xb-primary);
  border-bottom-color: var(--xb-primary);
  font-weight: 600;
}

/* Tab Content */
.xb-tab-content {
  padding: 0;
}

/* ============================================================
   LESSON CONTENT AREA (inside overview tab)
   ============================================================ */
.xb-lesson-content,
.tutor-lesson-wrapper {
  max-width: 100%;
  padding: 28px 32px 40px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--xb-text);
}

/* Widen the overview content column */
#tutor-course-spotlight-overview .tutor-col-xl-8 {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* Headings */
.xb-lesson-content h2,
.tutor-lesson-wrapper h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--xb-text);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--xb-primary-bg);
}
.xb-lesson-content h3,
.tutor-lesson-wrapper h3 {
  font-size: 18px;
  font-weight: 600;
  color: #334155;
  margin: 24px 0 10px;
}
.xb-lesson-content h4,
.tutor-lesson-wrapper h4 {
  font-size: 16px;
  font-weight: 600;
  color: #475569;
  margin: 20px 0 8px;
}

/* Paragraphs */
.xb-lesson-content p,
.tutor-lesson-wrapper p {
  margin-bottom: 14px;
  line-height: 1.75;
}

/* Lists */
.xb-lesson-content ul,
.xb-lesson-content ol,
.tutor-lesson-wrapper ul,
.tutor-lesson-wrapper ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.xb-lesson-content li,
.tutor-lesson-wrapper li {
  margin-bottom: 8px;
  line-height: 1.65;
}
/* Prevent paragraph spacing inside list items (markdown wraps li content in <p>) */
.xb-lesson-content li > p,
.tutor-lesson-wrapper li > p {
  margin-bottom: 4px;
}
.xb-lesson-content li > p:last-child,
.tutor-lesson-wrapper li > p:last-child {
  margin-bottom: 0;
}
.xb-lesson-content ul li::marker,
.tutor-lesson-wrapper ul li::marker {
  color: var(--xb-primary-light);
}

/* Links */
.xb-lesson-content a,
.tutor-lesson-wrapper a {
  color: var(--xb-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.xb-lesson-content a:hover,
.tutor-lesson-wrapper a:hover {
  border-bottom-color: var(--xb-primary);
}

/* Images */
.xb-lesson-content img,
.tutor-lesson-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: var(--xb-radius);
  box-shadow: var(--xb-shadow-sm);
  margin: 16px auto;
  display: block;
}

/* Tables */
.xb-lesson-content table,
.tutor-lesson-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border-radius: var(--xb-radius);
  overflow: hidden;
  box-shadow: var(--xb-shadow-sm);
}
.xb-lesson-content table thead th,
.tutor-lesson-wrapper table thead th {
  background: var(--xb-primary);
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
}
.xb-lesson-content table td,
.tutor-lesson-wrapper table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--xb-border);
}
.xb-lesson-content table tbody tr:nth-child(even),
.tutor-lesson-wrapper table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.xb-lesson-content table tbody tr:hover,
.tutor-lesson-wrapper table tbody tr:hover {
  background: var(--xb-primary-bg);
}

/* Strong / Bold */
.xb-lesson-content strong,
.tutor-lesson-wrapper strong {
  font-weight: 600;
  color: #0f172a;
}

/* Inline code */
.xb-lesson-content code,
.tutor-lesson-wrapper code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #be185d;
}

/* Block code / ASCII tables (e.g. synthetic division) — preserve whitespace
   alignment and render as a neutral monospace block, not pink inline text. */
.xb-lesson-content pre,
.tutor-lesson-wrapper pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--xb-radius, 8px);
  padding: 14px 16px;
  margin: 16px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  tab-size: 4;
}

.xb-lesson-content pre code,
.tutor-lesson-wrapper pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #334155;
  font-size: inherit;
  white-space: inherit;
}

/* Blockquotes */
.xb-lesson-content blockquote,
.tutor-lesson-wrapper blockquote {
  border-left: 4px solid var(--xb-primary);
  background: var(--xb-primary-bg);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--xb-radius) var(--xb-radius) 0;
  font-style: italic;
  color: #475569;
}

/* ============================================================
   PERSONALIZATION BANNER
   ============================================================ */
.xb-personalization-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--xb-radius, 8px);
  margin-bottom: 20px;
  font-size: 14px;
  box-shadow: var(--xb-shadow-sm, 0 1px 3px rgba(0,0,0,.1));
}
.xb-pb-greeting { font-weight: 700; }
.xb-pb-location { font-weight: 400; opacity: 0.9; font-size: 13px; }
@media (max-width: 768px) {
  .xb-personalization-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 16px;
  }
}

/* ============================================================
   XB PLUGIN SECTIONS (Intro, Teacher Notes, Help Links)
   ============================================================ */
.xb-lesson-intro {
  border-radius: 12px;
  padding: 24px 28px;
  margin: 24px 0;
  font-size: 16px;
  line-height: 1.7;
  box-shadow: 0 4px 15px rgba(102,126,234,.25);
}

.xb-teacher-notes {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: 0 var(--xb-radius) var(--xb-radius) 0;
  padding: 20px 24px;
  margin: 32px 0;
  box-shadow: var(--xb-shadow-sm);
}
.xb-teacher-notes h3 {
  color: #0369a1 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  margin-bottom: 12px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid #bae6fd;
}
.xb-teacher-notes ol,
.xb-teacher-notes ul {
  padding-left: 20px;
}
.xb-teacher-notes a {
  color: #0369a1;
  font-weight: 500;
}
.xb-teacher-notes a:hover {
  color: #0284c7;
  text-decoration: underline;
}

.tutor-course-help-link {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-left: 4px solid #059669;
  border-radius: 0 var(--xb-radius) var(--xb-radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.tutor-course-help-link h4 {
  color: #047857;
  margin: 0 0 8px;
}

/* ============================================================
   ASSIGNMENT PAGE (Tutor Pro elements inside our layout)
   ============================================================ */
.xb-main .tutor-assignment-content {
  padding: 24px 32px;
}
.xb-main .tutor-assignment-body {
  max-width: 100%;
}
.xb-main .tutor-assignment-submission {
  padding: 24px 32px;
}
.xb-main .tutor-assignment-footer {
  padding: 20px 32px;
}
.xb-main .tutor-assignment-footer .tutor-btn-primary,
.xb-main #tutor_assignment_start_btn,
.xb-main #tutor_assignment_submit_btn {
  background: var(--xb-primary) !important;
  border-color: var(--xb-primary) !important;
  border-radius: 8px !important;
  padding: 10px 28px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: all .2s;
}
.xb-main .tutor-assignment-footer .tutor-btn-primary:hover,
.xb-main #tutor_assignment_start_btn:hover,
.xb-main #tutor_assignment_submit_btn:hover {
  background: var(--xb-primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.3) !important;
}
.xb-main .tutor-assignment-submit-btn {
  padding: 16px 0;
}
/* Assignment attachment area */
.xb-main .tutor-assignment-attachment {
  background: var(--xb-primary-bg);
  border: 2px dashed var(--xb-border);
  border-radius: var(--xb-radius);
}
/* Assignment info cards (marks, deadline) */
.xb-main .tutor-assignment-info {
  border-radius: var(--xb-radius);
  overflow: hidden;
}

/* ============================================================
   FOOTER NAV (Prev / Next)
   ============================================================ */
.xb-footer-nav {
  border-top: 1px solid var(--xb-border);
  padding: 14px 24px;
  background: #fff;
  flex-shrink: 0;
}
.xb-footer-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.xb-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--xb-primary);
  background: var(--xb-primary-bg);
  border: 1px solid var(--xb-primary-bg);
  border-radius: 8px;
  text-decoration: none !important;
  transition: all .2s;
}
.xb-nav-btn:hover {
  background: var(--xb-primary);
  color: #fff !important;
  border-color: var(--xb-primary);
}
.xb-nav-btn.xb-nav-disabled {
  opacity: .4;
  pointer-events: none;
  cursor: default;
}

/* ============================================================
   MARK AS COMPLETE BUTTON (Tutor's own button)
   ============================================================ */
button[name="tutor_lesson_mark_complete_btn"],
.tutor-topbar-complete-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16,185,129,.3) !important;
  transition: all .2s;
}
button[name="tutor_lesson_mark_complete_btn"]:hover,
.tutor-topbar-complete-btn:hover {
  box-shadow: 0 4px 12px rgba(16,185,129,.4) !important;
  transform: translateY(-1px);
}

/* ============================================================
   MOBILE PROGRESS BAR
   ============================================================ */
.xb-mobile-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--xb-border);
  padding: 10px 16px;
  z-index: 40;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.xb-mobile-progress-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.xb-mobile-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--xb-text);
}
.xb-mobile-progress-text span {
  color: var(--xb-text-muted);
  font-weight: 400;
}
.xb-mobile-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--xb-border);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.xb-mobile-progress-fill {
  height: 100%;
  background: var(--xb-success);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ============================================================
   RESPONSIVE — Tablet (< 1200px)
   ============================================================ */
@media (max-width: 1199px) {
  .xb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    min-width: 300px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 200;
    box-shadow: none;
  }
  .xb-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .xb-sidebar-overlay.is-active {
    display: block;
    z-index: 199;
  }
  .xb-lesson-content,
  .tutor-lesson-wrapper {
    padding: 20px 16px 32px;
    font-size: 15px;
  }
  .xb-video-wrap {
    max-width: 100%;
    padding: 0 16px;
    margin-bottom: 16px;
  }
  .xb-video-wrap .tutor-video-player {
    border-radius: 8px;
  }
  .xb-lesson-title-wrap {
    padding: 16px 16px 0;
  }
  .xb-tabs {
    padding: 0 16px;
  }
  /* Bottom padding for fixed mobile progress bar */
  .xb-main {
    padding-bottom: 60px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  .xb-header {
    padding: 0 12px;
    gap: 8px;
  }
  .xb-header-title {
    font-size: 13px;
  }
  .xb-lesson-title {
    font-size: 18px;
  }
  .xb-lesson-title-wrap {
    padding: 12px 12px 0;
  }
  .xb-lesson-content,
  .tutor-lesson-wrapper {
    padding: 16px 12px 24px;
    font-size: 14.5px;
  }
  .xb-lesson-content h2,
  .tutor-lesson-wrapper h2 {
    font-size: 19px;
  }
  .xb-lesson-content h3,
  .tutor-lesson-wrapper h3 {
    font-size: 16px;
  }
  .xb-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }
  .xb-tab-link {
    padding: 10px 14px;
    font-size: 13px;
  }
  .xb-video-wrap {
    padding: 0;
    margin-bottom: 12px;
  }
  .xb-video-wrap .tutor-video-player {
    border-radius: 0;
    box-shadow: none;
  }
  .xb-footer-nav {
    padding: 12px;
  }
  .xb-nav-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .xb-lesson-intro {
    padding: 16px 18px;
    font-size: 14.5px;
  }
  .xb-teacher-notes {
    padding: 16px 18px;
  }
  .xb-sidebar-item {
    padding: 10px 12px 10px 16px;
  }
}


/* ============================================================
   ONLINE SUBMISSION BUTTON CARD (on assignment page)
   ============================================================ */
.xb-online-btn-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  margin: 20px 0;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid var(--xb-primary, #4f46e5);
  border-radius: 10px;
  transition: all .2s;
}
.xb-online-btn-card:hover {
  box-shadow: 0 4px 16px rgba(79, 70, 229, .15);
  transform: translateY(-1px);
}
.xb-online-btn-card.xb-online-btn-submitted {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #10b981;
}
.xb-online-btn-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.xb-online-btn-text {
  flex: 1;
}
.xb-online-btn-text strong {
  display: block;
  font-size: 15px;
  color: var(--xb-primary-dark, #3730a3);
  margin-bottom: 2px;
}
.xb-online-btn-submitted .xb-online-btn-text strong {
  color: #065f46;
}
.xb-online-btn-text span {
  font-size: 13px;
  color: #475569;
}
.xb-online-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  background: var(--xb-primary, #4f46e5);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.xb-online-btn-action:hover {
  background: var(--xb-primary-dark, #3730a3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}

@media (max-width: 640px) {
  .xb-online-btn-card {
    flex-direction: column;
    text-align: center;
  }
  .xb-online-btn-action {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Content Gate (Previous Week Quizzes Required) ===== */
.xb-content-gate {
  max-width: 520px;
  margin: 40px auto;
  padding: 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  text-align: center;
  border: 1px solid #e2e8f0;
}
.xb-gate-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.xb-content-gate h3 {
  font-size: 20px;
  color: #1e293b;
  margin: 0 0 10px;
  font-weight: 700;
}
.xb-content-gate p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 20px;
}
.xb-gate-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}
.xb-gate-progress span {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}
.xb-gate-bar {
  flex: 1;
  max-width: 200px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.xb-gate-fill {
  height: 100%;
  background: #4f46e5;
  border-radius: 4px;
  transition: width .3s;
}
.xb-gate-quizzes {
  text-align: left;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}
.xb-gate-quizzes strong {
  font-size: 13px;
  color: #475569;
  display: block;
  margin-bottom: 8px;
}
.xb-gate-quizzes ul {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: disc;
}
.xb-gate-quizzes li {
  font-size: 14px;
  margin-bottom: 6px;
}
.xb-gate-quizzes a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}
.xb-gate-quizzes a:hover {
  text-decoration: underline;
}
.xb-gate-btn {
  display: inline-block;
  padding: 10px 24px;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  transition: all .15s;
}
.xb-gate-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ============================================================
   Quiz Answer Selection Fix
   Theme hides radio circles; add visible card highlight on selection
   ============================================================ */

/* Fix: Theme adds gold border-top to .tutor-card in sidebar;
   this leaks onto quiz answer option cards. Remove it. */
.tutor-quiz-answer-single .tutor-card {
  border-top: none !important;
}

/* Show radio circle — override theme's left:-9999px hiding */
.tutor-quiz-answer-single .tutor-form-check-input[type="radio"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  border: 2px solid #cdcfd5 !important;
  border-radius: 50% !important;
  background: #fff !important;
  cursor: pointer !important;
  position: relative !important;
  left: 0 !important;
  right: auto !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  box-sizing: content-box !important;
}

.tutor-quiz-answer-single .tutor-form-check-input[type="radio"]:checked {
  border-color: #3e64de !important;
  background: #3e64de !important;
  box-shadow: inset 0 0 0 3px #fff !important;
}

/* Highlight the card when answer is selected */
.tutor-quiz-answer-single:has(input:checked) .tutor-card {
  border-color: #3e64de !important;
  background-color: #f0f4ff !important;
  box-shadow: 0 0 0 2px rgba(62, 100, 222, 0.2);
}

/* Hover effect on answer cards */
.tutor-quiz-answer-single .tutor-card:hover {
  border-color: #a0aec0;
  cursor: pointer;
}

/* Checkbox styling for multiple_choice questions */
.tutor-quiz-answer-single .tutor-form-check-input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  border: 2px solid #cdcfd5 !important;
  border-radius: 4px !important;
  background: #fff !important;
  cursor: pointer !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  box-sizing: content-box !important;
}

.tutor-quiz-answer-single .tutor-form-check-input[type="checkbox"]:checked {
  border-color: #3e64de !important;
  background: #3e64de url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2.5-2.5a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") center/14px no-repeat !important;
}

/* ============================================================
   Interactive Embeds: Desmos & GeoGebra
   ============================================================ */
.xb-desmos-embed,
.xb-geogebra-embed {
  border: 1px solid var(--xb-border, #e2e8f0);
  border-radius: var(--xb-radius, 10px);
  margin: 1.5em 0;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--xb-shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}
.xb-desmos-embed {
  min-height: 350px;
}
.xb-geogebra-embed {
  min-height: 450px;
}

/* Responsive: full width on mobile */
@media (max-width: 768px) {
  .xb-desmos-embed,
  .xb-geogebra-embed {
    height: 300px !important;
    min-height: 300px;
  }
}

/* ============================================================
   QUIZ — Answer Choice Left-Alignment Fix
   Overrides xcel theme's text-align: center on quiz components.
   ============================================================ */

/* Answers wrapper list */
.tutor-quiz-answers-list,
.tutor-quiz-answers,
.tutor-quiz-answer-list,
.tutor_quiz_answers {
  text-align: left !important;
}

/* Each answer row */
.tutor-quiz-answer-single,
.tutor-quiz-answer,
.tutor-quiz-answer-single .tutor-card,
.tutor-quiz-answer-single .tutor-card-body {
  text-align: left !important;
  align-items: flex-start !important;
}

/* The flex row inside each answer card */
.tutor-quiz-answer-single .tutor-form-check,
.tutor-quiz-answer-single .tutor-d-flex {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 10px !important;
}

/* Answer label text */
.tutor-quiz-answer-single label,
.tutor-quiz-answer-single .tutor-form-check-label,
.tutor-quiz-answer-single .answer-label {
  text-align: left !important;
  flex: 1 !important;
  cursor: pointer !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  color: #1e293b !important;
}

/* Question description area (passage / image context) */
.tutor-quiz-question-description,
.tutor-quiz-question .question-description {
  text-align: left !important;
}

/* Question title */
.tutor-quiz-question-title,
.tutor-quiz-question h4,
.tutor-quiz-question .question-title {
  text-align: left !important;
}

/* ============================================================
   QUIZ — Reading Passage Box (inside quiz description)
   ============================================================ */
.xb-reading-passage {
  text-align: left !important;
  display: block !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  margin-bottom: 16px !important;
  scrollbar-width: thin;
  scrollbar-color: #a5b4fc transparent;
}
.xb-reading-passage::-webkit-scrollbar { width: 5px; }
.xb-reading-passage::-webkit-scrollbar-thumb { background: #a5b4fc; border-radius: 3px; }

.xb-static-passage {
  text-align: left !important;
}

