/* =========================================================================
   ملف الأنماط والثيمات العشرة لملف الإنجاز الإلكتروني
   10 Complete Themes + Responsive Portfolio + Report Builder Styles
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary: #0b6b53;
    --primary-dark: #074737;
    --accent: #c59b27;
    --bg-main: #f4f9f6;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #d1e7dd;
    --header-gradient: linear-gradient(135deg, #0b6b53 0%, #064e3b 100%);
    --shadow-soft: 0 10px 25px -5px rgba(11, 107, 83, 0.12);
}

/* 1. الأخضر الرسمي (وزارة التعليم) */
body.theme-moe-green {
    --primary: #0b6b53;
    --primary-dark: #064e3b;
    --accent: #c59b27;
    --bg-main: #f4f9f6;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #52665e;
    --border-color: #cde5d9;
    --header-gradient: linear-gradient(135deg, #0b6b53 0%, #053b2c 100%);
}

/* 2. الذهبي الملكي الفاخر */
body.theme-royal-gold {
    --primary: #7c5812;
    --primary-dark: #543b0b;
    --accent: #d4af37;
    --bg-main: #fdfbf5;
    --bg-card: #ffffff;
    --text-main: #292524;
    --text-muted: #78716c;
    --border-color: #f3e8c8;
    --header-gradient: linear-gradient(135deg, #7c5812 0%, #422c05 100%);
}

/* 3. الكحلي الأكاديمي الرسمي */
body.theme-navy-academic {
    --primary: #1e3a8a;
    --primary-dark: #172554;
    --accent: #0284c7;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --header-gradient: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}

/* 4. الفيروزي العصري */
body.theme-teal-modern {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #14b8a6;
    --bg-main: #f0fdfa;
    --bg-card: #ffffff;
    --text-main: #134e4a;
    --text-muted: #4b6a67;
    --border-color: #99f6e4;
    --header-gradient: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}

/* 5. العنابي الكلاسيكي */
body.theme-burgundy-classic {
    --primary: #7f1d1d;
    --primary-dark: #450a0a;
    --accent: #d97706;
    --bg-main: #fef2f2;
    --bg-card: #ffffff;
    --text-main: #271212;
    --text-muted: #6b4c4c;
    --border-color: #fecaca;
    --header-gradient: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
}

/* 6. الزمردي الهادئ */
body.theme-emerald-soft {
    --primary: #065f46;
    --primary-dark: #064e3b;
    --accent: #10b981;
    --bg-main: #ecfdf5;
    --bg-card: #ffffff;
    --text-main: #064e3b;
    --text-muted: #376e5c;
    --border-color: #a7f3d0;
    --header-gradient: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

/* 7. البنفسجي الإبداعي */
body.theme-purple-creative {
    --primary: #581c87;
    --primary-dark: #3b0764;
    --accent: #a855f7;
    --bg-main: #faf5ff;
    --bg-card: #ffffff;
    --text-main: #2e1065;
    --text-muted: #6b538c;
    --border-color: #e9d5ff;
    --header-gradient: linear-gradient(135deg, #581c87 0%, #3b0764 100%);
}

/* 8. الرمادي الاحترافي المينيمال */
body.theme-slate-minimal {
    --primary: #1e293b;
    --primary-dark: #0f172a;
    --accent: #3b82f6;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* 9. الرملي التراثي الدافئ (الدرعية) */
body.theme-desert-sand {
    --primary: #78350f;
    --primary-dark: #451a03;
    --accent: #d97706;
    --bg-main: #fffbeb;
    --bg-card: #ffffff;
    --text-main: #291807;
    --text-muted: #785c3c;
    --border-color: #fde68a;
    --header-gradient: linear-gradient(135deg, #78350f 0%, #451a03 100%);
}

/* 10. الداكن التنفيذي الفخم */
body.theme-dark-executive {
    --primary: #10b981;
    --primary-dark: #059669;
    --accent: #fbbf24;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --header-gradient: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    text-decoration: underline;
}

/* شريط التنقل العلوي */
.top-navbar {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

.brand-badge {
    background: var(--primary);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* الهيرو (بطاقة التعريف العليا) */
.portfolio-hero {
    background: var(--header-gradient);
    color: #ffffff;
    padding: 45px 20px;
    border-bottom: 5px solid var(--accent);
    position: relative;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
}

@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.hero-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.meta-pill {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* الفهرس التلقائي التفاعلي */
.toc-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-right: 6px solid var(--accent);
    border-radius: 16px;
    padding: 24px;
    margin: 28px auto;
    max-width: 1200px;
    box-shadow: var(--shadow-soft);
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.toc-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 700;
    transition: all 0.22s ease;
}

.toc-item-link:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-3px);
    text-decoration: none;
    border-color: var(--primary);
}

.toc-number {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* أقسام ملف الإنجاز */
.portfolio-container {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.section-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    scroll-margin-top: 90px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.section-block.highlight-pulse {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 5px rgba(197, 155, 39, 0.25);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.section-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.item-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

.item-card h4 {
    margin: 0 0 12px 0;
    color: var(--primary);
    font-size: 1.15rem;
}

/* أزرار عامة */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.94;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* الجداول داخل الأقسام والتقارير */
.portfolio-data-table,
.report-interactive-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: #ffffff;
    color: #1e293b;
}

.portfolio-data-table th,
.portfolio-data-table td,
.report-interactive-table th,
.report-interactive-table td {
    border: 1px solid #94a3b8;
    padding: 10px 12px;
    text-align: right;
    vertical-align: middle;
}

.portfolio-data-table th,
.report-interactive-table th {
    background: #0b6b53;
    color: #ffffff;
    font-weight: 700;
}

/* منشئ التقارير التفاعلي (صفحة A4) */
.report-page-a4 {
    background: #ffffff;
    color: #1e293b;
    max-width: 210mm;
    min-height: 280mm;
    margin: 0 auto;
    padding: 16mm 14mm;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.report-title-banner {
    background: linear-gradient(90deg, #f0fdf4 0%, #dcfce7 50%, #f0fdf4 100%);
    border: 2px solid #0b6b53;
    border-radius: 10px;
    padding: 12px 18px;
    text-align: center;
    margin: 14px 0 20px;
}

.report-title-banner h2 {
    margin: 0;
    font-size: 1.45rem;
    color: #0b6b53;
    font-weight: 800;
}

/* شريط أدوات المحرر الغني */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 6px 11px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background: #0b6b53;
    color: #ffffff;
    border-color: #0b6b53;
}

.tool-btn.highlight-qr {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.tool-btn.highlight-qr:hover {
    background: #d97706;
    color: #ffffff;
}

@media print {
    .no-print, .top-navbar {
        display: none !important;
    }
    body {
        background: #ffffff !important;
    }
    .report-page-a4 {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 5mm !important;
        max-width: 100% !important;
    }
}
