/**
 * web/v2/css/v2-style.css
 * Hệ thống giao diện Cổng Học Viên NextSkill Pro V2
 * Cảm hứng: Mr2 + Apple Design System (High Contrast, Siêu Nhẹ, Tối Giản Điện Ảnh)
 */

:root {
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F1F5F9;
  --border-color: #E2E8F0;
  --border-focus: #3B82F6;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-border: #BFDBFE;

  --emerald: #10B981;
  --emerald-light: #ECFDF5;
  --emerald-border: #A7F3D0;
  
  --amber: #F59E0B;
  --amber-light: #FFFBEB;
  --amber-border: #FDE68A;
  
  --purple: #8B5CF6;
  --purple-light: #F5F3FF;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- APP HEADER --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.header-center {
  flex: 1;
  max-width: 440px;
  margin: 0 20px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.search-box:hover {
  background: #FFF;
  border-color: var(--border-focus);
}

.search-shortcut {
  margin-left: auto;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-redeem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-light);
  color: #B45309;
  border: 1px solid var(--amber-border);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  transition: transform 0.15s, background 0.15s;
}

.btn-redeem:hover {
  transform: translateY(-1px);
  background: #FEF3C7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  max-width: 320px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-badge:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.user-name-text {
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.btn-logout {
  color: var(--text-subtle);
  font-size: 12px;
  margin-left: 2px;
  padding: 2px 4px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.btn-logout:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.user-role-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.role-vip { background: var(--amber-light); color: #B45309; border: 1px solid var(--amber-border); }
.role-registered { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.role-guest { background: var(--bg-card-subtle); color: var(--text-muted); }

.vip-countdown-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* --- VIEWS CONTAINER --- */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* ========================================================
   VIEW 1: DASHBOARD
   ======================================================== */
.dashboard-container {
  max-width: 1200px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #090D16 0%, #0F172A 50%, #1E293B 100%);
  color: #FFFFFF;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.35), 0 0 24px rgba(245, 158, 11, 0.06);
  margin-bottom: 32px;
}

.hero-left h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: #F8FAFC;
}

.hero-left p {
  font-size: 14px;
  color: #94A3B8;
}

.stats-grid {
  display: flex;
  gap: 12px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  text-align: center;
  min-width: 90px;
}

.stat-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: #F59E0B;
}

.stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  margin-top: 4px;
}

/* Course Tabs */
.dashboard-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.dash-tab {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 10px 4px;
  position: relative;
  cursor: pointer;
}

.dash-tab.active {
  color: var(--primary);
}

.dash-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.dash-tab .tab-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

/* Course Cards */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.course-thumb-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.course-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.course-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.course-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.progress-box {
  margin-top: auto;
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #2563EB);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.course-actions {
  display: flex;
  gap: 10px;
}

.btn-card-learn {
  flex: 1;
  background: #0F172A;
  color: #FFF;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s;
  border: 1px solid #1E293B;
}

.btn-card-learn:hover {
  background: #1E293B;
  color: #F59E0B;
  border-color: #F59E0B;
}

.btn-card-detail {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.btn-card-detail:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

/* ========================================================
   VIEW 2: CLASSROOM (2 CỘT CHUẨN SƯ PHẠM)
   ======================================================== */
.classroom-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 64px);
  background: #FFF;
}

/* Cột Trái: Video & Content */
.classroom-main {
  padding: 24px 32px 60px;
  border-right: 1px solid var(--border-color);
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  position: relative;
  scroll-margin-top: 76px;
}

.video-container iframe,
.video-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --- VIDEO SERVER SWITCHER & RESILIENCE CONTROLS (CHUẨN LMS MR2) --- */
.video-server-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.video-server-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.video-server-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.server-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.btn-server-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-server-switch:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

.btn-server-switch.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563EB;
  color: #2563EB;
  font-weight: 700;
}

.btn-server-reload {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px dashed var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-server-reload:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.video-server-hint {
  width: 100%;
  font-size: 11.5px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

/* --- DYNAMIC FLOATING WATERMARK CHỐNG TẢI LẬU & QUAY LÉN (GHOST WATERMARK SIÊU MỜ) --- */
.video-dynamic-watermark {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 15;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s ease, top 0.8s ease, left 0.8s ease, right 0.8s ease, bottom 0.8s ease;
  will-change: opacity, transform;
}

.video-dynamic-watermark.visible {
  opacity: 0.28;
  transform: translateY(0);
}

.video-dynamic-watermark .watermark-pulse-dot {
  display: none;
}

.video-dynamic-watermark.pos-top-right {
  top: 14px;
  right: 18px;
  bottom: auto;
  left: auto;
}
.video-dynamic-watermark.pos-top-left {
  top: 14px;
  left: 18px;
  bottom: auto;
  right: auto;
}
.video-dynamic-watermark.pos-bottom-right {
  bottom: 56px;
  right: 18px;
  top: auto;
  left: auto;
}
.video-dynamic-watermark.pos-bottom-left {
  bottom: 56px;
  left: 18px;
  top: auto;
  right: auto;
}

/* --- EMPTY STATE CHO BÀI CHƯA CÓ VIDEO CHUẨN LMS 4K --- */
.video-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, #0B0F17, #1E293B);
  padding: 20px;
  text-align: center;
  color: #FFF;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .video-empty-state {
    padding: 12px 14px;
  }
  .video-empty-state h3 {
    font-size: 14px !important;
    margin-bottom: 4px !important;
  }
  .video-empty-state p {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
  }
}

.video-gate-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #FFF;
  z-index: 10;
}

.video-gate-overlay h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 12px 0 8px;
}

.video-gate-overlay p {
  font-size: 14px;
  color: var(--text-subtle);
  max-width: 440px;
  margin-bottom: 20px;
}

/* Lesson Control Header */
.lesson-meta-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.lesson-module-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.lesson-title-h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.lesson-meta-info {
  flex: 1;
  min-width: 0;
}

.lesson-subpart-indicator {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.subpart-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  max-width: 100%;
}

.subpart-active-time-inline {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.subpart-active-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.lesson-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-complete-lesson {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #FFF;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.btn-complete-lesson.is-completed {
  background: var(--emerald);
}

.btn-next-lesson {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.btn-next-lesson:hover {
  background: var(--bg-card-subtle);
}

/* Subparts Carousel / Pills */
.subparts-container {
  margin-bottom: 20px;
  background: transparent;
  padding: 0;
  border: none;
}

.subparts-title {
  display: none;
}

.subparts-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.subparts-list::-webkit-scrollbar {
  display: none;
}

.subpart-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  background: #F1F5F9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.subpart-btn:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
  color: var(--text-main);
}

.subpart-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Tabs: Thảo luận / Tài liệu */
.lesson-bottom-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.bottom-tab {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 10px 2px;
  position: relative;
  cursor: pointer;
  transition: color 0.15s;
}

.bottom-tab:hover {
  color: var(--text-main);
}

.bottom-tab.active {
  color: var(--primary);
}

.bottom-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.mobile-only-tab {
  display: none;
}

.materials-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.materials-notice-box {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 4px;
}

.material-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.material-item:hover {
  border-color: var(--primary-border);
}

.material-item.is-locked {
  background: #FFFDF5;
  border-color: #FDE68A;
}

.material-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.material-text-wrap {
  min-width: 0;
  flex: 1;
}

.material-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.material-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}

.material-size {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-download {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-download:hover {
  background: var(--primary);
  color: #FFF;
}

.btn-download-locked {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
  cursor: pointer;
}

.btn-download-locked:hover {
  background: #F59E0B;
  color: #FFF;
  border-color: #F59E0B;
}

.discussion-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* --- CỘT PHẢI: CURRICULUM SIDEBAR --- */
.classroom-sidebar {
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow: hidden;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #FFF;
}

.sidebar-course-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #FFF;
}

.sidebar-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.sidebar-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.curriculum-tree {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.module-group {
  margin-bottom: 14px;
}

.module-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  margin-bottom: 4px;
}

.lesson-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}

.lesson-tree-item:hover {
  background: #EEF2F6;
}

.lesson-tree-item.active {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
}

.lesson-tree-icon {
  font-size: 15px;
  color: var(--text-muted);
}
.lesson-tree-item.active .lesson-tree-icon {
  color: var(--primary);
}

.lesson-tree-text {
  flex: 1;
  min-width: 0;
}

.lesson-tree-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-tree-item.active .lesson-tree-name {
  color: var(--primary);
  font-weight: 700;
}

.lesson-tree-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}

.badge-access {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge-free { background: var(--emerald-light); color: var(--emerald); }
.badge-reg { background: var(--primary-light); color: var(--primary); }
.badge-vip { background: var(--amber-light); color: #B45309; }
.badge-vip-unlocked { background: var(--emerald-light); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.25); font-weight: 700; }

/* --- SUBPART TREE ITEMS (CHUYÊN ĐỀ 2 TẦNG CHUẨN MASTERCLASS) --- */
.lesson-accordion-group {
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.lesson-accordion-group.open {
  background: rgba(241, 245, 249, 0.4);
  border-color: var(--border-color);
  padding-bottom: 4px;
}

.subpart-tree-list {
  padding-left: 20px;
  padding-right: 6px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Trên mobile lộ trình: Thu gọn các phân đoạn con của bài học chưa active để danh sách gọn gàng */
.mobile-tree .lesson-accordion-group:not(.open) .subpart-tree-list {
  display: none;
}

.subpart-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border-left: 2px solid transparent;
}

.subpart-tree-item:hover {
  background: #E2E8F0;
}

.subpart-tree-item.active {
  background: var(--primary-light);
  border-left: 2px solid var(--primary);
}

.subpart-tree-icon {
  font-size: 11px;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.subpart-tree-item.active .subpart-tree-icon {
  color: var(--primary);
  font-weight: 700;
}

.subpart-tree-text {
  flex: 1;
  min-width: 0;
}

.subpart-tree-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.subpart-tree-item.active .subpart-tree-name {
  color: var(--primary);
  font-weight: 700;
}

.subpart-tree-sub {
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 1px;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFF;
  border-radius: var(--radius-xl);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-backdrop.open .modal-card {
  transform: scale(1);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  font-size: 20px;
  color: var(--text-muted);
  padding: 4px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ========================================================
   RESPONSIVE DESIGN (CHUẨN MR2)
   Tối ưu hóa toàn diện cho Mobile (OPPO, iPhone) & Desktop
   ======================================================== */

@media (max-width: 900px) {
  .classroom-layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
    width: 100%;
    max-width: 100vw;
  }
  .classroom-main {
    padding: 12px 12px 36px;
    max-width: 100%;
    width: 100%;
    border-right: none;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .classroom-sidebar {
    display: none; /* Trên mobile, lộ trình nằm gọn gàng bên trong Tab Lộ Trình! */
  }
  #classroom-subparts-carousel {
    display: none !important; /* Trên mobile đã có Tab Các Phần chuyên dụng, ẩn thanh cuộn ngang để giao diện tinh giản tuyệt đối */
  }
  .mobile-only-tab {
    display: block !important;
  }
  .header-center {
    display: none;
  }
}

@media (min-width: 901px) {
  .mobile-only-tab {
    display: none !important;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Top Navigation */
  .app-header {
    height: 56px;
    padding: 0 12px;
  }
  .header-left {
    gap: 8px;
  }
  .brand-logo {
    font-size: 15px;
    gap: 6px;
  }
  .brand-badge {
    font-size: 9px;
    padding: 1px 6px;
  }
  .nav-links {
    display: none;
  }
  .header-right {
    gap: 6px;
  }
  .btn-redeem {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
  }
  .user-badge {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
    max-width: 140px;
    overflow: hidden;
  }
  .user-badge .vip-countdown-tag {
    display: none;
  }
  .user-role-tag {
    font-size: 9px;
    padding: 1px 4px;
  }

  /* Dashboard View */
  .dashboard-container {
    margin: 14px auto 36px;
    padding: 0 12px;
  }
  .hero-banner {
    padding: 18px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
  }
  .hero-left h1 {
    font-size: 18px;
    line-height: 1.3;
  }
  .hero-left p {
    font-size: 12px;
    line-height: 1.5;
  }
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .stat-pill {
    min-width: 0;
    padding: 8px 4px;
    border-radius: var(--radius-md);
  }
  .stat-val {
    font-size: 16px;
  }
  .stat-lbl {
    font-size: 9px;
  }

  /* Courses Grid */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .course-card {
    border-radius: var(--radius-lg);
  }
  .course-body {
    padding: 16px;
  }
  .course-title {
    font-size: 16px;
    line-height: 1.35;
  }
  .course-sub {
    font-size: 12px;
  }
  .course-actions {
    flex-direction: column;
    gap: 8px;
  }
  .btn-card-learn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
  .btn-card-detail {
    display: none;
  }

  /* Classroom View (Buồng Học) */
  .classroom-main {
    padding: 10px 12px 36px;
  }
  .video-container {
    border-radius: var(--radius-md);
    margin-bottom: 12px;
  }
  .video-gate-overlay {
    padding: 16px;
  }
  .video-gate-overlay h3 {
    font-size: 16px;
    margin: 8px 0 6px;
  }
  .video-gate-overlay p {
    font-size: 12px;
    margin-bottom: 14px;
    line-height: 1.45;
  }

  /* Lesson Meta Bar */
  .lesson-meta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .lesson-module-tag {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .lesson-title-h1 {
    font-size: 16px;
    line-height: 1.35;
  }
  .lesson-actions-group {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .btn-complete-lesson,
  .btn-next-lesson {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 10px 6px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  /* Subparts Horizon Scroll Chips */
  .subparts-container {
    padding: 0;
    margin-bottom: 12px;
    background: transparent;
    border: none;
  }
  .subparts-title {
    display: none;
  }
  .subparts-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .subparts-list::-webkit-scrollbar {
    display: none;
  }
  .subpart-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
  }

  /* Classroom Tabs */
  .lesson-bottom-tabs {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .lesson-bottom-tabs::-webkit-scrollbar {
    display: none;
  }
  .bottom-tab {
    font-size: 12.5px;
    padding: 8px 4px;
    flex-shrink: 0;
    text-align: center;
  }

  /* Materials Items */
  .material-item {
    padding: 12px;
    gap: 8px;
  }
  .material-left {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .material-icon {
    font-size: 18px;
  }
  .material-name {
    font-size: 12px;
    line-height: 1.35;
  }
  .material-size {
    font-size: 10px;
  }
  .btn-download {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Modals */
  .modal-card {
    padding: 20px 16px;
    max-width: calc(100vw - 24px);
    border-radius: var(--radius-lg);
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-input {
    font-size: 16px;
    padding: 10px 12px;
  }
}

/* ========================================================
   PAYMENT & VIETQR MODAL STYLES (Chuẩn Xem Mệnh Nhà)
   ======================================================== */
.modal-card.modal-card-lg {
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.payment-nav-tabs {
  display: flex;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.payment-nav-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.payment-nav-btn.active {
  background: #FFF;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color);
}

.vietqr-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.vietqr-img-wrapper {
  background: #FFF;
  padding: 8px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
  display: inline-block;
  margin: 6px 0 12px;
}

.vietqr-img {
  width: 175px;
  height: 175px;
  object-fit: contain;
  display: block;
}

.payment-info-table {
  background: #FFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  text-align: left;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.payment-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed #F1F5F9;
}

.payment-info-row:last-child {
  border-bottom: none;
}

.payment-info-label {
  color: var(--text-muted);
  font-size: 12px;
}

.payment-info-val-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-info-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
}

.btn-copy-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-copy-chip:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.countdown-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 14px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F59E0B;
  animation: pulseAnimation 1.5s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ========================================================
   OMNI-CHANNEL AUTH HUB (GOOGLE 1-CHẠM + TELEGRAM + EMAIL OTP)
   ======================================================== */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  color: #1E293B;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 14px;
}

.btn-google-auth:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  margin: 12px 0 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 10px;
}

.auth-channel-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-auth-channel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-auth-channel:hover {
  background: #E2E8F0;
}

.btn-auth-channel.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.otp-input-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  text-align: center;
}

.otp-input-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  padding: 10px 14px;
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 220px;
  margin: 10px auto 12px;
  display: block;
  outline: none;
}

.otp-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* --- TOAST NOTIFICATIONS (APPLE QUALITY) --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}

@media (max-width: 768px) {
  .toast-container {
    top: auto;
    bottom: 24px;
    left: 16px;
    right: 16px;
    max-width: none;
    align-items: center;
  }
  .toast-item {
    width: 100%;
    max-width: 420px;
    transform: translateY(16px) scale(0.96);
  }
  .toast-item.show {
    transform: translateY(0) scale(1);
  }
}

.toast-item {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.94);
  color: #F8FAFC;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-item.toast-success {
  border-left: 4px solid #10B981;
}

.toast-item.toast-error {
  border-left: 4px solid #EF4444;
}

.toast-item.toast-info {
  border-left: 4px solid #3B82F6;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-text {
  flex: 1;
}

/* --- MOBILE STICKY ACTION BAR (CRO & THUMB ZONE) --- */
.mobile-sticky-bar {
  display: none;
}

.btn-open-bank-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #0068FF;
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  margin-top: 10px;
  margin-bottom: 6px;
  transition: background 0.15s ease;
}

.btn-open-bank-app:hover {
  background: #0056D2;
}

@media (max-width: 768px) {
  .mobile-sticky-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    gap: 10px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  }
  .mobile-sticky-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-sticky-zalo {
    background: #0068FF;
    color: #FFFFFF;
  }
  .mobile-sticky-vip {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
  }
  .classroom-layout {
    padding-bottom: 74px;
  }
}

/* Ẩn hoàn toàn mobile sticky bar khi học viên ở trong phòng học (view-classroom) */
body.in-classroom-view .mobile-sticky-bar,
#view-classroom.active ~ .mobile-sticky-bar {
  display: none !important;
}

body.in-classroom-view .classroom-layout {
  padding-bottom: 24px !important;
}

/* Ẩn nút Kích Hoạt VIP khi tài khoản đã là VIP/Admin */
body.user-is-vip .mobile-sticky-vip,
body.user-is-vip .btn-redeem {
  display: none !important;
}

/* VIP Active Adaptive Card in Modal */
.vip-status-active-box {
  text-align: center;
  padding: 6px 0;
}

.vip-active-badge-header {
  margin-bottom: 14px;
}

.vip-active-info-card {
  background: var(--bg-surface, #F8FAFC);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.vip-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.vip-info-lbl {
  color: var(--text-muted, #64748B);
  font-weight: 500;
}

.badge-active-green {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #10B981;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.vip-active-perks {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.vip-active-perks .perk-item {
  color: #92400E;
  font-weight: 600;
}

/* Highlight Pulse for Google Auth Button */
@keyframes highlightPulseAnim {
  0% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.6);
    border-color: #4285F4;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.15);
    border-color: #1A73E8;
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    border-color: #4285F4;
    transform: scale(1);
  }
}

.highlight-pulse {
  animation: highlightPulseAnim 1.2s infinite ease-in-out !important;
  border: 2px solid #4285F4 !important;
}

/* ========================================================
   TAB CÁC PHẦN (SUBPARTS VERTICAL LIST) & BIG PLAY OVERLAY
   ======================================================== */
.subparts-vertical-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.subpart-vertical-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.subpart-vertical-item:hover {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.04);
  transform: translateY(-1px);
}

.subpart-vertical-item.active {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3B82F6;
  box-shadow: 0 0 0 1.5px #3B82F6;
}

.subpart-vertical-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.subpart-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #F1F5F9;
  color: #64748B;
  flex-shrink: 0;
}

.subpart-status-badge.active {
  background: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.subpart-status-badge.done {
  background: #10B981;
  color: #FFFFFF;
}

.subpart-vertical-details {
  min-width: 0;
  flex: 1;
}

.subpart-vertical-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main, #0F172A);
  line-height: 1.35;
  white-space: normal;
}

.subpart-vertical-meta {
  font-size: 11.5px;
  color: var(--text-muted, #64748B);
  margin-top: 2px;
}

.btn-subpart-play {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color, #CBD5E1);
  background: #F8FAFC;
  color: #334155;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
  transition: all 0.15s ease;
}

.btn-subpart-play.active {
  background: #F59E0B;
  color: #050811;
  border-color: #F59E0B;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* --- NATIVE VIDEO PLAY OVERLAY (CHUẨN DI ĐỘNG ZERO-FRICTION) --- */
.video-native-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s ease, background 0.25s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.video-native-play-overlay:hover {
  background: rgba(0, 0, 0, 0.55);
}

.play-pulse-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  padding-left: 4px;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7), 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: play-pulse 2s infinite;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  cursor: pointer;
}

.video-native-play-overlay:hover .play-pulse-circle {
  transform: scale(1.1);
}

.play-pulse-label {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 16px;
  border-radius: 20px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.btn-cache-purge {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #FCA5A5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.btn-cache-purge:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #FFF !important;
}

@keyframes play-pulse {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 16px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.98);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}






