youssefreda9 commited on
Commit
acf7dfb
·
1 Parent(s): b5890c0

Full UI/UX modernization: fix hero examples, pricing beta, Apply All cursor/format fix, design polish

Browse files
Files changed (5) hide show
  1. src/css/base.css +49 -0
  2. src/css/components.css +28 -1
  3. src/index.html +131 -79
  4. src/js/editor.js +42 -7
  5. src/js/ui.js +28 -16
src/css/base.css CHANGED
@@ -182,3 +182,52 @@ input[type="range"] {
182
 
183
  .animate-fade-in { animation: fadeIn 0.5s ease-out; }
184
  .animate-float { animation: float 6s ease-in-out infinite; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  .animate-fade-in { animation: fadeIn 0.5s ease-out; }
184
  .animate-float { animation: float 6s ease-in-out infinite; }
185
+
186
+ /* Shimmer animation for loading skeletons */
187
+ @keyframes shimmer {
188
+ 0% { background-position: -200px 0; }
189
+ 100% { background-position: calc(200px + 100%) 0; }
190
+ }
191
+
192
+ .skeleton {
193
+ background: linear-gradient(90deg, var(--color-surface-elevated) 0%, var(--color-border) 50%, var(--color-surface-elevated) 100%);
194
+ background-size: 200px 100%;
195
+ animation: shimmer 1.5s ease-in-out infinite;
196
+ border-radius: var(--radius-sm);
197
+ }
198
+
199
+ /* Slide up animation for staggered entry */
200
+ @keyframes slideUp {
201
+ from { opacity: 0; transform: translateY(24px); }
202
+ to { opacity: 1; transform: translateY(0); }
203
+ }
204
+
205
+ .animate-slide-up {
206
+ animation: slideUp 0.6s ease-out both;
207
+ }
208
+
209
+ /* Staggered grid children */
210
+ .grid > *:nth-child(1) { animation-delay: 0ms; }
211
+ .grid > *:nth-child(2) { animation-delay: 80ms; }
212
+ .grid > *:nth-child(3) { animation-delay: 160ms; }
213
+ .grid > *:nth-child(4) { animation-delay: 240ms; }
214
+ .grid > *:nth-child(5) { animation-delay: 320ms; }
215
+ .grid > *:nth-child(6) { animation-delay: 400ms; }
216
+ .grid > *:nth-child(7) { animation-delay: 480ms; }
217
+ .grid > *:nth-child(8) { animation-delay: 560ms; }
218
+
219
+ /* Score ring change animation */
220
+ @keyframes scoreChange {
221
+ 0%, 100% { filter: none; }
222
+ 50% { filter: brightness(1.3); }
223
+ }
224
+
225
+ .score-ring-wrap.score-changed {
226
+ animation: scoreChange 0.6s ease;
227
+ }
228
+
229
+ /* Button press effect */
230
+ .btn-primary:active,
231
+ .gradient-accent:active {
232
+ transform: scale(0.97) !important;
233
+ }
src/css/components.css CHANGED
@@ -84,6 +84,15 @@
84
  color: var(--color-primary);
85
  }
86
 
 
 
 
 
 
 
 
 
 
87
  .theme-toggle {
88
  display: flex;
89
  align-items: center;
@@ -928,18 +937,36 @@
928
  /* ── Suggestion cards ── */
929
  .suggestion-card {
930
  padding: var(--spacing-md);
 
931
  border-radius: var(--radius-md);
932
  border: 1px solid var(--color-border);
 
933
  background: var(--color-surface-elevated);
934
  cursor: pointer;
935
- transition: border-color var(--transition-base), background var(--transition-base);
936
  text-align: right;
937
  }
938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
939
  .suggestion-card:hover,
940
  .suggestion-card.focused {
941
  border-color: var(--color-primary);
942
  background: var(--color-suggestion-hover-bg);
 
943
  }
944
 
945
  .suggestion-card-badge {
 
84
  color: var(--color-primary);
85
  }
86
 
87
+ .footer-link-hover:hover {
88
+ color: var(--color-text-primary) !important;
89
+ }
90
+
91
+ .footer-bar {
92
+ background: var(--color-surface);
93
+ border-color: var(--color-border);
94
+ }
95
+
96
  .theme-toggle {
97
  display: flex;
98
  align-items: center;
 
937
  /* ── Suggestion cards ── */
938
  .suggestion-card {
939
  padding: var(--spacing-md);
940
+ padding-right: calc(var(--spacing-md) + 4px);
941
  border-radius: var(--radius-md);
942
  border: 1px solid var(--color-border);
943
+ border-right: 4px solid var(--color-border-strong);
944
  background: var(--color-surface-elevated);
945
  cursor: pointer;
946
+ transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
947
  text-align: right;
948
  }
949
 
950
+ .suggestion-card[data-suggestion-type="spelling"],
951
+ .suggestion-card:has(.badge-spelling) {
952
+ border-right-color: var(--color-error);
953
+ }
954
+
955
+ .suggestion-card[data-suggestion-type="grammar"],
956
+ .suggestion-card:has(.badge-grammar) {
957
+ border-right-color: var(--color-warning);
958
+ }
959
+
960
+ .suggestion-card[data-suggestion-type="punctuation"],
961
+ .suggestion-card:has(.badge-punctuation) {
962
+ border-right-color: var(--color-success);
963
+ }
964
+
965
  .suggestion-card:hover,
966
  .suggestion-card.focused {
967
  border-color: var(--color-primary);
968
  background: var(--color-suggestion-hover-bg);
969
+ transform: translateX(-2px);
970
  }
971
 
972
  .suggestion-card-badge {
src/index.html CHANGED
@@ -6,7 +6,7 @@
6
  <meta name="supabase-url" content="">
7
  <meta name="supabase-anon-key" content="">
8
  <title>بيان - مساعد الكتابة العربية الذكي</title>
9
- <meta name="description" content="بيان — مساعد ذكي يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص العربية بدقة عالية. جرّبه مجاناً!">
10
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
11
  <script src="https://cdn.tailwindcss.com"></script>
12
  <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -161,17 +161,17 @@
161
  <div class="grid lg:grid-cols-2 gap-16 items-center"><!-- Hero Content -->
162
  <div class="text-center lg:text-right animate-fade-in">
163
 
164
- <h1 id="hero-headline" class="text-5xl lg:text-7xl font-bold leading-tight mb-6" style="line-height: 1.3;">اكتب العربية<br><span class="text-gradient">بثقة واحتراف</span></h1>
165
- <p id="hero-subheadline" class="text-xl lg:text-2xl leading-relaxed mb-10" style="color: var(--text-secondary); line-height: 1.9;">مساعد ذكي يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص العربية بدقة عالية.</p>
166
- <div class="flex flex-col sm:flex-row gap-4 justify-center lg:justify-start mb-12"><button id="hero-cta-primary" onclick="showPage('editor')" class="px-8 py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> جربه الآن مجاناً </button> <button onclick="showPage('features')" class="px-8 py-4 rounded-2xl text-lg font-bold transition-all hover:scale-105 border-2" style="border-color: rgba(255, 255, 255, 0.35); color: var(--text-color); box-shadow: 0 0 20px rgba(107, 163, 224, 0.12);"> استكشف الميزات</button>
167
  </div><!-- Stats -->
168
  <div class="flex items-center gap-8 justify-center lg:justify-start">
169
  <div class="text-center">
170
  <div class="text-3xl font-bold text-gradient">
171
- ٣ أنواع
172
  </div>
173
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
174
- تصحيح ذكي
175
  </div>
176
  </div>
177
  <div class="w-px h-12" style="background: rgba(255, 255, 255, 0.2);"></div>
@@ -180,7 +180,7 @@
180
  فوري
181
  </div>
182
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
183
- تحليل أثناء الكتابة
184
  </div>
185
  </div>
186
  <div class="w-px h-12" style="background: rgba(255, 255, 255, 0.2);"></div>
@@ -189,7 +189,7 @@
189
  مجاني
190
  </div>
191
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
192
- بدون تسجيل
193
  </div>
194
  </div>
195
  </div>
@@ -205,14 +205,14 @@
205
  <div class="w-20"></div>
206
  </div><!-- Mock Editor Content -->
207
  <div class="p-8 editor-content text-right text-lg" dir="rtl" style="background: var(--surface-color); color: var(--text-color); min-height: 300px;">
208
- <p class="mb-4">تعتبر اللغة العربية من أجمل <span class="spelling-error">اللغاة</span> في العالم وأكثرها <span class="spelling-error">انتشاراً</span><span class="punctuation-suggestion">.</span></p>
209
  <p class="mb-4">الطالبات <span class="grammar-error">ذهبوا</span> إلى المكتبة لأن <span class="spelling-error">الأمتحان</span> قريب جداً<span class="punctuation-suggestion">.</span></p>
210
  <p>محرر بيان يساعدك على كتابة نصوص عربية <span class="spelling-error">صحيحه</span> بكل سهولة!</p>
211
  </div><!-- Mock Stats Bar -->
212
  <div class="flex items-center justify-between p-4 border-t" style="border-color: rgba(255, 255, 255, 0.1);">
213
  <div class="flex items-center gap-6">
214
  <div class="flex items-center gap-2">
215
- <div class="w-3 h-3 rounded-full" style="background: #ef4444;"></div><span class="text-sm" style="color: var(--text-secondary);">٣ إملائي</span>
216
  </div>
217
  <div class="flex items-center gap-2">
218
  <div class="w-3 h-3 rounded-full" style="background: #fbbf24;"></div><span class="text-sm" style="color: var(--text-secondary);">١ نحوي</span>
@@ -307,11 +307,52 @@
307
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">بوابتك للقرآن والتفسير والسنة والمصادر السردية الموثقة</p>
308
  </div>
309
  </div>
310
- <div class="text-center mt-12"><button onclick="showPage('features')" class="px-8 py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: var(--primary-color); color: var(--primary-color);"> استكشف جميع الميزات </button>
311
  </div>
312
  </div>
313
- </section>
314
- </div><!-- Features Page -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  <div id="page-features" class="page">
316
  <section class="pt-32 pb-24" style="background: var(--background-color);">
317
  <div class="max-w-7xl mx-auto px-6">
@@ -801,6 +842,26 @@
801
  </div>
802
  </div>
803
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
804
  <div class="editor-footer">
805
  <div class="editor-stats" role="status" aria-label="إحصائيات">
806
  <div class="flex items-center gap-2"><span class="stat-dot stat-dot--spelling" aria-hidden="true"></span><span class="text-sm text-secondary"><span id="spelling-count">٠</span> إملائي</span></div>
@@ -903,104 +964,95 @@
903
  <div class="max-w-7xl mx-auto px-6">
904
  <div class="text-center mb-16">
905
  <h1 class="text-5xl lg:text-6xl font-bold mb-6">خطط <span class="text-gradient">واضحة ومرنة</span></h1>
906
- <p class="text-xl max-w-3xl mx-auto" style="color: var(--text-secondary); line-height: 1.9;">اختر الخطة المناسبة لك. يمكنك الترقية أو التخفيض في أي وقت.</p>
 
 
 
 
 
 
 
 
907
  </div>
908
- <div class="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto"><!-- Free Plan -->
909
- <div class="p-8 rounded-3xl transition-all hover:scale-105" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
 
 
 
910
  <div class="text-center mb-8">
911
- <h3 class="text-3xl font-bold mb-2">مجاني</h3>
912
- <p class="text-base mb-6" style="color: var(--text-secondary);">للبدء والتجربة</p>
913
  <div class="text-6xl font-bold mb-2">
914
- ٠
915
  </div>
916
- <p class="text-base" style="color: var(--text-secondary);">مجاني للأبد</p>
917
  </div>
918
  <ul class="space-y-4 mb-8">
919
  <li class="flex items-center gap-3">
920
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
921
- </svg><span class="text-base">تدقيق إملائي أساسي</span></li>
922
  <li class="flex items-center gap-3">
923
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
924
- </svg><span class="text-base">٥٠٠ كلمة يوميًا</span></li>
925
  <li class="flex items-center gap-3">
926
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
927
- </svg><span class="text-base">محرر ويب</span></li>
928
  <li class="flex items-center gap-3">
929
- <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
930
- </svg><span class="text-base" style="color: var(--text-secondary);">اقتراحات نحوية</span></li>
931
  <li class="flex items-center gap-3">
932
- <svg class="w-5 h-5" style="color: rgba(241, 245, 249, 0.2);" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
933
- </svg><span class="text-base" style="color: var(--text-secondary);">تلخيص النصوص</span></li>
934
- </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> ابدأ مجانًا </button>
935
- </div><!-- Pro Plan (Most Popular) -->
936
- <div class="p-8 rounded-3xl transition-all hover:scale-105 relative shadow-2xl" style="background: linear-gradient(165deg, var(--surface-color) 0%, rgba(59, 130, 246, 0.1) 100%); border: 2px solid var(--primary-color);">
937
- <div class="pricing-badge gradient-accent text-white">
938
- الأكثر استخدامًا
 
939
  </div>
940
  <div class="text-center mb-8">
941
  <h3 class="text-3xl font-bold mb-2">احترافي</h3>
942
  <p class="text-base mb-6" style="color: var(--text-secondary);">للكُتّاب الجادين</p>
943
  <div class="flex items-center justify-center gap-2"><span class="text-6xl font-bold">٩</span>
944
  <div class="text-right">
945
- <div class="text-lg font-bold">
946
- دولار
947
- </div>
948
- <div class="text-sm" style="color: var(--text-secondary);">
949
- شهريًا
950
- </div>
951
  </div>
952
  </div>
953
  </div>
954
  <ul class="space-y-4 mb-8">
955
  <li class="flex items-center gap-3">
956
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
957
- </svg><span class="text-base">تدقيق إملائي ونحوي متقدم</span></li>
958
- <li class="flex items-center gap-3">
959
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
960
- </svg><span class="text-base">كلمات غير محدودة</span></li>
961
  <li class="flex items-center gap-3">
962
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
963
- </svg><span class="text-base">تصحيح علامات الترقيم</span></li>
964
  <li class="flex items-center gap-3">
965
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
966
- </svg><span class="text-base">تلخيص النصوص بالذكاء الاصطناعي</span></li>
967
  <li class="flex items-center gap-3">
968
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
969
- </svg><span class="text-base">تصدير PDF و Word</span></li>
970
- </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl"> الترقية للخطة الاحترافية </button>
971
- </div><!-- Enterprise Plan -->
972
- <div class="p-8 rounded-3xl transition-all hover:scale-105" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
 
 
973
  <div class="text-center mb-8">
974
  <h3 class="text-3xl font-bold mb-2">مؤسسات</h3>
975
  <p class="text-base mb-6" style="color: var(--text-secondary);">للفرق والمنظمات</p>
976
  <div class="flex items-center justify-center gap-2"><span class="text-6xl font-bold">٢٩</span>
977
  <div class="text-right">
978
- <div class="text-lg font-bold">
979
- دولار
980
- </div>
981
- <div class="text-sm" style="color: var(--text-secondary);">
982
- لكل مستخدم/شهر
983
- </div>
984
  </div>
985
  </div>
986
  </div>
987
  <ul class="space-y-4 mb-8">
988
  <li class="flex items-center gap-3">
989
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
990
- </svg><span class="text-base">كل ميزات الاحترافي</span></li>
991
  <li class="flex items-center gap-3">
992
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
993
- </svg><span class="text-base">إدارة الفرق</span></li>
994
  <li class="flex items-center gap-3">
995
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
996
- </svg><span class="text-base">واجهة برمجية (API)</span></li>
997
  <li class="flex items-center gap-3">
998
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
999
- </svg><span class="text-base">تكامل مخصص</span></li>
1000
  <li class="flex items-center gap-3">
1001
- <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
1002
- </svg><span class="text-base">دعم فني ذو أولوية</span></li>
1003
- </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-color);"> تواصل مع المبيعات </button>
1004
  </div>
1005
  </div>
1006
  </div>
@@ -1021,16 +1073,16 @@
1021
  <div class="grid grid-cols-1 md:grid-cols-3 gap-12 mb-12" dir="rtl">
1022
  <div>
1023
  <div class="flex items-center gap-3 mb-4">
1024
- <span id="footer-brand" class="text-2xl font-bold text-gradient">بيان</span>
1025
  </div>
1026
- <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">مساعد ذكي للكتابة العربية. يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص بدقة عالية.</p>
1027
  </div>
1028
  <div>
1029
  <h4 class="text-base font-bold mb-4">المنتج</h4>
1030
  <ul class="space-y-3">
1031
- <li><button onclick="showPage('editor')" class="text-sm transition-colors hover:text-white" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">المحرر</button></li>
1032
- <li><button onclick="showPage('features')" class="text-sm transition-colors hover:text-white" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">الميزات</button></li>
1033
- <li><button onclick="showPage('pricing')" class="text-sm transition-colors hover:text-white" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">الأسعار</button></li>
1034
  </ul>
1035
  </div>
1036
  <div>
@@ -1087,8 +1139,8 @@
1087
  const defaultConfig = {
1088
  brand_name: 'بيان',
1089
  hero_headline: 'اكتب العربية بثقة واحتراف',
1090
- hero_subheadline: 'مساعد ذكي يصحح الإملاء والنحو وعلامات الترقيم ويُلخّص النصوص العربية بدقة عالية.',
1091
- cta_primary: 'جربه الآن مجاناً',
1092
  primary_color: '#6BA3E0',
1093
  secondary_color: '#A594E8',
1094
  font_family: 'Cairo',
 
6
  <meta name="supabase-url" content="">
7
  <meta name="supabase-anon-key" content="">
8
  <title>بيان - مساعد الكتابة العربية الذكي</title>
9
+ <meta name="description" content="بيان — منصة ذكاء اصطناعي متكاملة لتصحيح الإملاء والنحو والترقيم وتلخيص النصوص والإكمال التلقائي — مصمّمة خصيصًا للغة العربية. جرّبه مجاناً!">
10
  <link rel="icon" type="image/svg+xml" href="/favicon.svg">
11
  <script src="https://cdn.tailwindcss.com"></script>
12
  <link rel="preconnect" href="https://fonts.googleapis.com">
 
161
  <div class="grid lg:grid-cols-2 gap-16 items-center"><!-- Hero Content -->
162
  <div class="text-center lg:text-right animate-fade-in">
163
 
164
+ <h1 id="hero-headline" class="text-5xl lg:text-7xl font-bold leading-tight mb-6" style="line-height: 1.4;">اكتب العربية<br><span class="text-gradient">بثقة واحتراف</span></h1>
165
+ <p id="hero-subheadline" class="text-xl lg:text-2xl leading-relaxed mb-10" style="color: var(--text-secondary); line-height: 1.9;">منصة ذكاء اصطناعي متكاملة لتصحيح الإملاء والنحو والترقيم وتلخيص النصوص والإكمال التلقائي — مصمّمة خصيصًا للغة العربية.</p>
166
+ <div class="flex flex-col sm:flex-row gap-4 justify-center lg:justify-start mb-12"><button id="hero-cta-primary" onclick="showPage('editor')" class="px-8 py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl">ابدأ الكتابة مجانًا </button> <button onclick="showPage('features')" class="px-8 py-4 rounded-2xl text-lg font-bold transition-all hover:scale-105 border-2" style="border-color: rgba(255, 255, 255, 0.35); color: var(--text-color); box-shadow: 0 0 20px rgba(107, 163, 224, 0.12);">اكتشف الميزات</button>
167
  </div><!-- Stats -->
168
  <div class="flex items-center gap-8 justify-center lg:justify-start">
169
  <div class="text-center">
170
  <div class="text-3xl font-bold text-gradient">
171
+ ٨ أدوات
172
  </div>
173
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
174
+ ذكاء اصطناعي
175
  </div>
176
  </div>
177
  <div class="w-px h-12" style="background: rgba(255, 255, 255, 0.2);"></div>
 
180
  فوري
181
  </div>
182
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
183
+ تحليل لحظي
184
  </div>
185
  </div>
186
  <div class="w-px h-12" style="background: rgba(255, 255, 255, 0.2);"></div>
 
189
  مجاني
190
  </div>
191
  <div class="text-sm mt-1" style="color: var(--text-secondary);">
192
+ لا يحتاج تسجيل
193
  </div>
194
  </div>
195
  </div>
 
205
  <div class="w-20"></div>
206
  </div><!-- Mock Editor Content -->
207
  <div class="p-8 editor-content text-right text-lg" dir="rtl" style="background: var(--surface-color); color: var(--text-color); min-height: 300px;">
208
+ <p class="mb-4">تعتبر اللغة العربية من أجمل <span class="spelling-error">اللغاة</span> في العالم، وهي لغة <span class="spelling-error">القرأن</span> الكريم<span class="punctuation-suggestion">.</span></p>
209
  <p class="mb-4">الطالبات <span class="grammar-error">ذهبوا</span> إلى المكتبة لأن <span class="spelling-error">الأمتحان</span> قريب جداً<span class="punctuation-suggestion">.</span></p>
210
  <p>محرر بيان يساعدك على كتابة نصوص عربية <span class="spelling-error">صحيحه</span> بكل سهولة!</p>
211
  </div><!-- Mock Stats Bar -->
212
  <div class="flex items-center justify-between p-4 border-t" style="border-color: rgba(255, 255, 255, 0.1);">
213
  <div class="flex items-center gap-6">
214
  <div class="flex items-center gap-2">
215
+ <div class="w-3 h-3 rounded-full" style="background: #ef4444;"></div><span class="text-sm" style="color: var(--text-secondary);">٤ إملائي</span>
216
  </div>
217
  <div class="flex items-center gap-2">
218
  <div class="w-3 h-3 rounded-full" style="background: #fbbf24;"></div><span class="text-sm" style="color: var(--text-secondary);">١ نحوي</span>
 
307
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">بوابتك للقرآن والتفسير والسنة والمصادر السردية الموثقة</p>
308
  </div>
309
  </div>
310
+ <div class="text-center mt-12"><button onclick="showPage('features')" class="px-8 py-4 rounded-2xl text-lg font-bold border-2 transition-all hover:scale-105" style="border-color: var(--primary-color); color: var(--primary-color);">شاهد جميع الميزات </button>
311
  </div>
312
  </div>
313
+ </section>
314
+ <!-- How It Works -->
315
+ <section class="py-24" style="background: var(--surface-color);">
316
+ <div class="max-w-7xl mx-auto px-6">
317
+ <div class="text-center mb-16">
318
+ <h2 class="text-4xl lg:text-5xl font-bold mb-6">كيف <span class="text-gradient">يعمل بيان؟</span></h2>
319
+ <p class="text-xl max-w-3xl mx-auto" style="color: var(--text-secondary); line-height: 1.9;">ثلاث خطوات بسيطة للحصول على نص عربي مثالي</p>
320
+ </div>
321
+ <div class="grid md:grid-cols-3 gap-8">
322
+ <!-- Step 1 -->
323
+ <div class="text-center p-8 rounded-3xl" style="background: var(--background-color); border: 1px solid var(--color-border);">
324
+ <div class="w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-6" style="background: linear-gradient(135deg, rgba(107, 163, 224, 0.15), rgba(107, 163, 224, 0.05));">
325
+ <svg width="28" height="28" fill="none" stroke="var(--color-primary)" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>
326
+ </div>
327
+ <div class="text-sm font-bold mb-2 text-gradient">الخطوة ١</div>
328
+ <h3 class="text-xl font-bold mb-3">اكتب نصّك</h3>
329
+ <p class="text-sm" style="color: var(--text-secondary); line-height: 1.8;">اكتب أو الصق نصك العربي في المحرر — يدعم جميع أنماط الكتابة</p>
330
+ </div>
331
+ <!-- Step 2 -->
332
+ <div class="text-center p-8 rounded-3xl" style="background: var(--background-color); border: 1px solid var(--color-border);">
333
+ <div class="w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-6" style="background: linear-gradient(135deg, rgba(165, 148, 232, 0.15), rgba(165, 148, 232, 0.05));">
334
+ <svg width="28" height="28" fill="none" stroke="var(--color-secondary)" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"/></svg>
335
+ </div>
336
+ <div class="text-sm font-bold mb-2 text-gradient">الخطوة ٢</div>
337
+ <h3 class="text-xl font-bold mb-3">تحليل تلقائي</h3>
338
+ <p class="text-sm" style="color: var(--text-secondary); line-height: 1.8;">يحلل بيان النص فورًا ويكتشف الأخطاء الإملائية والنحوية والترقيمية</p>
339
+ </div>
340
+ <!-- Step 3 -->
341
+ <div class="text-center p-8 rounded-3xl" style="background: var(--background-color); border: 1px solid var(--color-border);">
342
+ <div class="w-16 h-16 rounded-2xl flex items-center justify-center mx-auto mb-6" style="background: linear-gradient(135deg, rgba(107, 201, 138, 0.15), rgba(107, 201, 138, 0.05));">
343
+ <svg width="28" height="28" fill="none" stroke="var(--color-success)" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
344
+ </div>
345
+ <div class="text-sm font-bold mb-2 text-gradient">الخطوة ٣</div>
346
+ <h3 class="text-xl font-bold mb-3">صحّح بضغطة</h3>
347
+ <p class="text-sm" style="color: var(--text-secondary); line-height: 1.8;">اختر الاقتراح المناسب وطبّقه بضغطة واحدة — أو طبّق الكل دفعة واحدة</p>
348
+ </div>
349
+ </div>
350
+ <div class="text-center mt-12">
351
+ <button onclick="showPage('editor')" class="px-8 py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl">جرّب المحرر الآن →</button>
352
+ </div>
353
+ </div>
354
+ </section>
355
+ </div><!-- Features Page -->
356
  <div id="page-features" class="page">
357
  <section class="pt-32 pb-24" style="background: var(--background-color);">
358
  <div class="max-w-7xl mx-auto px-6">
 
842
  </div>
843
  </div>
844
  </div>
845
+ <!-- Dialect Conversion Panel -->
846
+ <div id="dialect-area" class="summarize-panel is-hidden">
847
+ <div class="mb-4">
848
+ <div class="flex items-center gap-2 mb-3">
849
+ <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24" style="color: #f97316;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"/></svg>
850
+ <span class="text-base font-bold">تحويل اللهجات للفصحى</span>
851
+ <span class="text-xs px-2 py-0.5 rounded-full" style="background: rgba(249, 115, 22, 0.15); color: #f97316;">قيد التطوير</span>
852
+ </div>
853
+ <p class="text-sm mb-4" style="color: var(--text-secondary);">اكتب نصًا بأي لهجة عربية (مصرية، خليجية، شامية...) وسنحوّله إلى لغة عربية فصحى سليمة.</p>
854
+ </div>
855
+ <textarea id="dialect-input" class="w-full p-4 rounded-xl text-right text-lg editor-content" dir="rtl" rows="6" placeholder="اكتب النص باللهجة هنا... مثال: ازيك يا صاحبي، انت فين دلوقتي؟" style="background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-primary); resize: vertical; font-family: inherit;"></textarea>
856
+ <button onclick="convertDialect()" class="btn-primary w-full py-4 text-lg mt-4 mb-4" type="button" style="background: linear-gradient(135deg, #f97316, #ea580c);">تحويل إلى الفصحى</button>
857
+ <div id="dialect-result-card" class="is-hidden" style="background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 1rem; padding: 1.5rem;">
858
+ <div class="flex items-center justify-between mb-3">
859
+ <h3 class="text-base font-bold" style="color: #f97316;">✓ النص بالعربية الفصحى</h3>
860
+ <button onclick="copyDialectResult()" class="btn-ghost text-sm" type="button">نسخ</button>
861
+ </div>
862
+ <div id="dialect-result" class="text-right text-lg editor-content" dir="rtl" style="line-height: 2;"></div>
863
+ </div>
864
+ </div>
865
  <div class="editor-footer">
866
  <div class="editor-stats" role="status" aria-label="إحصائيات">
867
  <div class="flex items-center gap-2"><span class="stat-dot stat-dot--spelling" aria-hidden="true"></span><span class="text-sm text-secondary"><span id="spelling-count">٠</span> إملائي</span></div>
 
964
  <div class="max-w-7xl mx-auto px-6">
965
  <div class="text-center mb-16">
966
  <h1 class="text-5xl lg:text-6xl font-bold mb-6">خطط <span class="text-gradient">واضحة ومرنة</span></h1>
967
+ <p class="text-xl max-w-3xl mx-auto" style="color: var(--text-secondary); line-height: 1.9;">جميع الميزات متاحة مجانًا خلال الإصدار التجريبي. الخطط المدفوعة قادمة قريبًا.</p>
968
+ </div>
969
+ <!-- Beta Banner -->
970
+ <div class="text-center mb-12 p-6 rounded-2xl" style="background: linear-gradient(135deg, rgba(107, 163, 224, 0.1), rgba(165, 148, 232, 0.1)); border: 1px solid rgba(107, 163, 224, 0.2);">
971
+ <div class="flex items-center justify-center gap-2 mb-2">
972
+ <span class="text-sm font-bold px-3 py-1 rounded-full text-white gradient-accent">BETA</span>
973
+ <span class="text-lg font-bold">الإصدار التجريبي — مجاني بالكامل</span>
974
+ </div>
975
+ <p class="text-base" style="color: var(--text-secondary);">استمتع بجميع ميزات بيان بدون أي قيود أثناء فترة التطوير</p>
976
  </div>
977
+ <div class="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto"><!-- Current: Beta Free -->
978
+ <div class="p-8 rounded-3xl transition-all hover:scale-105 relative shadow-2xl" style="background: linear-gradient(165deg, var(--surface-color) 0%, rgba(59, 130, 246, 0.1) 100%); border: 2px solid var(--primary-color);">
979
+ <div class="pricing-badge gradient-accent text-white">
980
+ متاح الآن
981
+ </div>
982
  <div class="text-center mb-8">
983
+ <h3 class="text-3xl font-bold mb-2">الإصدار التجريبي</h3>
984
+ <p class="text-base mb-6" style="color: var(--text-secondary);">جميع الميزات بدون قيود</p>
985
  <div class="text-6xl font-bold mb-2">
986
+ مجاني
987
  </div>
988
+ <p class="text-base" style="color: var(--text-secondary);">لفترة محدودة</p>
989
  </div>
990
  <ul class="space-y-4 mb-8">
991
  <li class="flex items-center gap-3">
992
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تدقيق إملائي ونحوي متقدم</span></li>
 
993
  <li class="flex items-center gap-3">
994
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تصحيح علامات الترقيم</span></li>
 
995
  <li class="flex items-center gap-3">
996
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تلخيص النصوص بالذكاء الاصطناعي</span></li>
 
997
  <li class="flex items-center gap-3">
998
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">الإكمال التلقائي الذكي</span></li>
 
999
  <li class="flex items-center gap-3">
1000
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تصدير PDF و Word</span></li>
1001
+ <li class="flex items-center gap-3">
1002
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">كلمات غير محدودة</span></li>
1003
+ </ul><button onclick="showPage('editor')" class="w-full py-4 rounded-2xl text-lg font-bold text-white gradient-accent transition-all hover:scale-105 hover:shadow-2xl">ابدأ الكتابة مجانًا →</button>
1004
+ </div><!-- Future: Pro Plan -->
1005
+ <div class="p-8 rounded-3xl transition-all hover:scale-105 relative" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08); opacity: 0.7;">
1006
+ <div class="pricing-badge" style="background: var(--color-surface-elevated); color: var(--color-text-secondary);">
1007
+ قريبًا
1008
  </div>
1009
  <div class="text-center mb-8">
1010
  <h3 class="text-3xl font-bold mb-2">احترافي</h3>
1011
  <p class="text-base mb-6" style="color: var(--text-secondary);">للكُتّاب الجادين</p>
1012
  <div class="flex items-center justify-center gap-2"><span class="text-6xl font-bold">٩</span>
1013
  <div class="text-right">
1014
+ <div class="text-lg font-bold">دولار</div>
1015
+ <div class="text-sm" style="color: var(--text-secondary);">شهريًا</div>
 
 
 
 
1016
  </div>
1017
  </div>
1018
  </div>
1019
  <ul class="space-y-4 mb-8">
1020
  <li class="flex items-center gap-3">
1021
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">كل ميزات الإصدار التجريبي</span></li>
 
 
 
 
1022
  <li class="flex items-center gap-3">
1023
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">أولوية في التحليل</span></li>
 
1024
  <li class="flex items-center gap-3">
1025
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تخزين سحابي للمستندات</span></li>
 
1026
  <li class="flex items-center gap-3">
1027
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">دعم فني مباشر</span></li>
1028
+ </ul><button disabled class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-secondary); cursor: not-allowed;">قريبًا</button>
1029
+ </div><!-- Future: Enterprise Plan -->
1030
+ <div class="p-8 rounded-3xl transition-all hover:scale-105" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08); opacity: 0.7;">
1031
+ <div class="pricing-badge" style="background: var(--color-surface-elevated); color: var(--color-text-secondary);">
1032
+ قريبًا
1033
+ </div>
1034
  <div class="text-center mb-8">
1035
  <h3 class="text-3xl font-bold mb-2">مؤسسات</h3>
1036
  <p class="text-base mb-6" style="color: var(--text-secondary);">للفرق والمنظمات</p>
1037
  <div class="flex items-center justify-center gap-2"><span class="text-6xl font-bold">٢٩</span>
1038
  <div class="text-right">
1039
+ <div class="text-lg font-bold">دولار</div>
1040
+ <div class="text-sm" style="color: var(--text-secondary);">لكل مستخدم/شهر</div>
 
 
 
 
1041
  </div>
1042
  </div>
1043
  </div>
1044
  <ul class="space-y-4 mb-8">
1045
  <li class="flex items-center gap-3">
1046
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">كل ميزات الاحترافي</span></li>
 
1047
  <li class="flex items-center gap-3">
1048
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">إدارة الفرق</span></li>
 
1049
  <li class="flex items-center gap-3">
1050
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">واجهة برمجية (API)</span></li>
 
1051
  <li class="flex items-center gap-3">
1052
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">تكامل مخصص</span></li>
 
1053
  <li class="flex items-center gap-3">
1054
+ <svg class="w-5 h-5" style="color: #22c55e;" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" /></svg><span class="text-base">دعم فني ذو أولوية</span></li>
1055
+ </ul><button disabled class="w-full py-4 rounded-2xl text-lg font-bold border-2 transition-all" style="border-color: rgba(255, 255, 255, 0.2); color: var(--text-secondary); cursor: not-allowed;">قريبًا</button>
 
1056
  </div>
1057
  </div>
1058
  </div>
 
1073
  <div class="grid grid-cols-1 md:grid-cols-3 gap-12 mb-12" dir="rtl">
1074
  <div>
1075
  <div class="flex items-center gap-3 mb-4">
1076
+ <svg width="24" height="24" fill="none" stroke="url(#grad1)" viewBox="0 0 24 24" style="flex-shrink:0;"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:var(--color-primary)"/><stop offset="100%" style="stop-color:var(--color-secondary)"/></linearGradient></defs><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/></svg><span id="footer-brand" class="text-2xl font-bold text-gradient">بيان</span>
1077
  </div>
1078
+ <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">منصة ذكاء اصطناعي للكتابة العربية — تدقيق إملائي ونحوي، ترقيم، تلخيص، وإكمال تلقائي ذكي.</p>
1079
  </div>
1080
  <div>
1081
  <h4 class="text-base font-bold mb-4">المنتج</h4>
1082
  <ul class="space-y-3">
1083
+ <li><button onclick="showPage('editor')" class="text-sm transition-colors footer-link-hover" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">المحرر</button></li>
1084
+ <li><button onclick="showPage('features')" class="text-sm transition-colors footer-link-hover" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">الميزات</button></li>
1085
+ <li><button onclick="showPage('pricing')" class="text-sm transition-colors footer-link-hover" style="color: var(--text-secondary); background: none; border: none; cursor: pointer; font-family: inherit;">الأسعار</button></li>
1086
  </ul>
1087
  </div>
1088
  <div>
 
1139
  const defaultConfig = {
1140
  brand_name: 'بيان',
1141
  hero_headline: 'اكتب العربية بثقة واحتراف',
1142
+ hero_subheadline: 'منصة ذكاء اصطناعي متكاملة لتصحيح الإملاء والنحو والترقيم وتلخيص النصوص والإكمال التلقائي — مصمّمة خصيصًا للغة العربية.',
1143
+ cta_primary: 'ابدأ الكتابة مجانًا',
1144
  primary_color: '#6BA3E0',
1145
  secondary_color: '#A594E8',
1146
  font_family: 'Cairo',
src/js/editor.js CHANGED
@@ -674,21 +674,57 @@ function applySuggestionById(id) {
674
 
675
  function applyAllSuggestions() {
676
  // CRITICAL: Sort in REVERSE order (highest start offset first).
677
- // Applying edits back-to-front preserves the offset validity of all
678
- // subsequent edits. Front-to-back would invalidate every offset after
679
- // the first edit due to text length changes. Do NOT change this sort.
680
  const suggestions = [...(window.currentSuggestions || [])].sort((a, b) => b.start - a.start);
681
  if (suggestions.length === 0) return;
682
  _isApplyingSuggestion = true;
683
  try {
684
  pushUndoState(); // Save state before applying all
685
 
686
- let text = getEditorText();
 
687
  suggestions.forEach((s) => {
688
- text = text.substring(0, s.start) + s.correction + text.substring(s.end);
 
 
 
 
 
 
 
 
 
689
  });
690
 
691
- setEditorHTML(escapeHtml(text));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  hideTooltip();
693
 
694
  // Clear suggestions
@@ -696,7 +732,6 @@ function applyAllSuggestions() {
696
  updateSuggestionCounts(0, 0, 0);
697
  updateWritingScore(0, 0, 0);
698
  updateSuggestionsList([]);
699
- // Pipeline Hardening v3.3: Do NOT call analyzeTextDelayed() — prevents recursive re-analysis
700
  if (typeof showToast === 'function') showToast('✓ تم تطبيق ' + suggestions.length + ' تصحيح');
701
  } finally {
702
  _isApplyingSuggestion = false;
 
674
 
675
  function applyAllSuggestions() {
676
  // CRITICAL: Sort in REVERSE order (highest start offset first).
 
 
 
677
  const suggestions = [...(window.currentSuggestions || [])].sort((a, b) => b.start - a.start);
678
  if (suggestions.length === 0) return;
679
  _isApplyingSuggestion = true;
680
  try {
681
  pushUndoState(); // Save state before applying all
682
 
683
+ // DOM-based approach: replace each error span individually to preserve formatting
684
+ let appliedCount = 0;
685
  suggestions.forEach((s) => {
686
+ const sid = s.id;
687
+ const errorSpan = sid ? document.querySelector(`[data-suggestion-id="${sid}"]`) : null;
688
+ if (errorSpan) {
689
+ const parent = errorSpan.parentNode;
690
+ const correctedNode = document.createTextNode(s.correction);
691
+ parent.insertBefore(correctedNode, errorSpan);
692
+ parent.removeChild(errorSpan);
693
+ parent.normalize();
694
+ appliedCount++;
695
+ }
696
  });
697
 
698
+ // Fallback: if DOM approach missed some, do text-based replacement
699
+ if (appliedCount < suggestions.length) {
700
+ let text = getEditorText();
701
+ // Re-sort remaining by offset (they weren't found as spans)
702
+ const remaining = suggestions.filter(s => {
703
+ const sid = s.id;
704
+ return !sid || !document.querySelector(`[data-suggestion-id="${sid}"]`);
705
+ }).sort((a, b) => b.start - a.start);
706
+ remaining.forEach((s) => {
707
+ text = text.substring(0, s.start) + s.correction + text.substring(s.end);
708
+ });
709
+ if (remaining.length > 0) {
710
+ setEditorHTML(escapeHtml(text));
711
+ }
712
+ }
713
+
714
+ // Place cursor at end of editor content
715
+ const editor = getEditorElement();
716
+ if (editor) {
717
+ try {
718
+ const sel = window.getSelection();
719
+ const range = document.createRange();
720
+ range.selectNodeContents(editor);
721
+ range.collapse(false);
722
+ sel.removeAllRanges();
723
+ sel.addRange(range);
724
+ } catch(e) {}
725
+ editor.focus();
726
+ }
727
+
728
  hideTooltip();
729
 
730
  // Clear suggestions
 
732
  updateSuggestionCounts(0, 0, 0);
733
  updateWritingScore(0, 0, 0);
734
  updateSuggestionsList([]);
 
735
  if (typeof showToast === 'function') showToast('✓ تم تطبيق ' + suggestions.length + ' تصحيح');
736
  } finally {
737
  _isApplyingSuggestion = false;
src/js/ui.js CHANGED
@@ -204,31 +204,43 @@ function focusSuggestionInEditor(suggestionId) {
204
  if (span) showTooltip(span);
205
  }
206
 
 
207
  function setAnalyzingState(isAnalyzing) {
208
  const editor = getEditorElement();
209
  const indicator = document.getElementById('analyzing-indicator');
210
 
211
  if (editor) {
212
- editor.classList.toggle('analyzing', isAnalyzing);
213
  editor.setAttribute('aria-busy', isAnalyzing ? 'true' : 'false');
214
  }
215
- if (indicator) {
216
- indicator.classList.toggle('active', isAnalyzing);
217
- }
218
 
219
- // Show skeleton loading in suggestions panel
220
  if (isAnalyzing) {
221
- const lists = [
222
- document.getElementById('suggestions-list'),
223
- document.getElementById('bottom-sheet-list')
224
- ].filter(Boolean);
225
- const skeletonHTML = `
226
- <div style="padding: 16px;">
227
- <div class="skeleton skeleton-line" style="width:80%"></div>
228
- <div class="skeleton skeleton-line" style="width:100%"></div>
229
- <div class="skeleton skeleton-line" style="width:65%"></div>
230
- </div>`;
231
- lists.forEach(el => { el.innerHTML = skeletonHTML; });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
233
  }
234
 
 
204
  if (span) showTooltip(span);
205
  }
206
 
207
+ let _analyzingTimer = null;
208
  function setAnalyzingState(isAnalyzing) {
209
  const editor = getEditorElement();
210
  const indicator = document.getElementById('analyzing-indicator');
211
 
212
  if (editor) {
 
213
  editor.setAttribute('aria-busy', isAnalyzing ? 'true' : 'false');
214
  }
 
 
 
215
 
 
216
  if (isAnalyzing) {
217
+ // Debounce: only show indicator after 400ms to prevent flicker on fast re-analyses
218
+ if (!_analyzingTimer) {
219
+ _analyzingTimer = setTimeout(() => {
220
+ if (editor) editor.classList.add('analyzing');
221
+ if (indicator) indicator.classList.add('active');
222
+ // Show skeleton loading in suggestions panel
223
+ const lists = [
224
+ document.getElementById('suggestions-list'),
225
+ document.getElementById('bottom-sheet-list')
226
+ ].filter(Boolean);
227
+ const skeletonHTML = `
228
+ <div style="padding: 16px;">
229
+ <div class="skeleton skeleton-line" style="width:80%"></div>
230
+ <div class="skeleton skeleton-line" style="width:100%"></div>
231
+ <div class="skeleton skeleton-line" style="width:65%"></div>
232
+ </div>`;
233
+ lists.forEach(el => { el.innerHTML = skeletonHTML; });
234
+ }, 400);
235
+ }
236
+ } else {
237
+ // Clear timer and hide immediately
238
+ if (_analyzingTimer) {
239
+ clearTimeout(_analyzingTimer);
240
+ _analyzingTimer = null;
241
+ }
242
+ if (editor) editor.classList.remove('analyzing');
243
+ if (indicator) indicator.classList.remove('active');
244
  }
245
  }
246