/* ==========================================================================
   Quizati Core Structure - RTL First
   ========================================================================== */

/* --- Variables --- */
:root {
	--color-primary: #4a90e2;    /* Main Brand Color */
	--color-secondary: #f39c12;  /* Accent/Highlight */
	--color-success: #27ae60;    /* Correct Answers */
	--color-danger: #e74c3c;     /* Wrong Answers */
	--color-text-main: #333333;  /* Main text */
	--color-text-light: #777777; /* Meta text */
	--color-bg: #fdfdfd;         /* Site Background */
	--color-bg-alt: #f4f6f9;     /* Alternate Section Background */
	
    --gradient-primary: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); /* Modern Tech Gradient */

	--font-main: 'Tajawal', 'Cairo', sans-serif; /* Recommended Arabic Fonts */
	
	--border-radius-sm: 8px;
	--border-radius-md: 12px;
	--border-radius-pill: 50px;
	
	--shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
	--shadow-md: 0 4px 15px rgba(0,0,0,0.08);
	--shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
	
	--transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Base RTL Resets --- */
html, body {
	direction: rtl; /* Enforce RTL globally */
	font-family: var(--font-main);
	color: var(--color-text-main);
	background-color: var(--color-bg);
	line-height: 1.6;
	margin: 0;
	padding: 0;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--color-primary);
	text-decoration: none;
	transition: var(--transition);
}

a:hover {
	color: var(--color-secondary);
}

.quizati-container {
	max-width: 1200px;
	margin-inline: auto; /* Logical property replacing margin-left/right: auto */
	padding-inline: 20px; /* Logical property replacing padding-left/right: 20px */
}

/* Utilities */
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Buttons */
.btn {
	display: inline-block;
	font-weight: 700;
	text-align: center;
	padding: 12px 30px;
	border-radius: var(--border-radius-pill);
	transition: var(--transition);
	cursor: pointer;
	border: none;
	font-family: inherit;
}

.btn-primary {
	background: var(--gradient-primary);
	color: #fff;
	box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}

.btn-primary:hover {
	background: var(--gradient-primary);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 114, 255, 0.4);
}

.hero-cta-btn,
.hero-cta-btn:visited {
    background: #ffffff;
    color: var(--color-primary);
    border: 2px solid #ffffff;
}

.hero-cta-btn:hover {
    background: #ffffff;
    color: var(--color-secondary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

/* ==========================================================================
   Homepage Sections
   ========================================================================== */

/* --- Hero Section --- */
.quizati-hero-section {
	padding-block: 50px 70px; /* Reduced logical padding top/bottom */
	background: var(--gradient-primary);
    color: #fff;
	border-bottom: 1px solid rgba(0,0,0,0.03);
}

.hero-title {
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: 800;
	color: #fff;
	margin-block-end: 15px; /* Logical margin-bottom */
}

.hero-subtitle {
	font-size: 1.25rem;
	color: rgba(255,255,255,0.9);
	margin-block-end: 40px;
	max-width: 600px;
	margin-inline: auto;
}

.hero-search-bar {
	max-width: 600px;
	margin-inline: auto;
	margin-block-end: 30px;
	position: relative;
}

.hero-search-bar .search-form {
	display: flex;
	background: #fff;
	border-radius: var(--border-radius-pill);
	box-shadow: var(--shadow-md);
	overflow: hidden;
	padding: 5px;
	transition: var(--shadow-hover);
}

.hero-search-bar .search-form:focus-within {
	box-shadow: var(--shadow-hover);
}

.hero-search-bar .search-field {
	flex-grow: 1;
	border: none;
	padding-inline-start: 25px; /* Logical property for RTL padding-right */
	padding-inline-end: 15px; /* Logical property for RTL padding-left */
	font-size: 1.1rem;
	font-family: inherit;
	background: transparent;
}

.hero-search-bar .search-field:focus {
	outline: none;
}

.hero-search-bar .search-submit {
	background: var(--color-primary);
	color: #fff;
	border: none;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: var(--transition);
}

.hero-search-bar .search-submit:hover {
	background: var(--color-secondary);
}

/* --- Category Navigation --- */
.quizati-category-nav {
	padding-block: 40px; /* Reduced */
}

.section-title {
	font-size: 2rem;
	font-weight: 700;
	margin-block-end: 30px;
	position: relative;
}

.category-pills {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 15px;
}

.category-pill {
	background: #fff;
	border: 1px solid #eaeaea;
	padding: 10px 25px;
	border-radius: var(--border-radius-pill);
	font-weight: 600;
	color: var(--color-text-main);
	box-shadow: var(--shadow-sm);
}

.category-pill:hover {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
	transform: translateY(-2px);
}

/* --- Grid System --- */
.quiz-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
}

/* --- Quiz Cards --- */
.quiz-card {
	background: #fff;
	border-radius: var(--border-radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-md);
	transition: var(--transition);
	position: relative;
	display: flex;
	flex-direction: column;
}

.quiz-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-hover);
}

.quiz-card-link {
	position: absolute;
	inset: 0; /* Logical top, right, bottom, left: 0 */
	z-index: 2;
}

.quiz-card-thumbnail {
	position: relative;
	height: 200px;
	overflow: hidden;
}

.quiz-card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.quiz-card:hover .quiz-card-thumbnail img {
	transform: scale(1.05);
}

.quiz-difficulty-badge {
	position: absolute;
	top: 15px;
	inset-inline-start: 15px; /* Logical left in LTR, right in RTL */
	background: rgba(255, 255, 255, 0.9);
	color: var(--color-primary);
	padding: 4px 12px;
	border-radius: var(--border-radius-pill);
	font-size: 0.85rem;
	font-weight: 700;
	z-index: 1;
}

.quiz-card-content {
	padding: 20px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.quiz-card-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin-block-start: 0;
	margin-block-end: 15px;
	line-height: 1.4;
    flex-grow: 1; /* Pushes the card footer to the bottom */
}

.quiz-card-title a {
	color: inherit;
}

/* --- Card Footer & Meta --- */
.quiz-card-footer {
	border-block-start: 1px solid #f0f0f0;
	padding-block-start: 15px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-block-start: auto;
}

.quiz-card-meta {
	display: flex;
	gap: 15px;
	color: var(--color-text-light);
	font-size: 0.85rem;
}

.meta-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.meta-item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--color-primary);
}

.quiz-card-play-btn {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.quiz-card:hover .quiz-card-play-btn {
    transform: translateX(-5px); /* Move left in RTL */
    color: var(--color-secondary);
}

/* --- General Sections --- */
.view-all-link {
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 5px;
}
.quizati-trending-quizzes {
	padding-block: 40px; /* Reduced */
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.hero-title { font-size: 2rem; }
	.quiz-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;}
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.quizati-site-footer {
	background: #1a1f24; /* Dark elegant background */
	color: rgba(255,255,255,0.7);
	padding-block-start: 60px;
	margin-block-start: auto; /* Push to bottom if content is short */
}

.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 40px;
	margin-block-end: 40px;
}

.footer-widget-title {
	color: #fff;
	font-size: 1.3rem;
	margin-block-end: 20px;
	position: relative;
	padding-block-end: 10px;
}

.footer-widget-title::after {
	content: '';
	position: absolute;
	right: 0; /* RTL */
	bottom: 0;
	width: 40px;
	height: 3px;
	background: var(--gradient-primary);
	border-radius: 3px;
}

.footer-widget-text {
	line-height: 1.8;
}

.footer-social-icons {
	display: flex;
	gap: 15px;
	margin-block-start: 20px;
}

.footer-social-icons a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: rgba(255,255,255,0.05);
	color: #fff;
	border-radius: 50%;
	transition: var(--transition);
}

.footer-social-icons a:hover {
	background: var(--gradient-primary);
	transform: translateY(-3px);
}

.footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-links li {
	margin-block-end: 12px;
}

.footer-links a {
	color: inherit;
	transition: var(--transition);
	display: inline-block;
}

.footer-links a:hover {
	color: #fff;
	transform: translateX(-5px); /* RTL hover nudge */
}

.site-info {
	background: #111519; /* Darker than footer bg for contrast */
	padding-block: 20px;
	font-size: 0.95rem;
	border-block-start: 1px solid rgba(255,255,255,0.05);
}

.site-info a {
	color: #fff;
	font-weight: bold;
}

.site-info a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   SEO Pages Typography (page.php, single.php content)
   ========================================================================== */
.entry-content {
    line-height: 1.8;
    color: var(--color-text-main);
}

.entry-content p {
    font-size: 1.1rem;
    margin-block-end: 20px;
}

.entry-content h2, 
.entry-content h3 {
    color: var(--color-primary);
    margin-block-start: 1.5em;
    margin-block-end: 0.5em;
    font-weight: 700;
}

.entry-content h2 { font-size: 1.8rem; }
.entry-content h3 { font-size: 1.4rem; }

.entry-content ul, 
.entry-content ol {
    margin-block-start: 0;
    margin-block-end: 20px;
    padding-inline-start: 20px; /* RTL aware padding */
}

.entry-content li {
    margin-block-end: 10px;
}

.entry-content blockquote {
    border-inline-start: 4px solid var(--color-primary); /* RTL aware side-border */
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: var(--color-bg-alt);
    font-style: italic;
    color: var(--color-text-light);
    border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   Single Quiz SEO (Author Box, Related, Comments)
   ========================================================================== */

/* Author Box */
.quizati-author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--color-bg-alt);
    padding: 30px;
    border-radius: var(--border-radius-md);
    margin-block-start: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
}

.author-avatar img {
    border-radius: 50%;
    width: 90px;
    height: 90px;
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
}

.author-name {
    margin-block-start: 0;
    margin-block-end: 10px;
    font-size: 1.4rem;
    color: var(--color-text-main);
}

.author-name span {
    color: var(--color-primary);
}

.author-description {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-light);
}

/* Related Quizzes Section */
.related-quizzes-section {
    margin-block-start: 60px;
}

.related-quizzes-section .section-title {
    margin-block-end: 40px;
}

/* Comments Section */
.quizati-comments-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: var(--border-radius-md);
    margin-block-start: 60px;
    box-shadow: var(--shadow-sm);
}

.quizati-comments-wrapper .comments-title,
.quizati-comments-wrapper .comment-reply-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-block-end: 20px;
    color: var(--color-text-main);
}

.quizati-comments-wrapper .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quizati-comments-wrapper .comment-body {
    background: var(--color-bg-alt);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    margin-block-end: 20px;
}

.quizati-comments-wrapper .comment-meta {
    margin-block-end: 10px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.quizati-comments-wrapper .comment-form input[type="text"],
.quizati-comments-wrapper .comment-form input[type="email"],
.quizati-comments-wrapper .comment-form input[type="url"],
.quizati-comments-wrapper .comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    margin-block-end: 20px;
    background: #fafafa;
    transition: var(--transition);
}

.quizati-comments-wrapper .comment-form input:focus,
.quizati-comments-wrapper .comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
}

.quizati-comments-wrapper .form-submit .submit {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: var(--border-radius-pill);
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.quizati-comments-wrapper .form-submit .submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Premium Quiz UI Polish Phase 11
   ========================================================================== */
.quizati-option-btn {
    width: 100%;
    padding: 18px 25px;
    border-radius: var(--border-radius-md);
    border: 2px solid #eaeaea;
    background: #fff;
    cursor: pointer;
    text-align: right;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    font-family: inherit;
}

.quizati-option-btn:hover:not([disabled]) {
    border-color: var(--color-primary);
    background-color: rgba(74, 144, 226, 0.05); /* subtle tint of primary color */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quizati-option-btn.correct {
    background-color: #4caf50 !important;
    border-color: #4caf50 !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4) !important;
}

.quizati-option-btn.wrong {
    background-color: #f44336 !important;
    border-color: #f44336 !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4) !important;
}

@media (max-width: 768px) {
    .quizati-author-box {
        flex-direction: column;
        text-align: center;
    }
}

/* Header Branding & Logo Fix */
.site-branding .custom-logo {
    max-height: 55px;
    width: auto;
    object-fit: contain;
}
.site-branding {
    display: flex;
    align-items: center;
}
