/* BeingXpert lesson features: copy buttons, Try it Yourself, progress, search. */

[hidden] { display: none !important; }

/* ----- Buttons ----- */
.bxc-btn {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.8rem;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bx-primary, #0d6efd);
	background: var(--bx-white, #fff);
	border: 1px solid var(--bx-primary, #0d6efd);
	border-radius: 6px;
	cursor: pointer;
}

.bxc-btn:hover { background: var(--bx-light, #eaf5ff); }

.bxc-btn--primary {
	color: #fff;
	background: var(--bx-primary-dark, #0a58ca);
	border-color: var(--bx-primary-dark, #0a58ca);
}

.bxc-btn--primary:hover { background: var(--bx-navy, #082b59); }

/* ----- Code box toolbar (inside the label bar) ----- */
.bx-example > .bx-label.bxc-has-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.bxc-tools { display: inline-flex; gap: 0.5rem; }

/* ----- Editor dialog ----- */
.bxc-dialog {
	width: min(1200px, 96vw);
	height: min(85vh, 800px);
	max-width: 96vw;
	max-height: 95vh;
	padding: 0;
	color: var(--bx-text, #17345c);
	background: #fff;
	border: 1px solid var(--bx-border, #cfe6ff);
	border-radius: 12px;
	overflow: hidden;
}

.bxc-dialog[open] { display: flex; flex-direction: column; }
.bxc-dialog::backdrop { background: rgba(8, 43, 89, 0.6); }
body:has(dialog.bxc-dialog[open]) { overflow: hidden; }

.bxc-dlg__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	color: #fff;
	background: var(--bx-navy, #082b59);
}

.bxc-dlg__title { margin: 0; font-size: 1.05rem; color: #fff; }

.bxc-dlg__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 1rem;
	background: var(--bx-light, #eaf5ff);
	border-bottom: 1px solid var(--bx-border, #cfe6ff);
}

.bxc-dlg__hint { font-size: 0.85rem; color: var(--bx-muted, #4f6b8f); }

.bxc-dlg__panes {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.bxc-pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.bxc-pane + .bxc-pane { border-left: 1px solid var(--bx-border, #cfe6ff); }

.bxc-pane__title {
	padding: 0.35rem 1rem;
	font-size: 0.85rem;
	font-weight: 700;
	background: #f6faff;
	border-bottom: 1px solid var(--bx-border, #cfe6ff);
}

.bxc-pane textarea {
	flex: 1;
	width: 100%;
	min-height: 0;
	padding: 0.8rem 1rem;
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	font-size: 0.9rem;
	line-height: 1.5;
	tab-size: 2;
	color: #17345c;
	background: #fff;
	border: 0;
	border-radius: 0;
	resize: none;
	white-space: pre;
	overflow: auto;
}

.bxc-pane iframe {
	flex: 1;
	width: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
}

.bxc-dlg__note {
	margin: 0;
	padding: 0.4rem 1rem;
	font-size: 0.8rem;
	color: var(--bx-muted, #4f6b8f);
	border-top: 1px solid var(--bx-border, #cfe6ff);
}

@media (max-width: 800px) {
	.bxc-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.bxc-dlg__panes { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
	.bxc-pane + .bxc-pane { border-left: 0; border-top: 1px solid var(--bx-border, #cfe6ff); }
}

/* ----- Sidebar: progress and search ----- */
.bxc-side { margin: 0 0 1rem; }
.bxc-progress__text { margin: 0 0 0.25rem; font-size: 0.85rem; font-weight: 600; }
.bxc-progress__bar { display: block; width: 100%; height: 10px; margin-bottom: 0.75rem; }

.bxc-search {
	width: 100%;
	padding: 0.45rem 0.7rem;
	font: inherit;
	font-size: 0.9rem;
	color: var(--bx-text, #17345c);
	background: #fff;
	border: 1px solid var(--bx-border, #cfe6ff);
	border-radius: 6px;
}

.bxc-link {
	margin-top: 0.5rem;
	padding: 0;
	font: inherit;
	font-size: 0.8rem;
	color: var(--bx-primary-dark, #0a58ca);
	text-decoration: underline;
	background: none;
	border: 0;
	cursor: pointer;
}

.bx-lesson-nav__list a.is-done::after {
	content: "\2713";
	float: right;
	font-weight: 700;
	color: #146c43;
}

.bx-lesson-nav__list a[aria-current="page"].is-done::after { color: #fff; }

/* ----- Mark as completed ----- */
.bxc-complete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 2rem 0 0;
	padding: 1rem;
	background: var(--bx-light, #eaf5ff);
	border: 1px solid var(--bx-border, #cfe6ff);
	border-radius: 10px;
}

.bxc-complete .bxc-btn { padding: 0.55rem 1.1rem; font-size: 1rem; }

.bxc-complete .bxc-btn[aria-pressed="true"] { background: #146c43; border-color: #146c43; color: #fff; }
.bxc-complete .bxc-btn[aria-pressed="true"]::before { content: "\2713\00a0"; }

.bxc-complete__msg { font-size: 0.9rem; color: var(--bx-muted, #4f6b8f); }


/* ==========================================================
   Phase 9B: exercises, quizzes, tutorial search
   ========================================================== */

.bxc-dlg__task {
	margin: 0;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	background: #fff8e1;
	border-bottom: 1px solid var(--bx-border, #cfe6ff);
}

.bxc-ex-actions { margin: 0.75rem 0; }

/* Multiple-choice quiz */
.bxc-q {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 1px solid var(--bx-border, #cfe6ff);
	border-radius: 8px;
}

.bxc-q legend { padding: 0 0.4rem; font-weight: 700; color: var(--bx-navy, #082b59); }

.bxc-opt {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0.4rem 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--bx-border, #cfe6ff);
	border-radius: 6px;
	cursor: pointer;
}

.bxc-opt:hover { background: var(--bx-light, #eaf5ff); }
.bxc-opt input { margin-top: 0.3rem; }
.bxc-q:disabled .bxc-opt { cursor: default; }
.bxc-q:disabled .bxc-opt:hover { background: transparent; }

.bxc-opt.is-right { background: #d1e7dd; border-color: #146c43; color: #0a3622; }
.bxc-opt.is-wrong { background: #f8d7da; border-color: #b02a37; color: #58151c; }

.bxc-fb { margin-top: 0.6rem; padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.95rem; }
.bxc-fb.is-right { background: #d1e7dd; color: #0a3622; }
.bxc-fb.is-wrong { background: #f8d7da; color: #58151c; }

.bxc-summary { margin: 1rem 0 0.5rem; font-weight: 700; color: var(--bx-navy, #082b59); }

/* Self-check rows inside click-to-reveal quizzes */
.bxc-self {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
	font-size: 0.9rem;
}

.bxc-self .bxc-btn[aria-pressed="true"] { color: #fff; background: var(--bx-navy, #082b59); border-color: var(--bx-navy, #082b59); }

/* Tutorial search form */
.bxc-tsearch {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 1rem 0 1.5rem;
}

.bxc-tsearch input[type="search"] { flex: 1 1 16rem; }
.bxc-tsearch .bxc-btn { padding: 0.5rem 1.1rem; font-size: 1rem; }