/**
 * MasterQuiz AI - Public Styles
 *
 * Color scheme: Indigo (#6366f1) / Violet (#8b5cf6)
 * Matches the client's SaaS design at elearningevolve.com/pdf-to-quiz/
 *
 * @package MasterQuiz
 * @since   1.0.0
 */

/* =============================================
   Wrapper — Card with subtle shadow
   ============================================= */
.masterquiz-wrapper {
	max-width: 800px;
	margin: 30px auto;
	padding: 36px 40px;
	/* Inherit the active theme's font for a native, consistent look across any theme */
	font-family: inherit;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.masterquiz-wrapper,
.masterquiz-wrapper * {
	font-family: inherit;
}

.masterquiz-wrapper * {
	box-sizing: border-box;
}

@media (max-width: 600px) {
	.masterquiz-wrapper {
		padding: 24px 18px;
		margin: 16px auto;
		border-radius: 12px;
	}
}

/* =============================================
   Header — Title above the card
   ============================================= */
.masterquiz-header {
	text-align: center;
	max-width: 800px;
	margin: 0 auto 24px;
	font-family: inherit;
}

.masterquiz-header h2 {
	font-size: 28px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
	line-height: 1.3;
	font-family: inherit;
}

@media (max-width: 600px) {
	.masterquiz-header h2 {
		font-size: 22px;
	}
}

/* =============================================
   Dropzone — Upload area
   ============================================= */
.masterquiz-dropzone {
	border: 2px dashed #d1d5db;
	border-radius: 14px;
	padding: 48px 24px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.3s, background-color 0.3s;
	margin-bottom: 24px;
	min-height: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fafafa;
}

.masterquiz-dropzone:hover,
.masterquiz-dropzone.dragover {
	border-color: #8b5cf6;
	background-color: #f5f3ff;
}

.masterquiz-dropzone-icon {
	color: #8b5cf6;
	margin-bottom: 14px;
	line-height: 1;
}

.masterquiz-dropzone-icon svg {
	width: 48px;
	height: 48px;
}

.masterquiz-dropzone-text {
	font-size: 16px;
	color: #374151;
	margin-bottom: 6px;
	font-weight: 500;
}

.masterquiz-browse-link {
	color: #6366f1;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.masterquiz-browse-link:hover {
	color: #4f46e5;
}

.masterquiz-dropzone-subtext {
	font-size: 13px;
	color: #9ca3af;
}

/* File info — inside dropzone, shown after selection */
.masterquiz-file-info {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 4px;
}

.masterquiz-file-info.visible {
	display: flex;
}

.masterquiz-file-check-icon {
	width: 52px;
	height: 52px;
	background: #ecfdf5;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
	color: #22c55e;
}

.masterquiz-file-check-icon svg {
	width: 28px;
	height: 28px;
}

.masterquiz-file-name {
	font-size: 16px;
	font-weight: 600;
	color: #1f2937;
}

.masterquiz-file-size {
	font-size: 13px;
	color: #9ca3af;
	margin-bottom: 4px;
}

.masterquiz-remove-btn {
	cursor: pointer;
	background: none;
	border: none;
	color: #dc2626;
	font-weight: 600;
	font-size: 14px;
	padding: 4px 10px;
	border-radius: 6px;
	transition: background 0.2s, color 0.2s;
}

.masterquiz-remove-btn:hover {
	background: #fef2f2;
	color: #b91c1c;
}

/* =============================================
   Settings Grid
   ============================================= */
.masterquiz-settings {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-bottom: 24px;
}

@media (max-width: 600px) {
	.masterquiz-settings {
		grid-template-columns: 1fr;
	}
}

.masterquiz-setting-group {
	padding: 0;
}

.masterquiz-setting-group > label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #1f2937;
	margin-bottom: 6px;
}

.masterquiz-setting-group input[type="number"],
.masterquiz-setting-group select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	color: #1f2937;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.masterquiz-setting-group input[type="number"]:focus,
.masterquiz-setting-group select:focus {
	outline: none;
	border-color: #8b5cf6;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.masterquiz-helper-text {
	display: block;
	font-size: 12px;
	color: #9ca3af;
	margin-top: 4px;
	font-weight: 400;
}

/* Question type checkboxes — pill style */
.masterquiz-question-types {
	grid-column: 1 / -1;
}

.masterquiz-checkbox-group {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.masterquiz-checkbox-group label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-weight: 500;
	cursor: pointer;
	padding: 8px 16px;
	border: 1.5px solid #e5e7eb;
	border-radius: 8px;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
	font-size: 14px;
	color: #374151;
}

.masterquiz-checkbox-group label:hover {
	border-color: #a78bfa;
	background: #f5f3ff;
}

.masterquiz-checkbox-group input[type="checkbox"] {
	accent-color: #6366f1;
}

.masterquiz-checkbox-group input:checked + span {
	color: #4f46e5;
	font-weight: 600;
}

/* =============================================
   Generate Button — Purple gradient
   ============================================= */
.masterquiz-generate-btn {
	display: block;
	width: 100%;
	padding: 16px 24px;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, #8b5cf6, #a78bfa);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.3s, box-shadow 0.3s, transform 0.15s;
	margin-bottom: 24px;
	letter-spacing: 0.01em;
}

.masterquiz-generate-btn:hover {
	background: linear-gradient(135deg, #7c3aed, #8b5cf6);
	box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.masterquiz-generate-btn:active {
	transform: translateY(1px);
}

.masterquiz-generate-btn:disabled {
	background: #d1d5db;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* Links below generate button */
.masterquiz-below-btn-links {
	text-align: center;
	margin-bottom: 24px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.masterquiz-below-btn-links a {
	font-size: 13px;
	color: #6366f1;
	text-decoration: none;
	font-weight: 500;
}

.masterquiz-below-btn-links a:hover {
	color: #4f46e5;
	text-decoration: underline;
}

.masterquiz-below-btn-links a:last-child {
	color: #9ca3af;
	font-weight: 400;
	text-decoration: underline;
	font-size: 12px;
}

.masterquiz-below-btn-links a:last-child:hover {
	color: #6b7280;
}

/* =============================================
   Progress Bar
   ============================================= */
.masterquiz-progress {
	display: none;
	margin-bottom: 24px;
}

.masterquiz-progress.visible {
	display: block;
}

.masterquiz-progress-bar-wrapper {
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 10px;
}

.masterquiz-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
	border-radius: 4px;
	transition: width 0.5s ease;
	width: 0%;
}

.masterquiz-progress-text {
	font-size: 13px;
	color: #6b7280;
	text-align: center;
	font-weight: 500;
}

/* =============================================
   Error / Success Messages
   ============================================= */
.masterquiz-message {
	display: none;
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 24px;
	font-size: 14px;
	font-weight: 500;
}

.masterquiz-message.visible {
	display: block;
}

.masterquiz-message.error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.masterquiz-message.success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

/* =============================================
   Quiz Results
   ============================================= */
.masterquiz-results {
	display: none;
}

.masterquiz-results.visible {
	display: block;
}

.masterquiz-results-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}

.masterquiz-results-header h3 {
	font-size: 22px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
}

.masterquiz-results-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* =============================================
   Buttons — Shared + Variants
   ============================================= */
.masterquiz-btn {
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s, box-shadow 0.2s;
}

.masterquiz-btn-primary {
	color: #fff;
	background: #6366f1;
}

.masterquiz-btn-primary:hover {
	background: #4f46e5;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.masterquiz-btn-success {
	color: #fff;
	background: #22c55e;
}

.masterquiz-btn-success:hover {
	background: #16a34a;
	box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.masterquiz-btn-secondary {
	color: #374151;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
}

.masterquiz-btn-secondary:hover {
	background: #e5e7eb;
}

.masterquiz-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* =============================================
   Question Card
   ============================================= */
.masterquiz-question-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 24px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.masterquiz-question-number {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 10px;
}

.masterquiz-question-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 8px;
	flex-wrap: wrap;
	gap: 8px;
}

/* Keyword / Topic tags */
.masterquiz-keyword-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.masterquiz-keyword-tag {
	display: inline-block;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 500;
	color: #374151;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 5px;
}

.masterquiz-question-badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.masterquiz-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 6px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.masterquiz-badge-type {
	background: #eef2ff;
	color: #4338ca;
}

.masterquiz-badge-points {
	background: #fef3c7;
	color: #92400e;
}

.masterquiz-badge-level {
	background: #f3e8ff;
	color: #7c3aed;
}

.masterquiz-question-text {
	font-size: 16px;
	line-height: 1.65;
	color: #1f2937;
	margin-bottom: 16px;
}

/* =============================================
   Answer Options
   ============================================= */
.masterquiz-options {
	list-style: none;
	padding: 0;
	margin: 0 0 16px;
}

.masterquiz-option {
	padding: 12px 16px;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 8px;
	font-size: 14px;
	line-height: 1.5;
	transition: background 0.2s, border-color 0.2s;
}

.masterquiz-option.correct {
	border-color: #86efac;
	background: #f0fdf4;
}

.masterquiz-option.incorrect {
	border-color: #fca5a5;
	background: #fef2f2;
}

.masterquiz-option-label {
	font-weight: 700;
	margin-right: 6px;
	color: #6366f1;
}

/* =============================================
   Hint / Explanation / Model Answer
   ============================================= */
.masterquiz-explanation {
	padding: 14px 18px;
	background: #f8fafc;
	border-left: 3px solid #6366f1;
	border-radius: 0 10px 10px 0;
	margin-top: 10px;
	font-size: 13px;
	color: #475569;
	line-height: 1.6;
}

.masterquiz-hint {
	padding: 12px 16px;
	background: #fffbeb;
	border-left: 3px solid #f59e0b;
	border-radius: 0 10px 10px 0;
	margin-bottom: 14px;
	font-size: 13px;
	color: #92400e;
	line-height: 1.5;
}

.masterquiz-model-answer {
	padding: 14px 18px;
	background: #f0fdf4;
	border-left: 3px solid #22c55e;
	border-radius: 0 10px 10px 0;
	margin-top: 14px;
	font-size: 14px;
	color: #166534;
	line-height: 1.6;
}

.masterquiz-model-answer h4 {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
}

/* =============================================
   Navigation
   ============================================= */
.masterquiz-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #f3f4f6;
}

.masterquiz-question-counter {
	font-size: 14px;
	color: #6b7280;
	font-weight: 600;
}

/* =============================================
   Export Modal
   ============================================= */
.masterquiz-export-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

.masterquiz-export-modal.visible {
	display: flex;
}

.masterquiz-export-modal-content {
	background: #fff;
	border-radius: 20px;
	padding: 32px;
	max-width: 520px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.masterquiz-export-modal-content h3 {
	margin: 0 0 20px;
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
}

.masterquiz-export-format-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 20px;
}

.masterquiz-export-format-btn {
	padding: 12px 16px;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.masterquiz-export-format-btn:hover {
	border-color: #8b5cf6;
	background: #f5f3ff;
	box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
}

.masterquiz-export-close {
	display: block;
	width: 100%;
	padding: 12px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	transition: background 0.2s;
}

.masterquiz-export-close:hover {
	background: #e5e7eb;
}

/* =============================================
   LearnDash Result
   ============================================= */
.masterquiz-learndash-result {
	display: none;
	padding: 14px 18px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	margin-bottom: 16px;
	font-weight: 500;
}

.masterquiz-learndash-result.visible {
	display: block;
}

.masterquiz-learndash-result a {
	color: #16a34a;
	font-weight: 600;
}
