/**
 * Quiz Builder Styles - Skeleton
 *
 * Minimal structural and animation styles only.
 * Visual styling (colors, backgrounds, fonts) should be provided by theme.
 *
 * @package InteractiveElements
 * @since 1.0.0
 */

/* ==========================================================================
   Quiz Container
   ========================================================================== */

.ie-quiz-container {
	margin: 0 auto;
	overflow: hidden;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.ie-quiz-progress {
	padding: 20px 40px;
	position: relative;
	transition: background-position 0.5s ease-out;
}

.ie-progress-bar {
	position: relative;
	height: 8px;
	overflow: hidden;
	margin-bottom: 10px;
}

.ie-progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	transition: width 0.4s ease-out;
}

.ie-progress-text {
	text-align: center;
}

/* ==========================================================================
   Questions Container
   ========================================================================== */

.ie-quiz-questions {
	min-height: 350px;
	position: relative;
}

.ie-question {
	display: none;
	padding: 40px;
	animation: questionSlide 0.4s ease;
}

.ie-question.ie-active {
	display: block;
}

@keyframes questionSlide {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.ie-question-header {
	margin-bottom: 30px;
}

.ie-question-number {
	display: block;
	margin-bottom: 10px;
}

.ie-question-text {
	margin: 0;
}

/* ==========================================================================
   Multiple Choice Options
   ========================================================================== */

.ie-question-content {
	margin-top: 20px;
}

fieldset.ie-options {
	border: none;
	margin: 0;
	padding: 0;
}

.ie-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ie-option {
	display: flex;
	align-items: center;
	padding: 16px 20px;
	cursor: pointer;
	transition: transform 0.3s ease;
	position: relative;
}

.ie-option:hover {
	transform: translateX(5px);
}

.ie-option input[type="radio"] {
	margin: 0 15px 0 0;
}

.ie-option-text {
	flex: 1;
}

/* ==========================================================================
   Answer Feedback
   ========================================================================== */

.ie-answer-feedback {
	margin-top: 20px;
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.3s ease;
}

.ie-answer-feedback.ie-show {
	opacity: 1;
	transform: translateY(0);
}

.ie-feedback-content {
	padding: 20px;
}

.ie-feedback-status {
	margin-bottom: 8px;
}

/* ==========================================================================
   Answer Required Message
   ========================================================================== */

.ie-answer-required {
	margin-top: 15px;
	padding: 12px 16px;
	animation: shake 0.5s ease-in-out;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

.ie-question-error {
	animation: errorPulse 0.5s ease-in-out;
}

@keyframes errorPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

/* ==========================================================================
   Require Retry (incorrect answers in require_correct mode)
   ========================================================================== */

.ie-option.ie-require-retry {
	opacity: 0.5;
	pointer-events: none;
	text-decoration: line-through;
	border-color: #dc3545 !important;
	background-color: rgba(220, 53, 69, 0.05) !important;
}

.ie-option.ie-require-retry .ie-option-text {
	color: #999;
}

/* ==========================================================================
   Question Explanation
   ========================================================================== */

.ie-question-explanation {
	margin-top: 20px;
	padding: 20px;
}

.ie-question-explanation p {
	margin: 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.ie-quiz-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 25px 40px;
}

.ie-nav-button {
	padding: 14px 28px;
	border: none;
	cursor: pointer;
	transition: transform 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ie-prev-button:hover:not(:disabled) {
	transform: translateX(-3px);
}

.ie-prev-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ie-next-button:hover:not(:disabled),
.ie-submit-button:hover:not(:disabled) {
	transform: translateX(3px);
}

.ie-nav-button:disabled,
.ie-nav-button.ie-disabled {
	cursor: not-allowed;
	transform: none;
}

/* ==========================================================================
   Results Page
   ========================================================================== */

.ie-quiz-results-page {
	padding: 40px;
	text-align: center;
}

.ie-results-header {
	margin-bottom: 30px;
}

.ie-results-title {
	margin: 0;
}

.ie-score-display {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 30px;
	margin: 30px 0;
	padding: 30px;
}

.ie-score-circle {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ie-score-details {
	text-align: left;
}

.ie-score-text {
	margin: 0 0 10px 0;
}

.ie-pass-status {
	margin: 0;
	padding: 10px 20px;
	display: inline-block;
}

/* Results Breakdown */
.ie-results-breakdown {
	margin: 30px 0;
	text-align: left;
}

.ie-results-breakdown h3 {
	margin-bottom: 20px;
	text-align: center;
}

.ie-breakdown-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ie-breakdown-item {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px;
}

.ie-breakdown-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ie-breakdown-text {
	flex: 1;
}

/* Results Actions */
.ie-results-actions {
	margin-top: 30px;
}

.ie-btn {
	padding: 14px 30px;
	border: none;
	cursor: pointer;
	transition: transform 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ie-btn-primary:hover {
	transform: translateY(-2px);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
	.ie-quiz-container {
		margin: 10px;
	}

	.ie-quiz-progress.ie-train-track {
		padding: 20px;
	}

	.ie-question {
		padding: 25px;
	}

	.ie-quiz-navigation {
		padding: 20px;
		flex-direction: column;
		gap: 15px;
	}

	.ie-nav-button {
		width: 100%;
		justify-content: center;
	}

	.ie-score-display {
		flex-direction: column;
		gap: 20px;
		padding: 20px;
	}

	.ie-score-details {
		text-align: center;
	}
}

@media (max-width: 480px) {
	.ie-question {
		padding: 15px;
	}

	.ie-option {
		padding: 12px 15px;
	}

	.ie-score-circle {
		width: 100px;
		height: 100px;
	}
}

/* ==========================================================================
   Screen Reader Only & Announcements
   ========================================================================== */

.ie-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ie-sr-announcements {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Focus Styles
   ========================================================================== */

.ie-option:focus-within {
	outline: 2px solid #007bff;
	outline-offset: 2px;
}

.ie-nav-button:focus-visible,
.ie-retry-button:focus-visible {
	outline: 2px solid #007bff;
	outline-offset: 2px;
}

.ie-question-text:focus {
	outline: none;
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.ie-question,
	.ie-option,
	.ie-nav-button,
	.ie-progress-fill,
	.ie-quiz-progress,
	.ie-answer-feedback {
		animation: none;
		transition: none;
	}

	.ie-progress-fill {
		transition: width 0.1s linear;
	}

	.ie-quiz-progress {
		transition: background-position 0.1s linear;
	}
}
