/*
Theme Name: Shorouk Edu Theme (شروق التعليمي)
Theme URI: https://shoroukedu.com/theme
Author: Senior Developer & UI/UX Designer
Author URI: https://shoroukedu.com
Description: قالب ووردبريس احترافي، متجاوب، فائق السرعة، متوافق مع معايير الـ SEO والوضع الداكن، مصمم خصيصاً لتحميل المذكرات والملفات التعليمية والـ PDFs.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: study-notes-theme
Domain Path: /languages
Tags: education, two-columns, custom-menu, translation-ready, rtl-language-support
*/

/* ==========================================================================
   1. CSS Custom Properties & Variables (Design System)
   ========================================================================== */
:root {
	/* لوحة الألوان الرئيسية (تمت تهيئتها لتقبل التخصيص برمجياً) */
	--primary-color: #4f46e5;
	--primary-hover: #4338ca;
	--secondary-color: #7c3aed;
	--accent-color: #06b6d4;
	
	/* ألوان الخلفيات والنصوص للوضع الفاتح */
	--bg-body: #f8fafc;
	--bg-card: #ffffff;
	--bg-input: #ffffff;
	--text-main: #1e293b;
	--text-muted: #64748b;
	--border-color: #e2e8f0;
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	
	/* هوامش وأقطار الحواف */
	--radius-sm: 6px;
	--radius-md: 12px;
	--radius-lg: 20px;
	
	/* الخطوط */
	--font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
	--font-english: 'Outfit', system-ui, sans-serif;
}

/* متغيرات الوضع الداكن (Dark Mode Variables) */
[data-theme="dark"] {
	--bg-body: #0f172a;
	--bg-card: #1e293b;
	--bg-input: #0f172a;
	--text-main: #f8fafc;
	--text-muted: #94a3b8;
	--border-color: #334155;
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. Reset & Global Styles
   ========================================================================== */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: var(--bg-body);
	color: var(--text-main);
	font-family: var(--font-arabic);
	line-height: 1.6;
	transition: background-color 0.3s ease, color 0.3s ease;
	font-size: 16px;
}

body.ltr {
	font-family: var(--font-english);
}

a {
	color: var(--primary-color);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--primary-hover);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

.container {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ==========================================================================
   3. Header & Navigation (رأس الموقع والقوائم)
   ========================================================================== */
.site-header {
	background-color: var(--bg-card);
	border-bottom: 1px solid var(--border-color);
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: var(--shadow-sm);
	transition: background-color 0.3s ease;
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 80px;
}

.site-logo a {
	display: flex;
	align-items: center;
	font-weight: 800;
	font-size: 24px;
	color: var(--primary-color);
}

.main-navigation ul {
	display: flex;
	list-style: none;
	gap: 24px;
}

.main-navigation a {
	color: var(--text-main);
	font-weight: 700;
	font-size: 15px;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	transition: background-color 0.2s, color 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
	background-color: rgba(79, 70, 229, 0.1);
	color: var(--primary-color);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* زر الوضع الداكن */
.theme-toggle-btn {
	background: none;
	border: 1px solid var(--border-color);
	cursor: pointer;
	padding: 8px;
	border-radius: 50%;
	color: var(--text-main);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
	background-color: var(--border-color);
}

/* ==========================================================================
   4. Hero Section & AJAX Search (البطل ومحرك البحث)
   ========================================================================== */
.hero-section {
	background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
	padding: 60px 0;
	text-align: center;
	border-bottom: 1px solid var(--border-color);
}

.hero-title {
	font-size: 36px;
	font-weight: 900;
	color: var(--text-main);
	margin-bottom: 12px;
}

.hero-subtitle {
	font-size: 16px;
	color: var(--text-muted);
	max-width: 600px;
	margin: 0 auto 30px auto;
}

/* فلتر البحث المتطور */
.search-filter-box {
	background-color: var(--bg-card);
	padding: 24px;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	max-width: 900px;
	margin: 0 auto;
	border: 1px solid var(--border-color);
}

.filter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.filter-item select, 
.search-input-wrapper input {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	background-color: var(--bg-input);
	color: var(--text-main);
	font-family: var(--font-arabic);
	outline: none;
	font-size: 14px;
	transition: border-color 0.2s;
}

.filter-item select:focus, 
.search-input-wrapper input:focus {
	border-color: var(--primary-color);
}

.search-input-wrapper {
	position: relative;
}

.search-input-wrapper input {
	padding-right: 45px;
}

.search-icon-btn {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
}

/* ==========================================================================
   5. Main Grid & Post Cards (الشبكة والبطاقات)
   ========================================================================== */
.section-title {
	font-size: 24px;
	font-weight: 800;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-right: 4px solid var(--primary-color);
	padding-right: 12px;
}

.study-files-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 40px;
}

.file-card {
	background-color: var(--bg-card);
	border-radius: var(--radius-md);
	border: 1px solid var(--border-color);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	position: relative;
	display: flex;
	flex-direction: column;
}

.file-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
}

.card-thumbnail {
	position: relative;
	height: 180px;
	background-color: #cbd5e1;
	overflow: hidden;
}

.card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.file-card:hover .card-thumbnail img {
	transform: scale(1.05);
}

/* شارات نوع الملف */
.badge-premium {
	position: absolute;
	top: 12px;
	left: 12px;
	background-color: var(--secondary-color);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: var(--radius-sm);
	max-width: calc(100% - 24px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 10;
}

.badge-free {
	position: absolute;
	top: 12px;
	left: 12px;
	background-color: var(--accent-color);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: var(--radius-sm);
	max-width: calc(100% - 24px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 10;
}

.card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-title {
	font-size: 16px;
	font-weight: 800;
	color: var(--text-main);
	margin-bottom: 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-meta-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	font-size: 13px;
	color: var(--text-muted);
	margin-bottom: 15px;
	border-top: 1px solid var(--border-color);
	padding-top: 12px;
}

.card-meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.card-footer {
	border-top: 1px solid var(--border-color);
	padding: 15px 20px;
	background-color: rgba(248, 250, 252, 0.03);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.card-downloads-count {
	font-size: 13px;
	color: var(--text-muted);
	font-weight: bold;
}

/* ==========================================================================
   6. Statistics Counter Section (عداد الإحصائيات)
   ========================================================================== */
.stats-counter-bar {
	background-color: var(--bg-card);
	border: 1px solid var(--border-color);
	padding: 30px 20px;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	text-align: center;
	margin-bottom: 40px;
}

.stat-item-box {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.stat-number {
	font-size: 32px;
	font-weight: 900;
	color: var(--primary-color);
	margin-bottom: 4px;
}

.stat-label {
	font-size: 14px;
	color: var(--text-muted);
	font-weight: bold;
}

/* ==========================================================================
   7. Single File Layout (صفحة المذكرة الفردية)
   ========================================================================== */
.single-file-container {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 30px;
	margin-top: 40px;
	margin-bottom: 60px;
}

.file-content-card {
	background-color: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 30px;
	box-shadow: var(--shadow-sm);
}

.file-detail-title {
	font-size: 26px;
	font-weight: 900;
	margin-bottom: 20px;
}

/* جدول معلومات الملف */
.file-details-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 30px;
}

.file-details-table tr {
	border-bottom: 1px solid var(--border-color);
}

.file-details-table td {
	padding: 12px 8px;
	font-size: 15px;
}

.file-details-table td.label-cell {
	font-weight: bold;
	color: var(--text-muted);
	width: 150px;
}

.file-details-table td.value-cell {
	color: var(--text-main);
	font-weight: bold;
}

/* معاينة ملف الـ PDF */
.pdf-preview-box {
	background-color: #0f172a;
	border-radius: var(--radius-md);
	overflow: hidden;
	margin-bottom: 30px;
	position: relative;
	aspect-ratio: 16/9;
	box-shadow: var(--shadow-md);
}

.pdf-preview-box iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* أزرار التحميل الإبداعية */
.downloads-panel-box {
	background-color: rgba(79, 70, 229, 0.03);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 24px;
	margin-bottom: 30px;
	text-align: center;
}

.countdown-box {
	font-size: 16px;
	font-weight: bold;
	margin-bottom: 20px;
	color: var(--secondary-color);
}

.countdown-number {
	font-size: 32px;
	font-weight: 900;
	display: block;
}

.download-buttons-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
}

.btn-download-action {
	padding: 14px 20px;
	border-radius: var(--radius-md);
	color: #fff !important;
	font-weight: 800;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: var(--shadow-sm);
	transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download-action:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.btn-pdf-direct { background-color: #ef4444; } /* Red */
.btn-drive { background-color: #10b981; }      /* Green */
.btn-mediafire { background-color: #3b82f6; }  /* Blue */
.btn-mega { background-color: #ea580c; }       /* Orange */

/* ==========================================================================
   7.5 Standard WordPress Sidebar Widgets Styling (تنسيق الودجات القياسية)
   ========================================================================== */
.widget {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--shadow-sm);
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.widget-title, .widgettitle {
	font-size: 16px;
	font-weight: 800;
	border-right: 4px solid var(--primary-color);
	padding-right: 10px;
	margin-bottom: 20px;
	color: var(--text-main);
	position: relative;
}

.widget ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.widget li {
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color);
	font-size: 14px;
	transition: transform 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.widget li:hover {
	transform: translateX(-4px); /* RTL slide-in */
}

.widget li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.widget a {
	color: var(--text-main);
	font-weight: 600;
	transition: color 0.2s;
}

.widget a:hover {
	color: var(--primary-color);
}

/* تنسيق نموذج البحث المطور في الشريط الجانبي */
.search-form {
	position: relative;
	width: 100%;
}

.search-form .search-field {
	width: 100%;
	padding: 12px 45px 12px 16px;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	background: var(--bg-input);
	color: var(--text-main);
	font-family: var(--font-arabic);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form .search-field:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-form .search-submit-btn {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: color 0.2s;
}

.search-form .search-submit-btn:hover {
	color: var(--primary-color);
}



/* ==========================================================================
   8. Ads Placements (المساحات الإعلانية)
   ========================================================================== */
.ad-slot-wrapper {
	margin: 20px auto;
	text-align: center;
	clear: both;
}

.ad-label {
	display: block;
	font-size: 11px;
	color: var(--text-muted);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* ==========================================================================
   9. Footer (ذيل الموقع)
   ========================================================================== */
.site-footer {
	background-color: var(--bg-card);
	border-top: 1px solid var(--border-color);
	padding: 60px 0 30px 0;
	margin-top: auto;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 40px;
	margin-bottom: 40px;
}

.footer-widget-title {
	font-size: 18px;
	font-weight: 800;
	margin-bottom: 20px;
	position: relative;
}

.footer-widget ul {
	list-style: none;
}

.footer-widget li {
	margin-bottom: 12px;
}

.footer-widget a {
	color: var(--text-muted);
	font-weight: 500;
}

.footer-widget a:hover {
	color: var(--primary-color);
}

.site-info-bar {
	border-top: 1px solid var(--border-color);
	padding-top: 30px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
	font-size: 14px;
	color: var(--text-muted);
}

/* ==========================================================================
   10. Responsiveness & Media Queries (التجاوب للموبايل)
   ========================================================================== */
@media (max-width: 992px) {
	.single-file-container {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.header-container {
		height: auto;
		flex-direction: column;
		padding: 15px 20px;
		gap: 15px;
	}

	.main-navigation ul {
		gap: 12px;
		flex-wrap: wrap;
		justify-content: center;
	}

	.hero-title {
		font-size: 28px;
	}

	.site-info-bar {
		flex-direction: column;
		text-align: center;
	}
}
