/* custom.css */
/* توحيد الخط اللاتيني في أسماء الملفات داخل الجداول */
div.file-name, span.file-name, td.file-name, th.file-name, .file-name {
	font-family: 'Noto Kufi Arabic', 'Noto Sans Arabic', 'Noto Sans Tifinagh', 'Segoe UI', 'Arial', 'sans-serif' !important;
	font-weight: 400 !important;
	font-size: 16px !important;
	letter-spacing: 0.02em;
}

/* تنسيقات جدول مكتبة الملفات */
/* توحيد الخط اللاتيني في جميع الجداول */
.library-table {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 8px #0001;
	overflow-x: auto;
}
.library-table th, .library-table td {
	vertical-align: middle;
	text-align: center;
	font-size: var(--font-size-lib);
}
.library-table thead th {
}

.file-list .table thead th,
.library-table thead th {
	background: #f3f3fa !important;
	--bs-table-color: #111 !important;
	color: #111 !important;
	font-size: 0.95rem !important;
	font-weight: 700 !important;
	padding: 8px 12px !important;
	vertical-align: middle !important;
	border-bottom: 2px solid rgba(0, 0, 0, 0.04) !important;
}

/* Force color for table-light header in all cases */
.library-table thead.table-light th,
.file-list .table thead.table-light th,
thead.table-light th {
	--bs-table-color: #111 !important;
	color: #111 !important;
	background: #f3f3fa !important;
}
}
.library-table tbody tr:nth-child(even) {
	background: #f8f9fc;
}
.library-table .btn-sm {
	padding: 3px 8px;
	font-size: var(--font-size-lib-sm);
}
.library-table .fa {
	font-size: var(--font-size-lib-lg);
	border-radius: 8px;
	font-size: 1.05rem;
}
.admin-sidebar .nav-link.logout:hover {
	background: rgba(255,255,255,0.08);
	color: #fff;
}
.admin-sidebar .nav-link.logout:hover .fa {
	background: #fff;
	color: #E55353;
}

/* ======================================
   أكواد التجاوب للوحة الإدارة
   ====================================== */

/* --- التابلت والشاشات المتوسطة (992px وأقل) --- */
@media (max-width: 991.98px) {
	/* تخطيط الإدارة يصبح عموديًا */
	.admin-layout {
		flex-direction: column;
	}
	/* القائمة الجانبية تتحول لشريط علوي أفقي */
	.admin-sidebar {
		width: 100%;
		min-height: auto;
		flex-direction: row;
		position: static;
		padding: 10px 8px;
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
	}
	.admin-sidebar .nav-link {
		font-size: 0.85rem;
		margin-bottom: 0;
		margin-inline-end: 4px;
		padding: 8px 12px;
		display: inline-flex;
		align-items: center;
		white-space: nowrap;
	}
	.admin-sidebar .nav-link i {
		margin-inline-end: 4px;
	}
	/* إخفاء زر الخروج المنفصل وإظهاره ضمن الشريط */
	.admin-sidebar .mt-auto {
		margin-top: 0 !important;
		display: inline-block;
	}
	/* المحتوى الرئيسي */
	main.flex-grow-1 {
		padding: 12px 8px;
		width: 100%;
	}
	/* تصغير عناوين الصفحات */
	.admin-layout .page-title,
	.admin-layout h2 {
		font-size: 1.25rem;
	}
	/* بطاقات الإحصائيات في لوحة التحكم */
	.admin-layout .row > [class*="col-md"] {
		margin-bottom: 8px;
	}
}

/* --- الهواتف الكبيرة (768px وأقل) --- */
@media (max-width: 767.98px) {
	.admin-sidebar .nav-link {
		font-size: 0.8rem;
		padding: 6px 10px;
	}
	/* تصغير بطاقات الإحصائيات */
	.admin-layout .p-3[style*="border-radius:16px"] {
		padding: 12px !important;
	}
	.admin-layout .p-3[style*="border-radius:16px"] div[style*="font-size:2em"],
	.admin-layout .p-3[style*="border-radius:16px"] div[style*="font-size:1.8em"] {
		font-size: 1.4em !important;
	}
	.admin-layout .p-3[style*="border-radius:16px"] div[style*="font-size:1.3em"],
	.admin-layout .p-3[style*="border-radius:16px"] div[style*="font-size:1.15em"] {
		font-size: 1rem !important;
	}
	/* الجداول: تمرير أفقي */
	.admin-layout .table-responsive {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.admin-layout .table {
		font-size: 0.85rem;
	}
	.admin-layout .table th,
	.admin-layout .table td {
		padding: 8px 6px;
		white-space: nowrap;
	}
}

/* --- الهواتف الصغيرة (576px وأقل) --- */
@media (max-width: 575.98px) {
	/* القائمة الجانبية */
	.admin-sidebar {
		padding: 6px 4px;
	}
	.admin-sidebar .nav-link {
		font-size: 0.7rem;
		padding: 5px 8px;
	}
	.admin-sidebar .nav-link i {
		font-size: 0.9rem;
		margin-inline-end: 3px;
	}
	.admin-sidebar img[alt="logo"] {
		width: 100px !important;
		height: auto !important;
	}
	
	/* === فلتر البحث === */
	.admin-layout .filter-panel .d-flex {
		flex-direction: column;
		gap: 10px;
	}
	.admin-layout .filter-panel .btn-group {
		width: 100%;
		flex-wrap: wrap;
	}
	.admin-layout .filter-panel .btn-group .btn {
		flex: 1 1 auto;
		font-size: 0.78rem;
		padding: 8px 10px;
		border-radius: 8px;
	}
	.admin-layout .filter-panel .input-group {
		width: 100%;
	}
	
	/* === ترقيم الصفحات === */
	.admin-layout .pagination {
		flex-wrap: wrap;
		gap: 4px;
		justify-content: center;
	}
	.admin-layout .pagination .page-link {
		padding: 8px 12px;
		font-size: 0.85rem;
		border-radius: 8px;
	}
	
	/* === شريط التحديد والإجراءات الجماعية === */
	.admin-layout .d-flex.align-items-center.justify-content-between.mb-2 {
		flex-wrap: wrap;
		gap: 10px;
	}
}
	.admin-layout .filter-panel .input-group {
		width: 100%;
	}
	/* ترقيم الصفحات */
	.admin-layout .pagination {
		flex-wrap: wrap;
		gap: 4px;
	}
	.admin-layout .pagination .page-link {
		padding: 6px 10px;
		font-size: 0.8rem;
	}
}

/* New theme variables and components (applied to match provided design) */
html, body {
	margin: 0;
	padding: 0;
}
:root{
	/* primary color replaced with #360d94 per request (remove previous purple) */
	--primary: #360d94;
	--primary-strong: #441fab; /* hover shade */
  --bg: #F6F7FB;
  --card-bg: #FFFFFF;
  --border: #E6E9F0;
  --text-muted: #6B6F76;
  --danger: #E55353;
  --success: #37B24D;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(16,24,40,0.06);
}

/* Typography variables and scale are defined in `assets/css/vars.css`.
   This file references those tokens via `var(--...)` so avoid duplicating
   the token definitions here to keep a single source-of-truth. */

/* -----------------------------
   Visual hierarchy overrides (values extracted from ai_studio_code.html)
   ----------------------------- */
/* Header / Navbar */
.navbar .navbar-brand, .site-logo, .brand-title, .header .site-title {
	font-size: 18px;
	font-weight: 700; /* Bold */
}
.lang-toggle, .btn-lang, .header .lang-btn {
	font-size: 14px;
	font-weight: 500; /* Medium */
}

/* Hero section (dark background, white text) - uses design tokens */
.hero {
	background: #360d94; /* اللون الأصلي للهيرو */
	color: #fff;
}
.hero h1, .hero .hero-title {
	font-size: var(--font-size-hero-title);
	font-weight: var(--fw-bold);
	color: #fff;
}
.hero .hero-subtitle, .hero p.lead {
	font-size: var(--font-size-hero-subtitle);
	font-weight: var(--fw-semi);
	color: #fff;
}
.hero .stat-number {
	font-size: var(--font-size-stat-number);
	font-weight: var(--fw-bold);
	color: #fff;
}
.hero .stat-label {
	font-size: var(--font-size-stat-label);
	font-weight: var(--fw-regular);
	color: #fff;
}
.btn-join {
	font-size: var(--font-size-btn);
	font-weight: var(--fw-semi);
}

.filter-box label.form-label, .filter-panel label, .filter-box .form-label {
	font-size: 16px; /* updated per request */
	font-weight: 400; /* updated per request */
}
.filter-box .form-control, .filter-panel .form-control, .results-search .search-input, .form-select {
	font-size: 14px;
	font-weight: 400;
}
.filter-box .btn, .filter-panel .btn, .btn-search, .btn-reset {
	font-size: 14px;
	font-weight: 500;
	font-family: var(--font-family);
}

/* أزرار التصفية غير النشطة: أبيض وكتابة رمادية غامقة */
.filter-panel .btn {
	background: #fff;
	color: #555;
	border: 1px solid var(--primary);
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* الزر النشط: أزرق غامق وكتابة بيضاء */
.filter-panel .btn.active {
	background: var(--primary-strong);
	color: #fff;
	border-color: var(--primary-strong);
}

/* عند مرور الماوس على زر غير نشط: يتحول للأزرق وكتابة بيضاء */
.filter-panel .btn:not(.active):hover,
.filter-panel .btn:not(.active):focus {
	background: var(--primary);
	color: #fff;
	border-color: var(--primary);
}
}

/* List / Files area (extracted) */
.list-title, .files-section .section-title, .files-section h2, .results-right .results-title {
	font-size: var(--font-size-h3);
	font-weight: var(--fw-bold);
}
.badge-count, .files-section .badge, .files-section .results-count-badge, .files-section .badge-counter {
	font-size: var(--font-size-badge);
	font-weight: var(--fw-bold);
}
.file-icon {
	font-size: var(--font-size-file-icon);
}
.file-name {
	font-size: var(--font-size-file-name) !important;
	font-family: 'Noto Kufi Arabic', 'Noto Sans Arabic', 'Segoe UI', 'Arial', 'sans-serif' !important;
	font-weight: 600 !important;
}
.tag {
	font-size: var(--font-size-tag); /* requested small size */
	font-weight: var(--fw-tag); /* Medium as requested */
	padding: 4px 8px; /* balanced padding for readability */
	border-radius: 6px;
}
.meta-info {
	font-size: var(--font-size-badge);
	font-weight: var(--fw-regular);
}
.btn-download {
	font-size: var(--font-size-13);
	font-weight: var(--fw-semi);
}

/* Footer */
.footer {
	font-size: 13px;
	font-weight: 400;
	background: #360d94; /* نفس لون الهيرو */
	color: #fff;
	/* زيادة ارتفاع الفوتر حتى يمتد للأسفل بشكل أوضح */
	padding-top: 24px;
	padding-bottom: 72px;
}

/* روابط الفوتر باللون الأبيض مع ظل خفيف عند المرور */
.footer a {
	color: #ffffff;
}
.footer a:hover,
.footer a:focus {
	color: #f5f5f5;
	text-decoration: underline;
}

/* Small helpers to ensure headings keep good line-height */
h1, h2, h3, h4, h5, h6 {
	letter-spacing: normal;
}

/* Tags / badges */
.badge, .tag, .badge-library, .badge-not {
	font-size: var(--font-size-tag);
	font-weight: var(--fw-tag);
	border-radius: 999px;
	padding: 4px 8px;
}

/* Buttons */
.btn { font-size: var(--font-size-btn); font-weight: var(--fw-semi); }

/* زر البحث: يظهر دائماً، رمادي عند التعطيل، أزرق عند التفعيل، أزرق غامق عند المرور */
#searchBtn {
	font-family: var(--font-family);
	background: #e0e0e0;
	color: #555;
	border: 1px solid #ccc;
	cursor: not-allowed;
	pointer-events: none;
	opacity: 1;
}
#searchBtn:not([disabled]) {
	background: var(--primary);
	color: #fff;
	border: 1px solid var(--primary);
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.2s, border-color 0.2s;
}
#searchBtn:not([disabled]):hover, #searchBtn:not([disabled]):focus {
	background: var(--primary-strong);
	color: #fff;
	border-color: var(--primary-strong);
}

/* Disabled buttons: remain visible but clearly inactive
   Keep background and text visible, reduce opacity and prevent pointer events. */
.btn[disabled], .btn.disabled, .brand-bg[disabled], .brand-bg.disabled {
	opacity: 0.65;
	cursor: not-allowed;
	pointer-events: none;
	display: inline-block; /* ensure not hidden */
	color: #fff !important; /* keep readable text for brand buttons */
}

/* Inputs and selects */
input, textarea, select, .form-control {
	font-size: var(--font-size-input);
	font-weight: var(--fw-regular);
}

/* Footer text */
.footer { font-size: var(--font-size-footer); font-weight: var(--fw-regular); }

/* Utility: readable px ↔ rem mapping (for quick reference)
	 12px = 0.75rem | 14px = 0.875rem | 16px = 1rem | 18px = 1.125rem
	 20px = 1.25rem | 24px = 1.5rem | 28px ≈ 1.75rem | 32px = 2rem
*/

/* Fonts: local fallbacks and webfonts
   - Local optional: Droid Arabic Kufi (woff2 in `assets/fonts/`)
   - Primary webfont: Noto Kufi Arabic (wght 300..700)
   - Latin UI: Poppins (wght 300..700)
*/

@font-face {
	font-family: 'Droid Arabic Kufi';
	src: url('../fonts/DroidArabicKufi-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Droid Arabic Kufi';
	src: url('../fonts/DroidArabicKufi-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* Noto Kufi Arabic — use gstatic woff2 assets for weights 300,400,500,600,700 */
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://fonts.gstatic.com/s/notokufiarabic/v27/CSRk4ydQnPyaDxEXLFF6LZVLKrodrOYFFlKp.woff2) format('woff2'); }
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/notokufiarabic/v27/CSRk4ydQnPyaDxEXLFF6LZVLKrodrOYFFlKp.woff2) format('woff2'); }
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/notokufiarabic/v27/CSRk4ydQnPyaDxEXLFF6LZVLKrodrOYFFlKp.woff2) format('woff2'); }
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://fonts.gstatic.com/s/notokufiarabic/v27/CSRk4ydQnPyaDxEXLFF6LZVLKrodrOYFFlKp.woff2) format('woff2'); }
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/notokufiarabic/v27/CSRk4ydQnPyaDxEXLFF6LZVLKrodrOYFFlKp.woff2) format('woff2'); }

/* Poppins (latin) weights */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLDz8Z11lFc-K.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiEyp8kv8JHgFVrJJbecmNE.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLGT9Z11lFc-K.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLEj6Z11lFc-K.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLCz7Z11lFc-K.woff2) format('woff2'); }

/* Prefer the same families as the reference site */
/* Prefer central design token for UI text so the loaded font is used consistently */
body, .page-title, .admin-sidebar, .filter-panel, .file-list, .library-table {
	font-family: var(--font-family);
}

/* Brand utility classes to centralize primary color usage */
.brand-bg {
	background: var(--primary);
	color: #fff;
}
.btn-download {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 12px 20px;
    display: inline-block;
    text-decoration: none;
    touch-action: manipulation;
}
.btn-download:hover {
    background: var(--primary-strong);
    color: #fff;
}
/* Active state for better feedback on touch devices */
.btn-download:active { transform: scale(0.98); box-shadow: 0 0 0 3px rgba(54,13,148,0.08) inset; }
 .admin-sidebar.brand-bg {
	background: var(--primary);
	color: #fff;
}

html{ background:var(--primary); }
body{ background:var(--bg); color: #111; overflow-x: hidden; }

.card, .file-card, .file-list { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }

.btn-primary, .btn-success { border-radius:8px; padding:10px 16px; font-weight:600; }
.btn-primary { background:var(--primary); color:#fff; border:1px solid var(--primary); }
.btn-primary:hover { background:var(--primary-strong); border-color:var(--primary-strong); }
.btn-success { background:var(--success); color:#fff; border:1px solid var(--success); }

.input, select, .form-control { background:#fff; border:1px solid var(--border); border-radius:8px; padding:8px 12px; }
.input:focus, .form-control:focus { border-color:var(--primary); box-shadow:0 0 0 4px rgba(54,13,148,0.06); }

.badge-library{ background:#E6F5E9; color:#2D7A3B; padding:4px 8px; border-radius:8px; }
.badge-not{ background:#FFF7E6; color:#B07C00; padding:4px 8px; border-radius:8px; }

.file-row { padding:16px 20px; margin-bottom:12px; border-radius:12px; border:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.file-icon { width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; background:#FFF0F2; color:#E55353; }

/* Responsive tweaks for small screens */
@media (max-width: 576px) {
  .results-header { flex-direction: column; gap: 8px; align-items: stretch !important; }
  .results-right, .results-left { width: 100%; justify-content: space-between; }
  .file-card { flex-direction: column; align-items: stretch !important; gap: 10px; }
  .file-card > .me-3 { margin-inline-end: 0 !important; width: 52px; height: 52px; border-radius: 10px; }
  .file-card .fw-bold { font-size: 1rem !important; }
  .file-card .badge { font-size: 12px; }
  .file-card .text-muted { font-size: 0.9rem; }
  .file-card .btn-download { width: 100%; padding: 14px 18px; border-radius: 12px; }
  .filter-box .row > .col, .filter-box .row > .col-auto { flex: 0 0 100%; max-width: 100%; }
  #searchBtn, .btn.btn-light { width: 100%; margin-top: 6px; }
  .hero .btn-join-fb, .hero .btn-join.brand-bg, .hero .btn-join-size { width: 135px; height: 41px; }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
  .file-card .btn-download { padding: 12px 16px; }
}

.search-box { background: #fff; border-radius: 10px; padding: 10px; border:1px solid var(--border); }

/* small helpers */
.ml-2{ margin-left:8px; }
.me-2{ margin-inline-end:8px; }
.ms-2{ margin-inline-start:8px; }

/* Ensure icons inside buttons are visually consistent and not oversized */
.btn .fa, .btn i.fas, .btn i.far, .btn i.fab { font-size: 0.95rem; vertical-align: middle; }

/* Generic icon helper: use this class on any <i> or inline icon to get consistent sizing/alignment
   Note: avoid forcing `.fa` globally so large decorative icons (e.g. file cards) inherit container size. */
.icon {
	font-size: 0.95rem;
	vertical-align: middle;
	display: inline-block;
	line-height: 1;
}

/* Ensure WhatsApp icon inside the hero/CTA button is visually larger to fit the button frame */
.btn-join .fa-whatsapp, .btn-join .fa-brands.fa-whatsapp {
	font-size: 1.25rem;
	vertical-align: middle;
	margin-inline-end: 0.5rem;
}

/* Specific small circular add button used in admin lists */
.btn-add-circle {
	/* Match size/feel of other small action buttons in library */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 3px 8px;
	border-radius: 8px;
	background: var(--success);
	color: #fff;
	border: none;
	box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.btn-add-circle .fa { font-size: 1rem; }
.btn-add-circle:focus { box-shadow: 0 0 0 4px rgba(56,179,84,0.12); }

/* Join group (text + two icon buttons) */
.join-btn-group { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
.join-icons { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; margin-top:2px; }
.join-text { font-weight: 700; font-size: 1rem; line-height: 1.25; color: #fff; }
.join-icon { width:41px; height:41px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; border:1px solid currentColor; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s; line-height:1; }
.join-icon i { font-size: 1.25rem; }
.join-icon:focus-visible { outline: 3px solid rgba(0,0,0,0.18); outline-offset: 2px; }
.join-icon-fb { background:#fff; color:#1877F2; border-color:#1877F2; }
.join-icon-fb:hover, .join-icon-fb:focus { background:#1877F2; color:#fff; border-color:#1877F2; }
.join-icon-fb:active { transform: scale(0.95); box-shadow: 0 0 0 3px rgba(24,119,242,0.12) inset; }
.join-icon-wa { background:#25D366; color:#fff; border-color:#25D366; }
.join-icon-wa:hover, .join-icon-wa:focus { background:#1EBE59; color:#fff; border-color:#1EBE59; }
.join-icon-wa:active { transform: scale(0.95); box-shadow: 0 0 0 3px rgba(55,178,77,0.12) inset; }

/* required star beside labels */
.required-star { font-size:1.05rem; color: var(--danger); margin-inline-start:6px; }

/* Results frame and header */
.results-frame { background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(16,24,40,0.06); border: 1px solid var(--border); }
.results-header { padding: 6px 8px; }
.results-header .results-actions { font-weight: 600; color: #222; }
.results-header .results-count { font-size: 0.95rem; color: var(--text-muted); }
.results-body { padding-top: 6px; }

/* Small search box inside results header */
.results-search .search-box {
	border: 1px solid var(--border);
	background: #fff;
	padding: 6px 8px;
	border-radius: 8px;
	color: #333;
	font-size: 0.98rem;
	cursor: text;
}
.results-search .search-box i { font-size: 1.05rem; color: #6b6f76; margin-inline-end:8px; }
.results-search .search-box:focus, .results-search .search-box:hover { box-shadow: 0 4px 12px rgba(16,24,40,0.06); }

/* Suppress the browser's default blue focus/outline on the download button inside result cards
	 while keeping a subtle accessible focus-visible ring for keyboard users. */
.file-card .btn {
	box-shadow: none;
	outline: none;
}
.file-card .btn:hover {
	box-shadow: none;
}
.file-card .btn:focus {
	box-shadow: none;
	outline: none;
}
.file-card .btn:focus-visible {
	/* use #360d94 -> rgb(54,13,148) for the button focus ring to match card color */
	box-shadow: 0 0 0 4px rgba(54,13,148,0.12);
	outline: none;
}

/* the actual input inside the small search */
.results-search .search-input { border: none; padding: 0; box-shadow: none; min-width: 220px; background: transparent; font-size: 0.98rem; font-weight: 400; }
.results-search .search-input:focus { outline: none; }

/* When the input contains Latin characters, force LTR and left-align */
.results-search .search-input.ltr-input {
	direction: ltr;
	text-align: left;
}

/* Results right header: title styling */
.results-right .results-title {
	font-size: 1.35rem;
	font-weight: 600;
	color: #000; /* make header title black */
	margin-inline-start: 12px;
}
.results-right { gap: 10px; }
.results-right .results-count { margin: 0; }

/* Ensure main content leaves room for header + footer to avoid unnecessary vertical scrollbar */
main.flex-grow-1 { min-height: calc(100vh - 120px); }

/* Page heading consistency */
.container-fluid > h2, .page-header h2, .d-flex h2.mb-0 {
	margin-bottom: 0.75rem;
}

/* Unified page title used in admin pages to ensure identical typography */
.page-title {
	font-family: var(--font-family);
	font-size: 1.35rem; /* consistent size for both pages */
	font-weight: 600;   /* lighten page title for better balance */
	color: #111;
	margin-bottom: 0.75rem;
}

/* File name display: force LTR and monospace so filenames read naturally */
.file-name {
	/* تمت إزالة فرض خطوط monospace هنا لضمان تطبيق الخطوط العربية واللاتينية المحددة فقط */
}

/* Force the same Latin (monospace) font for filenames in both pages so
   Latin characters render identically in 'الملفات المرفوعة' and 'الملفات المنشورة'. */
.file-list .file-name, .library-table .file-name {
	/* تمت إزالة فرض خطوط monospace هنا لضمان تطبيق الخطوط العربية واللاتينية المحددة فقط */
}

/* Ensure file name inside table cells doesn't overflow table layout */
.table .file-name { display: block !important; width:100% !important; max-width:100% !important; }

/* Strong override: ensure filename element occupies full cell width and is left-aligned LTR */
.table td .file-name,
.library-table td .file-name {
	display: block !important;
	width: 100% !important;
	text-align: left !important;
	direction: ltr !important;
	unicode-bidi: plaintext !important;
	margin: 0; padding: 0;
}

/* Target the second column (اسم الملف) in tables: header centered, cells left-aligned LTR.
   Keeps other columns (size, status, commands, ...) centered. */
.table thead th:nth-child(2), .library-table thead th:nth-child(2) {
	text-align: center !important;
	direction: ltr !important;
	unicode-bidi: plaintext !important;
	padding-right: 1rem !important;
}
.table td:nth-child(2), .library-table td:nth-child(2) {
	text-align: left !important;
	direction: ltr !important;
	unicode-bidi: plaintext !important;
	padding-right: 1rem !important;
}

/* Unified, compact table header styling for file-list and library tables
   Ensures headers in 'الملفات المرفوعة' and 'الملفات المنشورة' match exactly */
.file-list .table thead th, .library-table thead th {
	background: #f3f3fa !important; /* light lilac used elsewhere for consistency */
	color: #360d94 !important;      /* primary dark purple */
	font-size: 0.95rem !important;  /* slightly smaller than body for compactness */
	font-weight: 700 !important;    /* bold headers */
	padding: 8px 12px !important;   /* reduce vertical height */
	vertical-align: middle !important;
	border-bottom: 2px solid rgba(0,0,0,0.04) !important;
}

/* Reduce the surrounding container padding so header appears tighter but preserve spacing for rows */
.file-list.p-2 { padding: 0.6rem; }

	/* Center table headers by default; second-column header remains left due to specific rule above */

	/* Library table headers: align per-column to match cell alignment
		 1: serial (center), 2: filename (left), 3+ : other columns (center) */
	.library-table thead th:nth-child(1) { text-align: center !important; }
	.library-table thead th:nth-child(2) { text-align: center !important; direction: ltr !important; }
	.library-table thead th:nth-child(n+3) { text-align: center !important; }

/* Ensure the other library columns (size, pathway, stage, week, segment, branch, date, actions)
	 remain centered. Targets columns 3 through 10 in library tables. */
.library-table th:nth-child(n+3), .library-table td:nth-child(n+3) {
	text-align: center !important;
}

/* Strong fallback: force all library table cells to center except the filename column (2)
	 This overrides any other selectors or inline direction quirks. */
.library-table th:not(:nth-child(2)), .library-table td:not(:nth-child(2)) {
	text-align: center !important;
}

/* Center the serial/row-number column (first column) in all tables */
.table th:nth-child(1), .table td:nth-child(1), .library-table th:nth-child(1), .library-table td:nth-child(1) {
	text-align: center !important;
}

/* Ensure the numbering (serial) column has identical presentation across both
   the uploaded files and published library tables: fixed width, padding and
   font-size so numbers align and headers match. */
.file-list table th:nth-child(1), .library-table thead th:nth-child(1) {
	width: 44px !important;
	max-width: 44px !important;
	padding: 6px 6px !important;
	font-size: 0.95rem !important;
	font-weight: 700 !important;
	text-align: center !important;
}
.file-list table td:nth-child(1), .library-table td:nth-child(1) {
	width: 44px !important;
	max-width: 44px !important;
	padding: 6px 6px !important;
	font-size: 0.95rem !important;
	vertical-align: middle !important;
	text-align: center !important;
}

/* Force a persistent vertical scrollbar to keep page layout stable across pages
   (ensures content alignment doesn't shift between pages that do/don't need scrolling). */
html { overflow-y: scroll; }

/* Ensure action buttons inside tables match the same small size and padding
   used for other action buttons (download/delete). This overrides broader
   `.btn-success` padding elsewhere which was causing the add buttons to appear larger. */
.table .btn-sm,
.library-table .btn-sm,
.file-list table .btn-sm {
	padding: 4px 8px !important;
	font-size: 0.95rem !important;
	line-height: 1 !important;
	height: auto !important;
	min-width: 36px !important;
	border-radius: 6px !important;
}

/* Ensure icon inside these small buttons is centered and not oversized */
.table .btn-sm i.fa, .table .btn-sm .fa {
	font-size: 0.95rem !important;
	vertical-align: middle !important;
}

/* Header action buttons inside .file-list: make them match the small size used
   for action buttons in tables so header controls don't look oversized. */
.file-list .btn {
	padding: 4px 8px;
	font-size: 0.95rem;
	border-radius: 6px;
	height: auto;
	min-width: 36px;
}

.file-list .btn .fa { font-size: 0.95rem; }

/* Ensure buttons inside file-list / panels / upload forms remain readable
   when their background becomes light (e.g. white) on hover/focus. */
.file-list .btn:hover, .file-list .btn:focus,
.panel-card .btn:hover, .panel-card .btn:focus,
.page-card-form .btn:hover, .page-card-form .btn:focus,
.filter-panel .btn:hover, .filter-panel .btn:focus {
	/* تم حذف هذه القاعدة لتفعيل لون الكتابة الأبيض عند المرور كما هو مطلوب */
}

/* Unified panel/card helpers used by upload & edit pages */
.panel-card { border:1px solid var(--border); padding:16px; border-radius:var(--radius); background:var(--card-bg); box-shadow:var(--shadow); }
.page-card-form { width:100%; max-width:959px; margin-left:auto; margin-right:auto; }
.settings-card.page-card-form { max-width: 1200px; margin-left:auto; margin-right:0; }
.seo-card.page-card-form { max-width: 1200px; margin-left:auto; margin-right:0; }
@media (max-width: 1200px) {
  .seo-card.page-card-form { max-width: 100%; margin-left:auto; margin-right:auto; }
}
@media (max-width: 1200px) {
  .settings-card.page-card-form { max-width: 100%; margin-left:auto; margin-right:auto; }
  .seo-card.page-card-form { max-width: 100%; margin-left:auto; margin-right:auto; }
}
@media (max-width: 768px) {
  .settings-card.page-card-form { max-width: 100%; margin-left:auto; margin-right:auto; }
  .seo-card.page-card-form { max-width: 100%; margin-left:auto; margin-right:auto; }
}
.card-title { font-size:1.125rem; margin-bottom:0.5rem; font-weight:600; color:#111; }
.card-subtext { color:var(--text-muted); margin-bottom:0.75rem; }

/* Slight spacing tweak to keep top headings consistent between pages */
.page-heading { margin-top: 0.25rem; margin-bottom: 1rem; font-size:1.35rem; font-weight:700; color:#111; text-align:center; }
/* Filter panel styles */
.filter-panel { padding: 0.6rem; border: 1px solid var(--border); background: var(--card-bg); border-radius: 10px; }
.filter-panel .btn-group .btn { min-width: 110px; }
.filter-panel .filter-search { min-width: 200px; }
.filter-panel .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* حالة زر التصفية النشط عند المرور/التركيز */
	/* ...أزل جميع القواعد الجديدة الخاصة بالخلفية والنص للأزرار غير النشطة والمعطلة... */

/* small results meta: count and spinner */
.results-meta { display:inline-flex; align-items:center; gap:8px; }
.filter-count { font-size:0.95rem; color:var(--text-muted); }
.filter-spinner { width:18px; height:18px; border:2px solid rgba(0,0,0,0.08); border-top-color:var(--primary); border-radius:50%; display:inline-block; animation:spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Hero final override (pixel-exact and spacing fixes) ===
   Place at end to ensure specificity and prevent earlier rules
   from making headings look visually "compressed". */
.hero h1 {
	font-size: 32px; /* increased per request */
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.02em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	margin: 0 0 18px 0; /* slightly larger gap below title */
}
.hero p, .hero .hero-subtitle, .hero p.lead {
	font-size: 18px;
	font-weight: 400;
	line-height: 1.8; /* more breathing room */
	letter-spacing: normal;
	margin: 0 0 20px 0; /* create space between subtitle and stats */
}

/* Add explicit spacing between subtitle and the stats row inside hero */
.hero > .row {
	margin-top: 8px;
}

/* Ensure stats inside hero have clear vertical spacing and readable size */
.hero .stat { padding: 6px 0; }
.hero .stat-value, .hero .stat-number {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.hero .stat-title, .hero .stat-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  margin: 0;
}

/* Scale the icon inside the hero heading to match the larger title */
.hero h1 .fa, .hero h1 i {
	font-size: 1.25em; /* ~40px when h1 is 32px */
	vertical-align: middle;
	margin-inline-end: 0.6rem;
}



.btn-join-fb {
    background: #fff !important;
    color: #1877F2 !important; /* Facebook blue */
    border: 1px solid #1877F2 !important;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-join-fb:hover, .btn-join-fb:focus {
    background: #1877F2 !important;
    color: #fff !important;
    border-color: #1877F2 !important;
}
.btn-join-fb:active { transform: scale(0.98); box-shadow: 0 0 0 3px rgba(24,119,242,0.08) inset; }
/* Unified fixed size for join buttons */
.btn-join-size {
    width: 135px;
    height: 41px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 600;
}

/* Match active feedback for WhatsApp join */
.btn-join.brand-bg:active { transform: scale(0.98); box-shadow: 0 0 0 3px rgba(55,178,77,0.12) inset; }

/* Share dropdown icons */
.share-menu {
    min-width: auto !important;
    padding: 6px 8px !important;
    display: none;
    gap: 6px;
    flex-direction: row;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    background: #fff;
}
.share-menu.show {
    display: flex !important;
}
.share-menu .dropdown-item {
    padding: 0 !important;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.share-menu .dropdown-item:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.share-menu .share-facebook {
    background: #1877f2;
    color: #fff !important;
}
.share-menu .share-facebook:hover {
    background: #0d65d9;
}
.share-menu .share-whatsapp {
    background: #25d366;
    color: #fff !important;
}
.share-menu .share-whatsapp:hover {
    background: #1ebe5d;
}

/* Share toggle button */
.share-toggle {
    border-radius: 8px;
    transition: background 0.2s, transform 0.15s;
}
.share-toggle:hover {
    background: #e9ecef;
}
.share-toggle:active {
    transform: scale(0.95);
}
