.docx-content {
    font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
    font-size: 1.18rem;
    color: #232323;
    line-height: 2.1;
    background: #fff;
    padding: 2.5rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 4px 32px 0 rgba(34,34,68,0.12);
    direction: rtl;
    text-align: right;
}

.docx-content h1,
.docx-content h2,
.docx-content h3 {
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
    font-weight: bold;
    color: #173F7A;
    letter-spacing: 0.01em;
    margin-top: 2.3em;
    margin-bottom: 1.1em;
    line-height: 1.5;
    border-right: 6px solid #173F7A;
    padding-right: 0.5em;
    background: linear-gradient(90deg, #E9F1FF 65%, transparent);
    border-radius: 0.6em;
}

.docx-content h1 {
    font-size: 2.2rem;
    color: #8d1515;
    border-color: #8d1529;
}
.docx-content h2 {
    font-size: 1.6rem;
    color: #174d71;
    border-color: #174d71;
}
.docx-content h3 {
    font-size: 1.25rem;
    color: #1a3d54;
    border-color: #1a3d54;
    background: none;
}

.docx-content p {
    margin-top: 1.6em;
    margin-bottom: 1.2em;
    text-align: justify;
}

.docx-content b,
.docx-content strong {
    font-weight: bold;
    color: #144377;
    background: linear-gradient(90deg, #e3eefb 80%, transparent);
    padding: 0.1em 0.3em;
    border-radius: 0.2em;
}

.docx-content i,
.docx-content em {
    color: #c02040;
    font-style: italic;
    background: #fdf1f5;
    padding: 0.1em 0.3em;
    border-radius: 0.2em;
}

.docx-content ul,
.docx-content ol {
    margin-right: 2.1em;
    margin-left: 0.5em;
    padding-right: 1.4em;
}

.docx-content li {
    margin-bottom: 0.7em;
    font-size: 1.09em;
}

.docx-content table {
    width: 98%;
    border-collapse: collapse;
    margin: 2.2em 0 2.2em 0;
    background: #f7fafd;
    border-radius: 1.2em;
    overflow: hidden;
    font-size: 1em;
    direction: rtl;
}

.docx-content th,
.docx-content td {
    border: 1.5px solid #c8e1fa;
    padding: 0.6em 1.2em;
    text-align: right;
    background: #fff;
}

.docx-content th {
    background: #e1ecf7;
    font-weight: bold;
    color: #19487a;
}

.docx-content hr {
    border: 0;
    height: 2px;
    background: linear-gradient(90deg, #1b3e5a, #c8e1fa, #1b3e5a);
    margin: 2.6em 0;
}

.docx-content blockquote {
    background: #e5f2fa;
    border-right: 5px solid #1a547b;
    margin: 2em 0;
    padding: 1em 1.4em;
    border-radius: 0.6em;
    color: #174866;
    font-style: italic;
    font-size: 1.15em;
}

/* دعم الاقتباس القرآني */
.docx-content .quran {
    font-family: 'Amiri', 'Scheherazade', serif;
    font-size: 1.1em;
    color: #13756b;
    background: #e5f7f5;
    border-right: 4px solid #19947d;
    border-radius: 0.5em;
    padding: 0.7em 1em;
    margin: 1.8em 0;
    display: block;
    line-height: 2;
    text-align: justify;
    letter-spacing: 0.02em;
}

/* إبراز الجمل المفصلية */
.docx-content .highlight {
    color: #b22614;
    background: #fff7f2;
    font-weight: bold;
    border-right: 4px solid #b22614;
    border-radius: 0.4em;
    padding: 0.1em 0.7em;
}

/* تنسيقات إضافية */
.docx-content a {
    color: #1666aa;
    text-decoration: underline dotted;
    transition: color 0.2s;
}
.docx-content a:hover {
    color: #c02040;
    text-decoration: underline solid;
}

/* ================== الوضع الليلي =================== */
:root[data-theme='dark'] .docx-content {
    background: #191c22 !important;
    color: #e6e8ea !important;
    box-shadow: 0 2px 24px 0 rgba(0,0,0,0.36);
}
:root[data-theme='dark'] .docx-content h1,
:root[data-theme='dark'] .docx-content h2,
:root[data-theme='dark'] .docx-content h3 {
    color: #81b3ff !important;
    border-color: #334f75 !important;
    background: linear-gradient(90deg, #273951 65%, transparent) !important;
}
:root[data-theme='dark'] .docx-content h1 { color: #5ea4ea !important; border-color: #5ea4ea !important;}
:root[data-theme='dark'] .docx-content h2 { color: #4e8cc7 !important; border-color: #4e8cc7 !important;}
:root[data-theme='dark'] .docx-content h3 { color: #8dbad1 !important; border-color: #8dbad1 !important; background: none !important;}
:root[data-theme='dark'] .docx-content b,
:root[data-theme='dark'] .docx-content strong {
    color: #91bbfc !important;
    background: linear-gradient(90deg, #222b3c 80%, transparent) !important;
}
:root[data-theme='dark'] .docx-content i,
:root[data-theme='dark'] .docx-content em {
    color: #fb6c7b !important;
    background: #2a232c !important;
}
:root[data-theme='dark'] .docx-content table {
    background: #202736 !important;
    color: #e6e8ea !important;
}
:root[data-theme='dark'] .docx-content th,
:root[data-theme='dark'] .docx-content td {
    background: #23253d !important;
    border-color: #334f75 !important;
    color: #d8e6fc !important;
}
:root[data-theme='dark'] .docx-content th {
    background: #253554 !important;
    color: #98bdf2 !important;
}
:root[data-theme='dark'] .docx-content hr {
    background: linear-gradient(90deg, #4477aa, #273951, #4477aa) !important;
}
:root[data-theme='dark'] .docx-content blockquote {
    background: #222b3c !important;
    border-right: 5px solid #4e8cc7 !important;
    color: #b8e0f8 !important;
}
:root[data-theme='dark'] .docx-content .quran {
    color: #30efde !important;
    background: #16303a !important;
    border-right: 4px solid #30efde !important;
}
:root[data-theme='dark'] .docx-content .highlight {
    color: #ff9266 !important;
    background: #2d2222 !important;
    border-right: 4px solid #ff9266 !important;
}
:root[data-theme='dark'] .docx-content a {
    color: #98bdf2 !important;
}
:root[data-theme='dark'] .docx-content a:hover {
    color: #fb6c7b !important;
}
