.slms-course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin: 24px 0;
	align-items: stretch;
}

.slms-course-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	background: #fff;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.slms-course-thumb img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 10px;
}

.slms-course-card h3 {
	margin: 0 0 8px;
}

.slms-course-card .slms-btn {
	margin-top: auto;
	align-self: flex-start;
}

.slms-course-meta {
	font-size: 0.85em;
	color: #666;
}

.slms-btn {
	display: inline-block;
	background: #2271b1;
	color: #fff !important;
	border: none;
	padding: 10px 18px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 0.95em;
	text-decoration: none !important;
	margin-top: 8px;
}

.slms-btn:hover {
	background: #135e96;
}

.slms-notice {
	background: #f0f6fc;
	border-left: 4px solid #2271b1;
	padding: 10px 14px;
}

.slms-progress-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0;
}

.slms-progress-bar {
	flex: 1;
	background: #eee;
	border-radius: 6px;
	height: 10px;
	overflow: hidden;
}

.slms-progress-fill {
	background: #46b450;
	height: 100%;
}

.slms-progress-label {
	font-size: 0.85em;
	color: #555;
	white-space: nowrap;
}

.slms-module-heading {
	margin: 24px 0 10px;
	font-size: 1.05em;
}

.slms-module-heading:first-of-type {
	margin-top: 0;
}

.slms-sidebar-group {
	border-top: 1px solid #f0f0f0;
}

.slms-sidebar-group:first-child {
	border-top: none;
}

.slms-sidebar-module-heading {
	padding: 12px 16px 4px;
	font-size: 0.85em;
	font-weight: bold;
	color: #666;
}

/* WooCommerce lost/reset password form (on the My Account page) */
.woocommerce-ResetPassword,
.woocommerce-lost-password {
	max-width: 380px;
	margin: 20px auto;
}

.woocommerce-ResetPassword .form-row,
.woocommerce-lost-password .form-row {
	margin-bottom: 14px;
}

.woocommerce-ResetPassword input[type="text"],
.woocommerce-ResetPassword input[type="password"],
.woocommerce-lost-password input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-sizing: border-box;
}

.woocommerce-ResetPassword button,
.woocommerce-lost-password button {
	width: 100%;
	border: none;
	border-radius: 6px;
	padding: 10px 18px;
	cursor: pointer;
}

/* Price badge on course grid */
.slms-price-badge {
	font-weight: 600;
	margin: 4px 0;
}

.slms-form-toggle {
	text-align: center;
	font-size: 0.9em;
	margin-top: 10px;
}

.slms-success {
	background: #edfaef;
	border-left: 4px solid #46b450;
}

.slms-account-form-wrap {
	max-width: 420px;
}

.slms-account-form p {
	margin-bottom: 14px;
}

.slms-account-form input[type="text"],
.slms-account-form input[type="email"],
.slms-account-form input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-sizing: border-box;
}

.slms-password-fields-heading {
	margin-top: 24px;
	font-weight: bold;
}

.slms-password-fields-heading span {
	font-weight: normal;
	font-size: 0.85em;
	color: #666;
}

.slms-password-wrap {
	position: relative;
	display: block;
}

.slms-password-wrap input[type="password"],
.slms-password-wrap input[type="text"] {
	padding-right: 40px !important;
	box-sizing: border-box;
}

.slms-password-toggle {
	position: absolute !important;
	top: 50% !important;
	right: 4px !important;
	left: auto !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
	width: 28px !important;
	height: 28px !important;
	min-width: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	cursor: pointer;
	line-height: 1 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	opacity: 0.55;
	color: #555 !important;
}

.slms-password-toggle:hover {
	opacity: 1;
	color: #555 !important;
}

.slms-password-toggle svg {
	display: block;
	width: 16px;
	height: 16px;
}

/* Login form */
.slms-login-form-wrap {
	max-width: 380px;
	margin: 20px auto;
}

.slms-login-form p {
	margin-bottom: 14px;
}

.slms-login-form input[type="text"],
.slms-login-form input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-sizing: border-box;
}

.slms-login-form button {
	width: 100%;
}

.slms-lost-password {
	text-align: center;
	font-size: 0.9em;
}

.slms-error {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
}

/* Profile page */
.slms-profile-header {
	margin-bottom: 30px;
}

.slms-profile-name {
	margin: 0 0 4px;
}

.slms-profile-email {
	margin: 0 0 12px;
	color: #666;
}

.slms-profile-section-heading {
	margin: 30px 0 10px;
}

.slms-profile-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid #e0e0e0;
	margin: 20px 0 24px;
}

.slms-tab-link {
	padding: 10px 18px;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.slms-tab-active {
	font-weight: 600;
}

/* Course content block (lesson list on the course page) */
.slms-course-content-block {
	padding: 50px 0;
}

.slms-lesson-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.slms-lesson-row {
	margin-bottom: 12px;
}

.slms-lesson-row-link {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease;
}

.slms-lesson-marker {
	width: 22px;
	height: 22px;
	min-width: 22px;
	border-radius: 50%;
	border: 2px solid #ccc;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}

.slms-lesson-complete .slms-lesson-marker {
	border-color: #46b450;
	color: #46b450;
}

.slms-check {
	color: #46b450;
	font-weight: bold;
}

.slms-back-link {
	margin: 16px 0;
}

/* Keep lesson content responsive so nothing overflows on narrow screens.
   This is deliberately aggressive: WordPress's block editor often bakes
   an explicit pixel width into a video/image/figure's inline style when
   it's resized in the editor, which otherwise beats a narrower selector
   even with !important on the inner element alone. Capping every
   descendant closes that gap. */
.slms-lesson-content {
	max-width: 100%;
	overflow-x: hidden;
}

.slms-lesson-content * {
	max-width: 100% !important;
	box-sizing: border-box;
}

.slms-lesson-content img,
.slms-lesson-content video {
	width: 100% !important;
	height: auto !important;
}

/* WordPress's own native video wrapper (used now that MediaElement.js
   is disabled on lesson pages) hard-codes an inline "width: Npx" style
   on this div — max-width still wins over a plain (non-important)
   inline width per normal box-sizing rules, but we set width directly
   too for certainty. */
.slms-lesson-content .wp-video {
	width: 100% !important;
	max-width: 100% !important;
}

.slms-lesson-content .wp-video video,
.slms-lesson-content video.wp-video-shortcode {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
}

/* Older MediaElement.js structure, kept in case it ever reappears
   (e.g. on other post types where the library isn't disabled). */
.slms-lesson-content .mejs-container,
.slms-lesson-content .mejs-mediaelement,
.slms-lesson-content mediaelementwrapper {
	width: 100% !important;
	max-width: 100% !important;
	aspect-ratio: 16 / 9 !important;
	height: auto !important;
}

.slms-lesson-content .mejs-mediaelement video {
	width: 100% !important;
	height: 100% !important;
}

.slms-lesson-content iframe {
	width: 100% !important;
	aspect-ratio: 16 / 9;
	height: auto !important;
}

.slms-lesson-content h1,
.slms-lesson-content h2,
.slms-lesson-content h3,
.slms-lesson-content h4,
.slms-lesson-content h5,
.slms-lesson-content h6,
.slms-lesson-content p,
.slms-lesson-content li,
.slms-lesson-content a {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* Content pasted in from ChatGPT sometimes carries its own wrapper
   divs/classes (e.g. "...tableContainer", "...tableWrapper", "w-fit")
   which size themselves to fit their content's full natural width —
   defeating every container/max-width rule above before they even
   apply. Neutralize those specific wrapper patterns directly. */
.slms-lesson-content [class*="tableContainer"],
.slms-lesson-content [class*="tableWrapper"] {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
}

.slms-lesson-content .w-fit {
	width: 100% !important;
	max-width: 100% !important;
}

/* Tables can still be legitimately wider than the screen — let them
   scroll horizontally within themselves instead of being squashed or
   breaking the page layout. The .slms-table-scroll wrapper is added
   automatically by JS. This intentionally overrides the blanket
   max-width:100% above for the table itself and its cells. */
.slms-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 16px 0;
	max-width: 100%;
}

.slms-table-scroll table,
.slms-table-scroll table * {
	max-width: none !important;
}

.slms-table-scroll table {
	margin: 0;
}

/* Hard safeguard against any horizontal overflow on lesson pages,
   regardless of theme or brand stylesheet in use. */
body.single-lms_lesson {
	overflow-x: hidden;
}

/* Lesson page: sidebar + main column */
.slms-lesson-page {
	display: flex;
	align-items: flex-start;
	margin: 20px 0;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	max-width: 100%;
}

.slms-sidebar {
	width: 280px;
	min-width: 280px;
	border-right: 1px solid #e0e0e0;
	background: #fff;
}

.slms-sidebar-header {
	padding: 16px;
	font-weight: bold;
}

.slms-sidebar-header a {
	text-decoration: none;
	color: inherit;
}

.slms-sidebar-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.slms-sidebar-item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	text-decoration: none;
	color: inherit;
	border-top: 1px solid #f0f0f0;
}

.slms-sidebar-marker {
	width: 18px;
	height: 18px;
	min-width: 18px;
	border-radius: 50%;
	border: 2px solid #ccc;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
}

.slms-lesson-main {
	flex: 1;
	min-width: 0;
	padding: 24px;
}

.slms-breadcrumb {
	font-size: 0.85em;
	margin: 0 0 16px;
}

.slms-lesson-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.slms-nav-link {
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

@media (max-width: 700px) {
	.slms-lesson-page {
		flex-direction: column;
		align-items: stretch;
	}

	.slms-sidebar {
		width: 100%;
		min-width: 0;
		border-right: none;
		border-bottom: 1px solid #e0e0e0;
	}

	.slms-lesson-main {
		width: 100%;
		min-width: 0;
	}

	.slms-lesson-nav {
		flex-wrap: wrap;
	}
}

.slms-quiz {
	margin-top: 30px;
	padding: 20px;
	background: #f6f7f7;
	border-radius: 8px;
}

.slms-quiz-question {
	margin-bottom: 18px;
}

.slms-quiz-option {
	display: block;
	margin: 6px 0;
	cursor: pointer;
}

.slms-quiz-result {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 6px;
}

.slms-quiz-result.pass {
	background: #edfaef;
	border-left: 4px solid #46b450;
}

.slms-quiz-result.fail {
	background: #fcf0f1;
	border-left: 4px solid #d63638;
}

.slms-complete-badge {
	color: #46b450;
	font-weight: bold;
}

.slms-quiz-prev {
	font-size: 0.9em;
	color: #555;
}
