/**
 * Frontend styles for Blog Post Recommendation Quiz
 *
 * @package BlogPostRecommendationQuiz
 */

/* Quiz Container */
.bprq-quiz-container {
	max-width: 800px;
	margin: 30px auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.bprq-quiz-content {
	padding: 40px;
}

/* Loading State */
.bprq-quiz-loading {
	text-align: center;
	padding: 60px 20px;
}

.bprq-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: bprq-spin 1s linear infinite;
	margin: 0 auto 20px;
}

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

/* Question */
.bprq-question {
	animation: bprq-fade-in 0.4s ease-in;
}

@keyframes bprq-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.bprq-question-text {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 30px 0;
	color: #1a1a1a;
	line-height: 1.4;
}

/* Answers */
.bprq-answers {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.bprq-answer-btn {
	width: 100%;
	padding: 18px 24px;
	font-size: 16px;
	font-weight: 500;
	text-align: left;
	background: #f8f9fa;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #1a1a1a;
	text-align: right;
}

.bprq-answer-btn:hover {
	background: #fff;
	border-color: #2271b1;
	transform: translateX(5px);
	box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.bprq-answer-btn:active {
	transform: translateX(3px);
}

/* Results */
.bprq-results-container {
	animation: bprq-fade-in 0.4s ease-in;
}

.bprq-results-title {
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 30px 0;
	color: #1a1a1a;
	text-align: center;
}

/* Introduction Text Section */
.bprq-intro-text {
	background: #f8f9fa;
	border-left: 4px solid #2271b1;
	border-radius: 8px;
	padding: 25px 30px;
	margin-bottom: 30px;
	animation: bprq-fade-in 0.4s ease-in;
	line-height: 1.8;
	text-align: justify;
}

.bprq-intro-text p {
	margin: 0 0 15px 0;
	color: #1a1a1a;
	font-size: 16px;
}

.bprq-intro-text p:last-child {
	margin-bottom: 0;
}

.bprq-intro-text h1,
.bprq-intro-text h2,
.bprq-intro-text h3,
.bprq-intro-text h4,
.bprq-intro-text h5,
.bprq-intro-text h6 {
	margin: 20px 0 15px 0;
	color: #2271b1;
}

.bprq-intro-text h1:first-child,
.bprq-intro-text h2:first-child,
.bprq-intro-text h3:first-child,
.bprq-intro-text h4:first-child,
.bprq-intro-text h5:first-child,
.bprq-intro-text h6:first-child {
	margin-top: 0;
}

.bprq-intro-text a {
	color: #2271b1;
	text-decoration: underline;
	transition: color 0.2s;
}

.bprq-intro-text a:hover {
	color: #135e96;
}

.bprq-intro-text ul,
.bprq-intro-text ol {
	margin: 15px 0;
	padding-left: 30px;
}

.bprq-intro-text li {
	margin-bottom: 8px;
}

.bprq-intro-text strong,
.bprq-intro-text b {
	font-weight: 600;
	color: #1a1a1a;
}

.bprq-intro-text em,
.bprq-intro-text i {
	font-style: italic;
}

.bprq-intro-text code {
	background: #e5e7eb;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: monospace;
	font-size: 0.9em;
}

.bprq-intro-text blockquote {
	border-left: 3px solid #e5e7eb;
	margin: 20px 0;
	padding-left: 20px;
	color: #6b7280;
	font-style: italic;
}

/* Custom Button Section */
.bprq-custom-button-container {
	text-align: center;
	margin-bottom: 30px;
	animation: bprq-fade-in 0.4s ease-in;
}

.bprq-custom-button {
	display: inline-block;
	padding: 16px 40px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	text-decoration: none;
	border-radius: 12px;
	font-weight: 600;
	font-size: 18px;
	transition: all 0.3s ease;
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.bprq-custom-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
	background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.bprq-custom-button:active {
	transform: translateY(-1px);
}

.bprq-custom-button:focus {
	outline: 3px solid #667eea;
	outline-offset: 2px;
}

/* Custom Message Section */
.bprq-custom-message {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 12px;
	padding: 25px 30px;
	margin-bottom: 35px;
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
	animation: bprq-fade-in 0.4s ease-in;
	color: whitesmoke;
	text-align: center;
}

.bprq-custom-message p {
	color: #fff;
	font-size: 16px;
	line-height: 1.7;
	margin: 0;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bprq-custom-message a {
	color: #fbbf24;
	text-decoration: underline;
	font-weight: 600;
	transition: all 0.2s;
}

.bprq-custom-message a:hover {
	color: #fcd34d;
	text-decoration: none;
}

/* Results Separator */
.bprq-results-separator {
	border: none;
	border-top: 2px solid #e5e7eb;
	margin: 35px 0 30px 0;
	background: none;
}

/* Posts Section Heading */
.bprq-posts-section {
	margin-top: 20px;
}

.bprq-posts-heading {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 20px 0;
	color: #1a1a1a;
	text-align: center;
	position: relative;
	padding-bottom: 12px;
}

.bprq-posts-heading::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 3px;
	background: linear-gradient(90deg, #2271b1, #135e96);
	border-radius: 2px;
}

.bprq-posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 25px;
	margin-bottom: 30px;
}

.bprq-post-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.bprq-post-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	border-color: #2271b1;
}

.bprq-post-image {
	width: 100%;
	height: 180px;
	overflow: hidden;
	background: #f3f4f6;
}

.bprq-post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.bprq-post-card:hover .bprq-post-image img {
	transform: scale(1.05);
}

.bprq-post-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.bprq-post-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 12px 0;
}

.bprq-post-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 0.2s;
}

.bprq-post-title a:hover {
	color: #2271b1;
}

.bprq-post-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #6b7280;
	margin: 0 0 15px 0;
	flex: 1;
}

.bprq-read-more {
	display: inline-block;
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 500;
	font-size: 14px;
	transition: all 0.2s;
	align-self: flex-start;
}

.bprq-read-more:hover {
	background: #135e96;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.bprq-start-over {
	display: block;
	margin: 0 auto;
	padding: 14px 32px;
	background: #f3f4f6;
	color: #1a1a1a;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.bprq-start-over:hover {
	background: #fff;
	border-color: #2271b1;
	color: #2271b1;
}

/* No Results */
.bprq-no-results {
	text-align: center;
	padding: 60px 20px;
}

.bprq-no-results p {
	font-size: 18px;
	color: #6b7280;
	margin: 0;
}

/* Error */
.bprq-error {
	text-align: center;
	padding: 40px 20px;
	background: #fee;
	border-radius: 8px;
}

.bprq-error p {
	font-size: 16px;
	color: #b32d2e;
	margin: 0;
}

/* Progress Bar */
.bprq-quiz-progress {
	height: 6px;
	background: #e5e7eb;
	position: relative;
	overflow: hidden;
}

.bprq-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #2271b1, #135e96);
	transition: width 0.4s ease;
	box-shadow: 0 0 10px rgba(34, 113, 177, 0.5);
}

/* Standalone Page */
.bprq-standalone-page {
	padding: 60px 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
}

.bprq-standalone-container {
	max-width: 900px;
	margin: 0 auto;
}

.bprq-standalone-title {
	text-align: center;
	color: #fff;
	font-size: 42px;
	font-weight: 700;
	margin: 0 0 40px 0;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
	.bprq-quiz-content {
		padding: 30px 20px;
	}

	.bprq-question-text {
		font-size: 20px;
	}

	.bprq-answer-btn {
		padding: 15px 18px;
		font-size: 15px;
	}

	.bprq-posts-grid {
		grid-template-columns: 1fr;
	}

	.bprq-standalone-title {
		font-size: 32px;
	}

	.bprq-results-title {
		font-size: 22px;
	}

	.bprq-intro-text {
		padding: 20px;
		margin-bottom: 20px;
	}

	.bprq-intro-text p {
		font-size: 15px;
	}

	.bprq-custom-message {
		padding: 20px;
		margin-bottom: 25px;
	}

	.bprq-custom-message p {
		font-size: 15px;
	}

	.bprq-posts-heading {
		font-size: 20px;
	}
}

/* Accessibility */
.bprq-answer-btn:focus,
.bprq-read-more:focus,
.bprq-start-over:focus {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

/* Animation for smooth transitions */
.bprq-quiz-question,
.bprq-quiz-results {
	transition: opacity 0.3s ease;
}

.bprq-quiz-question[style*="display: none"],
.bprq-quiz-results[style*="display: none"] {
	opacity: 0;
}
