/* Path: Frontend/src/components/assignment/work/assignment-work.module.scss */

.page {
	min-height: 100dvh;
	padding: 1.25rem;
	background:
		radial-gradient(circle at top left, var(--page-glow-primary), transparent 30%),
		radial-gradient(circle at bottom right, var(--page-glow-secondary), transparent 28%),
		linear-gradient(135deg, var(--page-gradient-start), var(--page-gradient-end));
}

.shell {
	width: min(100%, 96rem);
	margin: 0 auto;
	display: grid;
	gap: 1.25rem;
}

.submitBanner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	border-radius: var(--radius-2xl);
	background: var(--surface-success);
	border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
	box-shadow: var(--shadow-soft);

	p:last-child {
		color: var(--text-muted);
	}

	@media (max-width: 768px) {
		flex-direction: column;
		align-items: flex-start;
	}
}

.bannerEyebrow,
.eyebrow,
.emptyEyebrow,
.helperEyebrow,
.questionEyebrow {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.76rem;
	color: var(--text-muted);
}

.bannerEyebrow {
	color: var(--success);
	font-weight: 600;
}

.bannerLink {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1rem;
	border-radius: var(--radius-full);
	background: var(--surface-panel);
	border: 1px solid var(--border-soft);
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
}

.headerCard {
	display: grid;
	gap: 1rem;
	padding: 1.4rem;
	border-radius: var(--radius-3xl);
	background: linear-gradient(135deg, var(--surface-hero-start), var(--surface-hero-end));
	border: 1px solid var(--border-overlay);
	box-shadow: var(--shadow-elevated);
	color: var(--text-on-accent);
}

@media (max-width: 768px) {
	.headerCard {
		gap: 0.8rem;
		padding: 1rem;
		border-radius: var(--radius-2xl);
	}
}

.headerTop {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

@media (max-width: 768px) {
	.headerTop {
		align-items: flex-start;
		flex-wrap: wrap;
		gap: 0.7rem;
	}
}

.backLink,
.statusPill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.8rem;
	border-radius: var(--radius-full);
	background: var(--surface-overlay-soft);
	border: 1px solid var(--border-overlay);
	color: var(--text-on-accent);
	font-size: 0.85rem;
	text-decoration: none;
}

.headerCopy {
	display: grid;
	gap: 0.4rem;

	h1 {
		font-size: clamp(2rem, 1.55rem + 1.3vw, 3rem);
		line-height: 1;
		letter-spacing: -0.04em;
	}

	p {
		max-width: 60ch;
	}
}

@media (max-width: 768px) {
	.headerCopy {
		gap: 0.25rem;
	}

	.headerCopy h1 {
		font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.9rem);
		line-height: 1.05;
	}

	.headerCopy > p:not(.eyebrow) {
		display: none;
	}
}

.eyebrow {
	color: var(--text-on-accent-muted);
}

.headerMeta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

@media (max-width: 768px) {
	.headerMeta {
		align-items: stretch;
		flex-direction: column;
		gap: 0.7rem;
	}
}

.submitMeta {
	display: grid;
	justify-items: end;
	gap: 0.45rem;

	@media (max-width: 768px) {
		justify-items: stretch;
		width: 100%;
	}
}

.saveState {
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--text-on-accent-muted);
}

.submitHint {
	max-width: 28rem;
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--text-on-accent-muted);
	text-align: right;

	@media (max-width: 768px) {
		text-align: left;
	}
}

.submitButton,
.primaryButton,
.secondaryButton,
.backButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.9rem 1rem;
	border-radius: var(--radius-md);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease;
}

.submitButton,
.backButton,
.primaryButton {
	border: none;
	background: linear-gradient(135deg, var(--action-primary-start), var(--action-primary-end));
	color: var(--action-primary-text);
	box-shadow: var(--action-primary-shadow);

	&:hover {
		transform: translateY(-1px);
		box-shadow: var(--action-primary-shadow-hover);
	}
}

.submitButton:disabled,
.primaryButton:disabled,
.secondaryButton:disabled,
.questionButton:disabled {
	cursor: wait;
	transform: none;
	box-shadow: none;
	opacity: 0.72;
}

.submitButton:disabled,
.primaryButton:disabled {
	background: linear-gradient(135deg, color-mix(in srgb, var(--action-primary-start) 82%, white), color-mix(in srgb, var(--action-primary-end) 82%, white));
}

.secondaryButton:disabled,
.questionButton:disabled {
	background: var(--surface-soft);
}

.contentGrid {
	display: grid;
	gap: 1.25rem;

	@include respond(workspace) {
		grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
		align-items: start;
	}
}

.navigator,
.workspace,
.emptyState {
	display: grid;
	gap: 1rem;
	padding: 1.2rem;
	border-radius: var(--radius-2xl);
	background: var(--surface-panel);
	border: 1px solid var(--border-soft);
	box-shadow: var(--shadow-soft);
}

.navigator {
	position: sticky;
	top: 0.75rem;
	z-index: 25;

	@include respond(workspace) {
		position: sticky;
		top: 1.25rem;
	}
}

.navigatorHeader,
.workspaceHeader {
	display: grid;
	gap: 0.2rem;

	h2 {
		font-size: 1.2rem;
		line-height: 1.12;
		letter-spacing: -0.03em;
	}

	p {
		color: var(--text-muted);
		font-size: 0.9rem;
	}
}

.navigatorHeader {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
}

.navigatorToggle {
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 0.9rem;
	border-radius: var(--radius-full);
	border: 1px solid var(--border-soft);
	background: var(--surface-panel-strong);
	color: var(--text);
	font-size: 0.84rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.navigatorContent {
	display: grid;
	gap: 1rem;
}

.navigatorContentExpanded {
	display: grid;
}

.progressMeta {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.8rem 0.9rem;
	border-radius: var(--radius-md);
	background: var(--surface-soft);
	border: 1px solid var(--border-soft);
	font-size: 0.85rem;
	color: var(--text-muted);
}

.questionButtons {
	display: grid;
	gap: 0.65rem;
}

@media (max-width: 1023px) {
	.navigator {
		gap: 0.75rem;
		padding: 0.95rem;
	}

	.navigatorToggle {
		display: inline-flex;
	}

	.navigatorContent {
		display: none;
		gap: 0.75rem;
	}

	.navigatorContentExpanded {
		display: grid;
	}

	.progressMeta {
		padding: 0.7rem 0.8rem;
	}

	.questionButtons {
		max-height: min(55dvh, 24rem);
		overflow-y: auto;
		padding-right: 0.15rem;
	}

	.workspace,
		.emptyState {
		padding: 1rem;
	}

	.workspaceHeader {
		gap: 0.45rem;
	}

	.workspaceHeader h2 {
		font-size: 1.02rem;
		line-height: 1.28;
	}
	}

@include respond(workspace) {
	.navigatorToggle {
		display: none;
	}

	.navigatorContent {
		display: grid;
	}
}

.questionButton {
	display: grid;
	gap: 0.15rem;
	padding: 0.85rem 0.95rem;
	text-align: left;
	border-radius: var(--radius-md);
	border: 1px solid var(--border-divider);
	background: var(--surface-panel-strong);
	color: var(--text);
	cursor: pointer;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		background-color 0.2s ease;

	&:hover {
		transform: translateY(-1px);
	}

	span {
		font-weight: 600;
	}

	small {
		color: var(--text-muted);
		font-size: 0.82rem;
	}
}

.activeQuestion {
	border-color: var(--info);
	background: var(--surface-info);
}

.completedQuestion {
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 30%, transparent);
}

.questionMeta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;

	span {
		padding: 0.35rem 0.6rem;
		border-radius: var(--radius-full);
		background: var(--surface-panel-strong);
		border: 1px solid var(--border-divider);
		font-size: 0.82rem;
		color: var(--text-muted);
	}
}

.questionStatus {
	margin-top: 0.4rem;
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--info);
}

.fieldGroup {
	display: grid;
	gap: 0.45rem;

	span {
		font-size: 0.88rem;
		font-weight: 500;
	}

	input,
	textarea,
	select {
		width: 100%;
		padding: 0.9rem 1rem;
		border-radius: var(--radius-md);
		border: 1px solid var(--border-field);
		background: var(--surface-field);
		outline: none;
		color: var(--text);

		&:focus {
			border-color: var(--primary);
			box-shadow: var(--focus-ring-primary-shadow);
			background: var(--surface-field-focus);
		}
	}

	textarea {
		resize: vertical;
		min-height: 10rem;
	}
}

.fieldHint {
	font-size: 0.82rem;
	color: var(--text-muted);
}

.helperCard {
	display: grid;
	gap: 0.45rem;
	padding: 1rem;
	border-radius: var(--radius-md);
	background: var(--surface-soft);
	border: 1px solid var(--border-soft);

	p:last-of-type {
		color: var(--text-muted);
	}
}

.answerReveal {
	display: grid;
	gap: 0.15rem;
	margin-top: 0.3rem;

	span {
		font-size: 0.78rem;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: var(--text-muted);
	}

	strong {
		font-size: 1rem;
	}
}

.actionRow {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.primaryActions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.secondaryButton {
	border: 1px solid var(--border-soft);
	background: var(--surface-panel-strong);
	color: var(--text);

	&:hover {
		transform: translateY(-1px);
		background: var(--surface-soft);
	}
}

.questionFooter {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.emptyState {
	h1 {
		font-size: clamp(2rem, 1.7rem + 1vw, 2.8rem);
		line-height: 1;
		letter-spacing: -0.04em;
	}

	p {
		color: var(--text-muted);
	}
}
