/*
 * PHASE 2F-1 - My Quiz History styles.
 * Section-level only. Every selector is namespaced under .jqc-my-history*.
 */

.jqc-my-history {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0 0 2rem;
	scroll-margin-top: 90px;
}

.jqc-my-history__header {
	margin: 0 0 1rem;
}

.jqc-my-history__title {
	margin: 0;
	font-size: clamp(1.25rem, 2.4vw, 1.75rem);
	line-height: 1.25;
}

.jqc-my-history__subtitle {
	margin: 0.35rem 0 0;
	font-size: 0.95rem;
	opacity: 0.75;
}

/* ---------- Rows ---------- */

.jqc-my-history__list {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.jqc-my-history__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 1rem;
	margin: 0;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.015);
	list-style: none;
}

.jqc-my-history__main {
	flex: 1 1 16rem;
	min-width: 0;
}

.jqc-my-history__quiz {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.jqc-my-history__quiz-link {
	display: inline-block;
	min-height: 44px;
	padding: 0.25rem 0;
	color: inherit;
	text-decoration: none;
}

.jqc-my-history__quiz-link:hover,
.jqc-my-history__quiz-link:focus {
	text-decoration: underline;
}

.jqc-my-history__quiz-missing {
	display: inline-block;
	padding: 0.25rem 0;
	opacity: 0.7;
	font-style: italic;
}

.jqc-my-history__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.9rem;
	margin: 0.1rem 0 0;
	font-size: 0.875rem;
	opacity: 0.75;
}

.jqc-my-history__metrics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.85rem;
	font-variant-numeric: tabular-nums;
}

.jqc-my-history__percentage {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.2;
}

.jqc-my-history__score {
	font-size: 0.875rem;
	opacity: 0.75;
}

.jqc-my-history__status {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 0.2rem 0.7rem;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.jqc-my-history__status.is-passed {
	border-color: rgba(21, 128, 61, 0.35);
	background: rgba(34, 160, 90, 0.14);
}

.jqc-my-history__status.is-failed {
	border-color: rgba(153, 27, 27, 0.3);
	background: rgba(190, 60, 60, 0.12);
}

.jqc-my-history__status.is-unknown {
	background: rgba(0, 0, 0, 0.05);
	opacity: 0.85;
}

/* ---------- Notices ---------- */

.jqc-my-history__notice {
	padding: 1.1rem 1rem;
	border: 1px dashed rgba(0, 0, 0, 0.18);
	border-radius: 14px;
	text-align: center;
}

.jqc-my-history__notice-title {
	margin: 0;
	font-weight: 600;
}

/* ---------- Pagination ---------- */

.jqc-my-history__pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 1.1rem 0 0;
}

.jqc-my-history__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0.4rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	color: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
}

.jqc-my-history__pagination .page-numbers.current {
	border-color: #14417C;
	background: #14417C;
	color: #FFFFFF;
}

.jqc-my-history__page-info {
	flex: 1 1 100%;
	margin: 0.15rem 0 0;
	font-size: 0.85rem;
	opacity: 0.7;
}

@media (max-width: 600px) {
	.jqc-my-history__item {
		flex-direction: column;
		align-items: flex-start;
	}

	.jqc-my-history__metrics {
		width: 100%;
	}
}

/* PHASE 2F-2 - quiz + date filters */
.jqc-my-history-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:0 0 18px;padding:14px 16px;border:1px solid var(--jqc-border,#e2e8f0);border-radius:12px;background:var(--jqc-surface,#f8fafc)}
.jqc-my-history-filters__field{display:flex;flex-direction:column;gap:6px;min-width:180px;flex:1 1 180px}
.jqc-my-history-filters__label{font-size:12px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--jqc-muted,#64748b)}
.jqc-my-history-filters__select{padding:8px 10px;border:1px solid var(--jqc-border,#e2e8f0);border-radius:8px;background:#fff;font-size:14px;color:inherit;max-width:100%}
.jqc-my-history-filters__actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.jqc-my-history-filters__submit{padding:9px 16px;border:0;border-radius:8px;background:var(--jqc-accent,#14417C);color:#fff;font-size:14px;font-weight:600;cursor:pointer}
.jqc-my-history-filters__submit:hover{filter:brightness(1.08)}
.jqc-my-history-filters__reset{font-size:13px;font-weight:600;color:var(--jqc-accent,#14417C);text-decoration:underline}
.jqc-my-history__notice-action{margin:8px 0 0}
@media (max-width:600px){.jqc-my-history-filters{flex-direction:column;align-items:stretch}.jqc-my-history-filters__actions{justify-content:space-between}}

/* PHASE 2F-3 - statistics summary + best attempt badge */
.jqc-my-history-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:0 0 18px}
.jqc-my-history-stats__card{display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:76px;padding:12px 14px;border:1px solid var(--jqc-border,#e2e8f0);border-radius:14px;background:var(--jqc-surface,#f8fafc)}
.jqc-my-history-stats__label{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--jqc-muted,#64748b)}
.jqc-my-history-stats__value{font-size:clamp(1.15rem,2.4vw,1.5rem);font-weight:700;line-height:1.15;font-variant-numeric:tabular-nums}
.jqc-my-history__badges{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 0}
.jqc-my-history__badge{display:inline-flex;align-items:center;padding:2px 10px;border:1px solid rgba(20,65,124,.35);border-radius:999px;background:rgba(20,65,124,.1);color:var(--jqc-accent,#14417C);font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;line-height:1.6}
@media (max-width:420px){.jqc-my-history-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* PHASE 2K - login / browse-quizzes call to action. */
.jqc-my-history__cta {
	display: inline-block;
	margin-top: 8px;
	padding: 10px 18px;
	border-radius: 8px;
	background: #14417C;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
.jqc-my-history__cta:hover,
.jqc-my-history__cta:focus {
	background: #0D2B59;
	color: #fff;
}

/* PHASE 2P3 FEATURE 1 - Download My Results action. */
.jqc-my-history__actions{margin:0 0 16px;display:flex;justify-content:flex-end}
.jqc-my-history__export{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border:1px solid currentColor;border-radius:6px;font-size:14px;font-weight:600;line-height:1.2;text-decoration:none}
.jqc-my-history__export:hover,.jqc-my-history__export:focus{text-decoration:underline}

/* TASK 2 - View Result navigation link (added; nothing else changed). */
.jqc-my-history__result-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 0.25rem 0.8rem;
	border: 1px solid #14417C;
	border-radius: 999px;
	color: #14417C;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
}

.jqc-my-history__result-link:hover,
.jqc-my-history__result-link:focus {
	background: rgba(20, 65, 124, 0.08);
}
