/**
 * IndianAgri Quiz Engine Frontend Exam Player Styles.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

.iae-quiz-player-wrap {
	font-family: 'Outfit', sans-serif;
	max-width: 1000px;
	margin: 20px auto;
	color: #1e293b;
}

.iae-quiz-container {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
	overflow: hidden;
	border: 1px solid #e2e8f0;
	padding: 30px;
}

/* Spinner loader */
.iae-quiz-loader {
	text-align: center;
	padding: 50px 0;
}

.iae-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #f1f5f9;
	border-top: 3px solid #2563eb;
	border-radius: 50%;
	margin: 0 auto 15px auto;
	animation: iae-spin 0.8s linear infinite;
}

@keyframes iae-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Welcome screen */
.iae-welcome-kicker {
	font-size: 11px;
	font-weight: 700;
	color: #2563eb;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	margin-bottom: 5px;
}

.iae-quiz-info-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	margin: 25px 0;
	background: #f8fafc;
	border-radius: 12px;
	padding: 20px;
	border: 1px solid #cbd5e1;
}

.iae-info-item {
	text-align: center;
}

.iae-info-val {
	display: block;
	font-size: 20px;
	font-weight: 700;
	color: #0f172a;
}

.iae-info-lbl {
	font-size: 11px;
	color: #64748b;
	text-transform: uppercase;
	margin-top: 3px;
}

/* Buttons */
.iae-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 24px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.iae-btn-primary {
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	color: #fff;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.iae-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.iae-btn-secondary {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
}

.iae-btn-secondary:hover {
	background: #e2e8f0;
}

.iae-btn-wide {
	width: 100%;
	display: block;
	margin-bottom: 10px;
}

.iae-btn-danger {
	background: #ef4444;
	color: #fff;
}

.iae-btn-danger:hover {
	background: #dc2626;
}

/* Exam Player layouts */
.iae-timer-card.warning {
	border: 1px solid #fecaca;
	background: #fef2f2;
	animation: iae-pulse-red 2s infinite;
}

.iae-timer-card.warning strong {
	color: #ef4444 !important;
}

@keyframes iae-pulse-red {
	0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
	70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
	100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Question Palette Items */
.iae-palette-grid {
	margin-top: 15px;
}

.iae-palette-item {
	font-family: 'Outfit', sans-serif;
	font-weight: 600;
	font-size: 13px;
	height: 38px;
	border-radius: 6px;
	cursor: pointer;
	border: 1px solid #cbd5e1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
}

.iae-palette-item.current {
	border: 2px solid #2563eb;
	font-weight: 700;
}

.iae-palette-item.unanswered {
	background: #fff;
	color: #64748b;
}

.iae-palette-item.answered {
	background: #16a34a;
	color: #fff;
	border-color: #15803d;
}

.iae-palette-item.marked {
	background: #7c3aed;
	color: #fff;
	border-color: #6d28d9;
}

.iae-palette-item.answered-marked {
	background: #16a34a;
	color: #fff;
	border-color: #7c3aed;
	position: relative;
}

.iae-palette-item.answered-marked::after {
	content: '';
	position: absolute;
	top: 3px;
	right: 3px;
	width: 6px;
	height: 6px;
	background: #fff;
	border-radius: 50%;
}

.iae-palette-item:hover {
	transform: scale(1.05);
}

/* Option inputs check styling */
.iae-option:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.iae-option.is-selected {
	background: #eff6ff;
	border-color: #2563eb;
}

.iae-action-secondary {
	font-family: 'Outfit', sans-serif;
	font-weight: 600;
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #475569;
	border-radius: 6px;
	padding: 8px 16px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.iae-action-secondary:hover {
	background: #f8fafc;
	color: #1e293b;
}

.iae-action-secondary.is-marked {
	background: #f5f3ff;
	border-color: #c084fc;
	color: #7c3aed;
}

.iae-action-secondary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.iae-exam-layout {
		grid-template-columns: 1fr !important;
	}
	
	.iae-quiz-info-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* v3.1.1: Student exam layout — question first, palette below. */
.iae-quiz-player-wrap .iae-exam-layout {
	display: flex !important;
	flex-direction: column !important;
	gap: 20px !important;
	width: 100% !important;
}

.iae-quiz-player-wrap .iae-quiz-main-column {
	width: 100% !important;
	min-width: 0 !important;
}

.iae-quiz-player-wrap .iae-quiz-sidebar-column {
	width: 100% !important;
	max-width: none !important;
	max-height: none !important;
	box-sizing: border-box !important;
	padding: 18px !important;
}

.iae-quiz-player-wrap .iae-palette-grid {
	display: grid !important;
	grid-template-columns: repeat(10, minmax(42px, 1fr)) !important;
	gap: 8px !important;
	max-height: none !important;
	overflow: visible !important;
	padding-right: 0 !important;
}

.iae-quiz-player-wrap .iae-palette-item {
	min-width: 42px;
	height: 42px;
}

.iae-quiz-player-wrap .iae-quiz-question-box {
	min-height: 280px !important;
	box-sizing: border-box !important;
}

.iae-quiz-player-wrap .iae-question-text {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	word-break: break-word;
}

.iae-no-options {
	padding: 14px;
	border: 1px solid #fecaca;
	background: #fef2f2;
	color: #991b1b;
	border-radius: 8px;
	margin-bottom: 20px;
}

@media (max-width: 900px) {
	.iae-quiz-player-wrap .iae-palette-grid {
		grid-template-columns: repeat(8, minmax(40px, 1fr)) !important;
	}
}

@media (max-width: 600px) {
	.iae-quiz-player-wrap .iae-palette-grid {
		grid-template-columns: repeat(5, minmax(42px, 1fr)) !important;
	}
	.iae-quiz-player-wrap .iae-container,
	.iae-quiz-player-wrap .iae-quiz-container {
		padding: 16px !important;
	}
	.iae-quiz-player-wrap .iae-question-actions {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 12px !important;
	}
	.iae-quiz-player-wrap .iae-question-actions > div {
		width: 100%;
	}
}
