/**
 * EP Courses — Frontend Styles
 * Card grid, course viewer, and progress display
 */

/* ═══════════════════════════════════════════════════
   Course Grid
   ═══════════════════════════════════════════════════ */

.courses-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}

.courses-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.courses-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.courses-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* ═══════════════════════════════════════════════════
   Course Card
   ═══════════════════════════════════════════════════ */

.course-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	display: flex;
	flex-direction: column;
}

.course-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.course-card-top {
	height: 6px;
}

.course-card-top.free {
	background: #2e9e5e;
}

.course-card-top.paid {
	background: #c8a838;
}

.course-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.course-card-body h3 {
	margin: 8px 0 12px;
	font-size: 1.15em;
	line-height: 1.3;
	overflow-wrap: break-word;
	word-wrap: break-word;
	hyphens: auto;
}

.course-card-body p,
.course-card-body span {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.course-badge {
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.badge-free { color: #2e9e5e; }
.badge-paid { color: #c8a838; }

.course-outcome {
	font-size: 0.9em;
	line-height: 1.5;
	color: #555;
	margin-bottom: 16px;
}

.course-meta {
	display: flex;
	gap: 16px;
	font-size: 0.82em;
	color: #777;
	margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════
   Progress Bar (shared by cards, viewer, dashboard)
   ═══════════════════════════════════════════════════ */

.course-progress-bar {
	background: #eee;
	border-radius: 4px;
	height: 8px;
	overflow: hidden;
	margin-bottom: 16px;
}

.course-progress-fill {
	height: 100%;
	background: #2e9e5e;
	border-radius: 4px;
	transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */

.course-card .btn,
.ep-course-viewer .btn,
.ep-courses-progress .btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	text-align: center;
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-green {
	background: #2e9e5e;
	color: #fff;
}

.btn-green:hover {
	background: #27864f;
	box-shadow: 0 2px 8px rgba(46, 158, 94, 0.3);
}

.btn-primary {
	background: #c8a838;
	color: #fff;
}

.btn-primary:hover {
	background: #b5962e;
}

.btn-primary[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

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

/* ═══════════════════════════════════════════════════
   Course Viewer
   ═══════════════════════════════════════════════════ */

.ep-course-viewer {
	margin: 24px 0;
}

.ep-viewer-header {
	margin-bottom: 24px;
}

.ep-viewer-header h2 {
	margin: 0 0 12px;
}

.ep-viewer-progress-text {
	font-size: 0.85em;
	color: #777;
}

.ep-viewer-layout {
	display: block;
}

.ep-viewer-content {}

.ep-viewer-description {
	background: #f6f7f9;
	border-left: 3px solid #1A9E4A;
	padding: 12px 16px;
	border-radius: 6px;
	color: #4a5560;
	line-height: 1.6;
	margin-bottom: 20px;
}

.ep-viewer-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin-bottom: 24px;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}

.ep-viewer-video iframe,
.ep-viewer-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 6px;
}

.ep-viewer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.ep-viewer-body {
	line-height: 1.7;
	margin-bottom: 24px;
}

.ep-viewer-done {
	display: inline-block;
	color: #2e9e5e;
	font-weight: 600;
	padding: 10px 0;
}

.ep-viewer-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #e2e2e2;
}

.ep-viewer-prev,
.ep-viewer-next {
	background: #f5f5f5;
	color: #333;
	border: 1px solid #e2e2e2;
}

.ep-viewer-prev:hover,
.ep-viewer-next:hover {
	background: #eee;
	border-color: #ccc;
}

/* ═══════════════════════════════════════════════════
   Lesson Sidebar
   ═══════════════════════════════════════════════════ */

/* "Lessons" toggle button */
.ep-lessons-toggle {
	background: #14213D;
	color: #fff;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ep-lessons-toggle:hover {
	background: #0e1729;
	box-shadow: 0 2px 8px rgba(20, 33, 61, 0.25);
}

.ep-lessons-toggle-icon {
	position: relative;
	display: inline-block;
	width: 16px;
	height: 12px;
}

.ep-lessons-toggle-icon span,
.ep-lessons-toggle-icon::before,
.ep-lessons-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	border-radius: 2px;
	background: #fff;
}

.ep-lessons-toggle-icon::before { top: 0; }
.ep-lessons-toggle-icon span { top: 5px; }
.ep-lessons-toggle-icon::after { bottom: 0; }

/* Lesson list drawer (slides in from the right) */
.ep-lessons-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 33, 61, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
	z-index: 998;
}

.ep-course-viewer.sidebar-open .ep-lessons-backdrop {
	opacity: 1;
	visibility: visible;
}

.ep-viewer-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: 320px;
	max-width: 85vw;
	background: #fff;
	box-shadow: -8px 0 32px rgba(20, 33, 61, 0.18);
	padding: 24px 20px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.28s ease;
	z-index: 999;
}

.ep-course-viewer.sidebar-open .ep-viewer-sidebar {
	transform: translateX(0);
}

.ep-lessons-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #4a5560;
	cursor: pointer;
}

.ep-viewer-sidebar h4 {
	margin: 4px 40px 16px 0;
	font-size: 1.05em;
}

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

.ep-lesson-list li {
	margin-bottom: 4px;
}

.ep-lesson-list li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	text-decoration: none;
	color: #333;
	font-size: 0.9em;
	transition: background 0.15s ease;
}

.ep-lesson-list li a:hover {
	background: #f5f5f5;
}

.ep-lesson-list li.active a {
	background: #eef7f1;
	font-weight: 600;
}

.ep-lesson-num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #eee;
	font-size: 0.78em;
	font-weight: 600;
	flex-shrink: 0;
}

.ep-lesson-num.done {
	background: #2e9e5e;
	color: #fff;
}

/* ═══════════════════════════════════════════════════
   Progress Cards (course-progress shortcode)
   ═══════════════════════════════════════════════════ */

.ep-courses-progress {
	margin: 24px 0;
}

.ep-progress-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 16px;
}

.ep-progress-card h3 {
	margin: 0 0 12px;
}

.ep-progress-meta {
	font-size: 0.85em;
	color: #777;
}

/* ═══════════════════════════════════════════════════
   Course Landing
   ═══════════════════════════════════════════════════ */

.ep-course-landing { margin: 0 0 48px; }

.ep-landing-hero { padding: 8px 0 28px; }
.ep-landing-hero-inner { max-width: 760px; }
.ep-landing-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.8em;
	font-weight: 700;
	color: #1A9E4A;
	margin: 0 0 8px;
}
.ep-landing-hero h1 { margin: 0 0 12px; }
.ep-landing-description {
	font-size: 1.1em;
	line-height: 1.6;
	color: #4a5560;
	margin: 0 0 20px;
}

.ep-landing-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	margin: 0 0 32px;
	padding: 20px 0;
	border-top: 1px solid #e8e6e0;
	border-bottom: 1px solid #e8e6e0;
}
.ep-landing-stat { display: flex; flex-direction: column; min-width: 96px; }
.ep-landing-stat strong { font-size: 1.4em; color: #14213D; line-height: 1.2; }
.ep-landing-stat span { font-size: 0.82em; color: #777; }

.ep-landing-outcome { margin: 0 0 32px; }
.ep-landing-outcome h2,
.ep-landing-lessons h2,
.ep-landing-cta-bottom h2 { font-size: 1.4em; margin: 0 0 14px; }
.ep-landing-outcome p { line-height: 1.7; color: #4a5560; margin: 0; }

.ep-landing-lessons { margin: 0 0 32px; }
.ep-landing-lesson-list { list-style: none; counter-reset: lesson; margin: 0; padding: 0; }
.ep-landing-lesson-list li {
	counter-increment: lesson;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
}
.ep-landing-lesson-list li::before {
	content: counter(lesson);
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #eef7f1;
	color: #1A9E4A;
	font-weight: 700;
	font-size: 0.85em;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ep-landing-lesson-text { display: flex; flex-direction: column; flex: 1; }
.ep-landing-lesson-title { font-weight: 600; color: #14213D; }
.ep-landing-lesson-desc { font-size: 0.9em; color: #777; margin-top: 2px; line-height: 1.5; }
.ep-landing-lesson-duration { font-size: 0.82em; color: #999; white-space: nowrap; padding-top: 2px; }

.ep-landing-cta-bottom {
	text-align: center;
	background: #fafaf7;
	border: 1px solid #e8e6e0;
	border-radius: 16px;
	padding: 32px 24px;
}
.ep-landing-cta-bottom p { color: #4a5560; margin: 0 0 18px; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 700px) {
	.courses-grid.columns-3,
	.courses-grid.columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.courses-grid.columns-2,
	.courses-grid.columns-3,
	.courses-grid.columns-4 {
		grid-template-columns: 1fr;
	}
}

.ep-courses-complete.ep-locked {
	background: #e2e2e2;
	color: #888;
	cursor: not-allowed;
}
