/* Qoss Training — front-end styles. Palette matches the core plugin
   (qoss-frontend.css): #2271b1 primary blue, #1a7f37 / #d9f0d9 success
   green, neutral grays. Kept as plain qoss- classes so themes can
   override freely. */

.qoss-course-layout {
	--qoss-primary: #2271b1;
	--qoss-primary-dark: #135e96;
	--qoss-success: #1a7f37;
	--qoss-success-bg: #d9f0d9;
	--qoss-border: #e2e2e2;
	--qoss-text: #1d2327;
	--qoss-muted: #666;
	--qoss-radius: 10px;

	display: flex;
	align-items: flex-start;
	gap: 2rem;
	margin: 1.5rem 0;
}

.qoss-course-main {
	flex: 1 1 auto;
	min-width: 0;
}

.qoss-course-cover {
	display: block;
	width: 100%;
	aspect-ratio: 480 / 200;
	object-fit: cover;
	border-radius: var(--qoss-radius);
	margin-bottom: 1.5rem;
	background: #eef1f4;
}

/* -------------------------------------------------------------- *
 * Right-hand course navigation: progress bar at the top, then the
 * ordered lesson list. Sticks in place while the main column scrolls.
 * -------------------------------------------------------------- */

.qoss-course-nav {
	flex: 0 0 300px;
	width: 300px;
	position: sticky;
	top: 2rem;
	background: #fff;
	border: 1px solid var(--qoss-border);
	border-radius: var(--qoss-radius);
	padding: 1.25rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.qoss-course-nav-header {
	padding-bottom: 1rem;
	margin-bottom: 0.75rem;
	border-bottom: 1px solid var(--qoss-border);
}

.qoss-course-nav-title {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--qoss-text);
	text-decoration: none;
	margin-bottom: 0.85rem;
}

.qoss-course-nav-title:hover {
	color: var(--qoss-primary);
	text-decoration: underline;
}

.qoss-progress-bar {
	background: #eef1f4;
	border-radius: 999px;
	height: 10px;
	overflow: hidden;
	margin: 0.5rem 0;
}

.qoss-progress-bar-fill {
	/* Fallback values because .qoss-progress-bar is also used inside
	   [qoss_my_courses]'s card grid, outside .qoss-course-layout, where
	   these custom properties aren't in scope. */
	background: linear-gradient(90deg, var(--qoss-primary, #2271b1), var(--qoss-primary-dark, #135e96));
	height: 100%;
	border-radius: 999px;
	transition: width 0.3s ease;
}

.qoss-progress-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.8rem;
	margin: 0.4rem 0 0;
}

.qoss-progress-percent {
	font-weight: 600;
	color: var(--qoss-text);
}

.qoss-progress-count {
	color: var(--qoss-muted);
	white-space: nowrap;
}

.qoss-lesson-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.qoss-lesson-item a {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.6rem;
	border-radius: 8px;
	text-decoration: none;
	color: var(--qoss-text);
	font-size: 0.9rem;
	line-height: 1.3;
	transition: background 0.15s ease, color 0.15s ease;
}

.qoss-lesson-item a:hover {
	background: #f0f6fb;
}

.qoss-lesson-marker {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #eef1f4;
	color: var(--qoss-muted);
	font-size: 0.72rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.qoss-lesson-title {
	flex: 1 1 auto;
	min-width: 0;
}

.qoss-lesson-complete .qoss-lesson-marker {
	background: var(--qoss-success-bg);
	color: var(--qoss-success);
}

.qoss-lesson-current a {
	background: #eaf3fb;
	color: var(--qoss-primary);
	font-weight: 600;
	border-left: 3px solid var(--qoss-primary);
	padding-left: calc(0.6rem - 3px);
}

.qoss-lesson-current .qoss-lesson-marker {
	background: var(--qoss-primary);
	color: #fff;
}

.qoss-certificate-link {
	display: block;
	margin-top: 1rem;
	padding: 0.65rem 1rem;
	text-align: center;
	background: var(--qoss-success-bg);
	color: var(--qoss-success);
	border-radius: 8px;
	font-weight: 600;
	text-decoration: none;
}

.qoss-certificate-link:hover {
	background: #c3e6c9;
	color: var(--qoss-success);
}

/* -------------------------------------------------------------- *
 * Lesson controls (mark complete / quiz) in the main column.
 * -------------------------------------------------------------- */

.qoss-lesson-controls {
	margin: 1.75rem 0;
	padding: 1.25rem;
	border: 1px solid var(--qoss-border);
	border-radius: var(--qoss-radius);
	background: #fafbfc;
}

.qoss-lesson-done {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--qoss-success);
	font-weight: 600;
	margin: 0;
}

.qoss-lesson-done-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--qoss-success-bg);
	font-size: 0.75rem;
}

.qoss-mark-complete,
.qoss-quiz-form button[type="submit"] {
	background: var(--qoss-primary);
	color: #fff;
	border: none;
	padding: 0.7rem 1.4rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.qoss-mark-complete:hover,
.qoss-quiz-form button[type="submit"]:hover {
	background: var(--qoss-primary-dark);
}

.qoss-mark-complete:disabled {
	opacity: 0.6;
	cursor: default;
}

.qoss-lesson-back {
	margin: 1rem 0 0;
	font-size: 0.85rem;
}

.qoss-lesson-back a {
	color: var(--qoss-muted);
	text-decoration: none;
}

.qoss-lesson-back a:hover {
	color: var(--qoss-primary);
	text-decoration: underline;
}

/* -------------------------------------------------------------- *
 * Quiz form.
 * -------------------------------------------------------------- */

.qoss-quiz-form h4 {
	margin-top: 0;
}

.qoss-quiz-question {
	border: none;
	border-bottom: 1px solid var(--qoss-border);
	padding: 0 0 1rem;
	margin: 0 0 1rem;
}

.qoss-quiz-question:last-of-type {
	border-bottom: none;
	padding-bottom: 0.25rem;
}

.qoss-quiz-question legend {
	font-weight: 600;
	margin-bottom: 0.5rem;
	padding: 0;
}

.qoss-quiz-question label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.15rem 0;
	padding: 0.35rem 0.5rem;
	border-radius: 6px;
	cursor: pointer;
}

.qoss-quiz-question label:hover {
	background: #f5f7fa;
}

.qoss-quiz-question input[type="radio"] {
	accent-color: var(--qoss-primary);
}

.qoss-quiz-result {
	margin-top: 0.75rem;
	padding: 0.65rem 1rem;
	border-radius: 8px;
	font-weight: 600;
	background: #f5f7fa;
	color: var(--qoss-text);
	border: 1px solid var(--qoss-border);
}

/* -------------------------------------------------------------- *
 * [qoss_my_courses] card grid.
 * -------------------------------------------------------------- */

.qoss-my-courses {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
	margin: 1.5rem 0;
}

.qoss-my-course {
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.qoss-my-course-thumb {
	display: block;
	aspect-ratio: 480 / 200;
	background: #eef1f4;
}

.qoss-my-course-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qoss-my-course-body {
	padding: 1rem 1.25rem 1.25rem;
}

.qoss-my-course-body h3 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}

.qoss-my-course-body h3 a {
	color: #1d2327;
	text-decoration: none;
}

.qoss-my-course-body h3 a:hover {
	color: #2271b1;
	text-decoration: underline;
}

.qoss-my-course-body .qoss-progress-label {
	color: #666;
	font-size: 0.8rem;
	margin: 0.4rem 0 0;
}

/* -------------------------------------------------------------- *
 * Certificate.
 * -------------------------------------------------------------- */

.qoss-certificate {
	border: 4px double #2271b1;
	border-radius: 10px;
	padding: 3rem;
	text-align: center;
	max-width: 640px;
	margin: 2rem auto;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.qoss-certificate-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.8rem;
	color: #666;
}

.qoss-certificate-name {
	font-size: 2rem;
	margin: 0.5rem 0;
}

/* -------------------------------------------------------------- *
 * Small screens: stack the nav below the content instead of beside it.
 * -------------------------------------------------------------- */

@media (max-width: 782px) {
	.qoss-course-layout {
		flex-direction: column;
	}

	.qoss-course-nav {
		width: 100%;
		flex-basis: auto;
		position: static;
		top: auto;
	}
}
