/* ==========================================================================
   Questions Pro — Frontend Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared utilities
   -------------------------------------------------------------------------- */
.qpr-no-results {
	color: #666;
	font-style: italic;
}

/* --------------------------------------------------------------------------
   Type badge (reused in both list and archive)
   -------------------------------------------------------------------------- */
.qpr-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
	flex-shrink: 0;
}

.qpr-badge--mcq {
	background: #e8f5e9;
	color: #2e7d32;
}

.qpr-badge--short_answer {
	background: #e3f2fd;
	color: #1565c0;
}

.qpr-badge--long_answer {
	background: #fff8e1;
	color: #f57f17;
}

.qpr-badge--topic {
	background: #ede9fe;
	color: #6d28d9;
}

/* --------------------------------------------------------------------------
   Questions list  [questions_list]
   -------------------------------------------------------------------------- */
.qpr-questions-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.qpr-question-item {
	padding: 20px 0;
	border-bottom: 1px solid #e5e7eb;
}

.qpr-question-item:first-child {
	padding-top: 0;
}

.qpr-question-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.qpr-question-item__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.qpr-question-item__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.4;
	flex: 1;
}

.qpr-question-item__title a {
	color: inherit;
	text-decoration: none;
}

.qpr-question-item__title a:hover {
	color: #2271b1;
}

/* Category tags */
.qpr-question-item__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.qpr-cat-tag {
	display: inline-block;
	padding: 2px 10px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	font-size: 12px;
	color: #374151;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.qpr-cat-tag:hover {
	background: #dbeafe;
	border-color: #93c5fd;
	color: #1d4ed8;
}

/* Excerpt */
.qpr-question-item__excerpt {
	font-size: 14px;
	color: #6b7280;
	line-height: 1.6;
	margin-bottom: 10px;
}

.qpr-question-item__excerpt p {
	margin: 0;
}

/* View Question link */
.qpr-question-item__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #2271b1;
	text-decoration: none;
}

.qpr-question-item__link:hover {
	color: #135e96;
}

.qpr-arrow {
	transition: transform 0.15s;
}

.qpr-question-item__link:hover .qpr-arrow {
	transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Topics grid  [question_topics]
   -------------------------------------------------------------------------- */
.qpr-categories-grid {
	display: grid;
	gap: 20px;
}

.qpr-categories-grid--cols-1 { grid-template-columns: 1fr; }
.qpr-categories-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.qpr-categories-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.qpr-categories-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Card */
.qpr-category-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 24px 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.qpr-category-card:hover {
	border-color: #2271b1;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
	color: inherit;
}

.qpr-category-card__icon {
	font-size: 32px;
	width: 32px;
	height: 32px;
	color: #2271b1;
	margin-bottom: 14px;
	line-height: 1;
}

.qpr-category-card__name {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}

.qpr-category-card:hover .qpr-category-card__name {
	color: #2271b1;
}

.qpr-category-card__desc {
	margin: 0 0 12px;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.6;
	flex: 1;
}

.qpr-category-card__count {
	display: inline-block;
	margin-top: auto;
	padding: 3px 10px;
	background: #f3f4f6;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
}

.qpr-category-card:hover .qpr-category-card__count {
	background: #dbeafe;
	color: #1d4ed8;
}

/* --------------------------------------------------------------------------
   Topic archive page  ( /question-topics/{slug} )
   -------------------------------------------------------------------------- */
.qpr-topic-archive {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 24px 64px;
}

.qpr-topic-archive__hero {
	margin-bottom: 36px;
	padding-bottom: 28px;
	border-bottom: 1px solid #e5e7eb;
}

.qpr-topic-archive__title {
	margin: 10px 0 0;
	font-size: 32px;
	line-height: 1.2;
	font-weight: 700;
}

.qpr-topic-archive__desc {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.7;
	color: #6b7280;
}

.qpr-topic-archive__count {
	margin: 14px 0 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #9ca3af;
}

.qpr-topic-archive__list {
	margin-bottom: 40px;
}

.qpr-topic-archive__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	margin-right: 6px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, background 0.15s;
}

.qpr-topic-archive__pagination .page-numbers:hover {
	border-color: #2271b1;
	background: #f0f7ff;
}

.qpr-topic-archive__pagination .page-numbers.current {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

/* --------------------------------------------------------------------------
   Single question  [question id="X"]
   -------------------------------------------------------------------------- */
.qpr-single-question {
	max-width: 760px;
	margin: 0 auto;
	padding: 32px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

.qpr-single-question__header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}

.qpr-single-question__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.qpr-single-question__body {
	font-size: 16px;
	line-height: 1.7;
	color: #111827;
	margin-bottom: 20px;
}

.qpr-single-question__body > *:last-child {
	margin-bottom: 0;
}

/* MCQ choice list */
.qpr-choice-list {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: qpr-choice;
}

.qpr-choice-list__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 16px;
	background: #f9fafb;
	border: 2px solid #e5e7eb;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.5;
	color: #1f2937;
	counter-increment: qpr-choice;
	position: relative;
}

.qpr-choice-list__item::before {
	content: counter(qpr-choice, upper-alpha) ".";
	font-weight: 700;
	font-size: 14px;
	color: #6b7280;
	flex-shrink: 0;
	min-width: 20px;
}

.qpr-choice-list__item--correct {
	background: #f0fdf4;
	border-color: #16a34a;
	color: #14532d;
}

.qpr-choice-list__item--correct::before {
	color: #16a34a;
}

.qpr-correct-mark {
	color: #16a34a;
	font-weight: 700;
	font-size: 16px;
	flex-shrink: 0;
	line-height: 1.4;
}

/* Model answer & explanation panels */
.qpr-single-question__model-answer,
.qpr-single-question__explanation {
	margin-top: 20px;
	padding: 16px 20px;
	border-radius: 6px;
}

.qpr-single-question__model-answer {
	background: #eff6ff;
	border-left: 4px solid #2563eb;
}

.qpr-single-question__explanation {
	background: #fefce8;
	border-left: 4px solid #ca8a04;
}

.qpr-answer-label {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #374151;
}

.qpr-single-question__model-answer .qpr-answer-label {
	color: #1d4ed8;
}

.qpr-single-question__explanation .qpr-answer-label {
	color: #92400e;
}

.qpr-answer-content {
	font-size: 15px;
	line-height: 1.7;
	color: #1f2937;
}

.qpr-answer-content > *:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Interactive MCQ block  (.qpr-question-interactive)
   -------------------------------------------------------------------------- */
.qpr-question-interactive {
	margin-top: 24px;
}

/* Choice buttons */
.qpr-choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.qpr-choice {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 12px 16px;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	font-size: 15px;
	line-height: 1.5;
	color: #1f2937;
	transition: border-color 0.15s, background 0.15s;
}

.qpr-choice:hover:not( :disabled ) {
	border-color: #2271b1;
	background: #f0f7ff;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.qpr-choice:disabled {
	cursor: default;
}

.qpr-choice--selected {
	border-color: #2271b1;
	background: #eff6ff;
}

.qpr-choice--correct {
	border-color: #16a34a;
	background: #f0fdf4;
	color: #14532d;
}

.qpr-choice--wrong {
	border-color: #dc2626;
	background: #fef2f2;
	color: #7f1d1d;
}

/* Letter badge */
.qpr-choice__letter {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f3f4f6;
	border: 2px solid #e5e7eb;
	font-size: 13px;
	font-weight: 700;
	color: #6b7280;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.qpr-choice--selected .qpr-choice__letter {
	background: #dbeafe;
	border-color: #2271b1;
	color: #1d4ed8;
}

.qpr-choice--correct .qpr-choice__letter {
	background: #dcfce7;
	border-color: #16a34a;
	color: #15803d;
}

.qpr-choice--wrong .qpr-choice__letter {
	background: #fee2e2;
	border-color: #dc2626;
	color: #b91c1c;
}

/* Choice body */
.qpr-choice__body {
	flex: 1;
}

.qpr-choice__body > *:last-child {
	margin-bottom: 0;
}

/* Result icon */
.qpr-choice__icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.15s;
}

.qpr-choice--correct .qpr-choice__icon,
.qpr-choice--wrong .qpr-choice__icon {
	opacity: 1;
}

.qpr-choice--correct .qpr-choice__icon::after {
	content: '✓';
	color: #16a34a;
}

.qpr-choice--wrong .qpr-choice__icon::after {
	content: '✗';
	color: #dc2626;
}

/* Submit button */
.qpr-quiz-actions {
	margin-bottom: 16px;
}

.qpr-btn-submit {
	padding: 10px 28px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
	transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.qpr-btn-submit:hover:not( :disabled ) {
	background: #135e96;
	box-shadow: 0 4px 10px rgba(34, 113, 177, 0.35);
	transform: translateY(-1px);
}

.qpr-btn-submit:disabled {
	background: #9ca3af;
	cursor: not-allowed;
}

/* Feedback message */
.qpr-feedback {
	margin-bottom: 16px;
}

.qpr-feedback__result {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	margin: 0;
}

.qpr-feedback__result--correct {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.qpr-feedback__result--incorrect {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* Explanation (revealed after answering) */
.qpr-explanation {
	margin-top: 16px;
	padding: 16px 20px;
	background: #fefce8;
	border-left: 4px solid #ca8a04;
	border-radius: 0 6px 6px 0;
}

.qpr-explanation .qpr-answer-label {
	color: #92400e;
}

/* --------------------------------------------------------------------------
   Dark theme — single question page (body.qpr-dark-page)
   -------------------------------------------------------------------------- */
body.qpr-dark-page {
	background: #0f1115;
	color: #e5e7eb;
}

body.qpr-dark-page a {
	color: #93c5fd;
}

body.qpr-dark-page h1,
body.qpr-dark-page h2,
body.qpr-dark-page h3,
body.qpr-dark-page h4,
body.qpr-dark-page h5,
body.qpr-dark-page h6 {
	color: #f9fafb;
}

/* Single-question card ([question] shortcode, if used in the post body) */
body.qpr-dark-page .qpr-single-question {
	background: #181b21;
	border-color: #2b2f38;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

body.qpr-dark-page .qpr-single-question__body,
body.qpr-dark-page .qpr-answer-content {
	color: #e5e7eb;
}

body.qpr-dark-page .qpr-cat-tag {
	background: #23272f;
	border-color: #343943;
	color: #d1d5db;
}

body.qpr-dark-page .qpr-cat-tag:hover {
	background: #1e3a5f;
	border-color: #3b82f6;
	color: #bfdbfe;
}

/* Static MCQ choice list */
body.qpr-dark-page .qpr-choice-list__item {
	background: #1b1e24;
	border-color: #2b2f38;
	color: #e5e7eb;
}

body.qpr-dark-page .qpr-choice-list__item--correct {
	background: #0f2b1a;
	border-color: #16a34a;
	color: #bbf7d0;
}

/* Model answer / explanation panels */
body.qpr-dark-page .qpr-single-question__model-answer {
	background: #14213d;
	border-left-color: #3b82f6;
}

body.qpr-dark-page .qpr-single-question__explanation,
body.qpr-dark-page .qpr-explanation {
	background: #2a2410;
	border-left-color: #ca8a04;
}

body.qpr-dark-page .qpr-answer-label {
	color: #9ca3af;
}

/* Interactive MCQ block (always present on single question pages) */
body.qpr-dark-page .qpr-choice {
	background: #181b21;
	border-color: #2b2f38;
	color: #e5e7eb;
}

body.qpr-dark-page .qpr-choice:hover:not( :disabled ) {
	border-color: #3b82f6;
	background: #142033;
}

body.qpr-dark-page .qpr-choice--selected {
	border-color: #3b82f6;
	background: #14213d;
}

body.qpr-dark-page .qpr-choice--correct {
	border-color: #16a34a;
	background: #0f2b1a;
	color: #bbf7d0;
}

body.qpr-dark-page .qpr-choice--wrong {
	border-color: #dc2626;
	background: #2b1414;
	color: #fecaca;
}

body.qpr-dark-page .qpr-choice__letter {
	background: #23272f;
	border-color: #343943;
	color: #9ca3af;
}

body.qpr-dark-page .qpr-choice--selected .qpr-choice__letter {
	background: #1e3a5f;
	border-color: #3b82f6;
	color: #bfdbfe;
}

body.qpr-dark-page .qpr-feedback__result--correct {
	background: #0f2b1a;
	color: #bbf7d0;
	border-color: #16a34a;
}

body.qpr-dark-page .qpr-feedback__result--incorrect {
	background: #2b1414;
	color: #fecaca;
	border-color: #dc2626;
}

/* Topic archive page */
body.qpr-dark-page .qpr-topic-archive__hero {
	border-bottom-color: #2b2f38;
}

body.qpr-dark-page .qpr-topic-archive__desc {
	color: #9ca3af;
}

body.qpr-dark-page .qpr-topic-archive__count {
	color: #6b7280;
}

body.qpr-dark-page .qpr-question-item {
	border-bottom-color: #2b2f38;
}

body.qpr-dark-page .qpr-question-item__excerpt {
	color: #9ca3af;
}

body.qpr-dark-page .qpr-topic-archive__pagination .page-numbers {
	border-color: #2b2f38;
	color: #e5e7eb;
}

body.qpr-dark-page .qpr-topic-archive__pagination .page-numbers:hover {
	border-color: #3b82f6;
	background: #142033;
}

body.qpr-dark-page .qpr-topic-archive__pagination .page-numbers.current {
	background: #2563eb;
	border-color: #2563eb;
}

/* --------------------------------------------------------------------------
   Responsive breakpoints
   -------------------------------------------------------------------------- */
@media ( max-width: 900px ) {
	.qpr-categories-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
	.qpr-categories-grid--cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 600px ) {
	.qpr-categories-grid--cols-4,
	.qpr-categories-grid--cols-3,
	.qpr-categories-grid--cols-2 {
		grid-template-columns: 1fr;
	}

	.qpr-question-item__top {
		flex-direction: column;
		gap: 6px;
	}

	.qpr-single-question {
		padding: 20px;
		border-radius: 0;
	}
}
