/* ── Theme layout reset ────────────────────────────────────────────────────── */
body.single-pl_lesson #page,  body.single-pl-lesson #page,
body.single-pl_lesson .site,  body.single-pl-lesson .site,
body.single-pl_lesson main,   body.single-pl-lesson main,
body.single-pl_lesson #main,  body.single-pl-lesson #main,
body.single-pl_lesson #content, body.single-pl-lesson #content,
body.single-pl_lesson .site-content, body.single-pl-lesson .site-content,
body.single-pl_lesson .entry-content, body.single-pl-lesson .entry-content {
	max-width: none !important; padding: 0 !important; margin: 0 !important;
	float: none !important; width: auto !important;
}

/* ── Shell ─────────────────────────────────────────────────────────────────── */
#pcs-lesson-wrapper {
	display: flex;
	flex-direction: column;
	height: 100vh;
	background: #0d1117;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* WordPress admin bar is 32px desktop, 46px mobile */
.admin-bar #pcs-lesson-wrapper { height: calc(100vh - 32px); }

@media screen and (max-width: 782px) {
	.admin-bar #pcs-lesson-wrapper { height: calc(100vh - 46px); }
	#pcs-lesson-wrapper { height: auto; }
}

/* ── Top bar ───────────────────────────────────────────────────────────────── */
#plc-topbar {
	height: 52px;
	background: #161b22;
	border-bottom: 1px solid #21262d;
	display: flex;
	align-items: center;
	padding: 0 16px;
	gap: 12px;
	flex-shrink: 0;
	z-index: 100;
}

#plc-topbar .plc-back {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #8b949e;
	text-decoration: none;
	font-size: 13px;
	white-space: nowrap;
	padding: 6px 10px;
	border-radius: 6px;
	transition: background .15s, color .15s;
	flex-shrink: 0;
}

#plc-topbar .plc-back:hover { background: #21262d; color: #e6edf3; }

#plc-topbar .plc-back i { font-size: 16px; }

#plc-topbar .plc-course-name {
	flex: 1;
	text-align: center;
	color: #e6edf3;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 0 8px;
}

#plc-topbar .plc-topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.plc-view-mode-btns { display: flex; gap: 4px; }

.plc-view-btn {
	width: 32px;
	height: 32px;
	background: #21262d;
	border: 1px solid #30363d;
	border-radius: 6px;
	color: #8b949e;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	transition: all .15s;
}

.plc-view-btn:hover,
.plc-view-btn.active { background: #388bfd22; border-color: #388bfd; color: #388bfd; }

/* ── Body ──────────────────────────────────────────────────────────────────── */
#plc-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

@media (max-width: 768px) {
	#plc-body { flex-direction: column; overflow: visible; }
}

/* ── Main ──────────────────────────────────────────────────────────────────── */
#plc-main { flex: 1; overflow-y: auto; background: #fff; display: flex; flex-direction: column; min-width: 0; }

/* ── Video zone ────────────────────────────────────────────────────────────── */
#plc-video-zone { background: #000; flex-shrink: 0; position: relative; line-height: 0; }
#plc-video-zone .pcs-video-container { width: 100%; display: block; }
#plc-video-zone .plc-plyr-wrap { display: block; width: 100%; aspect-ratio: 16/9; background: #000; position: relative; }
#plc-video-zone .plyr__video-embed { width: 100%; height: 100%; position: relative; }
#plc-video-zone .plyr__video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
#plc-video-zone .plyr { width: 100%; }
#plc-video-zone video { width: 100%; border: none; display: block; }

/* Audio / live zone variants */
.plc-audio-zone { padding: 2rem; background: #0d1117; }
.plc-live-zone  { padding: 1.5rem; background: #161b22; }

/* Locked / hero overlay */
.plc-locked-overlay {
	width: 100%;
	aspect-ratio: 16/9;
	background: #0d1117;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.plc-locked-overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, #1a2744 0%, #0d1117 70%);
}

.plc-locked-inner { position: relative; text-align: center; padding: 2rem; }

.plc-lock-icon {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .07);
	border: 2px solid rgba(255, 255, 255, .12);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.plc-lock-icon i { font-size: 26px; color: #8b949e; }
.plc-locked-title { color: #e6edf3; font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.plc-locked-sub   { color: #8b949e; font-size: 13px; margin: 0; }

/* Text/hero banners (no video) */
.plc-hero-banner { aspect-ratio: auto; min-height: 180px; max-height: 240px; }

.plc-hero-icon {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 15%, transparent);
	border: 2px solid color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 30%, transparent);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.plc-hero-icon i { font-size: 26px; color: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 45%, white); }

/* Preview badge */
.plc-preview-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 10;
	background: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 92%, transparent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	display: flex;
	align-items: center;
	gap: 5px;
	backdrop-filter: blur(4px);
	pointer-events: none;
	letter-spacing: .04em;
}

/* ── Info bar ──────────────────────────────────────────────────────────────── */
#plc-info-bar { padding: 18px 28px 0; background: #fff; border-bottom: 1px solid #f0f0f0; }
#plc-info-bar h1 { font-size: 21px; font-weight: 700; color: #0d1117; margin: 0 0 8px; line-height: 1.35; }
#plc-info-bar .plc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 13px; color: #656d76; padding-bottom: 14px; }
#plc-info-bar .plc-meta span { display: flex; align-items: center; gap: 4px; }
#plc-info-bar.is-compact { padding-top: 12px; }
#plc-info-bar.is-compact .plc-meta { padding-bottom: 10px; }

.plc-completed-tag  { color: #1a7f37 !important; font-weight: 600; }
.plc-type-label     { text-transform: capitalize; }
.plc-preview-label  { color: var(--pco-primary-color, #7A3FF2); font-weight: 600; }

/* ── Action bar (progress + complete) ─────────────────────────────────────── */
#plc-action-bar {
	padding: 11px 28px;
	background: #fafafa;
	border-bottom: 1px solid #f0f0f0;
	display: flex;
	align-items: center;
	gap: 14px;
}

#plc-action-bar .plc-prog-label { font-size: 12px; color: #656d76; font-weight: 600; white-space: nowrap; min-width: 32px; }
#plc-action-bar .plc-prog-track { flex: 1; height: 5px; background: #e6edf3; border-radius: 3px; overflow: hidden; }
#plc-action-bar .plc-prog-fill  { height: 100%; background: linear-gradient(90deg, var(--pco-primary-color, #7A3FF2), color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 40%, white)); border-radius: 3px; transition: width .4s; }

#plc-action-bar .plc-btn-complete {
	background: var(--pco-primary-color, #7A3FF2);
	color: #fff;
	border: none;
	border-radius: 7px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	transition: background .15s;
}

#plc-action-bar .plc-btn-complete:hover { background: var(--pco-primary-color, #7A3FF2); }
#plc-action-bar .plc-done-tag { color: #1a7f37; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; }

/* ── Gate cards ────────────────────────────────────────────────────────────── */
#plc-gate { padding: 36px 28px; display: flex; justify-content: center; }

.plc-gate-card {
	max-width: 440px;
	width: 100%;
	background: #fff;
	border: 1px solid #d0d7de;
	border-radius: 12px;
	padding: 32px 28px;
	text-align: center;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.plc-gate-icon {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
	font-size: 24px;
}

.plc-gate-icon.lock   { background: #fff8e1; color: #f59e0b; border: 2px solid #fde68a; }
.plc-gate-icon.prereq { background: #f3e8ff; color: #9333ea; border: 2px solid #e9d5ff; }
.plc-gate-icon.drip   { background: #dbeafe; color: #3b82f6; border: 2px solid #bfdbfe; }

.plc-gate-card h2 { font-size: 17px; font-weight: 700; color: #0d1117; margin: 0 0 8px; }
.plc-gate-card p  { font-size: 14px; color: #656d76; margin: 0 0 18px; line-height: 1.6; }

.plc-gate-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: opacity .15s;
}

.plc-gate-btn:hover { opacity: .87; }
.plc-gate-btn.indigo { background: var(--pco-primary-color, #7A3FF2); color: #fff; }
.plc-gate-btn.purple { background: #9333ea; color: #fff; }
.plc-gate-btn.blue   { background: #3b82f6; color: #fff; }

.plc-prereq-box {
	background: #f6f8fa;
	border: 1px solid #e9d5ff;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 18px;
	text-align: left;
}

.plc-prereq-box .plc-prereq-title { font-size: 13px; font-weight: 600; color: #1e293b; margin: 0 0 8px; }
.plc-prereq-track { height: 5px; background: #e9d5ff; border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.plc-prereq-fill  { height: 100%; background: #9333ea; border-radius: 3px; }
.plc-prereq-pct   { font-size: 12px; color: #656d76; }
.plc-drip-date    { font-size: 12px; color: #656d76; margin: -6px 0 16px; }

/* ── Notes panel (global shared styles) ────────────────────────────────────── */
.pcs-lesson-video-wrapper { display: block !important; }
.pcs-note-item { background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 8px; padding: 12px 14px; }
.pcs-note-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pcs-note-time { font-size: 12px; color: #656d76; display: flex; align-items: center; gap: 4px; }
.pcs-note-time a { color: var(--pco-primary-color, #7A3FF2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.pcs-note-delete { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px; font-size: 15px; transition: color .15s; }
.pcs-note-delete:hover { color: #ef4444; }
.pcs-note-content { font-size: 13px; color: #24292f; line-height: 1.6; }
.pcs-notes-list { display: flex; flex-direction: column; gap: 10px; }
.pcs-notes-empty { font-size: 13px; color: #8b949e; text-align: center; padding: 1rem 0; margin: 0; }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
#plc-tabs { flex: 1; display: flex; flex-direction: column; }

#plc-tab-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 14px 24px 0;
	background: #fff;
	border-bottom: 1px solid #eef0f3;
	flex-shrink: 0;
}

.plc-tab-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px 10px;
	font-size: 13px;
	font-weight: 600;
	color: #8b949e;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 6px 6px 0 0;
	cursor: pointer;
	transition: color .15s, background .15s, border-color .15s;
	white-space: nowrap;
	line-height: 1;
	letter-spacing: .01em;
	margin-bottom: -1px;
}

.plc-tab-btn i { font-size: 14px; line-height: 1; }
.plc-tab-btn:hover { color: #1e2228; background: #f6f8fa; }
.plc-tab-btn.active {
	color: var(--pco-primary-color, #7A3FF2);
	border-bottom-color: var(--pco-primary-color, #7A3FF2);
	background: #fff;
}

.plc-tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 14%, transparent);
	color: var(--pco-primary-color, #7A3FF2);
	font-size: 10px;
	font-weight: 700;
	border-radius: 20px;
	line-height: 1;
}
.plc-tab-btn.active .plc-tab-badge {
	background: var(--pco-primary-color, #7A3FF2);
	color: #fff;
}

/* Panels */
.plc-tab-panel { display: none; padding: 28px 28px 32px; flex: 1; }
.plc-tab-panel.active { display: block; }

.plc-tab-panel .prose { color: #1e2228; font-size: 15px; line-height: 1.8; }
.plc-tab-panel .prose p { margin: 0 0 1.15em; }
.plc-tab-panel .prose p:last-child { margin-bottom: 0; }
.plc-tab-panel .prose h2,
.plc-tab-panel .prose h3 { font-weight: 700; margin: 1.4em 0 .5em; }

.plc-tab-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 52px 28px;
	color: #b0b8c4;
	font-size: 13.5px;
	text-align: center;
	margin: 0;
}
.plc-tab-empty i { font-size: 34px; opacity: .5; margin-bottom: 2px; }

/* Notes list inside tab */
.pcs-notes-list-wrap { display: flex; flex-direction: column; gap: 12px; }
.pcs-notes-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	padding-bottom: 10px;
	border-bottom: 1px solid #f0f2f5;
}
.pcs-notes-count { font-size: 12px; color: #8b949e; font-weight: 600; }
.pcs-notes-export-btn {
	background: none;
	border: 1px solid #e2e6ea;
	border-radius: 7px;
	color: #656d76;
	font-size: 12px;
	font-weight: 500;
	padding: 5px 11px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: all .15s;
}
.pcs-notes-export-btn:hover { background: #f6f8fa; border-color: #c8cdd4; color: #1e2228; }

/* Notes panel compatibility */
.plc-tab-panel.pcs-notes-panel { display: none; }
.plc-tab-panel.pcs-notes-panel.active { display: block; }

/* Take Note form */
#plc-tab-take-note .pcs-notes-input {
	width: 100%;
	border: 1.5px solid #e2e6ea;
	border-radius: 10px;
	padding: 13px 15px;
	font-size: 14px;
	resize: vertical;
	line-height: 1.65;
	box-sizing: border-box;
	font-family: inherit;
	color: #1e2228;
	background: #fafbfc;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
#plc-tab-take-note .pcs-notes-input:focus {
	outline: none;
	border-color: var(--pco-primary-color, #7A3FF2);
	background: #fff;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 10%, transparent);
}
#plc-tab-take-note .pcs-notes-input::placeholder { color: #b0b8c4; }
#plc-tab-take-note .pcs-notes-form-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
#plc-tab-take-note .pcs-notes-save-btn {
	background: var(--pco-primary-color, #7A3FF2);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 9px 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: opacity .15s, transform .1s;
	letter-spacing: .01em;
}
#plc-tab-take-note .pcs-notes-save-btn:hover { opacity: .88; }
#plc-tab-take-note .pcs-notes-save-btn:active { transform: scale(.97); }
#plc-tab-take-note .pcs-notes-timestamp-btn {
	background: #f4f6f9;
	color: #4b5563;
	border: 1.5px solid #e2e6ea;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: background .15s, border-color .15s;
}
#plc-tab-take-note .pcs-notes-timestamp-btn:hover { background: #eaecf0; border-color: #c8cdd4; }

/* ── Lesson body (legacy, keep for back-compat) ────────────────────────────── */
#plc-lesson-body { padding: 28px; flex: 1; }
#plc-lesson-body .prose { max-width: 780px; color: #24292f; font-size: 15px; line-height: 1.75; }
#plc-lesson-body .prose p { margin: 0 0 1.2em; }
#plc-lesson-body .prose h2,
#plc-lesson-body .prose h3 { font-weight: 700; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#plc-sidebar {
	width: 336px;
	flex-shrink: 0;
	background: #161b22;
	border-left: 1px solid #21262d;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

@media (max-width: 768px) {
	#plc-sidebar { width: 100%; border-left: none; border-top: 1px solid #21262d; max-height: 380px; }
}

#plc-sidebar-head { padding: 15px 18px 13px; border-bottom: 1px solid #21262d; flex-shrink: 0; }
#plc-sidebar-head h3 { color: #e6edf3; font-size: 14px; font-weight: 700; margin: 0 0 10px; }

.plc-overall-prog-track { height: 4px; background: #21262d; border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.plc-overall-prog-fill  { height: 100%; background: linear-gradient(90deg, var(--pco-primary-color, #7A3FF2), color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 40%, white)); border-radius: 2px; }
.plc-overall-prog-label { font-size: 11px; color: #8b949e; }

#plc-sidebar-list { flex: 1; overflow-y: auto; }
#plc-sidebar-list::-webkit-scrollbar { width: 4px; }
#plc-sidebar-list::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

.plc-sec-header {
	padding: 10px 18px 5px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #8b949e;
	background: #161b22;
	position: sticky;
	top: 0;
	z-index: 1;
}

.plc-sidebar-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 18px 11px 15px;
	text-decoration: none;
	border-left: 3px solid transparent;
	border-bottom: 1px solid rgba(33, 38, 45, .5);
	transition: background .12s, border-color .12s;
}

.plc-sidebar-item:hover { background: #1c2128; }
.plc-sidebar-item.is-current { background: #1a2744; border-left-color: var(--pco-primary-color, #7A3FF2); }
.plc-sidebar-item.is-current .plc-item-title { color: #e6edf3; font-weight: 600; }

.plc-item-bullet {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
}

.plc-item-bullet.done    { background: rgba(26, 127, 55, .15); border: 1.5px solid #1a7f37; color: #1a7f37; }
.plc-item-bullet.current { background: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 15%, transparent); border: 1.5px solid var(--pco-primary-color, #7A3FF2); color: color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 35%, white); }
.plc-item-bullet.quiz    { background: rgba(245, 158, 11, .12); border: 1.5px solid #f59e0b; color: #f59e0b; }
.plc-item-bullet.default { background: transparent; border: 1.5px solid #30363d; color: #8b949e; }

.plc-item-info { flex: 1; min-width: 0; }
.plc-item-title { font-size: 13px; color: #c9d1d9; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-item-meta  { font-size: 11px; color: #8b949e; margin-top: 2px; }
