/**
 * Secure Quiz Manager front-end styles.
 * Mirrors the look of the original standalone quiz pages.
 */

.sqm-quiz-box {
	--sqm-bg: #90e0ef;
	--sqm-correct: #4caf50;
	--sqm-wrong: #f44336;
	--sqm-explain: #fff9c4;

	max-width: 900px;
	width: 100%;
	margin: 0 auto;
	background: var(--sqm-bg);
	padding: 30px;
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-weight: 300;
	box-sizing: border-box;
}

.sqm-quiz-box *,
.sqm-quiz-box *::before,
.sqm-quiz-box *::after {
	box-sizing: inherit;
}

/* Bangla text keeps its own face. */
.sqm-quiz-box .bn {
	font-family: 'Hind Siliguri', 'Rubik', system-ui, sans-serif;
	font-weight: 400;
}

.sqm-quiz-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 10px;
}

.sqm-quiz-description {
	margin-bottom: 16px;
}

.sqm-progress {
	font-size: 0.95rem;
	opacity: 0.85;
	margin-bottom: 8px;
}

.sqm-question-text {
	font-size: 1.4rem;
	line-height: 1.5;
	font-weight: 500;
	margin: 0 0 20px;
}

.sqm-question-img,
.sqm-quiz-box .in-question-img {
	width: min(100%, 420px);
	height: auto;
	max-height: 320px;
	object-fit: contain;
	margin: 10px auto 14px;
	display: block;
	border-radius: 10px;
	border: 2px solid #ddd;
}

/* ---------- Options ---------- */

.sqm-options button {
	display: block;
	margin: 10px 0;
	padding: 16px 22px;
	width: 85%;
	background: #fff;
	color: #000;
	border: 2px solid #ccc;
	border-radius: 10px;
	text-align: left;
	cursor: pointer;
	font: inherit;
	font-size: 1.2rem;
	line-height: 1.5;
	transition: background-color 0.3s, border-color 0.3s;
	white-space: normal;
}

.sqm-options button:hover:not(:disabled) {
	background: #dce2eb;
}

.sqm-options button:disabled {
	cursor: default;
}

.sqm-options button:focus-visible,
.sqm-navigation button:focus-visible {
	outline: 3px solid rgba(33, 150, 243, 0.65);
	outline-offset: 3px;
}

.sqm-options button.correct {
	background: var(--sqm-correct);
	border-color: var(--sqm-correct);
	color: #fff;
}

.sqm-options button.wrong {
	background: var(--sqm-wrong);
	border-color: var(--sqm-wrong);
	color: #fff;
}

/* Image answers sit in a 2x2 grid with A/B/C/D labels. */
.sqm-options.image-mode {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.sqm-options.image-mode button {
	width: 100%;
	margin: 0;
	position: relative;
	padding: 34px 14px 14px;
	text-align: center;
}

.sqm-options.image-mode button[data-label]::before {
	content: attr(data-label);
	position: absolute;
	top: 8px;
	left: 10px;
	font-weight: 700;
	font-size: 1rem;
}

.sqm-option-img {
	display: block;
	width: 100%;
	max-height: 200px;
	object-fit: contain;
	margin: 0 auto 8px;
}

@media (max-width: 600px) {
	.sqm-quiz-box {
		padding: 18px;
	}

	.sqm-options button {
		width: 100%;
		font-size: 1.05rem;
		padding: 14px 16px;
	}

	.sqm-question-text {
		font-size: 1.2rem;
	}
}

/* ---------- Explanation ---------- */

.sqm-explanation {
	margin-top: 18px;
	padding: 16px 18px;
	background: var(--sqm-explain);
	border-left: 6px solid #fbc02d;
	border-radius: 8px;
	font-size: 1.05rem;
	line-height: 1.6;
}

/* ---------- Navigation ---------- */

.sqm-navigation {
	margin-top: 18px;
}

.sqm-navigation button,
.sqm-score button {
	padding: 12px 22px;
	background: #2196f3;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font: inherit;
	font-size: 1rem;
}

.sqm-navigation button:disabled {
	background: #9e9e9e;
	cursor: not-allowed;
}

.sqm-score {
	margin-top: 18px;
	font-size: 1.05rem;
}

/* ---------- Summary ---------- */

.sqm-summary h3 {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 10px;
}

.sqm-summary-headline {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: 16px;
}

.sqm-summary ol {
	list-style: decimal;
	padding-left: 22px;
}

.sqm-summary li.sqm-summary-item {
	margin: 22px 0;
	background: rgba(255, 255, 255, 0.55);
	border-radius: 10px;
	padding: 14px;
}

.sqm-status-pill {
	display: inline-block;
	margin: 8px 0;
	padding: 4px 14px;
	border-radius: 999px;
	color: #fff;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sqm-status-pill.is-correct {
	background: var(--sqm-correct);
}

.sqm-status-pill.is-wrong {
	background: var(--sqm-wrong);
}

.sqm-summary-options {
	list-style: none;
	margin: 10px 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	overflow: hidden;
}

.sqm-summary-options li {
	padding: 12px 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	background: #fafafa;
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.sqm-summary-options li:last-child {
	border-bottom: none;
}

.sqm-summary-options li.is-correct {
	background: var(--sqm-correct);
	color: #fff;
}

.sqm-summary-options li.is-wrong {
	background: var(--sqm-wrong);
	color: #fff;
}

.sqm-mark {
	flex: 0 0 22px;
	font-weight: 700;
	line-height: 1.5;
}

.sqm-summary-explanation {
	margin-top: 8px;
	font-size: 0.98rem;
	line-height: 1.6;
}

.sqm-summary-actions {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.sqm-summary-actions .sqm-retry-wrong {
	background: var(--sqm-wrong);
}

/* Only rendered for editors or when WP_DEBUG is on. */
.sqm-debug {
	margin: 10px 0 0;
	padding: 10px 12px;
	background: #2c3338;
	color: #f0f0f1;
	border-radius: 6px;
	font-size: 0.8rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-x: auto;
}

.sqm-notice {
	padding: 12px 16px;
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	border-radius: 4px;
}
