/* =============================================================================
   EduVortex — app.css
   Thin SSR glue: only components that Eduport's style.css does not provide.
   Eduport (style.css) supplies Bootstrap 5.3, typography, navbar, footer,
   dark-mode tokens, cards, forms, and all standard Bootstrap utilities.
   Add here: EduVortex-specific page components.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   SITE CHROME (not covered by Eduport's navbar-sticky)
   ───────────────────────────────────────────────────────────────────────────── */

/* Skip link (WCAG 2.4.1) */
.ev-skip-link {
	position: absolute;
	top: -100%;
	left: 1rem;
	z-index: 9999;
	background: var(--bs-primary);
	color: #fff;
	padding: .5rem 1rem;
	border-radius: 0 0 8px 8px;
	font-weight: 600;
	text-decoration: none;
	transition: top .15s;
}
.ev-skip-link:focus { top: 0; }

/* Email verification banner */
.ev-verify-banner {
	background: #fff3cd;
	color: #664d03;
	border-bottom: 1px solid #ffecb5;
	padding: .55rem 1rem;
	font-size: .85rem;
	font-weight: 500;
	text-align: center;
}
[data-bs-theme="dark"] .ev-verify-banner {
	background: rgba(255,193,7,.12);
	color: #ffc107;
	border-color: rgba(255,193,7,.2);
}
.ev-verify-link {
	font-weight: 700;
	color: inherit;
	text-decoration: underline;
}

/* User avatar initial (letter avatar used in nav dropdown) */
.ev-avatar-initial {
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, var(--bs-primary), #6246ea);
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* Dark-mode icon visibility — sun on light, moon on dark */
.ev-icon-dark { display: none; }
[data-bs-theme="dark"] .ev-icon-light { display: none; }
[data-bs-theme="dark"] .ev-icon-dark  { display: inline; }


/* ─────────────────────────────────────────────────────────────────────────────
   FORMS (.field wraps label + input pairs in SSR templates)
   ───────────────────────────────────────────────────────────────────────────── */

.field { margin-bottom: 1rem; }
.field label {
	display: block;
	font-size: .85rem;
	font-weight: 500;
	margin-bottom: .3rem;
	color: var(--bs-body-color);
}
.field input,
.field select,
.field textarea {
	display: block;
	width: 100%;
	padding: .45rem .75rem;
	font-size: .9rem;
	font-family: inherit;
	line-height: 1.5;
	color: var(--bs-body-color);
	background-color: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius);
	transition: border-color .15s, box-shadow .15s;
	appearance: auto;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--bs-primary);
	box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25);
}
.field.error input,
.field.error select,
.field.error textarea { border-color: var(--bs-danger); }
.field .error-message,
.field .errorlist {
	color: var(--bs-danger);
	font-size: .8rem;
	margin-top: .25rem;
	list-style: none;
	padding: 0;
}


/* ─────────────────────────────────────────────────────────────────────────────
   TWO-COLUMN LAYOUTS (dashboard / instructor / admin)
   ───────────────────────────────────────────────────────────────────────────── */

.dashboard,
.instructor,
.admin {
	display: grid;
	grid-template-columns: 240px 1fr;
	min-height: calc(100vh - 64px);
	align-items: start;
}
@media (max-width: 767.98px) {
	.dashboard,
	.instructor,
	.admin { grid-template-columns: 1fr; }
}

.dash-sidebar,
.instr-sidebar,
.admin-sidebar {
	background: var(--bs-secondary-bg);
	border-right: 1px solid var(--bs-border-color);
	padding: 1.5rem 1rem;
	min-height: calc(100vh - 64px);
	position: sticky;
	top: 64px;
	align-self: flex-start;
}
@media (max-width: 767.98px) {
	.dash-sidebar,
	.instr-sidebar,
	.admin-sidebar {
		position: static;
		min-height: auto;
		border-right: none;
		border-bottom: 1px solid var(--bs-border-color);
	}
}

.dash-sidebar nav a,
.instr-sidebar nav a,
.admin-sidebar nav a {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .5rem .75rem;
	border-radius: var(--bs-border-radius-sm);
	font-size: .875rem;
	font-weight: 500;
	color: var(--bs-body-color);
	text-decoration: none;
	transition: background .15s, color .15s;
	margin-bottom: .15rem;
	min-height: 40px;
}
.dash-sidebar nav a:hover,
.instr-sidebar nav a:hover,
.admin-sidebar nav a:hover {
	background: rgba(var(--bs-primary-rgb), .08);
	color: var(--bs-primary);
}
.dash-sidebar nav a.active,
.instr-sidebar nav a.active,
.admin-sidebar nav a.active {
	background: rgba(var(--bs-primary-rgb), .12);
	color: var(--bs-primary);
	font-weight: 600;
}

.dash-main,
.instr-main,
.admin-main { padding: 1.5rem; min-width: 0; }


/* ─────────────────────────────────────────────────────────────────────────────
   LESSON PLAYER LAYOUT + PANEL TABS
   ───────────────────────────────────────────────────────────────────────────── */

.lesson-player-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	min-height: calc(100vh - 64px);
	align-items: start;
}
@media (max-width: 767.98px) {
	.lesson-player-layout { grid-template-columns: 1fr; }
}

.lesson-main { padding: 1.5rem; min-width: 0; }
.lesson-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }

.video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	background: #000;
	border-radius: var(--bs-border-radius);
	overflow: hidden;
	margin-bottom: 1.25rem;
}
.video-wrap video,
.video-wrap iframe { width: 100%; height: 100%; border: none; }

.lesson-sidebar {
	background: var(--bs-secondary-bg);
	border-left: 1px solid var(--bs-border-color);
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 64px);
	position: sticky;
	top: 64px;
}
@media (max-width: 767.98px) {
	.lesson-sidebar {
		position: static;
		min-height: auto;
		border-left: none;
		border-top: 1px solid var(--bs-border-color);
	}
}

.panel-tabs {
	display: flex;
	border-bottom: 1px solid var(--bs-border-color);
	overflow-x: auto;
	flex-shrink: 0;
}
.panel-tab {
	flex-shrink: 0;
	padding: .65rem .9rem;
	font-size: .78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--bs-secondary-color);
	border: none;
	background: transparent;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	transition: color .15s, border-color .15s;
	white-space: nowrap;
}
.panel-tab.active,
.panel-tab:hover { color: var(--bs-primary); border-bottom-color: var(--bs-primary); }

.panel-body { padding: 1rem; overflow-y: auto; flex: 1; }
.notes-panel textarea { min-height: 120px; resize: vertical; }

.quiz-question { margin-bottom: 1.5rem; }
.quiz-option { margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.result-pass { color: var(--bs-success); font-weight: 700; }
.result-fail  { color: var(--bs-danger);  font-weight: 700; }

@media (max-width: 767.98px) {
	.lesson-nav-bar {
		position: sticky;
		bottom: 0;
		z-index: 10;
		background: var(--bs-body-bg);
		border-top: 1px solid var(--bs-border-color);
		padding: .75rem 1rem;
		display: flex;
		gap: .5rem;
		justify-content: space-between;
	}
}


/* ─────────────────────────────────────────────────────────────────────────────
   ALERTS & BADGES (legacy SSR class names)
   ───────────────────────────────────────────────────────────────────────────── */

.error,
.alert-error,
ul.messages li.error {
	background: rgba(var(--bs-danger-rgb), .1);
	color: var(--bs-danger);
	border: 1px solid rgba(var(--bs-danger-rgb), .25);
	border-radius: var(--bs-border-radius);
	padding: .75rem 1rem;
	font-size: .875rem;
	margin-bottom: 1rem;
}
.notice,
.alert-notice,
.alert-info,
ul.messages li.info,
ul.messages li.success {
	background: rgba(var(--bs-success-rgb), .1);
	color: var(--bs-success);
	border: 1px solid rgba(var(--bs-success-rgb), .25);
	border-radius: var(--bs-border-radius);
	padding: .75rem 1rem;
	font-size: .875rem;
	margin-bottom: 1rem;
}
.alert-warning,
ul.messages li.warning {
	background: rgba(var(--bs-warning-rgb), .15);
	color: #664d03;
	border: 1px solid rgba(var(--bs-warning-rgb), .35);
	border-radius: var(--bs-border-radius);
	padding: .75rem 1rem;
	font-size: .875rem;
	margin-bottom: 1rem;
}
[data-bs-theme="dark"] .alert-warning,
[data-bs-theme="dark"] ul.messages li.warning { color: #ffc107; }

.resolved-badge {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	font-size: .75rem;
	font-weight: 600;
	padding: .15rem .5rem;
	border-radius: 20px;
	background: rgba(var(--bs-success-rgb), .12);
	color: var(--bs-success);
}
.completed {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	font-size: .75rem;
	font-weight: 600;
	padding: .15rem .5rem;
	border-radius: 20px;
	background: rgba(var(--bs-primary-rgb), .12);
	color: var(--bs-primary);
}


/* ─────────────────────────────────────────────────────────────────────────────
   COHORT & PEER REVIEW
   ───────────────────────────────────────────────────────────────────────────── */

.cohort-detail { max-width: 860px; margin: 0 auto; padding: 2rem 1rem; }
.cohort-header { margin-bottom: 2rem; }

.peer-review {
	background: var(--bs-secondary-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-lg);
	padding: 1.25rem;
	margin-bottom: 1rem;
}
.peer-review .reviewer { font-size: .8rem; color: var(--bs-secondary-color); margin-bottom: .5rem; }
.peer-review .feedback { font-size: .9rem; line-height: 1.6; }

.leaderboard-rank {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--bs-primary);
	width: 2rem;
	text-align: center;
}


/* ─────────────────────────────────────────────────────────────────────────────
   MISC UTILITIES
   ───────────────────────────────────────────────────────────────────────────── */

.surface-card {
	background: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-lg);
	padding: 1.5rem;
}

.page-hero {
	padding: 3.5rem 0 2.5rem;
	background: var(--bs-secondary-bg);
	border-bottom: 1px solid var(--bs-border-color);
}
.page-hero h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); }

.prose { max-width: 720px; margin: 0 auto; line-height: 1.8; }
.prose h2 { margin-top: 2rem; margin-bottom: .75rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1rem; }

.notif-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--bs-danger);
}

.checkout-result {
	max-width: 520px;
	margin: 4rem auto;
	padding: 2.5rem;
	text-align: center;
	background: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-xl);
	box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.checkout-result .icon { font-size: 3rem; margin-bottom: 1rem; }
.checkout-result h1   { font-size: 1.5rem; margin-bottom: .75rem; }
.checkout-result p    { color: var(--bs-secondary-color); margin-bottom: 1.5rem; }

.certificate {
	background: #fff;
	border: 2px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-xl);
	padding: 3rem;
	text-align: center;
	max-width: 680px;
	margin: 0 auto;
	box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
[data-bs-theme="dark"] .certificate { background: var(--bs-secondary-bg); }
.certificate .cert-title { font-size: 1.75rem; color: var(--bs-primary); margin-bottom: .5rem; }
.certificate .cert-name  { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.certificate .cert-meta  { color: var(--bs-secondary-color); font-size: .875rem; }

.portfolio-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}
.portfolio-card {
	background: var(--bs-body-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: var(--bs-border-radius-lg);
	overflow: hidden;
	transition: box-shadow .2s;
}
.portfolio-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }


/* ─────────────────────────────────────────────────────────────────────────────
   ACCESSIBILITY
   ───────────────────────────────────────────────────────────────────────────── */

:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}
