/**
 * Student dashboard. Cards, meters, tabs, forms and the dialog are in
 * front.css.
 */

.nslms-dash-page {
	padding-bottom: 72px;
}

.nslms-dash-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

/* ----------------------------------------------------------------- sidebar */

.nslms-dash-side {
	position: sticky;
	top: 24px;
	padding: 20px;
	background: var(--nsf-surface);
	border: 1px solid var(--nsf-line);
	border-radius: var(--nsf-radius);
}

.admin-bar .nslms-dash-side {
	top: 56px;
}

.nslms-dash-profile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 18px;
	margin-bottom: 12px;
	border-bottom: 1px solid var(--nsf-line-soft);
}

.nslms-dash-profile .nslms-avatar--lg {
	width: 52px;
	height: 52px;
}

.nslms-dash-profile > div {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.nslms-dash-profile strong {
	color: var(--nsf-ink);
	font-size: 15px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nslms-dash-profile .nslms-muted {
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nslms-dash-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.nslms-app .nslms-dash-tab {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	height: 44px;
	padding: 0 12px;
	border-radius: var(--nsf-radius-sm);
	color: var(--nsf-text);
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	transition: background-color .15s, color .15s;
}

.nslms-app .nslms-dash-tab:hover {
	background: var(--nsf-bg);
	color: var(--nsf-ink);
}

.nslms-app .nslms-dash-tab .nslms-icon {
	color: var(--nsf-muted);
}

.nslms-app .nslms-dash-tab[aria-selected="true"] {
	background: var(--nsf-accent-soft);
	color: var(--nsf-accent);
}

.nslms-app .nslms-dash-tab[aria-selected="true"] .nslms-icon {
	color: var(--nsf-accent);
}

.nslms-dash-tab > span:not(.nslms-tab-count) {
	flex: 1;
}

.nslms-dash-tab[aria-selected="true"] .nslms-tab-count {
	background: #fff;
	color: var(--nsf-accent);
}

.nslms-app .nslms-dash-logout {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	margin-top: 12px;
	padding: 12px 12px 0;
	border-top: 1px solid var(--nsf-line-soft);
	font-size: 14px;
	font-weight: 600;
	color: var(--nsf-muted);
}

.nslms-app .nslms-dash-logout:hover {
	color: var(--nsf-accent);
}

/* ------------------------------------------------------------------ panels */

.nslms-dash-panel:focus {
	outline: none;
}

.nslms-dash-head {
	margin-bottom: 24px;
}

.nslms-app .nslms-dash-head h1,
.nslms-app .nslms-dash-title {
	font-size: clamp(24px, 2.6vw, 30px);
	letter-spacing: -.02em;
}

.nslms-dash-head p {
	margin-top: 6px;
}

.nslms-dash-section + .nslms-dash-section {
	margin-top: 36px;
}

.nslms-dash-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.nslms-app .nslms-dash-section-head h2 {
	font-size: 20px;
}

.nslms-app .nslms-dash-subtitle {
	margin-bottom: 14px;
	font-size: 17px;
}

/* -------------------------------------------------------------------- stats */

.nslms-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 36px;
}

.nslms-stat {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
	background: var(--nsf-surface);
	border: 1px solid var(--nsf-line);
	border-radius: var(--nsf-radius);
}

.nslms-stat-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--nsf-accent-soft);
	color: var(--nsf-accent);
}

.nslms-stat:nth-child(2) .nslms-stat-icon {
	background: var(--nsf-ok-soft);
	color: var(--nsf-ok);
}

.nslms-stat:nth-child(3) .nslms-stat-icon {
	background: #f1f2f6;
	color: var(--nsf-ink);
}

.nslms-stat > div {
	display: flex;
	flex-direction: column;
}

.nslms-stat strong {
	font-size: 28px;
	line-height: 1.1;
	font-weight: 800;
	color: var(--nsf-ink);
}

.nslms-stat span:not(.nslms-stat-icon) {
	font-size: 14px;
	color: var(--nsf-muted);
}

/* ------------------------------------------------------- continue learning */

.nslms-resume-list {
	display: grid;
	gap: 12px;
}

.nslms-resume {
	display: grid;
	grid-template-columns: 128px minmax(0, 1fr) auto;
	gap: 20px;
	align-items: center;
	padding: 14px;
	background: var(--nsf-surface);
	border: 1px solid var(--nsf-line);
	border-radius: var(--nsf-radius);
	transition: box-shadow .2s var(--nsf-ease);
}

.nslms-resume:hover {
	box-shadow: var(--nsf-shadow);
}

.nslms-resume-thumb {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	border-radius: var(--nsf-radius-sm);
	overflow: hidden;
	background: linear-gradient(135deg, var(--nsf-ink), var(--nsf-ink-2));
	color: rgba(255, 255, 255, .35);
}

.nslms-resume-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nslms-app .nslms-resume-body h3 {
	margin-bottom: 12px;
	font-size: 16px;
}

.nslms-app .nslms-resume-body h3 a:hover {
	color: var(--nsf-accent);
}

.nslms-resume .nslms-btn .nslms-icon {
	fill: currentColor;
}

/* --------------------------------------------------------------- my courses */

.nslms-segments {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.nslms-app .nslms-segment {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 8px 0 14px;
	border: 1px solid var(--nsf-line);
	border-radius: 999px;
	background: var(--nsf-surface);
	font-size: 14px;
	font-weight: 600;
	color: var(--nsf-text);
	transition: border-color .15s, background-color .15s, color .15s;
}

.nslms-app .nslms-segment:hover {
	border-color: var(--nsf-ink);
}

.nslms-app .nslms-segment[aria-pressed="true"] {
	background: var(--nsf-ink);
	border-color: var(--nsf-ink);
	color: #fff;
}

.nslms-segment[aria-pressed="true"] .nslms-tab-count {
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.nslms-dash-progress {
	margin-top: 4px;
}

.nslms-dashboard-card .nslms-ccard-foot {
	border-top: 0;
	padding-top: 4px;
}

/* ------------------------------------------------------------------ reviews */

.nslms-review-queue {
	background: var(--nsf-surface);
	border: 1px solid var(--nsf-line);
	border-radius: var(--nsf-radius);
}

.nslms-review-row {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	padding: 16px 20px;
}

.nslms-review-row + .nslms-review-row {
	border-top: 1px solid var(--nsf-line-soft);
}

.nslms-app .nslms-review-row h4 {
	margin-bottom: 4px;
	font-size: 15px;
	color: var(--nsf-ink);
}

.nslms-review-row .nslms-muted {
	font-size: 14px;
}

.nslms-review-excerpt {
	margin-top: 6px;
	font-size: 14px;
	color: var(--nsf-text);
}

.nslms-review-row .nslms-btn .nslms-icon-star {
	fill: currentColor;
	stroke: none;
}

/* Review dialog. */
.nslms-review-course {
	margin-bottom: 16px;
	font-weight: 700;
	color: var(--nsf-ink);
}

.nslms-star-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.nslms-star-field legend {
	margin-bottom: 8px;
	padding: 0;
}

.nslms-star-input {
	justify-content: flex-end;
	width: max-content;
}

.nslms-star-caption {
	min-height: 20px;
	font-size: 14px;
	font-weight: 600;
	color: var(--nsf-muted);
}

/* ------------------------------------------------------------- certificates */

.nslms-cert-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.nslms-cert {
	overflow: hidden;
	background: var(--nsf-surface);
	border: 1px solid var(--nsf-line);
	border-radius: var(--nsf-radius);
}

.nslms-cert-art {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 150px;
	background:
		radial-gradient(260px 120px at 80% 0%, rgba(229, 9, 47, .28), transparent 70%),
		linear-gradient(135deg, var(--nsf-ink), var(--nsf-ink-2));
	color: var(--nsf-star);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.nslms-cert-art::after {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 8px;
}

.nslms-cert-art span {
	color: rgba(255, 255, 255, .78);
}

.nslms-cert-body {
	padding: 18px 20px 20px;
}

.nslms-app .nslms-cert-body h3 {
	font-size: 16px;
}

.nslms-cert-body .nslms-muted {
	margin-top: 6px;
	font-size: 13px;
}

.nslms-cert-body code {
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--nsf-line-soft);
	font-size: 12px;
}

.nslms-cert-actions {
	display: flex;
	gap: 8px;
	margin-top: 16px;
}

/* ----------------------------------------------------------------- settings */

.nslms-settings-card + .nslms-settings-card {
	margin-top: 20px;
}

.nslms-avatar-edit {
	display: flex;
	align-items: center;
	gap: 20px;
}

.nslms-avatar-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.nslms-avatar-actions label {
	position: relative;
	cursor: pointer;
}

.nslms-avatar-actions label:focus-within {
	outline: 2px solid var(--nsf-accent);
	outline-offset: 2px;
}

.nslms-form-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--nsf-line-soft);
}

.nslms-form-msg {
	margin-right: auto;
	font-size: 14px;
	font-weight: 600;
	color: var(--nsf-ok);
}

.nslms-form-msg.is-error {
	color: #a3071f;
}

/* -------------------------------------------------------------- signed out */

.nslms-dashboard-guest {
	display: grid;
	place-items: center;
	padding: 24px 0 72px;
}

.nslms-guest-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: 520px;
	padding: 48px 40px;
	text-align: center;
}

.nslms-app .nslms-guest-card h1 {
	font-size: 26px;
}

.nslms-guest-actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 960px) {
	.nslms-dash-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.nslms-dash-side {
		position: static;
		padding: 12px;
	}

	.nslms-dash-profile {
		display: none;
	}

	/* The vertical nav becomes a scrollable row of tabs. */
	.nslms-dash-nav {
		flex-direction: row;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.nslms-dash-nav::-webkit-scrollbar {
		display: none;
	}

	.nslms-app .nslms-dash-tab {
		width: auto;
		flex: none;
	}

	.nslms-app .nslms-dash-logout {
		display: none;
	}
}

@media (max-width: 640px) {
	/* Three compact tiles in a row rather than three full-width cards. */
	.nslms-stats {
		gap: 8px;
		margin-bottom: 28px;
	}

	.nslms-stat {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		padding: 14px 12px;
	}

	.nslms-stat-icon {
		width: 36px;
		height: 36px;
		border-radius: 10px;
	}

	.nslms-stat strong {
		font-size: 22px;
	}

	.nslms-stat span:not(.nslms-stat-icon) {
		font-size: 12px;
		line-height: 1.3;
	}

	.nslms-resume {
		grid-template-columns: 88px minmax(0, 1fr);
		gap: 12px 14px;
	}

	.nslms-resume > .nslms-btn {
		grid-column: 1 / -1;
	}

	.nslms-review-row {
		grid-template-columns: 72px minmax(0, 1fr);
		padding: 14px 16px;
	}

	.nslms-review-row > .nslms-btn {
		grid-column: 1 / -1;
	}

	.nslms-avatar-edit {
		flex-direction: column;
		align-items: flex-start;
	}

	.nslms-guest-card {
		padding: 36px 20px;
	}

	.nslms-guest-actions {
		flex-direction: column;
		width: 100%;
	}
}
