@charset "UTF-8";

/* إعدادات بيئة الألوان الافتراضية الداكنة */
body.dark-theme {
    background-color: #141414;
    color: #ffffff;
}

/* دعم كامل للتنسيق الفاتح المتوافق مع برمجيات الجافاسكربت المستخلصة */
body.light-mode {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

body.light-mode aside {
    background-color: #ffffff;
    border-left-color: rgba(0, 0, 0, 0.08);
}

body.light-mode main {
    background-color: #f5f5f7;
}

body.light-mode .text-white, 
body.light-mode h1, 
body.light-mode p {
    color: #1d1d1f;
}

body.light-mode .bg-white\/\[0\.03\] {
    background-color: rgba(0, 0, 0, 0.03);
}

body.light-mode .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.08);
}

/* تحسينات أشرطة التمرير والقوائم */
.nav-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}
body.light-mode .nav-btn {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
}

.nav-btn.active {
    background-color: #00A99D;
    border-color: #00A99D;
    color: #ffffff !important;
}

/* التنسيق الجمالي لتطابق المحاذاة الكاملة الجستفاي للخط العربي الأصيل */
.justify-active {
    text-align: justify;
    text-justify: inter-character;
    word-spacing: -0.02em;
}

/* إخفاء شريط التمرير الافتراضي وتجميله */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* تنسيق منطقة الكتابة الحرة المخصصة */
#customTextArea {
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    width: 100%;
    resize: vertical;
}

#customTextArea::-webkit-scrollbar {
    width: 6px;
}
#customTextArea::-webkit-scrollbar-thumb {
    background-color: rgba(0, 169, 157, 0.2);
    border-radius: 4px;
}
#customTextArea::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 169, 157, 0.4);
}

/* ==========================================================================
   أنماط الميزات التفاعلية المتقدمة وقسم الشلال ونافذة المحارف (مصحح ومطور)
   ========================================================================== */

/* التحكم في ظهور وإغلاق النافذة المنبثقة */
#glyphDetailModal {
    transition: opacity 0.2s ease-in-out;
}

#glyphDetailModal.active {
    opacity: 1;
    pointer-events: auto;
}

#glyphDetailModal.active > div {
    transform: scale(1);
}

/* صندوق فحص أبعاد الحرف البصرية (Boxing) وضمان ثبات الرندرة */
.glyph-box-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    width: 100%;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glyph-box-preview.boxed-mode {
    background-image: 
        linear-gradient(to right, rgba(0, 169, 157, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 169, 157, 0.15) 1px, transparent 1px);
    background-size: 8px 8px;
    border: 1px dashed rgba(0, 169, 157, 0.4) !important;
}

/* 🔒 تعديل حاسم: فرض السيطرة والأبعاد الصارمة لمنع خنق المتصفح للـ SVG */
.grid div svg {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    overflow: visible !important;
    flex-shrink: 0 !important; /* يمنع انكماش الحرف نهائياً داخل خلايا الشبكة الصغيره */
    display: block;
}

/* التحكم بـ SVG المودال الكبير ومنع هروبه أو تصغيره */
#glyphDetailModal svg {
    width: 220px !important;
    height: 220px !important;
    max-width: 220px !important;
    max-height: 220px !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    display: block;
}

/* حماية مسارات الـ SVG والحفاظ على سمك الحواف عند التكبير والتحجيم */
.glyph-box-preview path,
.grid div path,
#glyphDetailModal path {
    vector-effect: non-scaling-stroke;
}

/* تنسيق خلايا الشلال المتدرجة */
.waterfall-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1rem 0;
}
.waterfall-row:last-child {
    border-bottom: none;
}

/* تحسين تجربة التفاعل مع المحارف الفردية داخل الشلال والـ Glyphs */
.interactive-glyph-item {
    cursor: pointer;
    transition: all 0.15s ease;
}
.interactive-glyph-item:hover {
    background-color: rgba(0, 169, 157, 0.1);
    border-color: rgba(0, 169, 157, 0.3);
    transform: translateY(-2px);
}

/* دعم النصوص الاحتياطية الثابتة في حال رندرة حروف Fallback بدون مسارات */
.fallback-text-render {
    font-family: system-ui, -apple-system, sans-serif !important;
    line-height: 1;
    text-align: center;
    direction: ltr !important;
}


@font-face {
    font-family: 'SFLogoVF';
    src: url('libs/SFLogoVF.woff2') format('woff2'); /* مسار ملف الخط المتغير للشعار */
    font-display: swap;
}

.logo-symbol {
    font-family: 'SFLogoVF', sans-serif;
    font-variation-settings: "wght" 900; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
}