/* ==========================================================================
   Quang Phan — CSS cho trang hoc bai (learnpress/content-single-item.php)
   Dang 2-card (dashboard) tham khao dung layout that cua duongk.vn
   (astra-child/assets/css/learnpress-lesson-theme.css), doi tong mau tu
   do/vang (--dk-red/--dk-gold) sang xanh duong/vang thuong hieu Quang Phan
   (--ql-blue/--ql-gold), giu nguyen co che cuon rieng tung the + accordion.
   ========================================================================== */

.course-summary-qp {
	--ql-bg: #0B1220;
	--ql-bg-2: #111A2B;
	--ql-bg-3: #16213A;
	--ql-line: rgba(255, 255, 255, .08);
	--ql-blue: #0073B9;
	--ql-blue-light: #4FB6EE;
	--ql-gold: #F2C230;
	--ql-green: #2FBC97;
	--ql-white: #FFFFFF;
	--ql-muted: #8CA0BC;
	--ql-display: 'Plus Jakarta Sans', system-ui, sans-serif;

	background: var(--ql-bg) !important;
	min-height: 100vh;
}

/* Astra container nen toi cho ca trang lesson */
.site-content .ast-container .course-summary-qp,
body.course-item-popup #content,
body.course-item-popup .ast-container {
	background: var(--ql-bg) !important;
}

.course-summary-qp * { box-sizing: border-box; }

/* An header cua site (logo/menu/nut Giu cho) tren rieng trang Lesson de trai
   nghiem hoc tap gon gang, khong bi phan tam — dieu huong van con qua
   breadcrumb va nut "Ve trang khoa hoc" trong .ql-side-cta.
   "viewing-course-item" va "course-item-popup" la 2 class LearnPress tu
   gan vao <body> khi xem bai hoc (co san, khong can tao them). */
body.viewing-course-item .qp-nav,
body.course-item-popup .qp-nav {
	display: none;
}

/* LearnPress tu khoa body{overflow-y:hidden} khi xem bai hoc (thiet ke popup
   cua plugin). Tren desktop khong sao vi tung .ql-card tu cuon rieng (xem
   max-height/overflow-y ben duoi), nhung tren mobile .ql-card cao tu nhien
   theo noi dung (khong gioi han) nen can cuon CA TRANG — ma body dang bi
   khoa cuon se lam trang dung im, khong keo xuong duoc. Mo lai overflow cua
   body/html rieng cho trang lesson nay. */
html:has(body.course-item-popup),
body.course-item-popup,
body.viewing-course-item {
	overflow-y: auto !important;
	height: auto !important;
}

/* ---------- Wrap ----------
   LUU Y: duongk.vn dung position:fixed cho .wrap vi header cua ho khong choan
   cho o luong tai lieu (sticky nhung khong day noi dung xuong). Header cua
   Quang Phan (.qp-nav trong style.css) la phan tu THUONG trong luong tai
   lieu, neu dung position:fixed;top:0 o day no se de len header va che mat
   breadcrumb. Nen de wrap chay theo luong trang binh thuong; moi .ql-card
   van tu gioi han chieu cao + cuon rieng qua max-height ben duoi. */
.ql-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 48px 24px 60px;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* Breadcrumb */
.ql-crumb {
	color: var(--ql-muted);
	font-size: 13.5px;
	margin: 0 0 18px 4px;
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}
.ql-crumb a { color: var(--ql-muted); text-decoration: none; }
.ql-crumb a:hover { color: var(--ql-gold); }
.ql-crumb span { color: #3A4A63; }
.ql-crumb b { color: var(--ql-gold); font-weight: 700; }

.ql-grid {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 24px;
	flex: 1;
	min-height: 0;
}
@media (max-width: 900px) {
	.ql-grid { grid-template-columns: 1fr; }
	/* Dua currToggle (nam trong .ql-side-card) len TREN video/noi dung bai hoc
	   tren mobile — chi doi thu tu hien thi bang CSS order, khong dong DOM,
	   nen desktop (2 cot) khong bi anh huong gi. */
	.ql-side-card { order: -1; }
	.ql-main-card { order: 1; }
}

/* ---------- Card chung ----------
   max-height (khong phai height:100%) de card tu gioi han o khoang mot
   man hinh va cuon rieng ben trong khi noi dung dai, nhung van nam binh
   thuong trong luong trang (khong can .ql-wrap phai la khung fixed cao
   dung 100vh). */
.ql-card {
	background: var(--ql-bg-2);
	border: 1px solid var(--ql-line);
	border-radius: 20px;
	padding: 36px;
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
	max-height: calc(100vh - 120px);
	color: var(--ql-white);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--ql-blue) var(--ql-bg-3);
}
@media (max-width: 900px) {
	.ql-card { max-height: none; overflow-y: visible; }
}
.ql-card::-webkit-scrollbar { width: 8px; }
.ql-card::-webkit-scrollbar-track { background: var(--ql-bg-3); }
.ql-card::-webkit-scrollbar-thumb { background: var(--ql-blue); border-radius: 100px; }

/* ---------- Main card ---------- */
.ql-chips {
	display: flex;
	gap: 26px;
	overflow-x: auto;
	padding-bottom: 4px;
	margin-bottom: 18px;
}
.ql-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--ql-muted);
	white-space: nowrap;
}

/* Tieu de bai hoc — LAY TU markup that cua LearnPress (course-item-title),
   khong phai the tu them, de tranh lap 2 lan. */
.lp-native-content .course-item-title,
.lp-native-content h1.lesson-title {
	font-family: var(--ql-display);
	font-weight: 800;
	font-size: 26px;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin: 0 0 22px;
	color: var(--ql-white);
}

.lp-native-content { color: var(--ql-muted); }
.lp-native-content video,
.lp-native-content iframe,
.lp-native-content .mejs-container,
.lp-native-content .plyr,
.lp-native-content .wp-video {
	border-radius: 14px !important;
	border: 1px solid var(--ql-line);
	overflow: hidden;
	box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .5);
	width: 100% !important;
}
.lp-native-content .content-item-summary .content-item-description iframe {
	width: 100%;
	height: 375px;
}
.lp-native-content h1, .lp-native-content h2, .lp-native-content h3 {
	font-family: var(--ql-display);
	color: var(--ql-white);
}

/* Nut "Danh dau da hoan thanh" native cua LearnPress */
.content-item-summary .learn-press-form .lp-btn-complete-item,
.content-item-summary .learn-press-form .button-complete-lesson {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 30px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 13.5px;
	letter-spacing: .02em;
	cursor: pointer;
	border: none;
	background: var(--ql-blue);
	color: #fff;
	box-shadow: 0 8px 24px -6px rgba(0, 115, 185, .45);
	transition: transform .15s ease, background-color .15s ease;
	text-transform: uppercase;
}
.content-item-summary .learn-press-form .lp-btn-complete-item:hover,
.content-item-summary .learn-press-form .button-complete-lesson:hover {
	background: #01598F;
	transform: translateY(-2px);
}

.ql-body-copy { font-size: 15px; line-height: 1.85; color: var(--ql-muted); }
.ql-body-copy p { margin: 0 0 16px; }
.ql-body-copy h3 {
	font-family: var(--ql-display);
	font-size: 17px;
	margin: 26px 0 10px;
	color: var(--ql-gold);
}

/* Nav bai truoc / bai sau */
.ql-nav-lessons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: 30px;
	padding-top: 26px;
	border-top: 1px solid var(--ql-line);
}
@media (max-width: 640px) {
	.ql-nav-lessons { grid-template-columns: 1fr; }
}
.ql-nav-card {
	display: block;
	background: var(--ql-bg-3);
	border: 1px solid var(--ql-line);
	border-radius: 12px;
	padding: 18px 22px;
	text-decoration: none;
	transition: background-color .2s ease;
}
.ql-nav-card:hover { background: rgba(255, 255, 255, .05); }
.ql-nav-card.ql-next { text-align: right; }
.ql-nav-label {
	font-size: 11px;
	color: var(--ql-gold);
	text-transform: uppercase;
	letter-spacing: .1em;
	font-weight: 800;
	margin-bottom: 6px;
}
.ql-nav-name { font-size: 15.5px; font-weight: 700; color: var(--ql-white); }

/* ---------- Side card: tien do + curriculum ---------- */
.ql-side-card { padding: 28px; }

/* currToggle — thanh gon "Nội dung khóa học" chi hien tren mobile, tham khao
   dung m-curr-toggle cua duongk.vn. Mac dinh AN tren desktop (da co san
   .ql-side-head + curriculum hien day du). */
.ql-curr-toggle { display: none; }
.ql-side-panel { display: block; }

@media (max-width: 900px) {
	.ql-curr-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 14px 16px;
		background: var(--ql-bg-3);
		border: 1px solid var(--ql-line);
		border-radius: 12px;
		cursor: pointer;
		user-select: none;
	}
	.ql-toggle-label { font-size: 14px; font-weight: 800; color: var(--ql-white); }
	.ql-toggle-sub { font-size: 12px; color: var(--ql-muted); margin-top: 2px; }
	.ql-toggle-pct { font-family: var(--ql-display); font-weight: 800; color: var(--ql-gold); font-size: 15px; margin-left: auto; }
	.ql-toggle-chevron { color: var(--ql-muted); font-size: 13px; transition: transform .25s ease; }
	.ql-curr-toggle.ql-open .ql-toggle-chevron { transform: rotate(180deg); color: var(--ql-gold); }

	/* Panel curriculum: dong mac dinh tren mobile, mo khi bam vao currToggle */
	.ql-side-panel {
		max-height: 0;
		overflow: hidden;
		margin-top: 0;
		transition: max-height .3s ease, margin-top .3s ease;
	}
	.ql-side-panel.ql-open {
		max-height: 2000px;
		margin-top: 16px;
	}
}

.ql-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ql-side-head h4 { margin: 0; font-weight: 800; font-size: 16px; color: var(--ql-white); }
.ql-side-percent { font-family: var(--ql-display); color: var(--ql-gold); font-size: 16px; font-weight: 800; }

.ql-track {
	height: 6px;
	background: #12233F;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 24px;
}
.ql-track i {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--ql-blue), var(--ql-gold));
}

.ql-lesson-group { margin-bottom: 10px; border-bottom: 1px solid var(--ql-line); padding-bottom: 10px; }
.ql-lesson-group:last-of-type { border-bottom: none; }

.ql-group-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ql-white);
	padding: 6px 4px;
	margin-bottom: 0;
	line-height: 1.4;
	cursor: pointer;
	user-select: none;
}
.ql-chevron {
	flex-shrink: 0;
	width: 18px; height: 18px;
	display: flex; align-items: center; justify-content: center;
	color: var(--ql-muted);
	font-size: 11px;
	transition: transform .25s ease;
}
.ql-lesson-group.ql-open .ql-chevron { transform: rotate(180deg); color: var(--ql-gold); }
.ql-lesson-group.ql-open .ql-group-items { max-height: 800px; margin-top: 8px; }
.ql-group-items { max-height: 0; overflow: hidden; transition: max-height .3s ease, margin .3s ease; }
.ql-lesson-group:hover .ql-section-title,
.ql-lesson-group.ql-open .ql-section-title,
.ql-lesson-group:has(.ql-current) .ql-section-title { color: var(--ql-gold); }

.ql-lesson-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13.5px;
	color: var(--ql-muted);
	margin-bottom: 6px;
	text-decoration: none;
}
.ql-lesson-item:hover:not(.ql-current) { background: rgba(255, 255, 255, .05); color: var(--ql-muted); }
.ql-lesson-item.ql-current {
	background: #142238;
	border: 1px solid #223650;
	color: var(--ql-white);
	font-weight: 700;
}
.ql-ico {
	width: 22px; height: 22px;
	border-radius: 50%;
	background: #12233F;
	color: var(--ql-muted);
	display: flex; align-items: center; justify-content: center;
	font-size: 10px;
	flex-shrink: 0;
}
.ql-lesson-item.ql-current .ql-ico { background: var(--ql-blue); color: #fff; }
.ql-lesson-item.ql-done .ql-ico { background: var(--ql-green); color: #fff; }

.ql-side-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 14px;
	width: 100%;
	padding: 13px;
	border-radius: 999px;
	background: linear-gradient(180deg, #35C79E, var(--ql-green));
	box-shadow: 0 8px 20px -6px rgba(47, 188, 151, .4);
	color: #06281F;
	font-weight: 800;
	font-size: 13.5px;
	letter-spacing: .02em;
	border: none;
	text-decoration: none;
}
.ql-side-cta:hover { filter: brightness(1.06); color: #06281F; }

/* Khoi "noi dung bi khoa" (learnpress/single-course/content-protected.php) —
   hien khi nguoi xem chua dang nhap / chua ghi danh khoa hoc */
.qp-lesson-locked {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	padding: 48px 24px;
	background: var(--ql-bg-3);
	border: 1px solid var(--ql-line);
	border-radius: 12px;
}
.qp-lesson-locked__icon {
	font-size: 32px;
}
.qp-lesson-locked__text {
	color: var(--ql-muted);
	font-size: 14.5px;
	line-height: 1.7;
	max-width: 440px;
}
.qp-lesson-locked__text a.lp-link-login {
	color: var(--ql-blue-light);
	font-weight: 700;
	text-decoration: underline;
}
.qp-lesson-locked__btn {
	margin-top: 4px;
}
