Commit ·
078df28
1
Parent(s): 0475556
chore: revert frontend UI changes to 7aa0d90 to fix layout blowout
Browse filesFiles changed (7)
11 unmodified lines1213141516171811 unmodified lines}body {overflow-x: hidden;font-family: var(--font-family-primary);font-size: var(--font-size-body);font-weight: var(--font-weight-regular);11 unmodified lines12131415161711 unmodified lines}body {font-family: var(--font-family-primary);font-size: var(--font-size-body);font-weight: var(--font-weight-regular);
298 unmodified lines2993003013023033043053063073083097 unmodified lines31731831932032132232332432532632722 unmodified lines3503513523533543553568 unmodified lines3653663673683693703713723733743753763772 unmodified lines38038138238338438538611 unmodified lines3983994004014024034044054064074084093 unmodified lines413414415416417418419420421422423424425426427428429430431432433128 unmodified lines56256356456556656756880 unmodified lines64965065165265365465565665765865966066166266333 unmodified lines6976986997007017027035 unmodified lines7097107117127137147157167177187197207217227237247257267277287297307317323 unmodified lines736737738739740741742113 unmodified lines85685785885986086186286386486586686786886987087187292 unmodified lines96596696796896997097176 unmodified lines104810491050105110521053105410551056105710581059106010611062426 unmodified lines148914901491149214931494149514961497149 unmodified lines1647164816491650165116521653165416551656165716581659414 unmodified lines20742075207620772078207920802081398 unmodified lines24802481248224832484248524868 unmodified lines2495249624972498249925002501183 unmodified lines2685268626872688268926902691208 unmodified lines29002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293532 unmodified lines296829692970297129722973297410 unmodified lines298529862987298829892990299129922993299429952996299752 unmodified lines3050305130523053305430553056305730583059306030613062306330649 unmodified lines3074307530763077307830793080308130823083308430852 unmodified lines3088308930903091309230933094309530963097309830993100310131023103310431054 unmodified lines311031113112311331143115311631173118311931205 unmodified lines3126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317224 unmodified lines319731983199320032013202320310 unmodified lines32143215321632173218321932203221322232233224322532263227322813 unmodified lines324232433244324532463247324832495 unmodified lines3255325632573258325932603261326232633264326525 unmodified lines329132923293329432953296329710 unmodified lines33083309331033113312331333143315331633175 unmodified lines33233324332533263327332833292 unmodified lines333233333334333533363337333825 unmodified lines33643365336633673368336933703371337233733374337533763377337833 unmodified lines3412341334143415341634173418341934203421342234233424342534266 unmodified lines3433343434353436343734383439344034413442344334443445344634476 unmodified lines345434553456345734583459346034613462346334646 unmodified lines347134723473347434753476347713 unmodified lines34913492349334943495349634979 unmodified lines35073508350935103511351235135 unmodified lines351935203521352235233524352535263527352835293530353112 unmodified lines35443545354635473548354935505 unmodified lines355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035816 unmodified lines35883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036211 unmodified line362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436455 unmodified lines365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368731 unmodified lines3719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374710 unmodified lines37583759376037613762376337643765376637673768376911 unmodified lines37813782378337843785378637877 unmodified lines379537963797379837993800380138023803380438055 unmodified lines381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122298 unmodified linesposition: relative;}.editor-shell>*:first-child {border-radius: var(--radius-card) var(--radius-card) 0 0;}.editor-shell>*:last-child {border-radius: 0 0 var(--radius-card) var(--radius-card);}7 unmodified linesbackground: var(--color-surface);}.editor-toolbar>*:first-child {justify-self: start;}.editor-toolbar>*:last-child {justify-self: end;}22 unmodified lines.editor-tab:hover {color: var(--color-text-primary);background: rgba(255, 255, 255, 0.06);}.editor-tab.active {8 unmodified linesalign-items: center;gap: 5px;}.tab-icon {flex-shrink: 0;opacity: 0.8;vertical-align: middle;}.editor-tab.active .tab-icon {opacity: 1;}2 unmodified lines[data-tooltip] {position: relative;}[data-tooltip]::after {content: attr(data-tooltip);position: absolute;11 unmodified linesopacity: 0;visibility: hidden;transition: all 0.2s ease;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);border: 1px solid var(--color-border);z-index: 300;font-family: inherit;}[data-tooltip]:hover::after {opacity: 1;visibility: visible;3 unmodified lines/* ── Formatting Toolbar ── */.format-toolbar {display: flex;flex-wrap: wrap;align-items: center;justify-content: center;gap: 6px 3px; /* vertical and horizontal gaps */padding: 6px 10px;border-bottom: 1px solid var(--color-border);background: var(--color-surface);position: relative;z-index: 40;flex-shrink: 0;}.fmt-group {display: flex;flex-wrap: nowrap;align-items: center;gap: 1px;background: var(--color-border);128 unmodified linesbackground: var(--color-surface);border: 1px solid var(--color-border);border-radius: 8px;box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);padding: 4px;z-index: 200;opacity: 0;80 unmodified lines}@media (min-width: 768px) {.editor-surface {min-height: 60vh;}}@media (min-width: 1024px) {.editor-surface {min-height: 500px;}}.editor-surface:focus {33 unmodified lines.editor-stats {display: flex;flex-wrap: nowrap;gap: var(--spacing-md);align-items: center;}5 unmodified linesflex-shrink: 0;}.stat-dot--spelling {background: var(--color-error);}.stat-dot--grammar {background: var(--color-warning);}.stat-dot--punctuation {background: var(--color-success);}.editor-actions {display: flex;flex-wrap: nowrap;gap: var(--spacing-sm);}.editor-actions .btn-ghost,.editor-actions .doc-dropdown .btn-ghost {width: 40px;3 unmodified linesdisplay: inline-flex;align-items: center;justify-content: center;flex-shrink: 0;}/* ── Buttons ── */113 unmodified linesgap: var(--spacing-sm);}.popover-type--spelling {color: var(--color-error);}.popover-type--grammar {color: var(--color-warning);}.popover-type--punctuation {color: var(--color-success);}.popover-original-word {font-size: var(--font-size-sm);92 unmodified linescursor: pointer;transition: all var(--transition-fast);}.popover-dismiss:hover {color: var(--color-error);border-color: var(--color-error);76 unmodified lines}@keyframes fadeIn {from {opacity: 0;transform: translateY(4px);}to {opacity: 1;transform: translateY(0);}}426 unmodified lines.editor-layout.tools-mode {grid-template-columns: 1fr !important;}.editor-layout.tools-mode>.docs-panel-desktop,.editor-layout.tools-mode>.sidebar-panel {display: none !important;}149 unmodified linesborder: 1px solid var(--color-primary-subtle-border);}.check-icon {color: var(--color-success);}.muted-icon {color: var(--color-text-muted);}.demo-editor-surface {background: var(--color-editor);414 unmodified linestransform: translateX(100%);transition: transform var(--transition-slow), box-shadow var(--transition-slow);box-shadow: none;padding-top: 64px;/* below nav */}.docs-sidebar.is-open {398 unmodified linesbackground: linear-gradient(135deg, var(--color-primary), var(--color-secondary));cursor: pointer;border: 3px solid var(--color-surface);box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);transition: transform 0.15s ease;}8 unmodified linesbackground: linear-gradient(135deg, var(--color-primary), var(--color-secondary));cursor: pointer;border: 3px solid var(--color-surface);box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);}/* ── Item 3: Empty States ── */183 unmodified linesfont-weight: 700;color: var(--color-text-muted);}.fmt-color-swatch--reset:hover {border-color: var(--color-error);color: var(--color-error);208 unmodified linesanimation: toast-out 0.25s ease forwards;}.toast--success {border-color: rgba(34, 197, 94, 0.4);}.toast--error {border-color: rgba(239, 68, 68, 0.4);}@keyframes toast-in {from {opacity: 0;transform: translateY(16px);}to {opacity: 1;transform: translateY(0);}}@keyframes toast-out {from {opacity: 1;transform: translateY(0);}to {opacity: 0;transform: translateY(16px);}}/* ── Scroll to Top ── */32 unmodified lines/* ── Loading Skeleton ── */.skeleton {background: linear-gradient(90deg, var(--color-border) 25%, rgba(255, 255, 255, 0.08) 50%, var(--color-border) 75%);background-size: 200% 100%;animation: skeleton-shimmer 1.5s ease infinite;border-radius: 8px;10 unmodified lines}@keyframes skeleton-shimmer {0% {background-position: 200% 0;}100% {background-position: -200% 0;}}/* ── Word Count Goal ── */52 unmodified lines}@keyframes punc-blink {0%,100% {border-left-color: var(--highlight-punctuation-border);}50% {border-left-color: transparent;}}/* ── Fix #6: Document title truncation ── */9 unmodified lines/* ── Fix #8: Editor placeholder alignment (Removed hack) ── *//* ── Fix #11: Pricing cards equal heights ── */#page-pricing .grid>div {display: flex;flex-direction: column;}#page-pricing .grid>div>ul {flex: 1;}2 unmodified linescursor: default;transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;}.window-dots:hover .dot--red {transform: scale(1.25);box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);}.window-dots:hover .dot--yellow {transform: scale(1.25);box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);transition-delay: 0.05s;}.window-dots:hover .dot--green {transform: scale(1.25);box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);4 unmodified lines.sidebar-desktop.collapsed {display: none !important;}.editor-layout.editor-fullscreen {grid-template-columns: 1fr !important;}.editor-layout.editor-fullscreen .sidebar-panel.sidebar-desktop,.editor-layout.editor-fullscreen .docs-panel,.editor-layout.editor-fullscreen .docs-panel-desktop {5 unmodified linescolor: #3A424E;background: rgba(26, 29, 33, 0.04);}[data-theme="light"] .fmt-btn:hover {background: rgba(26, 29, 33, 0.1);color: #1A1D21;}[data-theme="light"] .fmt-btn.fmt-active {background: rgba(43, 108, 184, 0.14);color: #2B6CB8;}[data-theme="light"] .format-toolbar {background: #FAF9F6;border-bottom-color: rgba(26, 29, 33, 0.12);}[data-theme="light"] .surface-card {box-shadow: 0 2px 8px rgba(26, 29, 33, 0.06);border: 1px solid rgba(26, 29, 33, 0.08);}[data-theme="light"] .editor-tab {color: #5A6472;}[data-theme="light"] .editor-tab:hover {color: #1A1D21;background: rgba(26, 29, 33, 0.06);}[data-theme="light"] .editor-tab.active {color: #fff !important;background: linear-gradient(135deg, #4A8FD4, #7C6BC4);box-shadow: 0 2px 8px rgba(74, 143, 212, 0.25);}[data-theme="light"] .stat-item {color: #3A424E;opacity: 1;}[data-theme="light"] .scroll-top-btn {box-shadow: 0 4px 16px rgba(26, 29, 33, 0.15);}24 unmodified lines#autocomplete-dropdown {position: fixed;background: var(--color-surface, #1a1d21);border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));border-radius: 10px;box-shadow:0 4px 24px rgba(0, 0, 0, 0.25),10 unmodified lines}@keyframes ac-dropdown-in {from {opacity: 0;transform: translateY(-4px);}to {opacity: 1;transform: translateY(0);}}/* ── Dropdown Items ── */13 unmodified lines.ac-dropdown-item:hover,.ac-dropdown-item.ac-selected {background: linear-gradient(135deg,rgba(107, 163, 224, 0.15),rgba(160, 131, 237, 0.12));color: var(--color-primary, #6ba3e0);}5 unmodified lines#autocomplete-dropdown::-webkit-scrollbar {width: 4px;}#autocomplete-dropdown::-webkit-scrollbar-track {background: transparent;}#autocomplete-dropdown::-webkit-scrollbar-thumb {background: rgba(255, 255, 255, 0.12);border-radius: 2px;25 unmodified lines/* ── Print: hide autocomplete ── */@media print {#autocomplete-ghost,#autocomplete-dropdown {display: none !important;10 unmodified linesjustify-content: center;padding: 1rem;}.quran-modal.is-hidden {display: none;}/* Quran applied text — protected from analysis */.quran-applied {5 unmodified linescursor: default;user-select: text;}.quran-applied .spelling-error,.quran-applied .grammar-error,.quran-applied .punctuation-suggestion {2 unmodified linesbackground: none !important;cursor: default !important;}.quran-ref-inline {font-size: 0.72em;opacity: 0.6;25 unmodified lines}@keyframes quranModalIn {from {opacity: 0;transform: scale(0.95) translateY(10px);}to {opacity: 1;transform: scale(1) translateY(0);}}.quran-result-card {33 unmodified linestransition: all 0.2s;white-space: nowrap;}.quran-apply-btn:hover {transform: scale(1.05);box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);}.quran-apply-btn.is-hidden {display: none;}.quran-copy-btn {padding: 6px 10px;6 unmodified linestransition: all 0.2s;line-height: 1;}.quran-copy-btn:hover {background: rgba(6, 182, 212, 0.2);transform: scale(1.05);}.quran-copy-btn.is-hidden {display: none;}.quran-lang-select {padding: 6px 12px;6 unmodified linescursor: pointer;transition: border-color 0.2s;}.quran-lang-select:hover {border-color: #06b6d4;}.quran-lang-select:focus {outline: none;border-color: #06b6d4;6 unmodified linesborder-radius: 1.25rem;padding: 1.25rem;}.quran-uthmani {font-size: 20px;}13 unmodified lines.card-hover {transition: transform var(--transition-base), box-shadow var(--transition-base);}.card-hover:hover {transform: translateY(-3px);box-shadow: var(--shadow-glow);9 unmodified linestext-align: center;gap: 0.75rem;}.empty-state__icon {width: 48px;height: 48px;5 unmodified linescolor: var(--color-primary);margin-bottom: 0.25rem;}.empty-state__title {font-size: var(--font-size-body);font-weight: var(--font-weight-semibold);color: var(--color-text-primary);}.empty-state__subtitle {font-size: var(--font-size-caption);color: var(--color-text-secondary);12 unmodified linesjustify-content: center;animation: fadeIn 0.15s ease-out;}.confirm-dialog {background: var(--color-surface);border: 1px solid var(--color-border-strong);5 unmodified linestext-align: center;animation: modalSlideUp 0.25s ease-out;}.confirm-dialog__title {font-size: 1.125rem;font-weight: var(--font-weight-bold);margin-bottom: 0.5rem;}.confirm-dialog__message {font-size: var(--font-size-caption);color: var(--color-text-secondary);margin-bottom: 1.5rem;line-height: 1.7;}.confirm-dialog__actions {display: flex;gap: 0.75rem;justify-content: center;}.confirm-dialog__btn {padding: 0.6rem 1.5rem;border-radius: var(--radius-md);6 unmodified linestransition: all var(--transition-fast);font-family: inherit;}.confirm-dialog__btn:hover {background: var(--color-border);}.confirm-dialog__btn--danger {background: var(--color-error);color: white;border-color: transparent;}.confirm-dialog__btn--danger:hover {opacity: 0.9;}/* ── Modal entrance animation ── */@keyframes modalSlideUp {from {opacity: 0;transform: translateY(16px) scale(0.97);}to {opacity: 1;transform: translateY(0) scale(1);}}.quran-modal-panel,.auth-gate-panel,.confirm-dialog {1 unmodified line}/* ── Toast with icons ── */.toast--success::before {content: '✓ ';}.toast--error::before {content: '✕ ';}.toast--warning::before {content: '⚠ ';}/* ── Pricing card glow (active plan) ── */.pricing-glow {position: relative;}.pricing-glow::before {content: '';position: absolute;5 unmodified linesfilter: blur(12px);animation: pricingPulse 3s ease-in-out infinite;}@keyframes pricingPulse {0%,100% {opacity: 0.3;}50% {opacity: 0.6;}}/* ── Beta banner shimmer ── */@keyframes betaShimmer {0% {background-position: -200% center;}100% {background-position: 200% center;}}.beta-shimmer {background-size: 200% auto;background-image: linear-gradient(90deg,transparent 0%,rgba(107, 163, 224, 0.06) 40%,rgba(165, 148, 232, 0.08) 60%,transparent 100%);animation: betaShimmer 4s linear infinite;}31 unmodified linesborder-radius: 12px;background: var(--color-surface-elevated);border: 1px solid var(--color-border-strong);box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.05);backdrop-filter: blur(16px);transform: translateX(-50%);animation: selbar-in 0.2s ease;pointer-events: auto;}.selection-toolbar.is-hidden {display: none;}@keyframes selbar-in {from {opacity: 0;transform: translateX(-50%) translateY(6px);}to {opacity: 1;transform: translateX(-50%) translateY(0);}}.sel-tool-btn {display: inline-flex;align-items: center;10 unmodified linestransition: all 0.15s ease;white-space: nowrap;}.sel-tool-btn:hover {background: var(--color-surface);color: var(--color-text-primary);}.sel-tool-sep {width: 1px;height: 20px;11 unmodified linespadding: 3px;overflow: hidden;}.summary-source-btn {flex: 1;padding: 8px 16px;7 unmodified linescursor: pointer;transition: all 0.2s ease;}.summary-source-btn:hover {color: var(--color-text-primary);}.summary-source-btn.active {background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));color: var(--color-text-inverse);5 unmodified linesmargin-left: 4px;opacity: 0.7;}.editor-tab.active svg {opacity: 1;}/* ── Error Badge on Tab ── */.tab-badge {display: inline-flex;align-items: center;justify-content: center;min-width: 18px;height: 18px;padding: 0 5px;border-radius: 10px;background: #ef4444;color: #fff;font-size: 10px;font-weight: 700;margin-inline-start: 6px;line-height: 1;animation: badgePulse 2s ease-in-out infinite;}@keyframes badgePulse {0%, 100% { transform: scale(1); }50% { transform: scale(1.1); }}/* ── Find & Replace Bar ── */.find-replace-bar {padding: 8px 16px;background: var(--color-surface-elevated);border-bottom: 1px solid var(--color-border);display: flex;flex-direction: column;gap: 6px;}.find-replace-row {display: flex;align-items: center;gap: 6px;}.find-input {flex: 1;background: var(--color-bg);border: 1px solid var(--color-border);border-radius: 6px;padding: 6px 10px;color: var(--color-text-primary);font-size: 13px;font-family: inherit;outline: none;transition: border-color 0.2s;}.find-input:focus {border-color: var(--color-primary);}.find-count {font-size: 11px;color: var(--color-text-secondary);min-width: 35px;text-align: center;}.find-btn {background: var(--color-surface);border: 1px solid var(--color-border);border-radius: 5px;color: var(--color-text-secondary);padding: 4px 8px;cursor: pointer;font-size: 12px;transition: all 0.15s;font-family: inherit;}.find-btn:hover {background: var(--color-primary);color: #fff;border-color: var(--color-primary);}/* ── Find Highlights ── */.find-highlight {background: rgba(255, 213, 79, 0.3);border-radius: 2px;}.find-highlight--active {background: rgba(255, 152, 0, 0.6);outline: 2px solid var(--color-primary);border-radius: 2px;}body.focus-mode .main-nav,body.focus-mode .sidebar-panel,body.focus-mode .docs-panel,body.focus-mode .docs-panel-desktop {display: none !important;}body.focus-mode .editor-footer {opacity: 0.2;transition: opacity 0.3s ease;}body.focus-mode .editor-footer:hover {opacity: 1;}body.focus-mode .editor-layout {grid-template-columns: 1fr !important;}body.focus-mode .format-toolbar {opacity: 0.3;transition: opacity 0.3s;}body.focus-mode .format-toolbar:hover {opacity: 1;}body.focus-mode .editor-surface {width: 100%;}/* ── Blockquote Styling in Editor ── */#editor-container blockquote {border-right: 4px solid var(--color-primary);margin: 8px 0;padding: 8px 16px;background: rgba(124, 131, 237, 0.08);border-radius: 0 6px 6px 0;color: var(--color-text-secondary);font-style: italic;}/* ── HR Styling in Editor ── */#editor-container hr {border: none;height: 2px;background: linear-gradient(90deg, transparent, var(--color-border), transparent);margin: 16px 0;}/* ── Tab Switch Animation ── */#write-area,#summarize-area,#dialect-area,#quran-area {animation: tabFadeIn 0.3s ease-out;}@keyframes tabFadeIn {from { opacity: 0; transform: translateY(6px); }to { opacity: 1; transform: translateY(0); }}/* ── Typewriter Mode ── */.typewriter-mode {scroll-behavior: smooth;padding-top: 40vh !important;padding-bottom: 40vh !important;}/* ── Collaboration Hint ── */.collab-hint {font-size: 10px;color: var(--color-text-secondary);opacity: 0.7;display: inline-flex;align-items: center;gap: 4px;}.collab-hint::before {content: '';width: 6px;height: 6px;border-radius: 50%;background: #22c55e;display: inline-block;}/* ── Error Category Tabs ── */.error-tabs {display: flex;gap: 2px;margin-bottom: 10px;background: var(--color-border);border-radius: 8px;padding: 2px;overflow: hidden;}.error-tab {flex: 1;padding: 5px 4px;border: none;background: transparent;color: var(--color-text-secondary);font-size: 11px;font-weight: 600;cursor: pointer;border-radius: 6px;transition: all 0.2s;font-family: inherit;}.error-tab.active {background: var(--color-primary);color: #fff;}.error-tab:hover:not(.active) {background: var(--color-surface);}/* ── Error Donut Chart ── */.error-chart-wrap {display: flex;align-items: center;justify-content: center;gap: 10px;margin-bottom: 10px;min-height: 0;}.error-donut {transform: rotate(-90deg);}.chart-legend {display: flex;flex-direction: column;gap: 4px;}.chart-legend-item {display: flex;align-items: center;gap: 5px;font-size: 11px;color: var(--color-text-secondary);}.chart-dot {width: 8px;height: 8px;border-radius: 50%;flex-shrink: 0;}/* ── Dismiss All Button ── */.dismiss-all-btn {width: 100%;margin-top: 6px;font-size: 12px;color: var(--color-text-secondary);border: 1px dashed var(--color-border);border-radius: 6px;padding: 6px;text-align: center;}.dismiss-all-btn:hover {border-color: #ef4444;color: #ef4444;}/* ── Score Sparkline ── */.sparkline {display: block;margin: 6px auto;}/* ── Fix Layout: Editor Full Height Fit ── */#page-editor > section {height: 100vh;display: flex;flex-direction: column;overflow: hidden;padding-bottom: 0;}#page-editor .max-w-\[1600px\] {flex: 1;display: flex;flex-direction: column;min-height: 0;width: 100%;}#page-editor .editor-layout {flex: 1;min-height: 0;height: 100%;}/* Prevent grid items from growing beyond their track */#page-editor .editor-layout > div {min-width: 0;min-height: 0;}#page-editor .editor-shell {display: flex;flex-direction: column;height: 100%;overflow: hidden;}#page-editor #write-area,#page-editor #summarize-area,#page-editor #dialect-area,#page-editor #quran-area {flex: 1;overflow-y: auto;min-height: 0;}/* Prevent sidebar cards from squishing */#page-editor .sidebar-panel > div {flex-shrink: 0;}298 unmodified lines2993003013023033043053063073083097 unmodified lines31731831932032132232332432532632722 unmodified lines3503513523533543553568 unmodified lines3653663673683693703713723733743752 unmodified lines37837938038138238311 unmodified lines3953963973983994004014024034044053 unmodified lines409410411412413414415416417418419420421422423424425426427428429128 unmodified lines55855956056156256356480 unmodified lines64564664764864965065165265365465533 unmodified lines6896906916926936946955 unmodified lines7017027037047057067077087097107117127137147153 unmodified lines719720721722723724113 unmodified lines83883984084184284384484584692 unmodified lines93994094194294394476 unmodified lines10211022102310241025102610271028426 unmodified lines14551456145714581459146014611462149 unmodified lines16121613161416151616161716181619414 unmodified lines2034203520362037203820392040398 unmodified lines24392440244124422443244424458 unmodified lines2454245524562457245824592460183 unmodified lines264426452646264726482649208 unmodified lines2858285928602861286228632864286528662867286828692870287128722873287432 unmodified lines290729082909291029112912291310 unmodified lines2924292529262927292829292930293152 unmodified lines298429852986298729882989299029919 unmodified lines300130023003300430053006300730083009301030112 unmodified lines3014301530163017301830193020302130223023302430253026302730284 unmodified lines3033303430353036303730383039304030415 unmodified lines3047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308424 unmodified lines310931103111311231133114311510 unmodified lines3126312731283129313031313132313313 unmodified lines314731483149315031513152315331545 unmodified lines31603161316231633164316531663167316825 unmodified lines31943195319631973198319910 unmodified lines32103211321232133214321532165 unmodified lines3222322332243225322632272 unmodified lines32303231323232333234323525 unmodified lines3261326232633264326532663267326833 unmodified lines330233033304330533063307330833093310331133126 unmodified lines331933203321332233233324332533263327332833296 unmodified lines3336333733383339334033413342334333446 unmodified lines33513352335333543355335613 unmodified lines3370337133723373337433759 unmodified lines3385338633873388338933905 unmodified lines3396339733983399340034013402340334043405340612 unmodified lines3419342034213422342334245 unmodified lines34303431343234333434343534363437343834393440344134423443344434453446344734483449345034516 unmodified lines345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934801 unmodified line348234833484348534863487348834893490349134923493349434955 unmodified lines35013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352431 unmodified lines355635573558355935603561356235633564356535663567356835693570357135723573357410 unmodified lines358535863587358835893590359135923593359411 unmodified lines3606360736083609361036117 unmodified lines3619362036213622362336243625362636275 unmodified lines363336343635363636373638298 unmodified linesposition: relative;}.editor-shell > *:first-child {border-radius: var(--radius-card) var(--radius-card) 0 0;}.editor-shell > *:last-child {border-radius: 0 0 var(--radius-card) var(--radius-card);}7 unmodified linesbackground: var(--color-surface);}.editor-toolbar > *:first-child {justify-self: start;}.editor-toolbar > *:last-child {justify-self: end;}22 unmodified lines.editor-tab:hover {color: var(--color-text-primary);background: rgba(255,255,255,0.06);}.editor-tab.active {8 unmodified linesalign-items: center;gap: 5px;}.tab-icon {flex-shrink: 0;opacity: 0.8;vertical-align: middle;}.editor-tab.active .tab-icon {opacity: 1;}2 unmodified lines[data-tooltip] {position: relative;}[data-tooltip]::after {content: attr(data-tooltip);position: absolute;11 unmodified linesopacity: 0;visibility: hidden;transition: all 0.2s ease;box-shadow: 0 4px 12px rgba(0,0,0,0.2);border: 1px solid var(--color-border);z-index: 300;font-family: inherit;}[data-tooltip]:hover::after {opacity: 1;visibility: visible;3 unmodified lines/* ── Formatting Toolbar ── */.format-toolbar {display: flex;flex-wrap: nowrap;align-items: center;justify-content: center;gap: 3px;padding: 6px 10px;border-bottom: 1px solid var(--color-border);background: var(--color-surface);overflow: visible;position: relative;z-index: 50;flex-shrink: 0;}.fmt-group {display: flex;align-items: center;gap: 1px;background: var(--color-border);128 unmodified linesbackground: var(--color-surface);border: 1px solid var(--color-border);border-radius: 8px;box-shadow: 0 8px 24px rgba(0,0,0,0.15);padding: 4px;z-index: 200;opacity: 0;80 unmodified lines}@media (min-width: 768px) {.editor-surface { min-height: 60vh; }}@media (min-width: 1024px) {.editor-surface { min-height: 500px; }}.editor-surface:focus {33 unmodified lines.editor-stats {display: flex;flex-wrap: wrap;gap: var(--spacing-md);align-items: center;}5 unmodified linesflex-shrink: 0;}.stat-dot--spelling { background: var(--color-error); }.stat-dot--grammar { background: var(--color-warning); }.stat-dot--punctuation { background: var(--color-success); }.editor-actions {display: flex;flex-wrap: wrap;gap: var(--spacing-sm);}.editor-actions .btn-ghost,.editor-actions .doc-dropdown .btn-ghost {width: 40px;3 unmodified linesdisplay: inline-flex;align-items: center;justify-content: center;}/* ── Buttons ── */113 unmodified linesgap: var(--spacing-sm);}.popover-type--spelling { color: var(--color-error); }.popover-type--grammar { color: var(--color-warning); }.popover-type--punctuation { color: var(--color-success); }.popover-original-word {font-size: var(--font-size-sm);92 unmodified linescursor: pointer;transition: all var(--transition-fast);}.popover-dismiss:hover {color: var(--color-error);border-color: var(--color-error);76 unmodified lines}@keyframes fadeIn {from { opacity: 0; transform: translateY(4px); }to { opacity: 1; transform: translateY(0); }}426 unmodified lines.editor-layout.tools-mode {grid-template-columns: 1fr !important;}.editor-layout.tools-mode > .docs-panel-desktop,.editor-layout.tools-mode > .sidebar-panel {display: none !important;}149 unmodified linesborder: 1px solid var(--color-primary-subtle-border);}.check-icon { color: var(--color-success); }.muted-icon { color: var(--color-text-muted); }.demo-editor-surface {background: var(--color-editor);414 unmodified linestransform: translateX(100%);transition: transform var(--transition-slow), box-shadow var(--transition-slow);box-shadow: none;padding-top: 64px; /* below nav */}.docs-sidebar.is-open {398 unmodified linesbackground: linear-gradient(135deg, var(--color-primary), var(--color-secondary));cursor: pointer;border: 3px solid var(--color-surface);box-shadow: 0 2px 8px rgba(0,0,0,0.25);transition: transform 0.15s ease;}8 unmodified linesbackground: linear-gradient(135deg, var(--color-primary), var(--color-secondary));cursor: pointer;border: 3px solid var(--color-surface);box-shadow: 0 2px 8px rgba(0,0,0,0.25);}/* ── Item 3: Empty States ── */183 unmodified linesfont-weight: 700;color: var(--color-text-muted);}.fmt-color-swatch--reset:hover {border-color: var(--color-error);color: var(--color-error);208 unmodified linesanimation: toast-out 0.25s ease forwards;}.toast--success { border-color: rgba(34, 197, 94, 0.4); }.toast--error { border-color: rgba(239, 68, 68, 0.4); }@keyframes toast-in {from { opacity: 0; transform: translateY(16px); }to { opacity: 1; transform: translateY(0); }}@keyframes toast-out {from { opacity: 1; transform: translateY(0); }to { opacity: 0; transform: translateY(16px); }}/* ── Scroll to Top ── */32 unmodified lines/* ── Loading Skeleton ── */.skeleton {background: linear-gradient(90deg, var(--color-border) 25%, rgba(255,255,255,0.08) 50%, var(--color-border) 75%);background-size: 200% 100%;animation: skeleton-shimmer 1.5s ease infinite;border-radius: 8px;10 unmodified lines}@keyframes skeleton-shimmer {0% { background-position: 200% 0; }100% { background-position: -200% 0; }}/* ── Word Count Goal ── */52 unmodified lines}@keyframes punc-blink {0%, 100% { border-left-color: var(--highlight-punctuation-border); }50% { border-left-color: transparent; }}/* ── Fix #6: Document title truncation ── */9 unmodified lines/* ── Fix #8: Editor placeholder alignment (Removed hack) ── *//* ── Fix #11: Pricing cards equal heights ── */#page-pricing .grid > div {display: flex;flex-direction: column;}#page-pricing .grid > div > ul {flex: 1;}2 unmodified linescursor: default;transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;}.window-dots:hover .dot--red {transform: scale(1.25);box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);}.window-dots:hover .dot--yellow {transform: scale(1.25);box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);transition-delay: 0.05s;}.window-dots:hover .dot--green {transform: scale(1.25);box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);4 unmodified lines.sidebar-desktop.collapsed {display: none !important;}.editor-layout.editor-fullscreen {grid-template-columns: 1fr !important;}.editor-layout.editor-fullscreen .sidebar-panel.sidebar-desktop,.editor-layout.editor-fullscreen .docs-panel,.editor-layout.editor-fullscreen .docs-panel-desktop {5 unmodified linescolor: #3A424E;background: rgba(26, 29, 33, 0.04);}[data-theme="light"] .fmt-btn:hover {background: rgba(26, 29, 33, 0.1);color: #1A1D21;}[data-theme="light"] .fmt-btn.fmt-active {background: rgba(43, 108, 184, 0.14);color: #2B6CB8;}[data-theme="light"] .format-toolbar {background: #FAF9F6;border-bottom-color: rgba(26, 29, 33, 0.12);}[data-theme="light"] .surface-card {box-shadow: 0 2px 8px rgba(26, 29, 33, 0.06);border: 1px solid rgba(26, 29, 33, 0.08);}[data-theme="light"] .editor-tab {color: #5A6472;}[data-theme="light"] .editor-tab:hover {color: #1A1D21;background: rgba(26, 29, 33, 0.06);}[data-theme="light"] .editor-tab.active {color: #fff !important;background: linear-gradient(135deg, #4A8FD4, #7C6BC4);box-shadow: 0 2px 8px rgba(74, 143, 212, 0.25);}[data-theme="light"] .stat-item {color: #3A424E;opacity: 1;}[data-theme="light"] .scroll-top-btn {box-shadow: 0 4px 16px rgba(26, 29, 33, 0.15);}24 unmodified lines#autocomplete-dropdown {position: fixed;background: var(--color-surface, #1a1d21);border: 1px solid var(--color-border, rgba(255,255,255,0.1));border-radius: 10px;box-shadow:0 4px 24px rgba(0, 0, 0, 0.25),10 unmodified lines}@keyframes ac-dropdown-in {from { opacity: 0; transform: translateY(-4px); }to { opacity: 1; transform: translateY(0); }}/* ── Dropdown Items ── */13 unmodified lines.ac-dropdown-item:hover,.ac-dropdown-item.ac-selected {background: linear-gradient(135deg,rgba(107, 163, 224, 0.15),rgba(160, 131, 237, 0.12));color: var(--color-primary, #6ba3e0);}5 unmodified lines#autocomplete-dropdown::-webkit-scrollbar {width: 4px;}#autocomplete-dropdown::-webkit-scrollbar-track {background: transparent;}#autocomplete-dropdown::-webkit-scrollbar-thumb {background: rgba(255, 255, 255, 0.12);border-radius: 2px;25 unmodified lines/* ── Print: hide autocomplete ── */@media print {#autocomplete-ghost,#autocomplete-dropdown {display: none !important;10 unmodified linesjustify-content: center;padding: 1rem;}.quran-modal.is-hidden { display: none; }/* Quran applied text — protected from analysis */.quran-applied {5 unmodified linescursor: default;user-select: text;}.quran-applied .spelling-error,.quran-applied .grammar-error,.quran-applied .punctuation-suggestion {2 unmodified linesbackground: none !important;cursor: default !important;}.quran-ref-inline {font-size: 0.72em;opacity: 0.6;25 unmodified lines}@keyframes quranModalIn {from { opacity: 0; transform: scale(0.95) translateY(10px); }to { opacity: 1; transform: scale(1) translateY(0); }}.quran-result-card {33 unmodified linestransition: all 0.2s;white-space: nowrap;}.quran-apply-btn:hover {transform: scale(1.05);box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);}.quran-apply-btn.is-hidden { display: none; }.quran-copy-btn {padding: 6px 10px;6 unmodified linestransition: all 0.2s;line-height: 1;}.quran-copy-btn:hover {background: rgba(6, 182, 212, 0.2);transform: scale(1.05);}.quran-copy-btn.is-hidden { display: none; }.quran-lang-select {padding: 6px 12px;6 unmodified linescursor: pointer;transition: border-color 0.2s;}.quran-lang-select:hover {border-color: #06b6d4;}.quran-lang-select:focus {outline: none;border-color: #06b6d4;6 unmodified linesborder-radius: 1.25rem;padding: 1.25rem;}.quran-uthmani {font-size: 20px;}13 unmodified lines.card-hover {transition: transform var(--transition-base), box-shadow var(--transition-base);}.card-hover:hover {transform: translateY(-3px);box-shadow: var(--shadow-glow);9 unmodified linestext-align: center;gap: 0.75rem;}.empty-state__icon {width: 48px;height: 48px;5 unmodified linescolor: var(--color-primary);margin-bottom: 0.25rem;}.empty-state__title {font-size: var(--font-size-body);font-weight: var(--font-weight-semibold);color: var(--color-text-primary);}.empty-state__subtitle {font-size: var(--font-size-caption);color: var(--color-text-secondary);12 unmodified linesjustify-content: center;animation: fadeIn 0.15s ease-out;}.confirm-dialog {background: var(--color-surface);border: 1px solid var(--color-border-strong);5 unmodified linestext-align: center;animation: modalSlideUp 0.25s ease-out;}.confirm-dialog__title {font-size: 1.125rem;font-weight: var(--font-weight-bold);margin-bottom: 0.5rem;}.confirm-dialog__message {font-size: var(--font-size-caption);color: var(--color-text-secondary);margin-bottom: 1.5rem;line-height: 1.7;}.confirm-dialog__actions {display: flex;gap: 0.75rem;justify-content: center;}.confirm-dialog__btn {padding: 0.6rem 1.5rem;border-radius: var(--radius-md);6 unmodified linestransition: all var(--transition-fast);font-family: inherit;}.confirm-dialog__btn:hover {background: var(--color-border);}.confirm-dialog__btn--danger {background: var(--color-error);color: white;border-color: transparent;}.confirm-dialog__btn--danger:hover {opacity: 0.9;}/* ── Modal entrance animation ── */@keyframes modalSlideUp {from { opacity: 0; transform: translateY(16px) scale(0.97); }to { opacity: 1; transform: translateY(0) scale(1); }}.quran-modal-panel,.auth-gate-panel,.confirm-dialog {1 unmodified line}/* ── Toast with icons ── */.toast--success::before { content: '✓ '; }.toast--error::before { content: '✕ '; }.toast--warning::before { content: '⚠ '; }/* ── Pricing card glow (active plan) ── */.pricing-glow {position: relative;}.pricing-glow::before {content: '';position: absolute;5 unmodified linesfilter: blur(12px);animation: pricingPulse 3s ease-in-out infinite;}@keyframes pricingPulse {0%, 100% { opacity: 0.3; }50% { opacity: 0.6; }}/* ── Beta banner shimmer ── */@keyframes betaShimmer {0% { background-position: -200% center; }100% { background-position: 200% center; }}.beta-shimmer {background-size: 200% auto;background-image: linear-gradient(90deg,transparent 0%,rgba(107, 163, 224, 0.06) 40%,rgba(165, 148, 232, 0.08) 60%,transparent 100%);animation: betaShimmer 4s linear infinite;}31 unmodified linesborder-radius: 12px;background: var(--color-surface-elevated);border: 1px solid var(--color-border-strong);box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.05);backdrop-filter: blur(16px);transform: translateX(-50%);animation: selbar-in 0.2s ease;pointer-events: auto;}.selection-toolbar.is-hidden {display: none;}@keyframes selbar-in {from { opacity: 0; transform: translateX(-50%) translateY(6px); }to { opacity: 1; transform: translateX(-50%) translateY(0); }}.sel-tool-btn {display: inline-flex;align-items: center;10 unmodified linestransition: all 0.15s ease;white-space: nowrap;}.sel-tool-btn:hover {background: var(--color-surface);color: var(--color-text-primary);}.sel-tool-sep {width: 1px;height: 20px;11 unmodified linespadding: 3px;overflow: hidden;}.summary-source-btn {flex: 1;padding: 8px 16px;7 unmodified linescursor: pointer;transition: all 0.2s ease;}.summary-source-btn:hover {color: var(--color-text-primary);}.summary-source-btn.active {background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));color: var(--color-text-inverse);5 unmodified linesmargin-left: 4px;opacity: 0.7;}.editor-tab.active svg {opacity: 1;}
672 unmodified lines67367467567667767867968068168265 unmodified lines74874975075175275375475575675775875976076176276376427 unmodified lines79279379479579679779879980080180280380480580680780880981081181216 unmodified lines829830831832833834835836837838839840841842843844845846169 unmodified lines101610171018101910201021102210231024102510261027102810291030103110325 unmodified lines1038103910401041104210431044672 unmodified lines<span id="auto-save-status" class="text-xs text-secondary" style="opacity:0;transition:opacity 0.3s;"></span></div><div class="editor-tabs-center"><button id="write-tab" onclick="switchTab('write')" class="editor-tab active" data-tooltip="كتابة — الاختصار: Alt+1" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" 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>كتابة<span id="error-badge" class="tab-badge" style="display:none"></span></button><button id="summarize-tab" onclick="switchTab('summarize')" class="editor-tab" data-tooltip="تلخيص — الاختصار: Alt+2" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>تلخيص</button><button id="dialect-tab" onclick="switchTab('dialect')" class="editor-tab" data-tooltip="تحويل للفصحى — الاختصار: Alt+3" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"/></svg>تحويل للفصحى</button><button id="quran-tab" onclick="switchTab('quran')" class="editor-tab" data-tooltip="تدقيق القرآن — الاختصار: Ctrl+Q" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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>تدقيق النص القرآني</button></div><div class="flex items-center gap-2"><span id="doc-current-title" class="doc-current-title" style="display:none;"></span>65 unmodified lines<button id="fmt-ltr" class="fmt-btn" onclick="setDirection('ltr')" type="button" data-tooltip="يسار لليمين"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H7a4 4 0 000 8h2m4-8v14m4-14v14M21 8l-4-3v6"/></svg></button><button id="fmt-link" class="fmt-btn" onclick="insertLink()" type="button" data-tooltip="إدراج رابط"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/></svg></button><button id="fmt-line-height" class="fmt-btn" onclick="cycleLineHeight()" type="button" data-tooltip="ارتفاع السطر"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M20 4v4m0-4l-1.5 1.5M20 4l1.5 1.5M20 20v-4m0 4l-1.5-1.5M20 20l1.5-1.5"/></svg></button><button id="fmt-indent" class="fmt-btn" onclick="execFormat('indent')" type="button" data-tooltip="مسافة بادئة"><svg width="15" height="15" fill="currentColor" viewBox="0 0 24 24"><path d="M3 5h18v2H3V5zm6 4h12v2H9V9zm0 4h12v2H9v-2zm-6 4h18v2H3v-2zM3 9l4 3-4 3V9z"/></svg></button><button id="fmt-outdent" class="fmt-btn" onclick="execFormat('outdent')" type="button" data-tooltip="إزالة المسافة البادئة"><svg width="15" height="15" fill="currentColor" viewBox="0 0 24 24"><path d="M3 5h18v2H3V5zm6 4h12v2H9V9zm0 4h12v2H9v-2zm-6 4h18v2H3v-2zM7 9l-4 3 4 3V9z"/></svg></button><button id="fmt-superscript" class="fmt-btn" onclick="execFormat('superscript')" type="button" data-tooltip="نص مرتفع"><svg width="15" height="15" fill="currentColor" viewBox="0 0 24 24"><path d="M16 7h2v1h-2v1h3V6h-2V5h2V4h-3v3zM5.47 13h2.06L10 7.22 12.47 13h2.06L10 3.3 5.47 13zM4 21l5-7h-3l5-7"/></svg></button><button id="fmt-subscript" class="fmt-btn" onclick="execFormat('subscript')" type="button" data-tooltip="نص منخفض"><svg width="15" height="15" fill="currentColor" viewBox="0 0 24 24"><path d="M16 18h2v1h-2v1h3v-4h-2v1h2v1h-3v1zM5.47 13h2.06L10 7.22 12.47 13h2.06L10 3.3 5.47 13z"/></svg></button><button id="fmt-blockquote" class="fmt-btn" onclick="formatBlockquote()" type="button" data-tooltip="اقتباس"><svg width="15" height="15" fill="currentColor" viewBox="0 0 24 24"><path d="M6 17h3l2-4V7H5v6h3l-2 4zm8 0h3l2-4V7h-6v6h3l-2 4z"/></svg></button><button id="fmt-hr" class="fmt-btn" onclick="execFormat('insertHorizontalRule')" type="button" data-tooltip="فاصل أفقي"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-width="2" d="M3 12h18"/></svg></button><button id="fmt-paragraph-spacing" class="fmt-btn" onclick="cycleParagraphSpacing()" type="button" data-tooltip="تباعد الفقرات"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-width="2" d="M3 5h18M3 19h18"/><path stroke-linecap="round" stroke-width="1.5" d="M12 8v8m0-8l-2 2m2-2l2 2m-2 6l-2-2m2 2l2-2"/></svg></button><button id="fmt-remove-tashkeel" class="fmt-btn" onclick="removeTashkeel()" type="button" data-tooltip="إزالة التشكيل"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor"><path d="M3 17h18v2H3v-2zm0-6h12v2H3v-2zm0-6h18v2H3V5z"/><path d="M17 7l4 4m0-4l-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none"/></svg></button><button id="fmt-to-hindi" class="fmt-btn" onclick="convertToHindiNumerals()" type="button" data-tooltip="أرقام هندية ١٢٣"><svg width="15" height="15" viewBox="0 0 24 24"><text x="12" y="17" text-anchor="middle" font-size="14" font-weight="700" fill="currentColor">١٢</text></svg></button><button id="fmt-to-arabic" class="fmt-btn" onclick="convertToArabicNumerals()" type="button" data-tooltip="أرقام عربية 123"><svg width="15" height="15" viewBox="0 0 24 24"><text x="12" y="17" text-anchor="middle" font-size="14" font-weight="700" fill="currentColor">12</text></svg></button><button id="fmt-cleanup" class="fmt-btn" onclick="cleanupText()" type="button" data-tooltip="تنظيف النص"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"/></svg></button></div></div><div class="fmt-divider"></div>27 unmodified lines<button class="fmt-btn" onclick="execFormat('removeFormat')" type="button" data-tooltip="مسح التنسيق"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4h12v3M12 4v16"/><path stroke-linecap="round" stroke-width="2.5" d="M5 19L19 5" opacity="0.6"/></svg></button></div></div><div id="find-replace-bar" class="find-replace-bar" style="display:none;"><div class="find-replace-row"><input type="text" id="find-input" class="find-input" placeholder="بحث..." autocomplete="off"><span id="find-count" class="find-count">0/0</span><button type="button" class="find-btn" onclick="findPrev()" data-tooltip="السابق">▲</button><button type="button" class="find-btn" onclick="findNext()" data-tooltip="��لتالي">▼</button><button type="button" class="find-btn" onclick="toggleReplace()" data-tooltip="استبدال">⇄</button><button type="button" class="find-btn" onclick="closeFindReplace()" data-tooltip="إغلاق">✕</button></div><div id="replace-row" class="find-replace-row" style="display:none;"><input type="text" id="replace-input" class="find-input" placeholder="استبدال بـ..." autocomplete="off"><button type="button" class="find-btn" onclick="replaceCurrent()">استبدال</button><button type="button" class="find-btn" onclick="replaceAll()">استبدال الكل</button></div></div><input type="file" id="doc-import-input" class="sr-only" accept=".txt,.docx,text/plain,application/vnd.openxmlformats-officedocument.wordprocessingml.document" aria-hidden="true"><div id="write-area"><div id="analysis-limit-banner" class="analysis-limit-banner is-hidden" role="status" aria-live="polite"></div>16 unmodified lines<div class="flex items-center gap-2"><span class="stat-dot stat-dot--punctuation" aria-hidden="true"></span><span class="text-sm text-secondary"><span id="punctuation-count">٠</span> ترقيم</span></div><span class="stat-item--sep"></span><span class="stat-item"><span id="char-count">٠</span> حرف</span><span class="stat-item"><span id="paragraph-count">٠</span> فقرة</span><span class="stat-item"><span id="sentence-count">٠</span> جملة</span><span class="stat-item" style="cursor:pointer;" onclick="setWordGoalUI()" title="اضغط لتحديد هدف عدد الكلمات"><span id="word-count" class="font-bold">٠</span> كلمة</span><span id="word-goal-indicator" class="word-goal-badge" style="display:none;cursor:pointer;" onclick="setWordGoalUI()" title="اضغط لتغيير الهدف"></span><span class="stat-item--sep"></span><span class="stat-item">⏱ <span id="reading-time">٠</span> د قراءة</span><span class="collab-hint" id="last-edit-hint"></span></div><div class="editor-actions"><button id="focus-mode-btn" class="btn-ghost" type="button" data-tooltip="وضع التركيز (Ctrl+Shift+F)" onclick="toggleFocusMode()"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg></button><button id="typewriter-mode-btn" class="btn-ghost" type="button" data-tooltip="وضع الآلة الكاتبة" onclick="toggleTypewriterMode()"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M7 14h10M9 18h6"/></svg></button><button id="version-history-btn" class="btn-ghost" type="button" data-tooltip="سجل النسخ" onclick="showVersionHistory()"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/></svg></button><button id="doc-save-btn" class="doc-save-btn-icon btn-ghost" type="button" aria-label="حفظ المستند" title="حفظ"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"/></svg></button><button onclick="clearEditor()" class="btn-ghost" type="button" title="مسح الكل">169 unmodified lines<!-- LEFT: Sidebar (score + suggestions + import/export) --><div class="sidebar-panel sidebar-desktop"><div class="surface-card sidebar-card"><h3 class="text-xl font-bold mb-3 text-right">الاقتراحات</h3><div class="error-tabs"><button class="error-tab active" data-filter="all" onclick="filterErrors('all')">الكل</button><button class="error-tab" data-filter="spelling" onclick="filterErrors('spelling')">إملائي</button><button class="error-tab" data-filter="grammar" onclick="filterErrors('grammar')">نحوي</button><button class="error-tab" data-filter="punctuation" onclick="filterErrors('punctuation')">ترقيم</button></div><div id="error-chart" class="error-chart-wrap"></div><div id="suggestions-list" class="suggestions-scroll" role="list" aria-live="polite" aria-label="اقتراحات التصحيح"></div><button id="apply-all-btn" class="btn-primary apply-all-btn is-hidden" type="button">تطبيق الكل</button><button id="dismiss-filtered-btn" class="btn-ghost dismiss-all-btn is-hidden" type="button" onclick="dismissAllFiltered()">تجاهل الكل</button></div><div class="surface-card sidebar-card"><h3 class="text-xl font-bold mb-4 text-right">تقييم الكتابة</h3>5 unmodified lines</svg><div class="score-value"><span id="score-value">--</span></div></div><div id="score-sparkline"></div><p id="score-hint" class="text-center text-sm text-secondary">ابدأ الكتابة لرؤية تقييمك</p></div></div>672 unmodified lines67367467567667767867968068168265 unmodified lines74874975075175275327 unmodified lines78178278378478578616 unmodified lines803804805806807808809810811812813814815816169 unmodified lines9869879889899909919929939945 unmodified lines100010011002100310041005672 unmodified lines<span id="auto-save-status" class="text-xs text-secondary" style="opacity:0;transition:opacity 0.3s;"></span></div><div class="editor-tabs-center"><button id="write-tab" onclick="switchTab('write')" class="editor-tab active" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" 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>كتابة</button><button id="summarize-tab" onclick="switchTab('summarize')" class="editor-tab" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>تلخيص</button><button id="dialect-tab" onclick="switchTab('dialect')" class="editor-tab" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"/></svg>تحويل للفصحى</button><button id="quran-tab" onclick="switchTab('quran')" class="editor-tab" type="button"><svg class="tab-icon" width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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>تدقيق النص القرآني</button></div><div class="flex items-center gap-2"><span id="doc-current-title" class="doc-current-title" style="display:none;"></span>65 unmodified lines<button id="fmt-ltr" class="fmt-btn" onclick="setDirection('ltr')" type="button" data-tooltip="يسار لليمين"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H7a4 4 0 000 8h2m4-8v14m4-14v14M21 8l-4-3v6"/></svg></button><button id="fmt-link" class="fmt-btn" onclick="insertLink()" type="button" data-tooltip="إدراج رابط"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/></svg></button><button id="fmt-line-height" class="fmt-btn" onclick="cycleLineHeight()" type="button" data-tooltip="ارتفاع السطر"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M20 4v4m0-4l-1.5 1.5M20 4l1.5 1.5M20 20v-4m0 4l-1.5-1.5M20 20l1.5-1.5"/></svg></button></div></div><div class="fmt-divider"></div>27 unmodified lines<button class="fmt-btn" onclick="execFormat('removeFormat')" type="button" data-tooltip="مسح التنسيق"><svg width="15" height="15" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4h12v3M12 4v16"/><path stroke-linecap="round" stroke-width="2.5" d="M5 19L19 5" opacity="0.6"/></svg></button></div></div><input type="file" id="doc-import-input" class="sr-only" accept=".txt,.docx,text/plain,application/vnd.openxmlformats-officedocument.wordprocessingml.document" aria-hidden="true"><div id="write-area"><div id="analysis-limit-banner" class="analysis-limit-banner is-hidden" role="status" aria-live="polite"></div>16 unmodified lines<div class="flex items-center gap-2"><span class="stat-dot stat-dot--punctuation" aria-hidden="true"></span><span class="text-sm text-secondary"><span id="punctuation-count">٠</span> ترقيم</span></div><span class="stat-item--sep"></span><span class="stat-item"><span id="char-count">٠</span> حرف</span><span class="stat-item"><span id="sentence-count">٠</span> جملة</span><span class="stat-item" style="cursor:pointer;" onclick="setWordGoalUI()" title="اضغط لتحديد هدف عدد الكلمات"><span id="word-count" class="font-bold">٠</span> كلمة</span><span id="word-goal-indicator" class="word-goal-badge" style="display:none;cursor:pointer;" onclick="setWordGoalUI()" title="اضغط لتغيير الهدف"></span><span class="stat-item--sep"></span><span class="stat-item">⏱ <span id="reading-time">٠</span> د قراءة</span></div><div class="editor-actions"><button id="doc-save-btn" class="doc-save-btn-icon btn-ghost" type="button" aria-label="حفظ المستند" title="حفظ"><svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"/></svg></button><button onclick="clearEditor()" class="btn-ghost" type="button" title="مسح الكل">169 unmodified lines<!-- LEFT: Sidebar (score + suggestions + import/export) --><div class="sidebar-panel sidebar-desktop"><div class="surface-card sidebar-card"><h3 class="text-xl font-bold mb-4 text-right">الاقتراحات</h3><div id="suggestions-list" class="suggestions-scroll" role="list" aria-live="polite" aria-label="اقتراحات التصحيح"></div><button id="apply-all-btn" class="btn-primary apply-all-btn is-hidden" type="button">تطبيق الكل</button></div><div class="surface-card sidebar-card"><h3 class="text-xl font-bold mb-4 text-right">تقييم الكتابة</h3>5 unmodified lines</svg><div class="score-value"><span id="score-value">--</span></div></div><p id="score-hint" class="text-center text-sm text-secondary">ابدأ الكتابة لرؤية تقييمك</p></div></div>
665 unmodified lines666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703665 unmodified linesconst _ed3 = getEditorElement(); if (_ed3) _ed3.focus();}window.dismissAndReRenderAll = function(type) {if (!window.currentSuggestions || window.currentSuggestions.length === 0) return;pushUndoState();const toDismiss = type === 'all' ? window.currentSuggestions : window.currentSuggestions.filter(s => s.type === type);toDismiss.forEach(s => {if (s.original) _dismissedWords.add(s.original);});_saveDismissedWords();window.currentSuggestions = window.currentSuggestions.filter(s =>type === 'all' ? false : s.type !== type);const editor = getEditorElement();clearOverlays(editor);overlaySuggestions(editor, window.currentSuggestions);const spellingCount = window.currentSuggestions.filter(s => s.type === 'spelling').length;const grammarCount = window.currentSuggestions.filter(s => s.type === 'grammar').length;const punctuationCount = window.currentSuggestions.filter(s => s.type === 'punctuation').length;updateSuggestionCounts(spellingCount, grammarCount, punctuationCount);updateWritingScore(spellingCount, grammarCount, punctuationCount);updateSuggestionsList(window.currentSuggestions);// Update sidebar button visibility via global format.js function if it existsif (typeof window.renderSuggestionsSidebar === 'function') {window.renderSuggestionsSidebar(window.currentSuggestions);}};function applySuggestionById(id) {// Pipeline Hardening v3.3: UUID-based lookupconst suggestion = findSuggestionById(id);665 unmodified lines666667668669670671665 unmodified linesconst _ed3 = getEditorElement(); if (_ed3) _ed3.focus();}function applySuggestionById(id) {// Pipeline Hardening v3.3: UUID-based lookupconst suggestion = findSuggestionById(id);
94 unmodified lines9596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463200 unmodified lines664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705129 unmodified lines83583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293394 unmodified linesconst idx = heights.indexOf(_currentLineHeight);_currentLineHeight = heights[(idx + 1) % heights.length];editor.style.lineHeight = _currentLineHeight;const btn = document.getElementById('fmt-line-height');if (btn) {btn.setAttribute('data-tooltip', 'ارتفاع السطر: ' + _currentLineHeight);}}/* ── Blockquote ── */function formatBlockquote() {execFormat('formatBlock', 'blockquote');}/* ── Paragraph Spacing ── */var _paragraphSpacing = 'normal';function cycleParagraphSpacing() {const editor = getEditorElement();if (!editor) return;const modes = { tight: '0.3em', normal: '0.8em', wide: '1.5em' };const order = ['tight', 'normal', 'wide'];const idx = order.indexOf(_paragraphSpacing);_paragraphSpacing = order[(idx + 1) % order.length];const val = modes[_paragraphSpacing];editor.style.setProperty('--paragraph-spacing', val);editor.querySelectorAll('div,p').forEach(el => {el.style.marginBottom = val;});}/* ── Find & Replace ── */var _findMatches = [];var _findIdx = -1;function openFindReplace() {const bar = document.getElementById('find-replace-bar');if (bar) {bar.style.display = 'block';document.getElementById('find-input')?.focus();}}function closeFindReplace() {const bar = document.getElementById('find-replace-bar');if (bar) bar.style.display = 'none';clearHighlights();_findMatches = [];_findIdx = -1;const countEl = document.getElementById('find-count');if (countEl) countEl.textContent = '0/0';}function toggleReplace() {const row = document.getElementById('replace-row');if (row) row.style.display = row.style.display === 'none' ? 'flex' : 'none';}function doFind() {const query = document.getElementById('find-input')?.value;if (!query) { clearHighlights(); return; }const editor = getEditorElement();if (!editor) return;clearHighlights();const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT, null, false);_findMatches = [];let node;while (node = walker.nextNode()) {let idx = node.textContent.indexOf(query);while (idx !== -1) {_findMatches.push({ node, idx, len: query.length });idx = node.textContent.indexOf(query, idx + 1);}}// Highlight all matchesfor (let i = _findMatches.length - 1; i >= 0; i--) {const m = _findMatches[i];const range = document.createRange();range.setStart(m.node, m.idx);range.setEnd(m.node, m.idx + m.len);const span = document.createElement('span');span.className = 'find-highlight';range.surroundContents(span);}// Re-collect highlighted spans_findMatches = Array.from(editor.querySelectorAll('.find-highlight'));_findIdx = _findMatches.length > 0 ? 0 : -1;updateFindCount();if (_findIdx >= 0) highlightCurrent();}function findNext() {if (_findMatches.length === 0) { doFind(); return; }_findIdx = (_findIdx + 1) % _findMatches.length;updateFindCount();highlightCurrent();}function findPrev() {if (_findMatches.length === 0) { doFind(); return; }_findIdx = (_findIdx - 1 + _findMatches.length) % _findMatches.length;updateFindCount();highlightCurrent();}function highlightCurrent() {_findMatches.forEach((el, i) => {el.classList.toggle('find-highlight--active', i === _findIdx);});if (_findMatches[_findIdx]) {_findMatches[_findIdx].scrollIntoView({ block: 'center', behavior: 'smooth' });}}function updateFindCount() {const el = document.getElementById('find-count');if (el) el.textContent = _findMatches.length > 0 ? `${_findIdx + 1}/${_findMatches.length}` : '0/0';}function replaceCurrent() {if (_findIdx < 0 || !_findMatches[_findIdx]) return;const replaceVal = document.getElementById('replace-input')?.value || '';_findMatches[_findIdx].textContent = replaceVal;_findMatches[_findIdx].className = '';_findMatches.splice(_findIdx, 1);if (_findIdx >= _findMatches.length) _findIdx = 0;updateFindCount();if (_findMatches.length > 0) highlightCurrent();}function replaceAll() {const replaceVal = document.getElementById('replace-input')?.value || '';_findMatches.forEach(el => {el.textContent = replaceVal;el.className = '';});_findMatches = [];_findIdx = -1;updateFindCount();}function clearHighlights() {const editor = getEditorElement();if (!editor) return;editor.querySelectorAll('.find-highlight').forEach(el => {const parent = el.parentNode;parent.replaceChild(document.createTextNode(el.textContent), el);parent.normalize();});}/* ── Focus Mode ── */var _focusMode = false;function toggleFocusMode() {_focusMode = !_focusMode;document.body.classList.toggle('focus-mode', _focusMode);const btn = document.getElementById('focus-mode-btn');if (btn) btn.classList.toggle('fmt-active', _focusMode);}/* ── Typewriter Mode ── */var _typewriterMode = false;function toggleTypewriterMode() {_typewriterMode = !_typewriterMode;const editor = getEditorElement();if (!editor) return;editor.classList.toggle('typewriter-mode', _typewriterMode);if (_typewriterMode) {editor.addEventListener('input', typewriterScroll);editor.addEventListener('click', typewriterScroll);} else {editor.removeEventListener('input', typewriterScroll);editor.removeEventListener('click', typewriterScroll);}}function typewriterScroll() {const sel = window.getSelection();if (!sel.rangeCount) return;const range = sel.getRangeAt(0);const rect = range.getBoundingClientRect();const editor = getEditorElement();if (!editor) return;const editorRect = editor.getBoundingClientRect();const middle = editorRect.height / 2;const offset = rect.top - editorRect.top - middle;editor.scrollTop += offset;}/* ── Version History ── */function saveVersion() {const editor = getEditorElement();if (!editor) return;const versions = JSON.parse(localStorage.getItem('bayan_versions') || '[]');versions.push({timestamp: Date.now(),content: editor.innerHTML,preview: editor.textContent.substring(0, 50)});// Keep last 20 versionsif (versions.length > 20) versions.shift();localStorage.setItem('bayan_versions', JSON.stringify(versions));}function showVersionHistory() {const versions = JSON.parse(localStorage.getItem('bayan_versions') || '[]');if (!versions.length) { alert('لا توجد نسخ سابقة'); return; }let msg = 'اختر نسخة للاستعادة:\n\n';versions.forEach((v, i) => {const date = new Date(v.timestamp);msg += `${i + 1}. ${date.toLocaleString('ar-EG')} — "${v.preview}..."\n`;});const choice = prompt(msg + '\nأدخل رقم النسخة:');if (!choice) return;const idx = parseInt(choice) - 1;if (idx >= 0 && idx < versions.length) {const editor = getEditorElement();if (editor) {pushUndoState();editor.innerHTML = versions[idx].content;}}}/* ── Collaboration Hints (last edit timestamp) ── */var _lastEditTime = null;function updateLastEditTime() {_lastEditTime = Date.now();updateCollabHint();}function updateCollabHint() {const el = document.getElementById('last-edit-hint');if (!el || !_lastEditTime) return;const diff = Math.floor((Date.now() - _lastEditTime) / 1000);if (diff < 5) el.textContent = 'الآن';else if (diff < 60) el.textContent = `منذ ${diff} ثانية`;else if (diff < 3600) el.textContent = `منذ ${Math.floor(diff/60)} دقيقة`;else el.textContent = `منذ ${Math.floor(diff/3600)} ساعة`;}/* ── Tashkeel (Diacritics) ── */function addTashkeel() {// This adds basic tashkeel placeholder — real implementation needs NLPalert('ميزة التشكيل التلقائي قيد التطوير. سيتم إضافتها قريباً.');}function removeTashkeel() {const editor = getEditorElement();if (!editor) return;pushUndoState();const diacritics = /[\u064B-\u065F\u0670\u06D6-\u06ED]/g;// Walk through text nodes onlyconst walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT, null, false);let node;while (node = walker.nextNode()) {const cleaned = node.textContent.replace(diacritics, '');if (cleaned !== node.textContent) {node.textContent = cleaned;}}}/* ── Number Conversion (Arabic ↔ Hindi) ── */function convertToHindiNumerals() {const editor = getEditorElement();if (!editor) return;pushUndoState();const map = {'0':'٠','1':'١','2':'٢','3':'٣','4':'٤','5':'٥','6':'٦','7':'٧','8':'٨','9':'٩'};fmtWalkTextNodes(editor, text => text.replace(/[0-9]/g, d => map[d]));}function convertToArabicNumerals() {const editor = getEditorElement();if (!editor) return;pushUndoState();const map = {'٠':'0','١':'1','٢':'2','٣':'3','٤':'4','٥':'5','٦':'6','٧':'7','٨':'8','٩':'9'};fmtWalkTextNodes(editor, text => text.replace(/[٠-٩]/g, d => map[d]));}function fmtWalkTextNodes(root, fn) {const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false);let node;while (node = walker.nextNode()) {const result = fn(node.textContent);if (result !== node.textContent) node.textContent = result;}}/* ── Text Cleanup ── */function cleanupText() {const editor = getEditorElement();if (!editor) return;pushUndoState();fmtWalkTextNodes(editor, text => {return text.replace(/[\u064B-\u065F\u0670\u06D6-\u06ED]/g, '') // Remove diacritics.replace(/\u200C/g, '') // Remove ZWNJ.replace(/\u200D/g, '') // Remove ZWJ.replace(/\u00A0/g, ' ') // NBSP → space.replace(/ {2,}/g, ' ') // Multiple spaces → one.replace(/\n{3,}/g, '\n\n'); // Multiple newlines → two});}/* ── Error Badge Update ── */function updateErrorBadge() {const badge = document.getElementById('error-badge');if (!badge) return;const s = parseInt(document.getElementById('spelling-count')?.textContent) || 0;const g = parseInt(document.getElementById('grammar-count')?.textContent) || 0;const p = parseInt(document.getElementById('punctuation-count')?.textContent) || 0;const total = s + g + p;if (total > 0) {badge.textContent = total;badge.style.display = 'inline-flex';} else {badge.style.display = 'none';}}/* ── Paragraph Count ── */function updateParagraphCount() {const editor = getEditorElement();if (!editor) return;const text = editor.textContent || '';const paras = text.split(/\n\s*\n/).filter(p => p.trim().length > 0);const count = text.trim().length > 0 ? Math.max(1, paras.length) : 0;const el = document.getElementById('paragraph-count');if (el) el.textContent = count.toLocaleString('ar-EG');}/* ── Tab Keyboard Shortcuts ── */function initTabShortcuts() {document.addEventListener('keydown', (e) => {if (e.altKey && !e.ctrlKey) {if (e.key === '1') { e.preventDefault(); switchTab('write'); }else if (e.key === '2') { e.preventDefault(); switchTab('summarize'); }else if (e.key === '3') { e.preventDefault(); switchTab('dialect'); }else if (e.key === '4') { e.preventDefault(); switchTab('quran'); }}// Ctrl+H for Find & Replaceif (e.ctrlKey && e.key === 'h') {e.preventDefault();openFindReplace();}// Ctrl+Shift+F for Focus Modeif (e.ctrlKey && e.shiftKey && e.key === 'F') {e.preventDefault();toggleFocusMode();}// Ctrl+K for linkif (e.ctrlKey && e.key === 'k') {e.preventDefault();insertLink();}});}/* ── Font Hover Preview ── */function initFontHoverPreview() {document.querySelectorAll('#fmt-font-menu .fmt-dropdown__item').forEach(item => {item.addEventListener('mouseenter', () => {const label = document.getElementById('fmt-font-label');if (label) label.style.fontFamily = item.dataset.font;});item.addEventListener('mouseleave', () => {const label = document.getElementById('fmt-font-label');if (label) label.style.fontFamily = '';});});}/* ── Font family ── */function formatFont(fontName) {200 unmodified lines// Item 8: Color pickersinitColorPicker('fmt-textcolor', 'foreColor', 'fmt-textcolor-bar');initColorPicker('fmt-highlight', 'hiliteColor', 'fmt-highlight-bar');// Tab keyboard shortcuts (Alt+1/2/3/4, Ctrl+H, Ctrl+Shift+F, Ctrl+K)initTabShortcuts();// Font hover previewinitFontHoverPreview();// Find input listenerconst findInput = document.getElementById('find-input');if (findInput) {findInput.addEventListener('input', doFind);findInput.addEventListener('keydown', (e) => {if (e.key === 'Enter') { e.shiftKey ? findPrev() : findNext(); }if (e.key === 'Escape') closeFindReplace();});}// Auto-save version every 2 minutessetInterval(() => {const ed = getEditorElement();if (ed && ed.textContent.trim().length > 10) saveVersion();}, 120000);// Collaboration hint updater every 30ssetInterval(updateCollabHint, 30000);// Hook editor input for error badge + paragraph count + last edit timeif (editor) {const origInputHandler = editor.oninput;editor.addEventListener('input', () => {updateParagraphCount();updateLastEditTime();// Delay badge update to let analysis finishsetTimeout(updateErrorBadge, 2000);});}}/* ── Item 8: Color Picker ── */129 unmodified lines});});}/* ── Error Filtering (Sidebar tabs) ── */var _currentErrorFilter = 'all';function filterErrors(type) {_currentErrorFilter = type;// Update tab active statedocument.querySelectorAll('.error-tab').forEach(tab => {tab.classList.toggle('active', tab.dataset.filter === type);});// Filter suggestion itemsdocument.querySelectorAll('#suggestions-list .suggestion-item, #suggestions-list .sugg-card, #suggestions-list .suggestion-card').forEach(item => {if (type === 'all') {item.style.display = '';} else {const itemType = item.dataset.type || item.getAttribute('data-error-type') || '';item.style.display = itemType.includes(type) ? '' : 'none';}});// Show/hide dismiss buttonconst dismissBtn = document.getElementById('dismiss-filtered-btn');if (dismissBtn) {dismissBtn.classList.remove('is-hidden');// For 'all', show total count, else show filtered countconst count = type === 'all' ? window.currentSuggestions?.length || 0: (window.currentSuggestions?.filter(s => s.type === type).length || 0);dismissBtn.style.display = count > 0 ? '' : 'none';}}function dismissAllFiltered() {const type = window._currentErrorFilter || 'all';if (typeof window.dismissAndReRenderAll === 'function') {window.dismissAndReRenderAll(type);}}/* ── Error Breakdown Chart (SVG Donut) ── */function renderErrorChart() {const container = document.getElementById('error-chart');if (!container) return;const s = parseInt(document.getElementById('spelling-count')?.textContent) || 0;const g = parseInt(document.getElementById('grammar-count')?.textContent) || 0;const p = parseInt(document.getElementById('punctuation-count')?.textContent) || 0;const total = s + g + p;if (total === 0) {container.innerHTML = '';return;}const r = 30, cx = 40, cy = 40, c = 2 * Math.PI * r;const segments = [{ val: s, color: '#ef4444', label: 'إملائي' },{ val: g, color: '#f59e0b', label: 'نحوي' },{ val: p, color: '#22c55e', label: 'ترقيم' },].filter(seg => seg.val > 0);let offset = 0;let paths = '';segments.forEach(seg => {const pct = seg.val / total;const dash = c * pct;const gap = c - dash;paths += `<circle cx="${cx}" cy="${cy}" r="${r}" fill="none" stroke="${seg.color}" stroke-width="8" stroke-dasharray="${dash} ${gap}" stroke-dashoffset="${-offset}" opacity="0.85"/>`;offset += dash;});let legend = segments.map(seg => `<span class="chart-legend-item"><span class="chart-dot" style="background:${seg.color}"></span>${seg.label}: ${seg.val}</span>`).join('');container.innerHTML = `<svg width="80" height="80" viewBox="0 0 80 80" class="error-donut">${paths}<text x="${cx}" y="${cy}" text-anchor="middle" dominant-baseline="central" fill="var(--color-text-primary)" font-size="14" font-weight="700">${total}</text></svg><div class="chart-legend">${legend}</div>`;}/* ── Score History (Sparkline) ── */var _scoreHistory = [];function trackScore(score) {_scoreHistory.push(score);if (_scoreHistory.length > 20) _scoreHistory.shift();renderSparkline();}function renderSparkline() {const container = document.getElementById('score-sparkline');if (!container) return;if (_scoreHistory.length < 3) {container.innerHTML = '';return;}const w = 120, h = 30;const max = Math.max(..._scoreHistory, 100);const min = Math.min(..._scoreHistory, 0);const range = max - min || 1;const points = _scoreHistory.map((v, i) => {const x = (i / (_scoreHistory.length - 1)) * w;const y = h - ((v - min) / range) * h;return `${x},${y}`;}).join(' ');const polygonPoints = `0,${h} ${points} ${w},${h}`;container.innerHTML = `<svg width="${w}" height="${h}" class="sparkline"><polygon points="${polygonPoints}" fill="var(--color-primary)" opacity="0.15"/><polyline points="${points}" fill="none" stroke="var(--color-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;}94 unmodified lines9596979899100101102103104105106107200 unmodified lines308309310311312313129 unmodified lines44344444594 unmodified linesconst idx = heights.indexOf(_currentLineHeight);_currentLineHeight = heights[(idx + 1) % heights.length];editor.style.lineHeight = _currentLineHeight;// Show brief notificationconst btn = document.getElementById('fmt-line-height');if (btn) {btn.setAttribute('data-tooltip', 'ارتفاع السطر: ' + _currentLineHeight);}}/* ── Font family ── */function formatFont(fontName) {200 unmodified lines// Item 8: Color pickersinitColorPicker('fmt-textcolor', 'foreColor', 'fmt-textcolor-bar');initColorPicker('fmt-highlight', 'hiliteColor', 'fmt-highlight-bar');}/* ── Item 8: Color Picker ── */129 unmodified lines});});}
287 unmodified lines288289290291292293294287 unmodified linesconst localEnd = Math.min(tn.node.length, end - tn.start);// Split the text nodeif (!tn.node || !tn.node.textContent) return;const textContent = tn.node.textContent;const beforeText = textContent.slice(0, localStart);const errorText = textContent.slice(localStart, localEnd);287 unmodified lines288289290291292293287 unmodified linesconst localEnd = Math.min(tn.node.length, end - tn.start);// Split the text nodeconst textContent = tn.node.textContent;const beforeText = textContent.slice(0, localStart);const errorText = textContent.slice(localStart, localEnd);
53 unmodified lines5455565758596061626364656629 unmodified lines9697989910010110253 unmodified linesconst total = spelling + grammar + punctuation;sheetCount.textContent = total.toLocaleString('ar-EG');}// Hook: update error donut chartif (typeof renderErrorChart === 'function') renderErrorChart();// Hook: update error badge on write tabif (typeof updateErrorBadge === 'function') updateErrorBadge();// Hook: track score for sparklineif (typeof trackScore === 'function' && (spelling + grammar + punctuation) > 0) trackScore(score);}/**29 unmodified linesreturn `<div class="suggestion-card" role="listitem" tabindex="0"data-suggestion-id="${suggestionId}"data-type="${suggestion.type}"aria-label="${label}: ${suggestion.original} إلى ${suggestion.correction}"><span class="suggestion-card-badge ${badgeClass}">${label}</span><div class="suggestion-card-change">53 unmodified lines54555657585929 unmodified lines89909192939453 unmodified linesconst total = spelling + grammar + punctuation;sheetCount.textContent = total.toLocaleString('ar-EG');}}/**29 unmodified linesreturn `<div class="suggestion-card" role="listitem" tabindex="0"data-suggestion-id="${suggestionId}"aria-label="${label}: ${suggestion.original} إلى ${suggestion.correction}"><span class="suggestion-card-badge ${badgeClass}">${label}</span><div class="suggestion-card-change">
src/css/base.css-1
src/css/components.css+70-554
src/index.html+8-47
src/js/editor.js-32
src/js/format.js+1-489
src/js/renderer.js-1
src/js/ui.js-8