/**
 * 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: grid;
	grid-template-columns: 1fr 280px;
	gap: 32px;
}

.ep-viewer-content {}

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

.ep-viewer-video iframe,
.ep-viewer-video video {
	width: 100%;
	max-width: 100%;
	border-radius: 6px;
}

.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
   ═══════════════════════════════════════════════════ */

.ep-viewer-sidebar {
	border-left: 1px solid #e2e2e2;
	padding-left: 24px;
}

.ep-viewer-sidebar h3 {
	margin: 0 0 16px;
	font-size: 1em;
}

.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;
}

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

@media (max-width: 900px) {
	.ep-viewer-layout {
		grid-template-columns: 1fr;
	}
	.ep-viewer-sidebar {
		border-left: none;
		border-top: 1px solid #e2e2e2;
		padding-left: 0;
		padding-top: 24px;
	}
}

@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;
	}
}
