/**
 * Recently Viewed — Phase 5.12 Continue Studying dashboard.
 * Scoped to .nds-rv / #nds-recently-viewed only.
 */

.nds-rv {
	--rv-ink: #0f2430;
	--rv-muted: #5b7380;
	--rv-soft: #7a929e;
	--rv-line: rgba(20, 60, 80, 0.1);
	--rv-accent: #1a7a86;
	--rv-accent-soft: rgba(26, 122, 134, 0.1);
	--rv-panel: #f7fbfd;
	--rv-card: #ffffff;
	--rv-radius: 28px;
	--rv-ease: cubic-bezier(0.22, 1, 0.36, 1);
	margin: 2.25rem 0 2.6rem;
}

.nds-rv__panel {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--rv-radius);
	border: 1px solid rgba(140, 180, 200, 0.28);
	background:
		radial-gradient(ellipse 70% 55% at 12% 0%, rgba(120, 190, 210, 0.22), transparent 58%),
		radial-gradient(ellipse 50% 45% at 95% 100%, rgba(90, 150, 190, 0.14), transparent 55%),
		linear-gradient(165deg, #ffffff 0%, #f4f9fc 48%, #eaf4f9 100%);
	box-shadow:
		0 24px 48px rgba(20, 50, 70, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	padding: 1.85rem 1.7rem 1.7rem;
	color: var(--rv-ink);
}

.nds-rv__glow {
	position: absolute;
	inset: -10% auto auto 8%;
	width: min(420px, 55%);
	height: 280px;
	background: radial-gradient(circle, rgba(90, 180, 200, 0.22), transparent 70%);
	pointer-events: none;
	z-index: 0;
}

.nds-rv__texture {
	position: absolute;
	inset: 0;
	opacity: 0.035;
	pointer-events: none;
	z-index: 0;
	background-image: radial-gradient(rgba(20, 60, 80, 0.9) 0.7px, transparent 0.7px);
	background-size: 14px 14px;
	mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

.nds-rv__head,
.nds-rv__layout {
	position: relative;
	z-index: 1;
}

.nds-rv__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.25rem;
	margin-bottom: 1.45rem;
}

.nds-rv__eyebrow {
	margin: 0 0 0.4rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rv-accent);
}

.nds-rv__title {
	margin: 0 0 0.4rem;
	font-family: var(--nds-font-display, Georgia, "Times New Roman", serif);
	font-size: clamp(1.75rem, 2.3vw, 2.35rem);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.02em;
	color: var(--rv-ink);
}

.nds-rv__lede {
	margin: 0 0 0.55rem;
	max-width: 36rem;
	font-size: 0.98rem;
	line-height: 1.5;
	color: var(--rv-muted);
}

.nds-rv__stat {
	margin: 0;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--rv-soft);
}

.nds-rv__history {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
	padding: 0.62rem 1.05rem;
	border-radius: 999px;
	border: 1px solid rgba(26, 122, 134, 0.28);
	background: rgba(255, 255, 255, 0.72);
	color: var(--rv-accent);
	font-size: 0.88rem;
	font-weight: 650;
	text-decoration: none;
	box-shadow: 0 8px 18px rgba(20, 60, 80, 0.05);
	transition: transform 250ms var(--rv-ease), box-shadow 250ms var(--rv-ease), background 250ms var(--rv-ease);
}

.nds-rv__history:hover {
	transform: translateY(-1px);
	background: #ffffff;
	box-shadow: 0 12px 24px rgba(20, 60, 80, 0.08);
}

.nds-rv__history:focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 3px;
}

.nds-rv__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
	gap: 1.25rem;
	align-items: stretch;
}

/* —— Featured resume —— */
.nds-rv-resume {
	display: grid;
	grid-template-columns: minmax(132px, 168px) minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
	padding: 1.25rem;
	border-radius: 24px;
	border: 1px solid rgba(120, 170, 190, 0.22);
	background:
		radial-gradient(ellipse 80% 60% at 0% 0%, rgba(90, 180, 200, 0.12), transparent 55%),
		linear-gradient(160deg, #ffffff 0%, #f5fafc 100%);
	box-shadow:
		0 18px 36px rgba(20, 50, 70, 0.07),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);
	transition: transform 250ms var(--rv-ease), box-shadow 250ms var(--rv-ease);
}

.nds-rv-resume:hover {
	transform: translateY(-3px);
	box-shadow:
		0 28px 48px rgba(20, 50, 70, 0.11),
		0 0 0 1px rgba(26, 122, 134, 0.12);
}

.nds-rv-resume__kicker {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--rv-accent);
}

.nds-rv-resume__media {
	position: relative;
}

.nds-rv-resume__cover {
	display: block;
	overflow: hidden;
	border-radius: 16px;
	aspect-ratio: 3 / 4;
	background: linear-gradient(160deg, #d9e8ef, #b9d0db);
	box-shadow: 0 14px 28px rgba(20, 50, 70, 0.16);
}

.nds-rv-resume__img,
.nds-rv-resume__ph {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 250ms var(--rv-ease);
}

.nds-rv-resume:hover .nds-rv-resume__img {
	transform: scale(1.04);
}

.nds-rv-resume__badge {
	position: absolute;
	left: 0.55rem;
	bottom: 0.55rem;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	background: rgba(255, 255, 255, 0.94);
	color: var(--rv-ink);
	box-shadow: 0 6px 14px rgba(20, 50, 70, 0.12);
}

.nds-rv-resume__badge--opened,
.nds-rv-act__badge--opened {
	background: rgba(26, 122, 134, 0.12);
	color: #0f5f68;
}

.nds-rv-resume__badge--previewed,
.nds-rv-act__badge--previewed {
	background: rgba(70, 110, 180, 0.12);
	color: #2f4f8a;
}

.nds-rv-resume__badge--downloaded,
.nds-rv-act__badge--downloaded {
	background: rgba(50, 140, 100, 0.12);
	color: #1f6b4c;
}

.nds-rv-resume__badge--purchased,
.nds-rv-act__badge--purchased {
	background: rgba(160, 110, 40, 0.14);
	color: #8a5a12;
}

.nds-rv-resume__badge--collection,
.nds-rv-act__badge--collection {
	background: rgba(100, 80, 160, 0.12);
	color: #4e3d8a;
}

.nds-rv-resume__badge--edition,
.nds-rv-act__badge--edition {
	background: rgba(180, 80, 90, 0.12);
	color: #8a3038;
}

.nds-rv-resume__subject,
.nds-rv-act__subject {
	display: inline-flex;
	align-items: center;
	padding: 0.22rem 0.55rem;
	border-radius: 999px;
	border: 1px solid rgba(26, 122, 134, 0.18);
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.nds-rv-resume__title {
	margin: 0.55rem 0 0.35rem;
	font-family: var(--nds-font-display, Georgia, "Times New Roman", serif);
	font-size: clamp(1.2rem, 1.45vw, 1.45rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.nds-rv-resume__title a {
	color: inherit;
	text-decoration: none;
}

.nds-rv-resume__title a:hover {
	color: var(--rv-accent);
}

.nds-rv-resume__title a:focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 3px;
}

.nds-rv-resume__meta,
.nds-rv-resume__activity {
	margin: 0 0 0.35rem;
	font-size: 0.86rem;
	line-height: 1.4;
	color: var(--rv-muted);
}

.nds-rv-resume__opened {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.15rem 0 0.35rem;
	font-size: 0.84rem;
	font-weight: 650;
	color: var(--rv-accent);
}

.nds-rv-resume__dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--rv-accent);
	box-shadow: 0 0 0 4px rgba(26, 122, 134, 0.14);
	animation: nds-rv-pulse 2.4s ease-in-out infinite;
}

.nds-rv-progress {
	margin: 0.85rem 0 1rem;
	padding: 0.85rem 0.95rem;
	border-radius: 16px;
	border: 1px solid rgba(120, 170, 190, 0.18);
	background: rgba(255, 255, 255, 0.72);
}

.nds-rv-progress__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.nds-rv-progress__label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--rv-soft);
}

.nds-rv-progress__value {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--rv-ink);
}

.nds-rv-progress__note {
	margin: 0.25rem 0 0.55rem;
	font-size: 0.82rem;
	color: var(--rv-muted);
}

.nds-rv-progress__track {
	height: 6px;
	border-radius: 999px;
	overflow: hidden;
	background: rgba(26, 122, 134, 0.12);
}

.nds-rv-progress__bar {
	display: block;
	height: 100%;
	width: var(--nds-rv-progress, 50%);
	border-radius: inherit;
	background: linear-gradient(90deg, #1a7a86, #3aa8b4);
	transform-origin: left center;
	animation: nds-rv-progress-in 900ms var(--rv-ease) both;
}

.nds-rv-resume__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1.05rem;
	padding: 0;
	list-style: none;
}

.nds-rv-resume__tags li {
	padding: 0.28rem 0.6rem;
	border-radius: 999px;
	border: 1px solid var(--rv-line);
	background: rgba(255, 255, 255, 0.8);
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--rv-muted);
}

.nds-rv-resume__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 1rem;
}

.nds-rv-resume__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.72rem 1.15rem;
	border-radius: 999px;
	background: linear-gradient(135deg, #15707c, #1a8a96);
	color: #ffffff;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 12px 24px rgba(20, 100, 110, 0.22);
	transition: transform 250ms var(--rv-ease), box-shadow 250ms var(--rv-ease);
}

.nds-rv-resume:hover .nds-rv-resume__cta {
	transform: translateX(2px);
	box-shadow: 0 16px 28px rgba(20, 100, 110, 0.28);
}

.nds-rv-resume__cta:focus-visible,
.nds-rv-resume__secondary:focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 3px;
}

.nds-rv-resume__secondary {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	color: var(--rv-accent);
	font-size: 0.88rem;
	font-weight: 650;
	text-decoration: none;
}

.nds-rv-resume__secondary:hover {
	text-decoration: underline;
}

/* —— Side activity —— */
.nds-rv-side {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	min-width: 0;
}

.nds-rv-timeline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0;
	padding: 0.2rem 0 0;
}

.nds-rv-timeline__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.32rem 0.7rem;
	border-radius: 999px;
	border: 1px solid transparent;
	background: rgba(255, 255, 255, 0.55);
	color: var(--rv-soft);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.nds-rv-timeline__item.is-active {
	border-color: rgba(26, 122, 134, 0.22);
	background: rgba(26, 122, 134, 0.1);
	color: var(--rv-accent);
}

.nds-rv-timeline__dot {
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.55;
}

.nds-rv-timeline__item.is-active .nds-rv-timeline__dot {
	opacity: 1;
	box-shadow: 0 0 0 4px rgba(26, 122, 134, 0.14);
	animation: nds-rv-pulse 2.4s ease-in-out infinite;
}

.nds-rv-activity {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nds-rv-act {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 0.85rem;
	align-items: center;
	padding: 0.7rem 0.8rem;
	border-radius: 18px;
	border: 1px solid rgba(120, 170, 190, 0.16);
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 8px 18px rgba(20, 50, 70, 0.04);
	transition: transform 250ms var(--rv-ease), box-shadow 250ms var(--rv-ease), border-color 250ms var(--rv-ease);
}

.nds-rv-act:hover {
	transform: translateY(-2px);
	border-color: rgba(26, 122, 134, 0.28);
	box-shadow: 0 16px 28px rgba(20, 50, 70, 0.08);
}

.nds-rv-act__cover {
	display: block;
	overflow: hidden;
	width: 56px;
	height: 74px;
	border-radius: 10px;
	background: linear-gradient(160deg, #d9e8ef, #b9d0db);
	box-shadow: 0 6px 14px rgba(20, 50, 70, 0.12);
}

.nds-rv-act__img,
.nds-rv-act__ph {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 250ms var(--rv-ease);
}

.nds-rv-act:hover .nds-rv-act__img {
	transform: scale(1.05);
}

.nds-rv-act__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.25rem;
}

.nds-rv-act__badge {
	display: inline-flex;
	padding: 0.18rem 0.45rem;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 700;
}

.nds-rv-act__title {
	margin: 0 0 0.2rem;
	font-size: 0.92rem;
	font-weight: 650;
	line-height: 1.3;
}

.nds-rv-act__title a {
	color: inherit;
	text-decoration: none;
}

.nds-rv-act__title a:hover {
	color: var(--rv-accent);
}

.nds-rv-act__title a:focus-visible,
.nds-rv-act__resume:focus-visible,
.nds-rv-act__open:focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 2px;
}

.nds-rv-act__time {
	margin: 0 0 0.35rem;
	font-size: 0.78rem;
	color: var(--rv-soft);
}

.nds-rv-act__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.55rem 0.85rem;
}

.nds-rv-act__resume {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	color: var(--rv-accent);
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
}

.nds-rv-act__open {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--rv-soft);
	text-decoration: none;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 250ms var(--rv-ease), transform 250ms var(--rv-ease), color 250ms var(--rv-ease);
	pointer-events: none;
}

.nds-rv-act:hover .nds-rv-act__open,
.nds-rv-act:focus-within .nds-rv-act__open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.nds-rv-act__open:hover {
	color: var(--rv-accent);
}

@keyframes nds-rv-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 3px rgba(26, 122, 134, 0.12);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(26, 122, 134, 0.06);
	}
}

@keyframes nds-rv-progress-in {
	from {
		transform: scaleX(0.15);
		opacity: 0.55;
	}
	to {
		transform: scaleX(1);
		opacity: 1;
	}
}

@media (max-width: 1100px) {
	.nds-rv__layout {
		grid-template-columns: 1fr;
	}

	.nds-rv-activity {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}

	.nds-rv-act {
		grid-template-columns: 52px minmax(0, 1fr);
	}
}

@media (max-width: 720px) {
	.nds-rv__panel {
		padding: 1.35rem 1.1rem 1.2rem;
		border-radius: 22px;
	}

	.nds-rv__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.nds-rv-resume {
		grid-template-columns: 108px minmax(0, 1fr);
		padding: 1rem;
		gap: 0.95rem;
	}

	.nds-rv-activity {
		grid-template-columns: 1fr;
	}

	.nds-rv-act__open {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

@media (max-width: 420px) {
	.nds-rv-resume {
		grid-template-columns: 1fr;
	}

	.nds-rv-resume__cover {
		max-width: 148px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nds-rv-resume,
	.nds-rv-act,
	.nds-rv__history,
	.nds-rv-resume__img,
	.nds-rv-act__img,
	.nds-rv-resume__cta,
	.nds-rv-act__open,
	.nds-rv-progress__bar {
		transition: none !important;
		animation: none !important;
	}

	.nds-rv-resume:hover,
	.nds-rv-act:hover,
	.nds-rv__history:hover {
		transform: none;
	}

	.nds-rv-resume:hover .nds-rv-resume__img,
	.nds-rv-act:hover .nds-rv-act__img {
		transform: none;
	}
}
