:root {
	color-scheme: dark;
	--bg: #090d16;
	--bg-subtle: #0f172a;
	--card-bg: #131b2e;
	--card-hover: #1e293b;
	--fg: #f8fafc;
	--fg-muted: #94a3b8;
	--border: #1e293b;
	--border-light: #334155;
	--accent: #3b82f6;
	--accent-hover: #2563eb;
	--accent-glow: rgba(59, 130, 246, 0.25);
	--success: #10b981;
	--success-bg: rgba(16, 185, 129, 0.15);
	--warning: #f59e0b;
	--warning-bg: rgba(245, 158, 11, 0.15);
	--danger: #ef4444;
	--purple: #8b5cf6;
	--radius: 12px;
	--radius-sm: 8px;
	--radius-lg: 16px;
	--space: 1rem;
	--font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
}

/* Base resets & utilities */
a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

button {
	font-family: inherit;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.55rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}
.btn:hover {
	background: var(--accent-hover);
	transform: translateY(-1px);
}
.btn:active {
	transform: translateY(0);
}
.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.btn-secondary {
	background: var(--bg-subtle);
	color: var(--fg);
	border-color: var(--border-light);
}
.btn-secondary:hover {
	background: var(--card-hover);
	border-color: var(--fg-muted);
}

.btn-success {
	background: var(--success);
	color: #fff;
}
.btn-success:hover {
	background: #059669;
}

.btn-sm {
	padding: 0.35rem 0.65rem;
	font-size: 0.8rem;
}

.btn-lg {
	padding: 0.75rem 1.4rem;
	font-size: 1rem;
	font-weight: 600;
	border-radius: var(--radius);
}

.card {
	padding: 1.25rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card-bg);
}

.input, .select, .textarea {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-sm);
	background: var(--bg-subtle);
	color: var(--fg);
	font: inherit;
	font-size: 0.925rem;
}
.input:focus, .select:focus, .textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent-glow);
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.55rem;
	border: 1px solid var(--border-light);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--fg-muted);
	background: var(--bg-subtle);
}
.badge-blue {
	background: rgba(59, 130, 246, 0.15);
	border-color: rgba(59, 130, 246, 0.3);
	color: #60a5fa;
}
.badge-green {
	background: var(--success-bg);
	border-color: rgba(16, 185, 129, 0.3);
	color: #34d498;
}
.badge-purple {
	background: rgba(139, 92, 246, 0.15);
	border-color: rgba(139, 92, 246, 0.3);
	color: #a78bfa;
}
.badge-amber {
	background: var(--warning-bg);
	border-color: rgba(245, 158, 11, 0.3);
	color: #fbbf24;
}

/* Header & Nav */
.header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(9, 13, 22, 0.85);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}
.header-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0.75rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.brand-logo {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 700;
	font-size: 1.15rem;
	color: #fff;
	cursor: pointer;
}
.brand-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: linear-gradient(135deg, #3b82f6, #8b5cf6);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	box-shadow: 0 0 15px var(--accent-glow);
}
.nav-links {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.nav-btn {
	background: transparent;
	border: none;
	color: var(--fg-muted);
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.5rem 0.85rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all 0.15s;
}
.nav-btn:hover {
	color: var(--fg);
	background: var(--bg-subtle);
}
.nav-btn.active {
	color: #fff;
	background: var(--border);
}

/* Hero Section */
.hero-banner {
	position: relative;
	overflow: hidden;
	padding: 3rem 1.25rem;
	background: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.18), transparent 70%),
		linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, transparent 100%);
	border-bottom: 1px solid var(--border);
}
.hero-inner {
	max-width: 1100px;
	margin: 0 auto;
	text-align: center;
}
.hero-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.8rem;
	background: rgba(59, 130, 246, 0.12);
	border: 1px solid rgba(59, 130, 246, 0.25);
	border-radius: 999px;
	color: #93c5fd;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 1rem;
}
.hero-title {
	font-size: clamp(2rem, 5vw, 3.25rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 1rem;
	background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}
.hero-subtitle {
	font-size: 1.1rem;
	color: var(--fg-muted);
	max-width: 650px;
	margin: 0 auto 1.75rem;
}

/* Catalog Filter */
.catalog-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 2rem 1.25rem;
}
.filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
}
.category-pills {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	padding-bottom: 0.25rem;
}
.cat-btn {
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	border: 1px solid var(--border-light);
	background: var(--bg-subtle);
	color: var(--fg-muted);
	font-size: 0.85rem;
	cursor: pointer;
	white-space: nowrap;
}
.cat-btn:hover {
	color: var(--fg);
	border-color: var(--accent);
}
.cat-btn.active {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

/* Course Grid */
.course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
	gap: 1.5rem;
}
.course-card {
	display: flex;
	flex-direction: column;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: all 0.2s ease;
	cursor: pointer;
}
.course-card:hover {
	transform: translateY(-4px);
	border-color: var(--border-light);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.course-thumb {
	height: 140px;
	position: relative;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.course-content {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.75rem;
}
.course-title {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
	color: #fff;
}
.course-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.825rem;
	color: var(--fg-muted);
}
.course-footer {
	margin-top: auto;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.course-price {
	font-size: 1.35rem;
	font-weight: 800;
	color: #fff;
}
.course-price-old {
	font-size: 0.9rem;
	text-decoration: line-through;
	color: var(--fg-muted);
	margin-left: 0.4rem;
}

/* Classroom / Video Player Layout */
.classroom-layout {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 60px);
	overflow: hidden;
}
.classroom-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 1.25rem;
	background: var(--bg-subtle);
	border-bottom: 1px solid var(--border);
	gap: 1rem;
}
.classroom-body {
	display: grid;
	grid-template-columns: 1fr 340px;
	flex: 1;
	overflow: hidden;
}
@media (max-width: 960px) {
	.classroom-body {
		grid-template-columns: 1fr;
		overflow-y: auto;
	}
}
.player-stage {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 1.25rem;
	gap: 1.25rem;
	background: #080c14;
}

/* Video Canvas & Controls */
.video-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #020617;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
	box-shadow: 0 10px 30px rgba(0,0,0,0.6);
	display: flex;
	flex-direction: column;
}
.video-canvas {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.video-controls {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
	padding: 1rem 1rem 0.6rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	transition: opacity 0.2s;
}
.scrubber {
	width: 100%;
	height: 6px;
	appearance: none;
	background: rgba(255,255,255,0.2);
	border-radius: 3px;
	outline: none;
	cursor: pointer;
}
.scrubber::-webkit-slider-thumb {
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #3b82f6;
	cursor: pointer;
	box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}
.ctrl-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.ctrl-group {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
.icon-btn {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 1.1rem;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.icon-btn:hover {
	background: rgba(255,255,255,0.15);
}

/* Quiz Interface */
.quiz-container {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.75rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.quiz-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border);
	padding-bottom: 1rem;
}
.quiz-question-card {
	background: var(--bg-subtle);
	border: 1px solid var(--border-light);
	border-radius: var(--radius);
	padding: 1.25rem;
}
.option-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-sm);
	background: var(--card-bg);
	cursor: pointer;
	transition: all 0.15s;
	margin-bottom: 0.6rem;
}
.option-item:hover {
	background: var(--card-hover);
	border-color: var(--accent);
}
.option-item.selected {
	border-color: var(--accent);
	background: rgba(59, 130, 246, 0.12);
}
.option-item.correct {
	border-color: var(--success);
	background: var(--success-bg);
}
.option-item.incorrect {
	border-color: var(--danger);
	background: rgba(239, 68, 68, 0.15);
}

/* Code Snippet Box */
.code-box {
	background: #0d1117;
	border: 1px solid #30363d;
	border-radius: var(--radius-sm);
	padding: 1rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	line-height: 1.5;
	overflow-x: auto;
	color: #e6edf3;
}

/* Syllabus Sidebar */
.syllabus-sidebar {
	background: var(--card-bg);
	border-left: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}
.sidebar-header {
	padding: 1rem;
	border-bottom: 1px solid var(--border);
}
.module-accordion {
	border-bottom: 1px solid var(--border);
}
.module-title-btn {
	width: 100%;
	padding: 0.85rem 1rem;
	background: var(--bg-subtle);
	border: none;
	color: var(--fg);
	font-weight: 600;
	font-size: 0.875rem;
	text-align: left;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
}
.lesson-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem 0.75rem 1.25rem;
	border-top: 1px solid var(--border);
	font-size: 0.85rem;
	color: var(--fg-muted);
	cursor: pointer;
	transition: background 0.12s;
}
.lesson-row:hover {
	background: var(--bg-subtle);
	color: var(--fg);
}
.lesson-row.active {
	background: rgba(59, 130, 246, 0.15);
	color: #93c5fd;
	border-left: 3px solid var(--accent);
}

/* Modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	padding: 1rem;
}
.modal-card {
	background: var(--card-bg);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-lg);
	max-width: 540px;
	width: 100%;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
	overflow: hidden;
}

/* Certificate Display */
.cert-frame {
	background: radial-gradient(circle at 50% 0%, #1e293b, #090d16);
	border: 6px double #d97706;
	border-radius: var(--radius-lg);
	padding: 2.5rem 2rem;
	text-align: center;
	position: relative;
	box-shadow: 0 0 50px rgba(217, 119, 6, 0.15);
}
.cert-gold-seal {
	width: 64px;
	height: 64px;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: linear-gradient(135deg, #fbbf24, #d97706);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.8rem;
	box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* Loading, Alert & Empty */
.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 2rem;
	color: var(--fg-muted);
}
.spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: fab-spin 0.7s linear infinite;
}
@keyframes fab-spin {
	to { transform: rotate(360deg); }
}
.alert {
	padding: 0.75rem 1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border-light);
	background: var(--bg-subtle);
	font-size: 0.9rem;
}
.alert-error {
	border-color: rgba(239, 68, 68, 0.3);
	background: rgba(239, 68, 68, 0.1);
	color: #fca5a5;
}
.empty {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--fg-muted);
}
.empty-title {
	font-size: 1.15rem;
	font-weight: 600;
	color: #fff;
	margin-bottom: 0.5rem;
}

/* Discussion & Q&A Styles */
.discussion-container {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}
.discussion-composer {
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-md);
	padding: 1.25rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.discussion-composer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}
.discussion-textarea {
	width: 100%;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.75rem 1rem;
	color: var(--fg);
	font-size: 0.95rem;
	resize: vertical;
	min-height: 80px;
	transition: border-color 0.15s;
}
.discussion-textarea:focus {
	outline: none;
	border-color: var(--accent);
}
.discussion-composer-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.75rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.tag-timestamp-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--fg-muted);
	padding: 0.35rem 0.65rem;
	border-radius: 9999px;
	font-size: 0.8rem;
	cursor: pointer;
	transition: all 0.15s;
}
.tag-timestamp-btn.active {
	background: var(--accent-subtle);
	border-color: var(--accent);
	color: #fff;
}
.thread-card {
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-md);
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	position: relative;
}
.thread-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}
.thread-author-group {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.thread-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	flex-shrink: 0;
}
.thread-author-name {
	font-weight: 600;
	font-size: 0.95rem;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.thread-instructor-badge {
	background: rgba(99, 102, 241, 0.2);
	border: 1px solid rgba(99, 102, 241, 0.4);
	color: #818cf8;
	font-size: 0.7rem;
	padding: 0.1rem 0.45rem;
	border-radius: 9999px;
	font-weight: 600;
}
.thread-time {
	font-size: 0.8rem;
	color: var(--fg-muted);
}
.thread-timestamp-tag {
	background: var(--accent-subtle);
	border: 1px solid rgba(99, 102, 241, 0.3);
	color: #a5b4fc;
	padding: 0.2rem 0.5rem;
	border-radius: var(--radius-sm);
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	transition: background 0.15s;
}
.thread-timestamp-tag:hover {
	background: rgba(99, 102, 241, 0.25);
	color: #fff;
}
.thread-content {
	color: var(--fg);
	font-size: 0.95rem;
	line-height: 1.55;
	white-space: pre-wrap;
}
.thread-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border);
}
.thread-action-btn {
	background: transparent;
	border: none;
	color: var(--fg-muted);
	font-size: 0.85rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.5rem;
	border-radius: var(--radius-sm);
	transition: all 0.15s;
}
.thread-action-btn:hover {
	background: var(--bg-hover);
	color: #fff;
}
.thread-action-btn.upvoted {
	color: var(--accent);
	font-weight: 600;
}
.replies-container {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 0.5rem;
	padding-left: 1.25rem;
	border-left: 2px solid var(--border);
}
.reply-card {
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.85rem 1rem;
}
.reply-composer {
	margin-top: 0.75rem;
	padding: 0.75rem;
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

/* Resources & Attachments Manager */
.resources-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}
.resource-download-card {
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 1rem;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.resource-download-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
	border-color: var(--primary-300);
}
.resource-type-badge-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}
.btn-sm {
	padding: 0.3rem 0.65rem;
	font-size: 0.8rem;
}
.resource-preview-dialog {
	background: var(--bg-surface);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	width: 90%;
	max-width: 680px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}
.resource-preview-content {
	background: #0f172a;
	color: #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.85rem;
	padding: 1rem;
	border-radius: var(--radius-sm);
	overflow: auto;
	max-height: 380px;
	white-space: pre-wrap;
	word-break: break-word;
	margin: 1rem 0;
}
