/* ===== Medaptly LMS — Frontend Styles ===== */

.mlms-course,
.mlms-lesson,
.mlms-quiz {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
	line-height: 1.6;
	max-width: 1100px;
	margin: 0 auto;
}

.mlms-breadcrumb {
	margin-bottom: 18px;
	font-size: 14px;
}
.mlms-breadcrumb a {
	color: #2271b1;
	text-decoration: none;
}
.mlms-breadcrumb a:hover { text-decoration: underline; }

.mlms-btn {
	display: inline-block;
	padding: 10px 22px;
	font-size: 15px;
	font-weight: 600;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s;
	background: #f0f0f1;
	color: #1d2327;
	font-family: inherit;
}
.mlms-btn:hover:not(:disabled) { background: #e0e0e1; transform: translateY(-1px); }
.mlms-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.mlms-btn-primary { background: #2271b1; color: #fff; }
.mlms-btn-primary:hover:not(:disabled) { background: #1a5d96; color: #fff; }
.mlms-btn-success { background: #00a32a; color: #fff; }
.mlms-btn-success:hover:not(:disabled) { background: #008a22; color: #fff; }
.mlms-btn-ghost { background: transparent; border: 1px solid #c3c4c7; }
.mlms-btn-ghost:hover { background: #f6f7f7; }
.mlms-btn-large { padding: 14px 30px; font-size: 17px; }

/* ============================================
 * COURSE LANDING PAGE
 * ============================================ */
.mlms-course-description {
	background: #f6f7f7;
	padding: 16px 20px;
	border-radius: 6px;
	margin-bottom: 20px;
}
.mlms-course-meta {
	display: flex;
	gap: 24px;
	margin: 16px 0;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 6px;
}
.mlms-course-meta strong {
	color: #2271b1;
	font-size: 18px;
	margin-right: 4px;
}

.mlms-item-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.mlms-item { margin-bottom: 10px; }
.mlms-item-link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 6px;
	text-decoration: none;
	color: #1d2327;
	transition: all 0.15s;
}
.mlms-item-link:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.08);
	transform: translateX(2px);
}
.mlms-item.mlms-completed .mlms-item-link {
	background: #f0f9ff;
	border-color: #bae6fd;
}
.mlms-item-num {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	background: #2271b1;
	color: #fff;
	border-radius: 50%;
	font-weight: 700;
	flex-shrink: 0;
}
.mlms-item.mlms-completed .mlms-item-num { background: #00a32a; }
.mlms-item-body { flex: 1; display: flex; align-items: center; gap: 10px; }
.mlms-item-type-badge {
	display: inline-block;
	font-size: 10px;
	padding: 3px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.5px;
}
.mlms-item-lesson .mlms-item-type-badge { background: #e0e7ff; color: #3730a3; }
.mlms-item-quiz   .mlms-item-type-badge { background: #fef3c7; color: #92400e; }
.mlms-item-title { font-weight: 500; font-size: 16px; }
.mlms-item-status { color: #646970; font-size: 13px; font-weight: 500; }
.mlms-item.mlms-completed .mlms-item-status { color: #00a32a; font-weight: 700; }

/* ===== Module sections on course landing page ===== */
.mlms-course-module {
	margin-bottom: 28px;
}
.mlms-course-module-head {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-left: 4px solid #2271b1;
	padding: 14px 18px;
	border-radius: 6px 6px 0 0;
}
.mlms-course-module-head h3 {
	margin: 4px 0 0;
	font-size: 20px;
	color: #1d2327;
}
.mlms-course-module-head .mlms-mod-badge {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1px;
	padding: 3px 8px;
	border-radius: 3px;
	text-transform: uppercase;
}
.mlms-course-module-desc {
	margin-top: 8px;
	font-size: 14px;
	color: #4b5563;
}
.mlms-course-module-desc p:last-child { margin-bottom: 0; }
.mlms-course-module .mlms-item-list {
	background: #fff;
	border: 1px solid #e0e0e1;
	border-top: none;
	border-radius: 0 0 6px 6px;
	padding: 10px;
}
.mlms-course-module .mlms-item { margin-bottom: 6px; }
.mlms-course-module .mlms-item:last-child { margin-bottom: 0; }

/* ===== Module sections in player sidebar ===== */
.mlms-sidebar-module {
	border-bottom: 1px solid #f0f0f1;
}
.mlms-sidebar-module:last-child { border-bottom: none; }
.mlms-sidebar-module-head {
	padding: 14px 22px 8px;
	background: #f6f7f7;
	border-bottom: 1px solid #f0f0f1;
	position: relative;
}
.mlms-sidebar-module-head .mlms-mod-label {
	display: block;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 1.5px;
	color: #2271b1;
	text-transform: uppercase;
	line-height: 1;
	margin-bottom: 4px;
}
.mlms-sidebar-module-head h4 {
	margin: 0;
	font-size: 14px;
	color: #1d2327;
	font-weight: 700;
	padding-right: 42px;
}
.mlms-sidebar-module-head .mlms-mod-count {
	position: absolute;
	top: 14px;
	right: 18px;
	font-size: 11px;
	color: #646970;
	background: #fff;
	padding: 2px 8px;
	border-radius: 10px;
	border: 1px solid #e0e0e1;
}

/* Module crumb in player content header */
.mlms-module-crumb {
	margin-left: 8px;
	color: #646970;
	font-size: 12px;
}
.mlms-module-crumb strong { color: #2271b1; font-weight: 700; }


/* ============================================
 * COURSE PLAYER (full-screen takeover)
 * ============================================ */
body.mlms-player-body {
	margin: 0;
	padding: 0;
	background: #f6f7f7;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
	overflow: hidden;
	height: 100vh;
}
body.mlms-player-body * { box-sizing: border-box; }

.mlms-player {
	display: flex;
	flex-direction: column;
	height: 100vh;
	overflow: hidden;
}

/* ===== Top Bar ===== */
.mlms-player-topbar {
	background: #1d2327;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 18px;
	height: 60px;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.mlms-player-course-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}
.mlms-player-label {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: rgba(255,255,255,0.55);
	line-height: 1;
	margin-bottom: 2px;
}
.mlms-player-course-title a {
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}
.mlms-player-course-title a:hover { text-decoration: underline; }

.mlms-player-progress-wrap {
	width: 220px;
	flex-shrink: 0;
}
.mlms-player-progress-text {
	font-size: 11px;
	color: rgba(255,255,255,0.7);
	margin-bottom: 4px;
}
.mlms-player-progress-bar {
	height: 6px;
	background: rgba(255,255,255,0.12);
	border-radius: 3px;
	overflow: hidden;
}
.mlms-player-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #2271b1, #00a32a);
	transition: width 0.4s;
}

.mlms-player-exit {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	background: rgba(255,255,255,0.08);
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.15s;
}
.mlms-player-exit:hover { background: rgba(255,255,255,0.18); color: #fff; }

.mlms-sidebar-toggle {
	display: none;
	background: none;
	border: none;
	width: 36px;
	height: 36px;
	padding: 0;
	cursor: pointer;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	align-items: center;
}
.mlms-sidebar-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: #fff;
	border-radius: 1px;
}

/* ===== Layout: sidebar + main ===== */
.mlms-player-layout {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

/* ===== Sidebar ===== */
.mlms-player-sidebar {
	width: 320px;
	flex-shrink: 0;
	background: #fff;
	border-right: 1px solid #e0e0e1;
	overflow-y: auto;
	height: 100%;
}
.mlms-sidebar-header {
	padding: 20px 22px 14px;
	border-bottom: 1px solid #f0f0f1;
}
.mlms-sidebar-header h3 {
	margin: 0 0 4px;
	font-size: 15px;
	color: #1d2327;
}
.mlms-sidebar-header p {
	margin: 0;
	font-size: 12px;
	color: #646970;
}
.mlms-sidebar-list {
	list-style: none;
	padding: 6px 0;
	margin: 0;
}
.mlms-sidebar-item a {
	display: flex;
	gap: 12px;
	padding: 12px 22px;
	text-decoration: none;
	color: #1d2327;
	border-left: 3px solid transparent;
	transition: background 0.12s;
}
.mlms-sidebar-item a:hover { background: #f6f7f7; }
.mlms-sidebar-item.mlms-active a {
	background: #f0f9ff;
	border-left-color: #2271b1;
}
.mlms-sidebar-item.mlms-active .mlms-sidebar-title { color: #2271b1; font-weight: 700; }

.mlms-sidebar-num {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f0f0f1;
	color: #646970;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
}
.mlms-sidebar-item.mlms-done .mlms-sidebar-num {
	background: #00a32a;
	color: #fff;
}
.mlms-sidebar-item.mlms-done .mlms-sidebar-num .dashicons { font-size: 16px; width: 16px; height: 16px; line-height: 1.2; }
.mlms-sidebar-item.mlms-active .mlms-sidebar-num {
	background: #2271b1;
	color: #fff;
}
.mlms-sidebar-item.mlms-active.mlms-done .mlms-sidebar-num { background: #00a32a; }

.mlms-sidebar-body { flex: 1; min-width: 0; }
.mlms-sidebar-type {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 1px;
	color: #646970;
	margin-bottom: 2px;
}
.mlms-sidebar-item.mlms-type-lesson .mlms-sidebar-type { color: #3730a3; }
.mlms-sidebar-item.mlms-type-quiz .mlms-sidebar-type { color: #92400e; }
.mlms-sidebar-title {
	display: block;
	font-size: 14px;
	line-height: 1.35;
}

/* ===== Course Player main area — flex column so iframe can fill remaining space ===== */
.mlms-player-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	background: #fff;
}
.mlms-player-content-head {
	padding: 24px 32px 18px;
	border-bottom: 1px solid #f0f0f1;
	background: #fff;
	flex-shrink: 0;
}
.mlms-player-content-meta {
	font-size: 12px;
	color: #646970;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.mlms-type-badge {
	display: inline-block;
	font-size: 10px;
	padding: 3px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.5px;
}
.mlms-type-lesson { background: #e0e7ff; color: #3730a3; }
.mlms-type-quiz   { background: #fef3c7; color: #92400e; }

.mlms-player-content-title {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.25;
}

/* The content body fills remaining vertical space; iframe inside fills it 100% */
.mlms-player-content-body {
	flex: 1;
	min-height: 0;
	padding: 16px 32px;
	background: #f6f7f7;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Iframe wrapper fills the body; iframe fills wrapper; content scrolls inside iframe */
.mlms-player-content-body .mlms-iframe-wrap {
	margin: 0;
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	flex: 1;
	min-height: 0;
	display: flex;
}
.mlms-player-content-body .mlms-lesson-iframe {
	display: block;
	width: 100%;
	flex: 1;
	border: none;
	background: #fff;
	/* No fixed height — flex sets it. Content scrolls inside the iframe. */
}

/* Quiz inside player — scrollable inside content body */
.mlms-player-content-body .mlms-quiz {
	max-width: none;
	margin: 0;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding-right: 6px;
}

/* ===== Footer Nav ===== */
.mlms-player-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 32px;
	background: #fff;
	border-top: 1px solid #e0e0e1;
	flex-shrink: 0;
	flex-wrap: wrap;
}
.mlms-player-footer .mlms-btn { white-space: nowrap; }

/* ===== Mobile sidebar drawer ===== */
@media (max-width: 900px) {
	.mlms-sidebar-toggle { display: flex; }
	.mlms-player-progress-wrap { width: 120px; }
	.mlms-player-sidebar {
		position: fixed;
		top: 60px;
		bottom: 0;
		left: 0;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		z-index: 90;
		box-shadow: 4px 0 16px rgba(0,0,0,0.1);
		width: 300px;
		height: auto;
	}
	.mlms-player.mlms-sidebar-open .mlms-player-sidebar { transform: translateX(0); }
	.mlms-player.mlms-sidebar-open::before {
		content: '';
		position: fixed;
		inset: 60px 0 0 0;
		background: rgba(0,0,0,0.45);
		z-index: 80;
	}
	.mlms-player-content-head { padding: 18px 18px 14px; }
	.mlms-player-content-title { font-size: 22px; }
	.mlms-player-content-body { padding: 16px; }
	.mlms-player-footer { padding: 14px 16px; }
	.mlms-player-footer .mlms-btn { font-size: 13px; padding: 8px 14px; }
}
@media (max-width: 600px) {
	.mlms-player-progress-wrap { display: none; }
	.mlms-player-content-title { font-size: 19px; }
}

/* ============================================
 * STANDALONE LESSON view (no course)
 * ============================================ */
.mlms-lesson .mlms-iframe-wrap {
	margin: 20px 0;
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 6px;
	overflow: hidden;
	height: 80vh;
	display: flex;
}
.mlms-lesson .mlms-lesson-iframe {
	display: block;
	width: 100%;
	flex: 1;
	background: #fff;
	border: none;
}

/* ============================================
 * QUIZ
 * ============================================ */
.mlms-quiz-intro {
	background: #f6f7f7;
	padding: 16px 20px;
	border-radius: 6px;
	margin-bottom: 20px;
}
.mlms-quiz-meta {
	display: flex;
	gap: 24px;
	padding: 14px 18px;
	background: #fef3c7;
	border-left: 4px solid #f59e0b;
	border-radius: 4px;
	margin-bottom: 20px;
}
.mlms-quiz-meta strong { color: #92400e; }

.mlms-quiz-start-screen { text-align: center; padding: 30px; }

.mlms-quiz-progress { margin-bottom: 24px; }
.mlms-quiz-progress > span { display: inline-block; margin-bottom: 8px; font-weight: 600; color: #646970; }
.mlms-quiz-progress strong, .mlms-q-current, .mlms-q-total { color: #2271b1; font-size: 18px; }
.mlms-progress-bar { height: 6px; background: #e0e0e1; border-radius: 3px; overflow: hidden; }
.mlms-progress-fill { height: 100%; background: linear-gradient(90deg, #2271b1, #00a32a); width: 0%; transition: width 0.4s ease; }

.mlms-question-card {
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 6px;
	padding: 28px 28px;
	margin-bottom: 16px;
}
.mlms-q-text-block { margin-bottom: 22px; font-size: 16px; line-height: 1.6; }

.mlms-q-choices { list-style: none; padding: 0; margin: 0; }
.mlms-q-choice { margin-bottom: 10px; }
.mlms-q-choice label {
	display: flex;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border: 2px solid #e0e0e1;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s;
}
.mlms-q-choice label:hover { border-color: #2271b1; background: #f0f9ff; }
.mlms-q-choice input[type="radio"] { margin-top: 4px; flex-shrink: 0; }
.mlms-q-choice-letter { font-weight: 700; color: #2271b1; flex-shrink: 0; }
.mlms-q-choice-text { flex: 1; line-height: 1.5; }
.mlms-q-choice.mlms-correct label { border-color: #00a32a; background: #e7f5ee; }
.mlms-q-choice.mlms-wrong label   { border-color: #d63638; background: #fdecec; }
.mlms-q-choice.mlms-locked label  { cursor: default; }

.mlms-q-feedback {
	margin-top: 22px;
	padding: 16px 18px;
	border-radius: 6px;
}
.mlms-q-feedback.mlms-feedback-correct { background: #e7f5ee; border-left: 4px solid #00a32a; }
.mlms-q-feedback.mlms-feedback-wrong   { background: #fdecec; border-left: 4px solid #d63638; }
.mlms-q-result { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.mlms-q-feedback.mlms-feedback-correct .mlms-q-result { color: #15803d; }
.mlms-q-feedback.mlms-feedback-wrong .mlms-q-result   { color: #b91c1c; }

.mlms-q-explanation {
	margin-top: 12px;
	background: #fff;
	border: 1px solid #e0e0e1;
	border-radius: 4px;
	padding: 12px 14px;
}
.mlms-q-explanation summary { cursor: pointer; color: #2271b1; font-weight: 600; }
.mlms-explanation-content {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e0e0e1;
	max-height: 600px;
	overflow-y: auto;
}

.mlms-q-actions { margin-top: 22px; display: flex; gap: 12px; justify-content: flex-end; }

.mlms-quiz-results { text-align: center; padding: 30px 20px; background: #fff; border: 1px solid #e0e0e1; border-radius: 6px; }
.mlms-result-score { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; margin: 30px 0; }
.mlms-score-circle {
	width: 160px; height: 160px; border-radius: 50%;
	background: conic-gradient(#2271b1 0%, #e0e0e1 0%);
	display: grid; place-items: center; position: relative;
}
.mlms-score-circle::before { content: ''; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.mlms-score-percent { position: relative; font-size: 42px; font-weight: 800; color: #1d2327; }
.mlms-result-summary { text-align: left; max-width: 320px; }
.mlms-result-message { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.mlms-result-message.passed { color: #15803d; }
.mlms-result-message.failed { color: #b91c1c; }
.mlms-result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

@media (max-width: 720px) {
	.mlms-item-link { flex-direction: column; align-items: flex-start; }
	.mlms-q-actions { flex-direction: column; }
	.mlms-q-actions .mlms-btn { width: 100%; }
	.mlms-result-score { flex-direction: column; gap: 16px; }
	.mlms-result-summary { text-align: center; }
}
