:root {
	--primary-color: #2c3e50;
	--secondary-color: #3498db;
	--accent-color: #e74c3c;
	--background-color: #f5f6fa;
	--text-color: #2c3e50;
	--border-radius: 12px;
	--box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	--transition: all 0.3s ease;
}

body,
html {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background-color: var(--background-color);
	color: var(--text-color);
	line-height: 1.6;
}

body {
	padding: 16px;
}

.flex-container {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px;
}

.flex-child {
	background: white;
	padding: 24px;
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
}

h1 {
	font-size: 1.75rem;
	color: var(--primary-color);
	margin-bottom: 1.5rem;
	font-weight: 700;
}

h2 {
	font-size: 1.25rem;
	color: var(--primary-color);
	margin-bottom: 1rem;
	font-weight: 600;
}

.form-group {
	margin-bottom: 1.5rem;
}

label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--primary-color);
}

input,
select,
button {
	width: 100%;
	padding: 12px;
	border: 2px solid #e1e1e1;
	border-radius: var(--border-radius);
	font-size: 1rem;
	transition: var(--transition);
}

input:focus,
select:focus {
	outline: none;
	border-color: var(--secondary-color);
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button {
	background-color: var(--secondary-color);
	color: white;
	border: none;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
}

button:hover {
	background-color: #2980b9;
	transform: translateY(-1px);
}

button:active {
	transform: translateY(0);
}

.category {
	background: #f8f9fa;
	padding: 16px;
	border-radius: var(--border-radius);
	margin-bottom: 16px;
}

.category-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.category-header h2 {
	margin: 0;
	font-size: 1.1rem;
}

.buttons {
	display: flex;
	gap: 8px;
}

.buttons button {
	flex: 1;
	padding: 8px;
	font-size: 1.25rem;
}

.score {
	background: #f8f9fa;
	padding: 16px;
	border-radius: var(--border-radius);
	margin-top: 16px;
	font-size: 1.1rem;
	font-weight: 600;
}

#total-score {
	color: var(--secondary-color);
}

#tajweed-score,
#memorization-score {
	color: #27ae60;
}

.count-text {
	color: var(--accent-color);
	font-weight: 700;
}

/* Desktop styles */
@media (min-width: 768px) {
	.flex-container {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.flex-child {
		flex: 1 1 calc(50% - 24px);
		min-width: 300px;
	}

	.flex-child:last-child {
		flex: 1 1 100%;
	}

	h1 {
		font-size: 2rem;
	}

	h2 {
		font-size: 1.5rem;
	}
}

/* Large Desktop styles */
@media (min-width: 1200px) {
	.flex-child {
		flex: 1 1 calc(33.333% - 24px);
	}

	.flex-child:last-child {
		flex: 1 1 calc(33.333% - 24px);
	}
}

.error-message {
	color: var(--accent-color);
	background-color: rgba(231, 76, 60, 0.1);
	padding: 12px;
	border-radius: var(--border-radius);
	margin-bottom: 1rem;
	font-weight: 500;
}

.button-group {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}

.primary-button {
	background-color: var(--secondary-color);
	color: white;
	flex: 2;
}

.secondary-button {
	background-color: #e1e1e1;
	color: var(--text-color);
	flex: 1;
}

.scores-container {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 24px;
}

.question-container {
	background: #fff;
	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow);
	padding: 2rem;
	margin-top: 1.5rem;
}

.question-header {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid #f0f0f0;
}

.question-counter {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--primary-color);
	text-align: left;
	background: #f8f9fa;
	padding: 0.5rem;
	border-radius: var(--border-radius);
	width: fit-content;
	margin: 0;
}

#nextButton {
	width: 100%;
	max-width: 300px;
	margin: 0 auto;
}

.english-info {
	background: #f8f9fa;
	padding: 1.5rem;
	border-radius: var(--border-radius);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.english-info h2 {
	font-size: 1.25rem;
	color: var(--primary-color);
	margin: 0;
	line-height: 1.6;
}

/* Responsive styles */
@media (max-width: 768px) {
	#arabic-text {
		font-size: 1.35rem;
		line-height: 1.6;
	}
}

@media (max-width: 480px) {
	#arabic-text {
		font-size: 1.2rem;
		line-height: 1.5;
	}
}

.response-container {
	margin-top: 16px;
}

.response-container h2 {
	margin: 8px 0;
	font-size: 1.1rem;
}

/* Add smooth transitions for all interactive elements */
button,
input,
select {
	transition: var(--transition);
}

/* Improve focus states for accessibility */
button:focus,
input:focus,
select:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Add hover effect for buttons */
.buttons button:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Improve disabled state styling */
button:disabled {
	background-color: #e1e1e1;
	color: #999;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Add loading state for buttons */
button.loading {
	position: relative;
	color: transparent;
}

button.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
	from {
		transform: rotate(0turn);
	}
	to {
		transform: rotate(1turn);
	}
}

/* Improve number input styling */
input[type="number"] {
	-moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add subtle hover effect to categories */
.category:hover {
	background: #f1f3f5;
}

/* Improve score display */
.score {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
	background: white;
	border-radius: var(--border-radius);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.score span {
	font-size: 1.2rem;
	font-weight: 700;
}

/* Add responsive improvements */
@media (max-width: 480px) {
	body {
		padding: 12px;
	}

	.flex-container {
		padding: 12px;
		gap: 16px;
	}

	.flex-child {
		padding: 16px;
	}

	h1 {
		font-size: 1.5rem;
	}

	.button-group {
		flex-direction: column;
	}

	.primary-button,
	.secondary-button {
		width: 100%;
	}
}

/* Arabic text styling */
[lang="ar"] {
	font-family: 'Amiri', serif !important;
	font-size: 2rem !important;
	line-height: 2 !important;
	text-align: right !important;
	direction: rtl !important;
	font-weight: 700 !important;
}