/* بسم الله الرحمن الرحيم */
/* ======================================================================== */
/* ملف الأنماط الرئيسي لسجل حزم لغة ص                                       */
/* Main Stylesheet for Sad Language Package Registry                        */
/* ======================================================================== */
/*                                                                          */
/* هذا الملف يحتوي على جميع أنماط CSS لواجهة الويب العربية.                 */
/* التصميم يعتمد على:                                                       */
/*   - نظام ألوان داكن (Dark Theme) مريح للأعين                             */
/*   - نظام CSS Custom Properties (المتغيرات) للتخصيص السهل                */
/*   - خط Noto Kufi Arabic لعرض النص العربي بشكل جميل                      */
/*   - تصميم متجاوب (Responsive) يعمل على كل الشاشات                       */
/*   - دعم كامل لاتجاه RTL (من اليمين لليسار) للغة العربية                 */
/*                                                                          */
/* البنية:                                                                   */
/*   1. المتغيرات (Custom Properties) — الألوان والخطوط والمسافات           */
/*   2. الأساس (Base) — إعدادات عامة للعناصر                                */
/*   3. شريط التنقل (Navbar) — ثابت في الأعلى مع بحث مدمج                  */
/*   4. البطل (Hero) — قسم الترحيب في الصفحة الرئيسية                       */
/*   5. شبكة الحزم (Packages Grid) — بطاقات الحزم الشعبية                   */
/*   6. قائمة الحزم (Package List) — عرض أفقي للنتائج                       */
/*   7. التصنيفات (Categories) — شبكة بطاقات التصنيفات                      */
/*   8. تفاصيل الحزمة (Package Detail) — صفحة العرض الكامل                  */
/*   9. البدء السريع (Getting Started) — خطوات 1-2-3                        */
/*  10. المكونات (Components) — أزرار، شارات، حالات فارغة                   */
/*  11. التذييل (Footer) — روابط وحقوق النشر                                */
/*  12. الاستجابة (Responsive) — تكييف الشاشات الصغيرة                      */
/* ======================================================================== */

/* ======================================================================== */
/* 1. المتغيرات / Custom Properties                                         */
/* ======================================================================== */
/* نظام ألوان مركزي — تغيير لون واحد هنا يؤثر على كل الموقع               */
/* Centralized color system — changing one color here affects the whole site */
/* ======================================================================== */

:root {
    /* ------------------------------------------------------------------ */
    /* الألوان الأساسية — مستوحاة من Tailwind CSS Slate + Blue             */
    /* Primary Colors — inspired by Tailwind CSS Slate + Blue               */
    /* ------------------------------------------------------------------ */
    --primary: #2563eb;
    /* الأزرق الأساسي — للأزرار والروابط */
    --primary-dark: #1d4ed8;
    /* أزرق داكن — للحالة المضغوطة (hover) */
    --primary-light: #3b82f6;
    /* أزرق فاتح — لأسماء الحزم والروابط */
    --accent: #f59e0b;
    /* الذهبي — للعناصر البارزة (حرف ص، الإحصائيات) */
    --accent-dark: #d97706;
    /* ذهبي داكن — hover على العناصر المميزة */
    --success: #10b981;
    /* أخضر — لأوامر التثبيت والحالات الناجحة */
    --danger: #ef4444;
    /* أحمر — للأخطاء والإصدارات المسحوبة */
    --warning: #f59e0b;
    /* برتقالي — للتحذيرات */

    /* ------------------------------------------------------------------ */
    /* ألوان الخلفية — متدرجة من الأغمق للأفتح                            */
    /* Background Colors — gradient from darkest to lightest                */
    /* ------------------------------------------------------------------ */
    --bg: #0f172a;
    /* خلفية الصفحة الرئيسية (Slate 900) */
    --bg-card: #1e293b;
    /* خلفية البطاقات والأقسام (Slate 800) */
    --bg-card-hover: #334155;
    /* خلفية البطاقة عند التمرير (Slate 700) */
    --bg-alt: #162032;
    /* خلفية الأقسام المتبادلة (بين bg و bg-card) */
    --bg-input: #0f172a;
    /* خلفية حقول الإدخال */

    /* ------------------------------------------------------------------ */
    /* ألوان النص — ثلاث مستويات من السطوع                                */
    /* Text Colors — three brightness levels                               */
    /* ------------------------------------------------------------------ */
    --text: #e2e8f0;
    /* نص عادي (Slate 200) */
    --text-muted: #94a3b8;
    /* نص ثانوي/خافت (Slate 400) */
    --text-bright: #f8fafc;
    /* نص ساطع — للعناوين (Slate 50) */

    /* ------------------------------------------------------------------ */
    /* الحدود والظلال — لتحديد البطاقات والأقسام                          */
    /* Borders & Shadows — for card/section delineation                    */
    /* ------------------------------------------------------------------ */
    --border: #334155;
    /* حد عادي */
    --border-light: #475569;
    /* حد فاتح — للتمييز */

    --radius: 12px;
    /* انحناء البطاقات الكبيرة */
    --radius-sm: 8px;
    /* انحناء الأزرار والحقول */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    /* ظل عادي */
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    /* ظل كبير — للبطاقات المرفوعة */

    /* ------------------------------------------------------------------ */
    /* الخطوط — خط عربي كوفي + خط أحادي العرض للكود                       */
    /* Fonts — Arabic Kufi + Monospace for code                            */
    /* ------------------------------------------------------------------ */
    --font-ar: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ======================================================================== */
/* 2. الأساس / Base Styles                                                  */
/* ======================================================================== */
/* إعدادات أساسية: box-sizing, إعادة تعيين الهوامش, الخط العام              */
/* لاحظ: لا نحتاج إعادة تعيين direction لأن HTML يحدد dir="rtl"            */
/* ======================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ar);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

code {
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    direction: ltr;
    unicode-bidi: isolate;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ======================================================================== */
/* 3. شريط التنقل / Navigation Bar                                          */
/* ======================================================================== */
/* شريط ثابت (sticky) في أعلى الصفحة يحتوي على:                            */
/*   - الشعار (📦 حزم ص): ينقل للصفحة الرئيسية                             */
/*   - حقل بحث سريع مدمج (يتمدد ليملأ المساحة المتاحة)                    */
/*   - روابط تنقل (تصفح + API)                                             */
/* يستخدم backdrop-filter لتأثير الزجاج الشفاف عند التمرير                  */
/* ======================================================================== */

.navbar {
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-bright);
    font-size: 1.2rem;
    white-space: nowrap;
    text-decoration: none;
}

.logo:hover {
    color: var(--text-bright);
}

.logo:hover .logo-badge {
    transform: scale(1.1);
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent) 0%, #e67e22 100%);
    color: #000;
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: transform 0.2s;
}

.logo-text {
    font-weight: 700;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--text-bright) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-search {
    flex: 1;
    max-width: 500px;
}

.nav-search form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-ar);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.search-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ar);
    font-weight: 500;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    white-space: nowrap;
}

.nav-link {
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.06);
}

/* ======================================================================== */
/* 4. قسم البطل / Hero Section                                              */
/* ======================================================================== */
/* القسم الترحيبي في الصفحة الرئيسية — يحتوي على:                          */
/*   - عنوان المستودع (سجل حزم لغة ص)                                      */
/*   - حقل بحث كبير ومركزي                                                  */
/*   - إحصائيات (عدد الحزم/التنزيلات/المطورين)                              */
/*   - أمر التثبيت السريع (sad-pkg install)                                 */
/* الخلفية تدرج لوني من الأزرق الداكن للأسود لإعطاء عمق بصري              */
/* ======================================================================== */

.hero {
    background: linear-gradient(135deg, var(--bg) 0%, #1a1a4e 40%, #0c2340 80%, var(--bg) 100%);
    padding: 5rem 0 4rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
}

.hero-brand {
    background: linear-gradient(135deg, var(--accent) 0%, #f97316 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 4rem;
}

.accent {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto 2rem;
    gap: 0.5rem;
}

.hero-search-input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-ar);
    font-size: 1.1rem;
}

.hero-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.hero-search-btn {
    padding: 0.85rem 1.5rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.hero-search-btn:hover {
    background: var(--accent-dark);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.hero-install {
    display: inline-block;
}

.install-code {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--success);
    cursor: pointer;
    transition: background 0.2s;
}

.install-code:hover {
    background: rgba(16, 185, 129, 0.18);
}

/* ======================================================================== */
/* 5. الأقسام العامة / Sections                                             */
/* ======================================================================== */
/* كل قسم (section) يحتوي على عنوان ومحتوى                                 */
/* section-alt يستخدم لوناً بديلاً لكسر الرتابة البصرية                    */
/* ======================================================================== */

.section {
    padding: 3.5rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 1.75rem;
    color: var(--text-bright);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ======================================================================== */
/* 6. شبكة الحزم / Packages Grid                                            */
/* ======================================================================== */
/* شبكة CSS Grid مع auto-fill: تتكيف تلقائياً مع عدد الأعمدة               */
/* الحد الأدنى لعرض البطاقة 320px — أي على شاشة 1200px تظهر 3 أعمدة       */
/* كل بطاقة تحتوي: اسم الحزمة + الإصدار + الوصف + إحصائيات                */
/* عند التمرير (hover): ارتفاع 2px + ظل + حد أزرق                         */
/* ======================================================================== */

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.package-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.25s ease;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.package-card:hover::before {
    transform: scaleX(1);
}

.package-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--text);
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.package-name {
    font-size: 1.1rem;
    color: var(--primary-light);
    font-weight: 600;
}

.package-version {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.package-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.package-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ======================================================================== */
/* 7. قائمة الحزم / Package List (عرض أفقي)                                */
/* ======================================================================== */
/* يُستخدم في: نتائج البحث + قسم أحدث الحزم                               */
/* كل عنصر يعرض: الاسم | الإصدار | الوصف | التنزيلات | المؤلف | تاغات     */
/* ======================================================================== */

.packages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.package-list-item {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s;
    color: var(--text);
}

.package-list-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    color: var(--text);
}

.package-list-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.package-list-name {
    font-size: 1.15rem;
    color: var(--primary-light);
}

.package-list-version {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.package-list-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.package-list-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ======================================================================== */
/* 8. شبكة التصنيفات / Categories Grid                                      */
/* ======================================================================== */
/* بطاقات صغيرة (150px min) تعرض: أيقونة + اسم عربي + اسم إنجليزي         */
/* عند الضغط: ينقل لصفحة البحث مع تصفية التصنيف                            */
/* ======================================================================== */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
    color: var(--text);
}

.category-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    color: var(--text);
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.category-name-en {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ======================================================================== */
/* 9. أزرار التصفية / Filter Tags                                           */
/* ======================================================================== */
/* أزرار حبوب (pill buttons) لتصفية نتائج البحث حسب التصنيف               */
/* tag-active: الزر المحدد حالياً (خلفية زرقاء + نص أبيض)                  */
/* ======================================================================== */

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.35rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--primary);
    color: var(--text);
}

.tag-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ======================================================================== */
/* 10. تفاصيل الحزمة / Package Detail Page                                  */
/* ======================================================================== */
/* صفحة تعرض كل معلومات حزمة واحدة بتخطيط عمودين:                        */
/*   - العمود الرئيسي (1fr): التبعيات + جدول الإصدارات                     */
/*   - الشريط الجانبي (300px): إحصائيات + معلومات + مالكين + تاغات        */
/* على الشاشات الصغيرة يتحول لعمود واحد                                  */
/* ======================================================================== */

.page-content {
    padding: 2rem 0;
}

.package-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.package-detail-name {
    font-size: 2rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.package-detail-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.package-detail-install {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.install-block {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--success);
    margin-top: 0.5rem;
}

.package-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.deps-section,
.versions-section,
.readme-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.deps-section h3,
.versions-section h3,
.readme-section h3 {
    margin-bottom: 1rem;
}

.deps-list {
    list-style: none;
}

.deps-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.versions-table {
    width: 100%;
    border-collapse: collapse;
}

.versions-table th,
.versions-table td {
    padding: 0.6rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.versions-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.yanked {
    opacity: 0.5;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text-bright);
}

.stats-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
}

.stats-dl dt {
    color: var(--text-muted);
}

.stats-dl dd {
    text-align: left;
}

.owners-list {
    list-style: none;
}

.owners-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.owner-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ======================================================================== */
/* 11. خطوات البدء السريع / Getting Started Steps                           */
/* ======================================================================== */
/* 3 بطاقات متساوية: (١) ثبّت  (٢) أضف  (٣) استخدم                              */
/* كل بطاقة فيها رقم دائري أزرق + عنوان + أمر باللون الذهبي                   */
/* ======================================================================== */

.getting-started {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.step {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step code {
    color: var(--accent);
}

/* ======================================================================== */
/* 12. الأزرار / Buttons                                                    */
/* ======================================================================== */
/* btn-primary: زر أزرق أساسي للإجراءات الرئيسية (بحث، العودة، إلخ)            */
/* btn-sm: زر صغير للإجراءات الثانوية (نسخ، مزيد من التفاصيل)               */
/* ======================================================================== */

.btn-primary {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ar);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

.btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* ======================================================================== */
/* 13. الحالات الفارغة والأخطاء / Empty States & Error Pages               */
/* ======================================================================== */
/* تظهر عندما لا توجد نتائج بحث أو عند خطأ 404/500                           */
/* التصميم: مركزي مع رسالة ودية وأزرار للعودة                            */
/* ======================================================================== */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.error-page p {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
}

.results-count {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.search-form-page {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-input-large {
    flex: 1;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-ar);
    font-size: 1.05rem;
}

.search-input-large:focus {
    outline: none;
    border-color: var(--primary);
}

/* ======================================================================== */
/* 14. التذييل / Footer                                                      */
/* ======================================================================== */
/* شبكة 3 أعمدة من الروابط:                                                  */
/*   عمود 1: لغة ص (رئيسية, تصفح, API)                                       */
/*   عمود 2: المجتمع (GitHub, منتدى, تواصل)                                 */
/*   عمود 3: أدوات (sad-pkg, sad-lsp, VS Code)                             */
/* margin-top: auto يدفع التذييل لأسفل الصفحة حتى إن كان المحتوى قصير*/
/* ======================================================================== */

.footer {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--text-bright);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s, padding-right 0.2s;
}

.footer-col a:hover {
    color: var(--accent);
    padding-right: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ======================================================================== */
/* 15. الاستجابة / Responsive Design                                       */
/* ======================================================================== */
/* نقطة الكسر: 768px (شاشات الجوال والتابلت)                                 */
/* التغييرات:                                                                */
/*   - شريط التنقل: البحث ينتقل لسطر جديد (flex-wrap)                     */
/*   - البطل: عنوان أصغر (2rem بدل 3rem)                                    */
/*   - شبكة الحزم: عمود واحد بدل 3                                        */
/*   - تفاصيل الحزمة: الشريط الجانبي أسفل بدل يمين                      */
/*   - التذييل: عمود واحد بدل 3                                           */
/* ======================================================================== */

@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
    }

    .nav-search {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-brand {
        font-size: 2.8rem;
    }

    .hero-stats {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .stat-card {
        padding: 0.75rem 1rem;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

    .package-detail-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .getting-started {
        grid-template-columns: 1fr 1fr;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* ======================================================================== */
/* 16. تأثيرات حركية / Animations                                            */
/* ======================================================================== */
/* تأثيرات الدخول للبطاقات عند التمرير:                                       */
/*   card-hidden: حالة البداية (شفافة ومنزلقة لأسفل)                       */
/*   card-visible: حالة الظهور (معتمة وفي موضعها الطبيعي)                  */
/*   الانتقال يستخدم CSS transition لأداء GPU-accelerated سلس.             */
/*   نستخدم transform بدل top/margin لأنه لا يسبب layout reflow.           */
/*                                                                          */
/* تأثير النسخ (copied):                                                     */
/*   عند نسخ أمر التثبيت، يظهر وميض أخضر خفيف.                             */
/* ======================================================================== */

/* --- تأثير دخول البطاقات مع التمرير --- */
.card-hidden {
    opacity: 0;
    transform: translateY(20px);
}

.card-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* --- تأثير تأكيد النسخ على أوامر التثبيت --- */
.install-code.copied,
.install-block.copied {
    background: rgba(46, 160, 67, 0.2);
    border-color: #2ea043;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ======================================================================== */
/* 17. تأثيرات إضافية / Additional Effects                                  */
/* ======================================================================== */

/* تأثير دخول تدريجي للعناصر */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    animation: fadeInUp 0.6s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-search {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-stats {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-install {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* تأثير النبض الخفيف على الإحصائيات */
@keyframes subtlePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.stat-number {
    animation: subtlePulse 3s ease-in-out infinite;
}

/* تأثير التركيز على حقل البحث في Hero */
.hero-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

/* اختيار النص */
::selection {
    background: rgba(245, 158, 11, 0.3);
    color: var(--text-bright);
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ======================================================================== */
/* 18. نظام المصادقة / Authentication System                                */
/* ======================================================================== */
/* نافذة تسجيل الدخول/إنشاء الحساب (Modal)                                    */
/* تشمل: الطبقة الشفافة، النافذة المركزية، الحقول، الأزرار، والإشعارات    */
/* ======================================================================== */

/* --- زر تسجيل الدخول في شريط التنقل --- */
.auth-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
    color: var(--bg) !important;
    padding: 0.4rem 1rem !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    white-space: nowrap;
}

.auth-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.auth-btn.logged-in {
    background: linear-gradient(135deg, var(--success), #059669) !important;
    color: #fff !important;
}

.auth-btn.logged-in:hover {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.user-avatar {
    font-size: 1rem;
    margin-left: 0.3rem;
}

/* --- القائمة المنسدلة للمستخدم --- */
.user-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeInUp 0.2s ease-out;
}

.user-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
}

.user-menu-item+.user-menu-item {
    border-top: 1px solid var(--border);
}

/* --- الطبقة الشفافة خلف النافذة --- */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- نافذة المصادقة المركزية --- */
.auth-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.auth-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

/* --- زر إغلاق النافذة (×) --- */
.auth-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-bright);
}

/* --- عنوان النافذة والنص الفرعي --- */
.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- نموذج المصادقة --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* --- حقول الإدخال --- */
.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-bright);
    font-size: 0.95rem;
    font-family: var(--font-ar);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input[dir="ltr"] {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.auth-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.optional-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- تلميحات كلمة المرور --- */
.auth-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    line-height: 1.5;
}

/* --- رسالة الخطأ --- */
.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    animation: fadeInUp 0.2s ease-out;
}

/* --- زر الإرسال --- */
.auth-submit {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* --- دوّارة التحميل --- */
.auth-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--bg);
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

/* --- رابط التبديل بين الدخول والتسجيل --- */
.auth-toggle {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-toggle-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    margin-right: 0.3rem;
    transition: color 0.2s ease;
}

.auth-toggle-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* --- إشعار Toast --- */
.auth-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-bright);
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-family: var(--font-ar);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- استجابة النافذة للجوال --- */
@media (max-width: 768px) {
    .auth-modal {
        padding: 1.5rem;
        width: 95%;
        max-width: 360px;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-btn {
        padding: 0.3rem 0.7rem !important;
        font-size: 0.8rem !important;
    }
}

/* ======================================================================== */
/* 19. صفحة الملف الشخصي / Profile Page                                    */
/* ======================================================================== */

/* --- رأس الملف الشخصي --- */
.profile-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, transparent 100%);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* --- الصورة الرمزية --- */
.profile-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg);
    font-size: 2.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
}

.avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

/* --- بيانات المستخدم --- */
.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.profile-username {
    font-size: 1rem;
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
    direction: ltr;
    text-align: right;
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.profile-joined {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- إحصائيات المستخدم --- */
.profile-stats {
    display: flex;
    gap: 2rem;
}

.profile-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 2rem;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.profile-stat:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.profile-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.profile-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* --- قسم الحزم --- */
.profile-packages {
    padding: 2rem 0 3rem;
}

/* --- الحالة الفارغة --- */
.profile-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.profile-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.profile-empty h3 {
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.profile-empty p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.profile-empty code {
    background: var(--bg-input);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--success);
}

/* --- زر أساسي --- */
.btn-primary {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-ar);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

/* --- قسم رموز API --- */
.profile-tokens {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border);
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.token-actions {
    margin-bottom: 1rem;
}

.token-result {
    margin-top: 1rem;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    direction: ltr;
}

.token-display code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--success);
    word-break: break-all;
}

.token-copy {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-ar);
    transition: background 0.2s ease;
}

.token-copy:hover {
    background: var(--primary-dark);
}

.token-warning {
    color: var(--warning);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* --- استجابة الملف الشخصي للجوال --- */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-username {
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .avatar-placeholder,
    .avatar-img {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .token-display {
        flex-direction: column;
    }
}

/* ======================================================================== */
/* 20. لوحة تحكم المشرف / Admin Dashboard                                   */
/* ======================================================================== */

.admin-page {
    padding: 2rem 0 3rem;
}

.admin-header {
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.admin-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- بطاقات الإحصائيات --- */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.admin-stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.admin-stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}

.admin-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- ألسنة التبويب --- */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.admin-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-ar);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-bright);
}

.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

/* --- جدول البيانات --- */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.85rem 1rem;
    text-align: right;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.loading-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
}

.admin-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

.admin-sub {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* --- شارات الحالة --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.badge-admin {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.badge-muted {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

/* --- أزرار الإجراءات --- */
.actions-cell {
    white-space: nowrap;
}

.action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-left: 0.3rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-light);
}

.action-btn.action-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* --- صفحة رفض الوصول --- */
.access-denied {
    text-align: center;
    padding: 4rem 1rem;
}

.access-denied h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.access-denied p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.access-denied a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.access-denied a:hover {
    text-decoration: underline;
}

/* --- استجابة لوحة الإدارة للجوال --- */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.6rem;
    }

    .admin-title {
        font-size: 1.5rem;
    }
}

/* ======================================================================== */
/* 21. صفحة إدارة الحزم التفصيلية / Package Admin Page                      */
/* ======================================================================== */

.pkg-admin-page {
    padding: 2rem 0 3rem;
}

/* --- الرأس --- */
.pkg-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.pkg-admin-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.pkg-admin-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.pkg-admin-back {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pkg-admin-back:hover {
    background: rgba(245, 158, 11, 0.1);
}

/* --- شريط الأدوات --- */
.pkg-admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pkg-search-box {
    flex: 1;
    min-width: 200px;
}

.pkg-search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-ar);
    transition: border-color 0.2s ease;
}

.pkg-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.pkg-filter-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pkg-filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-ar);
    cursor: pointer;
}

.pkg-filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

.pkg-count-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* --- قائمة الحزم (بطاقات) --- */
.pkg-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pkg-admin-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.pkg-admin-card:hover {
    border-color: var(--accent);
    transform: translateX(3px);
}

.pkg-card-main {
    flex: 1;
    min-width: 0;
}

.pkg-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}

.pkg-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 600px;
}

.pkg-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    align-items: center;
}

.pkg-card-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-right: 1rem;
}

.pkg-card-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent);
}

/* --- حالة فارغة --- */
.pkg-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.pkg-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* --- لوحة التفاصيل --- */
.pkg-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pkg-detail-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pkg-detail-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.pkg-detail-header {
    margin-bottom: 1rem;
}

.pkg-detail-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.pkg-detail-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- ألسنة التبويب الداخلية --- */
.pkg-detail-tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.pkg-dtab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-ar);
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.pkg-dtab:hover {
    color: var(--text-bright);
}

.pkg-dtab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.pkg-tab-content {
    display: none;
}

.pkg-tab-content.active {
    display: block;
}

/* --- شبكة المعلومات --- */
.pkg-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.pkg-info-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.pkg-info-full {
    grid-column: 1 / -1;
}

.pkg-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.pkg-info-value {
    font-size: 0.9rem;
    color: var(--text-bright);
}

.pkg-keyword,
.pkg-category {
    display: inline-block;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.15rem;
}

/* --- بطاقات المالكين --- */
.pkg-owners-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pkg-owner-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.pkg-owner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--bg);
}

.pkg-owner-info {
    flex: 1;
}

/* --- نموذج التعديل --- */
.pkg-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pkg-edit-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pkg-edit-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pkg-edit-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    font-family: var(--font-ar);
    transition: border-color 0.2s ease;
    resize: vertical;
}

.pkg-edit-input:focus {
    outline: none;
    border-color: var(--accent);
}

.pkg-edit-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pkg-edit-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pkg-edit-save {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pkg-edit-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.pkg-edit-delete {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-ar);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pkg-edit-delete:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* --- منطقة الخطر --- */
.pkg-danger-zone {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px dashed rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.05);
}

.pkg-danger-zone h3 {
    color: #fca5a5;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.pkg-danger-zone p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- استجابة صفحة إدارة الحزم للجوال --- */
@media (max-width: 768px) {
    .pkg-admin-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pkg-admin-toolbar {
        flex-direction: column;
    }

    .pkg-admin-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .pkg-card-btn {
        margin-right: 0;
        text-align: center;
    }

    .pkg-card-desc {
        max-width: 100%;
    }

    .pkg-info-grid {
        grid-template-columns: 1fr;
    }

    .pkg-edit-row-grid {
        grid-template-columns: 1fr;
    }

    .pkg-detail-tabs {
        flex-wrap: wrap;
    }

    .pkg-admin-title {
        font-size: 1.5rem;
    }
}

/* ======================================================================== */
/* 22. صفحة توثيق API / API Documentation Page                             */
/* ======================================================================== */

.api-docs-page {
    padding: 2rem 0 4rem;
}

/* --- الرأس --- */
.api-docs-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.api-docs-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.api-docs-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.api-docs-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.api-docs-base {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1.2rem;
}

.api-base-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.api-base-url {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    direction: ltr;
}

/* --- الفهرس --- */
.api-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
}

.api-toc-title {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
}

.api-toc-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.api-toc-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.api-toc-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

/* --- الأقسام --- */
.api-section {
    margin-bottom: 2.5rem;
}

.api-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.api-section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

/* --- نقطة API --- */
.api-endpoint {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.api-endpoint:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.api-endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    flex-wrap: wrap;
}

.api-endpoint-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.api-endpoint-label {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

/* --- أساليب HTTP --- */
.api-method {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 0.5px;
    min-width: 55px;
    text-align: center;
}

.method-get {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.method-post {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.method-put {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.method-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.api-path {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    direction: ltr;
}

.api-auth-badge {
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-right: auto;
}

/* --- جسم النقطة --- */
.api-endpoint-body {
    padding: 1rem 1.2rem;
}

.api-endpoint-body>p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* --- جداول المعاملات --- */
.api-params {
    margin: 0.75rem 0;
}

.api-params h4 {
    font-size: 0.85rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.api-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.api-params-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.api-params-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.api-params-table code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--primary-light);
}

/* --- كتل الكود --- */
.api-code {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #c9d1d9;
    direction: ltr;
    text-align: left;
}

/* --- الاستجابة --- */
.api-response {
    margin-top: 0.75rem;
}

.api-response h4,
.api-example h4 {
    font-size: 0.85rem;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
}

.api-status {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: monospace;
    margin-right: 0.3rem;
}

.status-200 {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-201 {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.status-400 {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

/* --- بنية الأخطاء --- */
.api-error-format {
    margin-bottom: 1.5rem;
}

.api-subtitle {
    font-size: 1.1rem;
    color: var(--text-bright);
    margin: 1.5rem 0 0.75rem;
}

.api-error-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.api-error-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.api-error-group h4 {
    font-size: 0.9rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

/* --- ملاحظة المصادقة --- */
.api-auth-note {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.api-auth-note h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.api-auth-note p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.api-auth-note a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.api-auth-note a:hover {
    text-decoration: underline;
}

/* --- غلاف كتلة الكود + زر النسخ --- */
.api-code-wrapper {
    position: relative;
}

.api-copy-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    z-index: 2;
}

.api-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-bright);
}

.api-copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* --- سهم الطي/الفتح --- */
.api-toggle-arrow {
    margin-right: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    user-select: none;
}

/* --- حركة الطي/الفتح لأجسام الـ endpoints --- */
.api-endpoint-body {
    transition: max-height 0.35s ease, padding 0.35s ease;
    overflow: hidden;
}

/* --- مؤشر القسم النشط في الفهرس --- */
.api-toc-item.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(245, 158, 11, 0.08);
    font-weight: 600;
}

/* --- تلوين JSON --- */
.json-key {
    color: #7dd3fc;
}

.json-string {
    color: #86efac;
}

.json-number {
    color: #fbbf24;
}

.json-bool {
    color: #c084fc;
}

/* --- زر توسيع/طي الكل --- */
.api-toggle-all-btn {
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.api-toggle-all-btn:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}

/* --- صندوق التجربة (Try it out sandbox) --- */

/* شريط المصادقة العام */
.api-auth-bar {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), rgba(245, 158, 11, 0.01));
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 2rem;
}

.api-auth-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-bright);
    font-weight: 600;
}

.api-auth-bar-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
}

.api-auth-bar-status.connected {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}

.api-auth-bar-content {
    display: flex;
    gap: 0.5rem;
}

.api-auth-bar-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-bright);
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: 'Fira Code', monospace;
    transition: border-color 0.2s ease;
}

.api-auth-bar-input:focus {
    outline: none;
    border-color: var(--accent);
}

.api-auth-bar-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-family: inherit;
}

.api-auth-bar-login {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent);
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.api-auth-bar-login:hover {
    background: rgba(245, 158, 11, 0.2);
}

.api-quick-login-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.api-quick-login-form input {
    flex: 1;
    min-width: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: var(--text-bright);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
}

.api-quick-login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.api-quick-login-form input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.api-quick-login-form button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.api-quick-login-form button:hover {
    background: #d97706;
}

.api-quick-login-form span {
    font-size: 0.78rem;
}

.api-sandbox {
    margin-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 0.75rem;
}

.api-sandbox-header {
    display: flex;
    align-items: center;
}

.api-sandbox-toggle {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent);
    font-size: 0.82rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 600;
}

.api-sandbox-toggle:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--accent);
}

.api-sandbox-content {
    margin-top: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.api-sandbox-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.api-sandbox-field {
    flex: 1;
    min-width: 150px;
}

.api-sandbox-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.api-sandbox-field label .required {
    color: #fca5a5;
}

.api-sandbox-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-bright);
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.api-sandbox-field input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
}

.api-sandbox-field input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.api-sandbox-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-basis: 100%;
    margin-top: 0.25rem;
}

.api-sandbox-run {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.45rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.api-sandbox-run:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.api-sandbox-status {
    font-size: 0.8rem;
}

/* --- نتيجة التجربة --- */
.api-sandbox-result {
    margin-top: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.api-sandbox-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.api-sandbox-result-status {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: monospace;
}

.api-sandbox-result-status.status-ok {
    color: #34d399;
}

.api-sandbox-result-status.status-err {
    color: #fca5a5;
}

.api-sandbox-result-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.api-sandbox-result-copy {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.api-sandbox-result-copy:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.1);
}

.api-sandbox-result-body {
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #c9d1d9;
    direction: ltr;
    text-align: left;
    max-height: 400px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- استجابة الجوال للـ sandbox --- */
@media (max-width: 768px) {
    .api-sandbox-form {
        flex-direction: column;
    }

    .api-sandbox-field {
        min-width: 100%;
    }

    .api-sandbox-result-body {
        font-size: 0.7rem;
        max-height: 300px;
    }
}

/* --- استجابة صفحة التوثيق للجوال --- */
@media (max-width: 768px) {
    .api-docs-title {
        font-size: 1.5rem;
    }

    .api-endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .api-error-codes {
        grid-template-columns: 1fr;
    }

    .api-toc-grid {
        flex-direction: column;
    }

    .api-code {
        font-size: 0.7rem;
        padding: 0.6rem;
    }
}

/* ======================================================================== */
/* 23. صفحة حالة النظام / System Status Page                                */
/* ======================================================================== */

.status-page {
    padding: 2rem 0 4rem;
}

/* --- الرأس والمؤشر الرئيسي --- */
.status-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.status-main-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    transition: background 0.5s ease;
}

.status-main-indicator.indicator-ok {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-main-indicator.indicator-err {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- نبض الحالة --- */
.status-pulse {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.status-pulse.pulse-ok {
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    animation: pulseGreen 2s infinite;
}

.status-pulse.pulse-err {
    background: #f87171;
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4);
    animation: pulseRed 2s infinite;
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(248, 113, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}

.status-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-bright);
}

.status-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.status-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- عناوين الأقسام --- */
.status-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* --- بطاقات الخدمات --- */
.status-services {
    margin-bottom: 2rem;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    transition: all 0.3s ease;
}

.status-card.card-ok {
    border-color: rgba(16, 185, 129, 0.2);
}

.status-card.card-err {
    border-color: rgba(239, 68, 68, 0.2);
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.status-card-icon {
    font-size: 1.3rem;
}

.status-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.status-card-badge {
    margin-right: auto;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-weight: 600;
}

.status-card-badge.badge-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.status-card-badge.badge-err {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.status-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.status-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.status-detail span:first-child {
    color: var(--text-muted);
}

.status-detail span:last-child {
    color: var(--text-bright);
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
}

/* --- معلومات الخادم --- */
.status-server-info {
    margin-bottom: 2rem;
}

.status-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.status-info-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.status-info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.status-info-value {
    font-size: 0.95rem;
    color: var(--text-bright);
    font-weight: 600;
}

/* --- إحصائيات السجل --- */
.status-registry-stats {
    margin-bottom: 2rem;
}

.status-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.status-stat {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.status-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: 'Fira Code', monospace;
}

.status-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* --- الرسم البياني --- */
.status-response-log {
    margin-bottom: 2rem;
}

.status-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.status-chart-container canvas {
    width: 100%;
}

.status-chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.dot-api {
    background: #f59e0b;
}

.dot-web {
    background: #3b82f6;
}

/* --- استجابة صفحة الحالة للجوال --- */
@media (max-width: 768px) {
    .status-title {
        font-size: 1.3rem;
    }

    .status-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .status-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .status-meta {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   القسم 24: لوحة المشرف المحسّنة — شريط أدوات، سجل أحداث، رسوم بيانية، إعدادات
   ═══════════════════════════════════════════════════════════════ */

/* شريط أدوات المستخدمين */
.admin-panel-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.5);
}

.admin-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.admin-filter-select {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

.admin-filter-select:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.5);
}

.admin-result-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* سجل الأحداث */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: background 0.2s;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.activity-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.activity-action {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.activity-target {
    color: #f59e0b;
    font-size: 0.85rem;
}

.activity-details {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.activity-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* رسوم بيانية */
.admin-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-chart-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1rem;
}

.admin-chart-box h4 {
    margin: 0 0 0.75rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
}

.admin-chart-box canvas {
    width: 100%;
    border-radius: 6px;
}

/* إعدادات الموقع */
.admin-settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 600px;
}

.admin-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-setting-group label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
}

.admin-setting-group input,
.admin-setting-group select,
.admin-setting-group textarea {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.admin-setting-group input:focus,
.admin-setting-group select:focus,
.admin-setting-group textarea:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.5);
}

.admin-setting-group textarea {
    min-height: 60px;
    resize: vertical;
}

.admin-settings-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.admin-save-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 6px;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.admin-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.admin-small-btn {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-small-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

#settingsStatus {
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s;
}

/* استجابة - لوحة المشرف المحسّنة */
@media (max-width: 768px) {
    .admin-charts-grid {
        grid-template-columns: 1fr;
    }

    .admin-panel-toolbar {
        flex-direction: column;
    }

    .admin-search-input {
        min-width: auto;
        width: 100%;
    }

    .activity-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .activity-meta {
        flex-direction: row;
        align-items: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   القسم 25: صفحة البحث المحسّنة — شبكة، ترتيب، اقتراحات، ترقيم
   ═══════════════════════════════════════════════════════════════ */

/* التفاف حقل البحث مع الاقتراحات */
.search-input-wrapper {
    position: relative;
    flex: 1;
}

/* اقتراحات البحث الفوري */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: rgba(245, 158, 11, 0.08);
}

.suggestion-name {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.suggestion-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* شريط أدوات النتائج */
.search-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-results-info {
    flex: 1;
}

.results-count-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.results-count-text strong {
    color: var(--accent);
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* عنصر الترتيب */
.sort-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sort-control label {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.sort-control select {
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

.sort-control select:focus {
    outline: none;
    border-color: var(--primary);
}

/* تبديل العرض (شبكة/قائمة) */
.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.view-btn {
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.view-btn.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

/* عرض الشبكة */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* بطاقة الحزمة في البحث */
.package-card-search {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.package-card-search:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.package-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.package-card-name {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.05rem;
}

.package-card-version {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.package-card-desc {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.package-card-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.package-card-stat {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.package-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.package-tag {
    padding: 0.15rem 0.5rem;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border-radius: 10px;
    font-size: 0.75rem;
}

/* عرض القائمة */
.packages-list-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.packages-list-view .package-card-search {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.packages-list-view .package-card-header {
    min-width: 200px;
    margin-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.packages-list-view .package-card-desc {
    flex: 1;
    margin: 0;
    -webkit-line-clamp: 1;
}

.packages-list-view .package-card-footer {
    margin-bottom: 0;
}

.packages-list-view .package-card-tags {
    display: none;
}

/* ترقيم الصفحات */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.45rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}

.pagination-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.pagination-active {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    font-weight: 600;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

/* الحالة الفارغة المحسّنة */
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

/* استجابة — صفحة البحث المحسّنة */
@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }

    .search-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-controls {
        justify-content: space-between;
    }

    .packages-list-view .package-card-search {
        flex-direction: column;
        align-items: stretch;
    }

    .packages-list-view .package-card-header {
        min-width: auto;
    }

    .search-pagination {
        gap: 0.3rem;
    }

    .pagination-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   القسم 26: صفحة سجل التغييرات — خط زمني مع شارات
   ═══════════════════════════════════════════════════════════════ */

.changelog-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.changelog-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* الخط الزمني */
.changelog-timeline {
    position: relative;
    padding-right: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), rgba(245, 158, 11, 0.1));
    border-radius: 2px;
}

/* مدخلة في الخط الزمني */
.changelog-entry {
    position: relative;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    right: -2.55rem;
    top: 0.3rem;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--accent);
}

/* شارة التاريخ والإصدار */
.changelog-date-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.changelog-version {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: monospace;
}

.changelog-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* محتوى المدخلة */
.changelog-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.changelog-title {
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

/* قسم فرعي (ميزات، إصلاحات، ...) */
.changelog-section {
    margin-bottom: 1rem;
}

.changelog-section:last-child {
    margin-bottom: 0;
}

.changelog-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-feature {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.badge-fix {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.badge-infra {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.badge-api {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.changelog-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-section li {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.5rem;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.changelog-section li::before {
    content: '›';
    position: absolute;
    right: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

.changelog-section li code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* استجابة — سجل التغييرات */
@media (max-width: 768px) {
    .changelog-timeline {
        padding-right: 1.5rem;
    }

    .changelog-entry::before {
        right: -2.05rem;
        width: 10px;
        height: 10px;
    }

    .changelog-content {
        padding: 1rem;
    }

    .changelog-date-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

/* =====================================================================
   القسم 27: نظام الإشعارات — جرس + لوحة منسدلة
   ===================================================================== */

/* غلاف الجرس — يظهر بجانب زر تسجيل الدخول */
.notif-bell-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 0.75rem;
}

/* زر الجرس */
.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.35rem;
    padding: 0.4rem;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
    position: relative;
}

.notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* شارة العدد */
.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.4);
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* لوحة الإشعارات المنسدلة */
.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    max-height: 420px;
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    direction: rtl;
}

/* ترويسة اللوحة */
.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e0e0e0);
}

/* زر تحديد الكل كمقروء */
.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary-color, #38b2ac);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.notif-mark-all:hover {
    background: rgba(56, 178, 172, 0.15);
}

/* منطقة المحتوى القابلة للتمرير */
.notif-panel-body {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* عنصر إشعار واحد */
.notif-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item:last-child {
    border-bottom: none;
}

/* إشعار غير مقروء */
.notif-item.unread {
    background: rgba(56, 178, 172, 0.08);
    border-right: 3px solid var(--primary-color, #38b2ac);
}

.notif-item.unread:hover {
    background: rgba(56, 178, 172, 0.14);
}

/* أيقونة الإشعار */
.notif-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    line-height: 1.5;
}

/* محتوى الإشعار: عنوان + رسالة + وقت */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-message {
    font-size: 0.78rem;
    color: var(--text-secondary, #a0a0a0);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted, #777);
    margin-top: 4px;
}

/* حالة تحميل + فارغ */
.notif-loading,
.notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.85rem;
}

/* ===================== استجابة ===================== */
@media (max-width: 480px) {
    .notif-panel {
        width: 290px;
        left: auto;
        right: -10px;
        transform: none;
    }
}

/* =====================================================================
   القسم 28: صفحة الملف الشخصي المحسّنة — تبويبات + تعديل + رسم بياني
   ===================================================================== */

/* ─── الرأس ─── */
.profile-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, rgba(56, 178, 172, 0.08) 0%, transparent 60%);
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-img,
.avatar-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #38b2ac, #2d8f8a);
    color: #fff;
}

.profile-owner-badge {
    position: absolute;
    bottom: 2px;
    right: -4px;
    background: var(--primary-color, #38b2ac);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(56, 178, 172, 0.3);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.15rem;
    color: var(--text-primary, #eee);
}

.profile-username {
    font-size: 0.95rem;
    color: var(--primary-color, #38b2ac);
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0 0 0.5rem;
    max-width: 500px;
    line-height: 1.5;
}

.profile-bio-empty {
    font-style: italic;
    opacity: 0.5;
}

.profile-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    margin-bottom: 0.75rem;
}

.btn-edit-profile {
    background: none;
    border: 1px solid rgba(56, 178, 172, 0.4);
    color: var(--primary-color, #38b2ac);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-edit-profile:hover {
    background: rgba(56, 178, 172, 0.1);
    border-color: var(--primary-color, #38b2ac);
}

/* ─── الإحصائيات ─── */
.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-stat {
    text-align: center;
}

.profile-stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color, #38b2ac);
}

.profile-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── نظام التبويبات ─── */
.profile-tabs-section {
    padding: 2rem 0 3rem;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0;
}

.profile-tab {
    background: none;
    border: none;
    padding: 0.65rem 1.2rem;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;
}

.profile-tab:hover {
    color: var(--text-primary, #eee);
    background: rgba(255, 255, 255, 0.03);
}

.profile-tab.active {
    color: var(--primary-color, #38b2ac);
    border-bottom-color: var(--primary-color, #38b2ac);
    font-weight: 600;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

/* ─── شبكة الحزم ─── */
.profile-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.profile-pkg-card {
    display: block;
    text-decoration: none;
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.25s;
}

.profile-pkg-card:hover {
    border-color: rgba(56, 178, 172, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.profile-pkg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.profile-pkg-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #eee);
    margin: 0;
}

.profile-pkg-version {
    font-size: 0.75rem;
    background: rgba(56, 178, 172, 0.15);
    color: var(--primary-color, #38b2ac);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.profile-pkg-desc {
    font-size: 0.82rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-pkg-footer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
}

.profile-pkg-date {
    margin-right: auto;
}

/* ─── الرسم البياني ─── */
.profile-chart-container {
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
}

.profile-chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-primary, #eee);
}

#profileChart {
    width: 100%;
    height: auto;
    max-height: 280px;
}

/* ─── رموز API ─── */
.profile-tokens-section {
    max-width: 600px;
}

.token-actions {
    margin: 1rem 0;
}

.token-result {
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.token-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.token-display code {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--primary-color, #38b2ac);
}

.token-copy {
    background: var(--primary-color, #38b2ac);
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.2s;
}

.token-copy:hover {
    opacity: 0.85;
}

.token-warning {
    font-size: 0.78rem;
    color: #e67e22;
    margin-top: 0.5rem;
}

/* ─── الحالة الفارغة ─── */
.profile-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary, #aaa);
}

.profile-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.profile-empty h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: var(--text-primary, #ddd);
}

.profile-empty code {
    background: rgba(56, 178, 172, 0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary-color, #38b2ac);
}

/* ─── نافذة التعديل ─── */
.profile-edit-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.profile-edit-box {
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: min(440px, 92vw);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.profile-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-edit-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary, #eee);
}

.profile-edit-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.profile-edit-close:hover {
    color: var(--text-primary, #eee);
}

#editProfileForm {
    padding: 1.25rem;
}

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

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #bbb);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #eee);
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #38b2ac);
}

.char-count {
    font-size: 0.7rem;
    color: var(--text-muted, #777);
    float: left;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary, #bbb);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── استجابة ─── */
@media (max-width: 640px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-info {
        text-align: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-packages-grid {
        grid-template-columns: 1fr;
    }

    .profile-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    #profileChart {
        max-height: 200px;
    }
}

/* =====================================================================
   القسم 29: صفحة المنظمات والفرق
   ===================================================================== */

.org-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, rgba(159, 122, 234, 0.08) 0%, transparent 60%);
}

.org-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.org-avatar-img,
.org-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: cover;
}

.org-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #9f7aea, #6b46c1);
    color: #fff;
}

.org-info {
    flex: 1;
}

.org-name {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 0.15rem;
    color: var(--text-primary, #eee);
}

.org-slug {
    font-size: 0.92rem;
    color: #9f7aea;
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.org-desc {
    font-size: 0.88rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0 0 0.5rem;
    max-width: 500px;
    line-height: 1.5;
}

.org-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    margin-bottom: 0.75rem;
}

.org-website {
    color: #9f7aea;
    text-decoration: none;
}

.org-website:hover {
    text-decoration: underline;
}

.org-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.org-stat {
    text-align: center;
}

.org-stat-num {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
    color: #9f7aea;
}

.org-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.org-tabs-section {
    padding: 2rem 0 3rem;
}

.org-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.org-member-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.org-member-card:hover {
    border-color: rgba(159, 122, 234, 0.3);
    transform: translateY(-1px);
}

.org-member-img,
.org-member-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.org-member-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #9f7aea, #6b46c1);
    color: #fff;
}

.org-member-info {
    flex: 1;
    min-width: 0;
}

.org-member-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #eee);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-member-username {
    font-size: 0.75rem;
    color: var(--text-muted, #888);
}

.org-role-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.org-role-owner {
    background: rgba(159, 122, 234, 0.2);
    color: #9f7aea;
}

.org-role-admin {
    background: rgba(56, 178, 172, 0.2);
    color: #38b2ac;
}

.org-role-member {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted, #888);
}

.org-manage-section {
    background: var(--card-bg, #1e2028);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.org-manage-section h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--text-primary, #eee);
}

.org-add-member {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.org-input,
.org-select {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #eee);
    font-family: inherit;
    font-size: 0.85rem;
}

.org-input {
    flex: 1;
    min-width: 150px;
}

.org-input:focus,
.org-select:focus {
    outline: none;
    border-color: #9f7aea;
}

.org-msg {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    min-height: 1.2em;
}

.org-manage-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.org-manage-row:last-child {
    border-bottom: none;
}

.org-manage-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary, #eee);
}

.org-manage-name small {
    color: var(--text-muted, #888);
}

.org-select-sm {
    padding: 0.25rem 0.4rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary, #eee);
    font-family: inherit;
    font-size: 0.78rem;
}

.org-btn-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.org-btn-remove:hover {
    background: rgba(231, 76, 60, 0.15);
}

.org-danger-zone {
    border-color: rgba(231, 76, 60, 0.2) !important;
}

.org-danger-zone h3 {
    color: #e74c3c;
}

.org-danger-zone p {
    font-size: 0.82rem;
    color: var(--text-muted, #888);
    margin: 0 0 0.75rem;
}

.org-btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

.org-btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

@media (max-width: 640px) {
    .org-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .org-meta {
        justify-content: center;
    }

    .org-stats {
        justify-content: center;
    }

    .org-members-grid {
        grid-template-columns: 1fr;
    }

    .org-add-member {
        flex-direction: column;
    }
}

/* =====================================================================
   القسم 30: توثيق الحزمة (README)
   ===================================================================== */

.readme-section {
    background: var(--card-bg, #1a202c);
    border: 1px solid var(--border-color, #2d3748);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.readme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #2d3748);
}

.readme-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.readme-raw-link {
    font-size: 0.85rem;
    color: var(--accent-color, #38b2ac);
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--accent-color, #38b2ac);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.readme-raw-link:hover {
    background: var(--accent-color, #38b2ac);
    color: #fff;
}

/* محتوى Markdown المُصيّر */
.readme-content {
    color: var(--text-secondary, #a0aec0);
    line-height: 1.8;
    font-size: 0.95rem;
    direction: rtl;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.readme-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #2d3748);
}

.readme-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 1.8rem 0 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color, #2d3748);
}

.readme-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 1.5rem 0 0.6rem;
}

.readme-content h4,
.readme-content h5,
.readme-content h6 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin: 1.2rem 0 0.5rem;
}

.readme-content p {
    margin: 0.8rem 0;
}

.readme-content a {
    color: var(--accent-color, #38b2ac);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.readme-content a:hover {
    border-bottom-color: var(--accent-color, #38b2ac);
}

.readme-content strong {
    color: var(--text-primary, #e2e8f0);
    font-weight: 600;
}

.readme-content em {
    font-style: italic;
}

/* قوائم */
.readme-content ul,
.readme-content ol {
    margin: 0.8rem 0;
    padding-right: 2rem;
    padding-left: 0;
}

.readme-content li {
    margin: 0.3rem 0;
}

.readme-content li > ul,
.readme-content li > ol {
    margin: 0.2rem 0;
}

/* كود مضمن */
.readme-content code {
    background: rgba(56, 178, 172, 0.1);
    color: var(--accent-color, #38b2ac);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88em;
    direction: ltr;
    unicode-bidi: embed;
}

/* كتل الكود */
.readme-content pre {
    background: #0d1117;
    border: 1px solid var(--border-color, #2d3748);
    border-radius: 8px;
    padding: 1.2rem;
    margin: 1rem 0;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.readme-content pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* اقتباسات */
.readme-content blockquote {
    border-right: 4px solid var(--accent-color, #38b2ac);
    border-left: none;
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    background: rgba(56, 178, 172, 0.05);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary, #a0aec0);
}

.readme-content blockquote p {
    margin: 0.3rem 0;
}

/* جداول */
.readme-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow-x: auto;
    display: block;
}

.readme-content thead {
    background: rgba(56, 178, 172, 0.1);
}

.readme-content th,
.readme-content td {
    border: 1px solid var(--border-color, #2d3748);
    padding: 0.6rem 1rem;
    text-align: right;
}

.readme-content th {
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.readme-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* فاصل أفقي */
.readme-content hr {
    border: none;
    border-top: 1px solid var(--border-color, #2d3748);
    margin: 2rem 0;
}

/* صور */
.readme-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* قوائم مهام */
.readme-content input[type="checkbox"] {
    margin-left: 0.5rem;
    margin-right: 0;
    accent-color: var(--accent-color, #38b2ac);
}

/* استجابة */
@media (max-width: 768px) {
    .readme-section {
        padding: 1.2rem;
    }

    .readme-content pre {
        padding: 0.8rem;
        font-size: 0.82rem;
    }

    .readme-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }

    .readme-content h1 {
        font-size: 1.5rem;
    }

    .readme-content h2 {
        font-size: 1.3rem;
    }
}

/* ================================================
   القسم 31: نظام التقييمات والمراجعات
   Reviews & Ratings System
   يشمل: عرض الإحصائيات، بطاقات المراجعة، نموذج الإضافة
   ================================================ */

/* --- حاوية قسم التقييمات --- */
.reviews-section {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- ترويسة التقييمات --- */
.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.reviews-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary, #e0e0e0);
}
.reviews-avg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.reviews-avg-number {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
}
.reviews-avg-stars .star {
    font-size: 1.3rem;
}

/* --- النجوم --- */
.star-filled { color: #fbbf24; }
.star-empty { color: rgba(255,255,255,0.2); }

/* --- توزيع التقييمات (أشرطة) --- */
.reviews-distribution {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
}
.reviews-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}
.reviews-bar-label {
    width: 40px;
    font-size: 0.85rem;
    color: var(--text-secondary, #aaa);
    text-align: left;
    direction: ltr;
}
.reviews-bar-track {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}
.reviews-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 5px;
    transition: width 0.4s ease;
}
.reviews-bar-count {
    width: 30px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #aaa);
}

/* --- نموذج إضافة تقييم --- */
.review-form-container {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.review-form-container h4 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--text-primary, #e0e0e0);
}
.review-rating-input {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.review-rating-input label {
    font-size: 0.95rem;
    color: var(--text-secondary, #aaa);
}
.star-rating-input {
    display: flex;
    gap: 0.2rem;
    direction: ltr;
}
.star-input {
    font-size: 1.8rem;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}
.star-input:hover,
.star-highlight,
.star-selected {
    color: #fbbf24;
    transform: scale(1.15);
}
.review-title-input {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}
.review-body-input {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}
.review-title-input:focus,
.review-body-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251,191,36,0.15);
}
.review-form-actions {
    display: flex;
    gap: 0.8rem;
}
.btn-review-submit {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-review-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251,191,36,0.3);
}
.btn-review-cancel {
    padding: 0.6rem 1.5rem;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary, #aaa);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-review-cancel:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary, #e0e0e0);
}

/* --- زر إضافة تقييم --- */
.review-add-btn-container {
    text-align: center;
    margin-bottom: 1.5rem;
}
.btn-add-review {
    padding: 0.7rem 2rem;
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.1));
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-add-review:hover {
    background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251,191,36,0.15);
}

/* --- رسالة فارغة --- */
.reviews-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary, #888);
    font-size: 1rem;
}

/* --- بطاقة المراجعة --- */
.review-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.review-card:hover {
    border-color: rgba(251,191,36,0.2);
}
.review-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}
.review-card-author {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(251,191,36,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.review-avatar-placeholder {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
}
.review-card-author strong {
    display: block;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.95rem;
}
.review-date {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    margin-right: 0.5rem;
}
.review-edited {
    font-size: 0.75rem;
    color: rgba(251,191,36,0.7);
    font-style: italic;
}
.review-card-stars .star {
    font-size: 1rem;
}
.review-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 0.5rem;
}
.review-card-body {
    font-size: 0.95rem;
    color: var(--text-secondary, #ccc);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.review-card-footer {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.btn-helpful {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary, #aaa);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-helpful:hover {
    background: rgba(251,191,36,0.1);
    border-color: rgba(251,191,36,0.3);
    color: #fbbf24;
}

/* --- استجابة للشاشات الصغيرة --- */
@media (max-width: 768px) {
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .review-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .reviews-avg-number {
        font-size: 1.5rem;
    }
    .star-input {
        font-size: 1.5rem;
    }
}