Hma47 commited on
Commit
bc86bf5
·
verified ·
1 Parent(s): 663824e

Upload 4 files

Browse files
Apache License.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright 2025 Shift Mind AI Labs
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "🔄 ContinuousImprovement Pro – Advanced PDCA Methodology"
3
+ emoji: "🔄"
4
+ colorFrom: "blue"
5
+ colorTo: "indigo"
6
+ sdk: "static"
7
+ sdk_version: "0.1.0"
8
+ app_file: "index.html"
9
+ pinned: false
10
+ ---
11
+
12
+ # 🔄 ContinuousImprovement Pro – Advanced PDCA Methodology
13
+ **Developed by Shift Mind AI Labs**
14
+
15
+ ContinuousImprovement Pro is an open-source, privacy-first platform that delivers expert, customized PDCA (Plan-Do-Check-Act) guides for any process or improvement initiative. Generate full-cycle, multilingual, and visually engaging PDCA explanations—instantly, in your language, with complete local privacy.
16
+
17
+ ---
18
+
19
+ ## 🚀 Features
20
+
21
+ - **Complete PDCA Cycle Generator:**
22
+ Structured, stepwise, and fully customized PDCA guides for your process scenario.
23
+ - **Multilingual UI & Output:**
24
+ Supports 70+ languages for interface and guide (client-side translation with your OpenAI API key).
25
+ - **Professional, Responsive HTML Output:**
26
+ Modern layout with clear headings, color-coded steps, bullet lists, and inline CSS.
27
+ - **Process-Aware:**
28
+ Guides are tailored to your input context, industry, or improvement challenge.
29
+ - **Privacy-First:**
30
+ No login, no cloud storage, no data sharing—your API key and input never leave your device.
31
+ - **Instant Cache Management:**
32
+ Translation cache for instant reloading, easy clearing, and full control.
33
+
34
+ ---
35
+
36
+ ## 🛠 How to Use
37
+
38
+ 1. **Open the tool** in your browser (locally or on Hugging Face Spaces).
39
+ 2. **Select your language** and enter your OpenAI API key (used only on your device).
40
+ 3. **Describe your process or improvement scenario** (minimum 50 characters).
41
+ 4. **Click “🔄 Generate PDCA Guide”.**
42
+ 5. **View and copy** the full, formatted PDCA guide for reports, training, or implementation.
43
+ 6. **Switch language or clear translation cache** as needed.
44
+
45
+ ---
46
+
47
+ ## 👩‍🏫 For Educators & Trainers
48
+
49
+ - **Process Improvement Courses:**
50
+ Walk students through real-world PDCA cycles for quality, Lean, Six Sigma, or operations.
51
+ - **Project-Based Learning:**
52
+ Assign group or solo improvement scenarios—let students generate, compare, and critique PDCA plans.
53
+ - **Cross-Language Teaching:**
54
+ Use in bilingual/multilingual classes—instant translation of both UI and PDCA output.
55
+ - **Portfolio/Assessment:**
56
+ Use HTML output as evidence for skills, reflection, or capstone projects.
57
+
58
+ ---
59
+
60
+ ## 👨‍💼 For Professionals & Teams
61
+
62
+ - **Real-World Improvement:**
63
+ Use for manufacturing, healthcare, business, education, service, or any continuous improvement process.
64
+ - **Onboarding & Training:**
65
+ Instantly explain PDCA with company-specific examples—no generic templates.
66
+ - **Change Management:**
67
+ Use as a change communication and planning tool; output can be shared, edited, or customized.
68
+ - **Quality & Compliance:**
69
+ Embed guides in documentation, SOPs, or audits.
70
+
71
+ ---
72
+
73
+ ## 🔐 Data Privacy Notice
74
+
75
+ - Your API key and all input/output **never leave your device**.
76
+ - No data is sent to Shift Mind AI Labs, Hugging Face, or third parties.
77
+
78
+ ---
79
+
80
+ ## 📄 License
81
+
82
+ Licensed under the [Apache License 2.0](./LICENSE).
83
+
84
+ ---
85
+
86
+ ## 🧠 About Shift Mind AI Labs
87
+
88
+ Shift Mind AI Labs creates open-source, ethical AI tools for education, business, and global impact.
89
+
90
+ 🌐 https://www.shiftmind.io
91
+ ✉️ info@shiftmind.io
92
+
93
+ ---
94
+
95
+ ## 🙌 Contributing
96
+
97
+ Feedback, pull requests, and pilots welcome!
98
+ For consulting, integrations, or school/enterprise partnerships: **info@shiftmind.io**
99
+
100
+ ---
101
+
102
+ *Empowering every organization to achieve systematic, data-driven, and sustainable improvement.*
index.html ADDED
@@ -0,0 +1,1701 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en" dir="ltr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>ContinuousImprovement Pro - Advanced PDCA Methodology</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
+ <style>
8
+ :root {
9
+ --primary: #1e40af;
10
+ --secondary: #3b82f6;
11
+ --accent: #60a5fa;
12
+ --background: #f8fafc;
13
+ --surface: #ffffff;
14
+ --text: #1e293b;
15
+ --text-secondary: #64748b;
16
+ --border: #e2e8f0;
17
+ --success: #10b981;
18
+ --warning: #f59e0b;
19
+ --error: #ef4444;
20
+ --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
21
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
22
+ }
23
+
24
+ * {
25
+ box-sizing: border-box;
26
+ margin: 0;
27
+ padding: 0;
28
+ }
29
+
30
+ body {
31
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
32
+ background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
33
+ color: var(--text);
34
+ line-height: 1.6;
35
+ min-height: 100vh;
36
+ padding: 15px;
37
+ transition: all 0.3s ease;
38
+ }
39
+
40
+ /* RTL Support */
41
+ [dir="rtl"] {
42
+ text-align: right;
43
+ }
44
+
45
+ [dir="rtl"] .container {
46
+ direction: rtl;
47
+ }
48
+
49
+ [dir="rtl"] .api-key-section {
50
+ margin: 15px 15px 15px auto;
51
+ }
52
+
53
+ [dir="rtl"] .pdca-steps {
54
+ direction: rtl;
55
+ }
56
+
57
+ [dir="rtl"] .generate-btn {
58
+ direction: rtl;
59
+ }
60
+
61
+ /* Language Selection Landing */
62
+ .language-landing {
63
+ display: block;
64
+ max-width: 600px;
65
+ margin: 50px auto;
66
+ background: var(--surface);
67
+ border-radius: 16px;
68
+ box-shadow: var(--shadow-lg);
69
+ padding: 40px;
70
+ text-align: center;
71
+ }
72
+
73
+ .language-landing h1 {
74
+ font-size: 2.5rem;
75
+ font-weight: 800;
76
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
77
+ -webkit-background-clip: text;
78
+ -webkit-text-fill-color: transparent;
79
+ background-clip: text;
80
+ margin-bottom: 15px;
81
+ }
82
+
83
+ .language-landing p {
84
+ font-size: 1.1rem;
85
+ color: var(--text-secondary);
86
+ margin-bottom: 30px;
87
+ }
88
+
89
+ .language-selector {
90
+ margin-bottom: 25px;
91
+ }
92
+
93
+ .language-selector label {
94
+ display: block;
95
+ margin-bottom: 10px;
96
+ font-weight: 600;
97
+ color: var(--text);
98
+ font-size: 1.1rem;
99
+ }
100
+
101
+ .language-selector select {
102
+ width: 100%;
103
+ padding: 15px 20px;
104
+ border: 2px solid var(--border);
105
+ border-radius: 12px;
106
+ font-size: 1.1rem;
107
+ font-family: inherit;
108
+ background: var(--surface);
109
+ transition: all 0.2s ease;
110
+ margin-bottom: 20px;
111
+ }
112
+
113
+ .language-selector select:focus {
114
+ outline: none;
115
+ border-color: var(--primary);
116
+ box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
117
+ }
118
+
119
+ .api-key-landing {
120
+ margin-bottom: 25px;
121
+ }
122
+
123
+ .api-key-landing label {
124
+ display: block;
125
+ margin-bottom: 10px;
126
+ font-weight: 600;
127
+ color: var(--text);
128
+ font-size: 1.1rem;
129
+ }
130
+
131
+ .api-key-landing input {
132
+ width: 100%;
133
+ padding: 15px 20px;
134
+ border: 2px solid var(--border);
135
+ border-radius: 12px;
136
+ font-size: 1.1rem;
137
+ background: var(--surface);
138
+ transition: all 0.2s ease;
139
+ font-family: 'Courier New', monospace;
140
+ }
141
+
142
+ .api-key-landing input:focus {
143
+ outline: none;
144
+ border-color: var(--primary);
145
+ box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
146
+ }
147
+
148
+ .start-btn {
149
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
150
+ color: white;
151
+ padding: 18px 40px;
152
+ border: none;
153
+ border-radius: 12px;
154
+ font-size: 1.2rem;
155
+ font-weight: 700;
156
+ cursor: pointer;
157
+ transition: all 0.3s ease;
158
+ width: 100%;
159
+ }
160
+
161
+ .start-btn:hover {
162
+ transform: translateY(-2px);
163
+ box-shadow: 0 12px 24px -8px rgba(30, 64, 175, 0.4);
164
+ }
165
+
166
+ .start-btn:disabled {
167
+ opacity: 0.7;
168
+ cursor: not-allowed;
169
+ transform: none;
170
+ }
171
+
172
+ /* Cache Management Section */
173
+ .cache-management {
174
+ background: rgba(30, 64, 175, 0.05);
175
+ border: 1px solid rgba(30, 64, 175, 0.1);
176
+ border-radius: 12px;
177
+ padding: 20px;
178
+ margin-bottom: 25px;
179
+ text-align: center;
180
+ }
181
+
182
+ .cache-management h3 {
183
+ color: var(--primary);
184
+ margin-bottom: 15px;
185
+ font-size: 1.1rem;
186
+ font-weight: 600;
187
+ }
188
+
189
+ .cache-status-display {
190
+ background: rgba(16, 185, 129, 0.1);
191
+ border: 1px solid rgba(16, 185, 129, 0.2);
192
+ color: var(--success);
193
+ padding: 12px 16px;
194
+ border-radius: 8px;
195
+ margin-bottom: 15px;
196
+ font-size: 0.9rem;
197
+ font-weight: 500;
198
+ }
199
+
200
+ .cache-status-display.no-cache {
201
+ background: rgba(100, 116, 139, 0.1);
202
+ border-color: rgba(100, 116, 139, 0.2);
203
+ color: var(--text-secondary);
204
+ }
205
+
206
+ .clear-cache-btn {
207
+ background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
208
+ color: white;
209
+ padding: 12px 24px;
210
+ border: none;
211
+ border-radius: 8px;
212
+ font-size: 0.9rem;
213
+ font-weight: 600;
214
+ cursor: pointer;
215
+ transition: all 0.3s ease;
216
+ }
217
+
218
+ .clear-cache-btn:hover {
219
+ transform: translateY(-1px);
220
+ box-shadow: 0 6px 12px -4px rgba(245, 158, 11, 0.4);
221
+ }
222
+
223
+ .clear-cache-btn:disabled {
224
+ opacity: 0.5;
225
+ cursor: not-allowed;
226
+ transform: none;
227
+ }
228
+
229
+ /* Cache Status Indicator */
230
+ .cache-status {
231
+ background: rgba(16, 185, 129, 0.1);
232
+ border: 1px solid rgba(16, 185, 129, 0.2);
233
+ color: var(--success);
234
+ padding: 8px 12px;
235
+ border-radius: 6px;
236
+ margin-bottom: 15px;
237
+ font-size: 0.85rem;
238
+ text-align: center;
239
+ font-weight: 500;
240
+ display: none;
241
+ }
242
+
243
+ .cache-status.cached {
244
+ display: block;
245
+ }
246
+
247
+ .cache-status.translating {
248
+ background: rgba(30, 64, 175, 0.1);
249
+ border-color: rgba(30, 64, 175, 0.2);
250
+ color: var(--primary);
251
+ }
252
+
253
+ /* Translation Loading Overlay */
254
+ .translation-overlay {
255
+ position: fixed;
256
+ top: 0;
257
+ left: 0;
258
+ width: 100%;
259
+ height: 100%;
260
+ background: rgba(30, 64, 175, 0.9);
261
+ display: none;
262
+ justify-content: center;
263
+ align-items: center;
264
+ z-index: 10000;
265
+ color: white;
266
+ text-align: center;
267
+ }
268
+
269
+ .translation-content {
270
+ background: rgba(255, 255, 255, 0.1);
271
+ padding: 40px;
272
+ border-radius: 16px;
273
+ backdrop-filter: blur(10px);
274
+ }
275
+
276
+ .translation-spinner {
277
+ width: 50px;
278
+ height: 50px;
279
+ border: 4px solid rgba(255, 255, 255, 0.3);
280
+ border-radius: 50%;
281
+ border-top-color: white;
282
+ animation: spin 1s ease-in-out infinite;
283
+ margin: 0 auto 20px;
284
+ }
285
+
286
+ /* Main Application (Hidden Initially) */
287
+ .main-app {
288
+ display: none;
289
+ }
290
+
291
+ .container {
292
+ max-width: 1000px;
293
+ margin: 0 auto;
294
+ background: var(--surface);
295
+ border-radius: 16px;
296
+ box-shadow: var(--shadow-lg);
297
+ overflow: hidden;
298
+ position: relative;
299
+ }
300
+
301
+ /* API Key Section - Static Position Top Left */
302
+ .api-key-section {
303
+ background: rgba(30, 64, 175, 0.05);
304
+ border: 1px solid rgba(30, 64, 175, 0.1);
305
+ border-radius: 8px;
306
+ padding: 12px;
307
+ margin: 15px;
308
+ max-width: 280px;
309
+ }
310
+
311
+ .api-key-section label {
312
+ font-size: 12px;
313
+ font-weight: 600;
314
+ color: var(--primary);
315
+ margin-bottom: 6px;
316
+ display: block;
317
+ }
318
+
319
+ .api-key-section input {
320
+ width: 100%;
321
+ padding: 8px 12px;
322
+ border: 1px solid var(--border);
323
+ border-radius: 6px;
324
+ font-size: 14px;
325
+ background: var(--surface);
326
+ transition: all 0.2s ease;
327
+ font-family: 'Courier New', monospace;
328
+ }
329
+
330
+ .api-key-section input:focus {
331
+ outline: none;
332
+ border-color: var(--primary);
333
+ box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
334
+ }
335
+
336
+ /* Language Switcher in Main App */
337
+ .language-switcher {
338
+ position: absolute;
339
+ top: 15px;
340
+ right: 15px;
341
+ display: flex;
342
+ gap: 10px;
343
+ align-items: center;
344
+ }
345
+
346
+ [dir="rtl"] .language-switcher {
347
+ right: auto;
348
+ left: 15px;
349
+ }
350
+
351
+ .language-switch-btn {
352
+ background: rgba(30, 64, 175, 0.05);
353
+ border: 1px solid rgba(30, 64, 175, 0.1);
354
+ border-radius: 8px;
355
+ padding: 8px 12px;
356
+ font-size: 12px;
357
+ cursor: pointer;
358
+ transition: all 0.2s ease;
359
+ color: var(--primary);
360
+ font-weight: 500;
361
+ }
362
+
363
+ .language-switch-btn:hover {
364
+ background: rgba(30, 64, 175, 0.1);
365
+ }
366
+
367
+ .mini-clear-cache {
368
+ background: rgba(245, 158, 11, 0.1);
369
+ border: 1px solid rgba(245, 158, 11, 0.2);
370
+ color: var(--warning);
371
+ padding: 6px 10px;
372
+ border-radius: 6px;
373
+ font-size: 11px;
374
+ cursor: pointer;
375
+ transition: all 0.2s ease;
376
+ font-weight: 500;
377
+ }
378
+
379
+ .mini-clear-cache:hover {
380
+ background: rgba(245, 158, 11, 0.2);
381
+ }
382
+
383
+ /* Main Content */
384
+ .main-content {
385
+ padding: 20px 30px 30px;
386
+ }
387
+
388
+ /* Header */
389
+ .header {
390
+ text-align: center;
391
+ margin-bottom: 25px;
392
+ padding-bottom: 20px;
393
+ border-bottom: 2px solid var(--border);
394
+ }
395
+
396
+ .header h1 {
397
+ font-size: 2.5rem;
398
+ font-weight: 800;
399
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
400
+ -webkit-background-clip: text;
401
+ -webkit-text-fill-color: transparent;
402
+ background-clip: text;
403
+ margin-bottom: 8px;
404
+ }
405
+
406
+ .header .subtitle {
407
+ font-size: 1.1rem;
408
+ color: var(--text-secondary);
409
+ font-weight: 500;
410
+ }
411
+
412
+ .header .description {
413
+ font-size: 1rem;
414
+ color: var(--text-secondary);
415
+ margin-top: 12px;
416
+ max-width: 600px;
417
+ margin-left: auto;
418
+ margin-right: auto;
419
+ }
420
+
421
+ /* PDCA Cycle Steps */
422
+ .pdca-steps {
423
+ display: grid;
424
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
425
+ gap: 15px;
426
+ margin-bottom: 25px;
427
+ }
428
+
429
+ .step-card {
430
+ background: rgba(30, 64, 175, 0.05);
431
+ border: 1px solid rgba(30, 64, 175, 0.1);
432
+ border-radius: 8px;
433
+ padding: 15px;
434
+ text-align: center;
435
+ position: relative;
436
+ }
437
+
438
+ .step-card.plan {
439
+ background: rgba(239, 68, 68, 0.05);
440
+ border-color: rgba(239, 68, 68, 0.1);
441
+ }
442
+
443
+ .step-card.do {
444
+ background: rgba(245, 158, 11, 0.05);
445
+ border-color: rgba(245, 158, 11, 0.1);
446
+ }
447
+
448
+ .step-card.check {
449
+ background: rgba(16, 185, 129, 0.05);
450
+ border-color: rgba(16, 185, 129, 0.1);
451
+ }
452
+
453
+ .step-card.act {
454
+ background: rgba(30, 64, 175, 0.05);
455
+ border-color: rgba(30, 64, 175, 0.1);
456
+ }
457
+
458
+ .step-card h4 {
459
+ color: var(--primary);
460
+ font-size: 0.9rem;
461
+ font-weight: 600;
462
+ margin-bottom: 6px;
463
+ }
464
+
465
+ .step-card.plan h4 { color: #ef4444; }
466
+ .step-card.do h4 { color: #f59e0b; }
467
+ .step-card.check h4 { color: #10b981; }
468
+ .step-card.act h4 { color: #1e40af; }
469
+
470
+ .step-card p {
471
+ font-size: 0.8rem;
472
+ color: var(--text-secondary);
473
+ }
474
+
475
+ /* Input Section */
476
+ .input-section {
477
+ background: var(--surface);
478
+ border: 1px solid var(--border);
479
+ border-radius: 12px;
480
+ padding: 20px;
481
+ margin-bottom: 25px;
482
+ transition: all 0.3s ease;
483
+ box-shadow: var(--shadow);
484
+ }
485
+
486
+ .input-section:hover {
487
+ border-color: var(--primary);
488
+ box-shadow: 0 8px 25px -8px rgba(30, 64, 175, 0.3);
489
+ }
490
+
491
+ .input-section h3 {
492
+ font-size: 1.1rem;
493
+ font-weight: 700;
494
+ color: var(--primary);
495
+ margin-bottom: 8px;
496
+ display: flex;
497
+ align-items: center;
498
+ gap: 8px;
499
+ }
500
+
501
+ .input-section .description {
502
+ font-size: 0.9rem;
503
+ color: var(--text-secondary);
504
+ margin-bottom: 12px;
505
+ }
506
+
507
+ /* Form Elements */
508
+ label {
509
+ display: block;
510
+ margin-bottom: 6px;
511
+ font-weight: 600;
512
+ color: var(--text);
513
+ font-size: 0.95rem;
514
+ }
515
+
516
+ textarea {
517
+ width: 100%;
518
+ padding: 12px 16px;
519
+ border: 2px solid var(--border);
520
+ border-radius: 8px;
521
+ font-size: 1rem;
522
+ font-family: inherit;
523
+ background: var(--surface);
524
+ transition: all 0.2s ease;
525
+ resize: vertical;
526
+ min-height: 150px;
527
+ }
528
+
529
+ textarea:focus {
530
+ outline: none;
531
+ border-color: var(--primary);
532
+ box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
533
+ }
534
+
535
+ /* Character Counter */
536
+ .char-counter {
537
+ font-size: 0.8rem;
538
+ color: var(--text-secondary);
539
+ text-align: right;
540
+ margin-top: 4px;
541
+ }
542
+
543
+ [dir="rtl"] .char-counter {
544
+ text-align: left;
545
+ }
546
+
547
+ /* Generate Button */
548
+ .generate-btn {
549
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
550
+ color: white;
551
+ padding: 16px 32px;
552
+ border: none;
553
+ border-radius: 12px;
554
+ font-size: 1.1rem;
555
+ font-weight: 700;
556
+ cursor: pointer;
557
+ transition: all 0.3s ease;
558
+ display: block;
559
+ margin: 25px auto;
560
+ min-width: 280px;
561
+ position: relative;
562
+ overflow: hidden;
563
+ }
564
+
565
+ .generate-btn:hover {
566
+ transform: translateY(-2px);
567
+ box-shadow: 0 12px 24px -8px rgba(30, 64, 175, 0.4);
568
+ }
569
+
570
+ .generate-btn:active {
571
+ transform: translateY(0);
572
+ }
573
+
574
+ .generate-btn:disabled {
575
+ opacity: 0.7;
576
+ cursor: not-allowed;
577
+ transform: none;
578
+ }
579
+
580
+ /* Loading Spinner */
581
+ .spinner {
582
+ display: none;
583
+ width: 20px;
584
+ height: 20px;
585
+ border: 2px solid rgba(255, 255, 255, 0.3);
586
+ border-radius: 50%;
587
+ border-top-color: white;
588
+ animation: spin 1s ease-in-out infinite;
589
+ margin-right: 8px;
590
+ }
591
+
592
+ [dir="rtl"] .spinner {
593
+ margin-right: 0;
594
+ margin-left: 8px;
595
+ }
596
+
597
+ @keyframes spin {
598
+ to { transform: rotate(360deg); }
599
+ }
600
+
601
+ /* Output Section */
602
+ .output-section {
603
+ margin-top: 30px;
604
+ }
605
+
606
+ .output-section h2 {
607
+ font-size: 1.5rem;
608
+ font-weight: 700;
609
+ color: var(--primary);
610
+ margin-bottom: 15px;
611
+ display: flex;
612
+ align-items: center;
613
+ gap: 8px;
614
+ }
615
+
616
+ .output-area {
617
+ background: var(--surface);
618
+ border: 2px solid var(--border);
619
+ border-radius: 12px;
620
+ padding: 20px;
621
+ min-height: 300px;
622
+ transition: all 0.3s ease;
623
+ position: relative;
624
+ overflow-x: auto;
625
+ }
626
+
627
+ .output-area:empty::before {
628
+ content: "Your comprehensive PDCA cycle explanation will appear here...";
629
+ color: var(--text-secondary);
630
+ font-style: italic;
631
+ }
632
+
633
+ /* Enhanced output styling */
634
+ .output-area h3 {
635
+ color: var(--primary);
636
+ border-bottom: 2px solid var(--primary);
637
+ padding-bottom: 8px;
638
+ margin: 20px 0 15px 0;
639
+ font-size: 1.2rem;
640
+ }
641
+
642
+ .output-area h4 {
643
+ color: var(--secondary);
644
+ margin: 15px 0 10px 0;
645
+ font-size: 1.1rem;
646
+ }
647
+
648
+ .output-area ul {
649
+ margin: 10px 0 15px 20px;
650
+ line-height: 1.7;
651
+ }
652
+
653
+ .output-area li {
654
+ margin-bottom: 5px;
655
+ }
656
+
657
+ .output-area p {
658
+ margin: 12px 0;
659
+ line-height: 1.7;
660
+ }
661
+
662
+ .output-area strong {
663
+ color: var(--primary);
664
+ }
665
+
666
+ /* Error Messages */
667
+ .error-message {
668
+ background: rgba(239, 68, 68, 0.1);
669
+ border: 1px solid rgba(239, 68, 68, 0.2);
670
+ color: var(--error);
671
+ padding: 12px 16px;
672
+ border-radius: 8px;
673
+ margin: 10px 0;
674
+ font-size: 0.9rem;
675
+ display: none;
676
+ }
677
+
678
+ /* Footer */
679
+ .footer {
680
+ text-align: center;
681
+ padding: 20px;
682
+ background: rgba(30, 64, 175, 0.05);
683
+ border-top: 1px solid var(--border);
684
+ color: var(--text-secondary);
685
+ font-size: 0.9rem;
686
+ }
687
+
688
+ /* Responsive Design */
689
+ @media (max-width: 768px) {
690
+ body {
691
+ padding: 10px;
692
+ }
693
+
694
+ .language-landing {
695
+ margin: 20px auto;
696
+ padding: 30px 20px;
697
+ }
698
+
699
+ .api-key-section {
700
+ margin: 10px;
701
+ max-width: none;
702
+ }
703
+
704
+ .language-switcher {
705
+ position: relative;
706
+ top: auto;
707
+ right: auto;
708
+ margin-bottom: 15px;
709
+ justify-content: center;
710
+ }
711
+
712
+ .main-content {
713
+ padding: 15px 20px 20px;
714
+ }
715
+
716
+ .header h1 {
717
+ font-size: 2rem;
718
+ }
719
+
720
+ .input-section {
721
+ padding: 15px;
722
+ }
723
+
724
+ .pdca-steps {
725
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
726
+ }
727
+
728
+ .generate-btn {
729
+ width: 100%;
730
+ margin: 20px 0;
731
+ }
732
+
733
+ .output-area {
734
+ padding: 15px;
735
+ }
736
+ }
737
+
738
+ @media (max-width: 480px) {
739
+ .language-landing h1 {
740
+ font-size: 2rem;
741
+ }
742
+
743
+ .header h1 {
744
+ font-size: 1.8rem;
745
+ }
746
+
747
+ .input-section {
748
+ padding: 12px;
749
+ }
750
+
751
+ .pdca-steps {
752
+ grid-template-columns: 1fr 1fr;
753
+ }
754
+ }
755
+
756
+ /* Dark mode support */
757
+ @media (prefers-color-scheme: dark) {
758
+ :root {
759
+ --background: #0f172a;
760
+ --surface: #1e293b;
761
+ --text: #f1f5f9;
762
+ --text-secondary: #94a3b8;
763
+ --border: #334155;
764
+ }
765
+
766
+ body {
767
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
768
+ }
769
+ }
770
+ </style>
771
+ </head>
772
+ <body>
773
+ <!-- Translation Loading Overlay -->
774
+ <div class="translation-overlay" id="translationOverlay">
775
+ <div class="translation-content">
776
+ <div class="translation-spinner"></div>
777
+ <h2 id="translationTitle">Translating Interface...</h2>
778
+ <p id="translationMessage">Please wait while we translate the interface to your selected language.</p>
779
+ </div>
780
+ </div>
781
+
782
+ <!-- Language Selection Landing Page -->
783
+ <div class="language-landing" id="languageLanding">
784
+ <h1 data-translate="app_title">ContinuousImprovement Pro</h1>
785
+ <p data-translate="welcome_message">Welcome! Please select your preferred language and enter your API key to get started.</p>
786
+
787
+ <!-- Cache Status Indicator -->
788
+ <div class="cache-status" id="cacheStatus">
789
+ 💾 Translations cached - instant loading!
790
+ </div>
791
+
792
+ <!-- Cache Management Section -->
793
+ <div class="cache-management" id="cacheManagement">
794
+ <h3 data-translate="cache_management_title">🗂️ Translation Cache Management</h3>
795
+ <div class="cache-status-display" id="cacheStatusDisplay">
796
+ <span data-translate="cache_status_checking">Checking cache status...</span>
797
+ </div>
798
+ <button class="clear-cache-btn" id="clearCacheBtn" data-translate="clear_cache_button">
799
+ 🗑️ Clear All Cached Translations
800
+ </button>
801
+ </div>
802
+
803
+ <div class="language-selector">
804
+ <label for="languageSelect" data-translate="select_language">🌐 Select Language</label>
805
+ <select id="languageSelect">
806
+ <option value="en">🇺🇸 English</option>
807
+ <option value="es">🇪🇸 Español (Spanish)</option>
808
+ <option value="fr">🇫🇷 Français (French)</option>
809
+ <option value="de">🇩🇪 Deutsch (German)</option>
810
+ <option value="zh">🇨🇳 中文 (Chinese)</option>
811
+ <option value="ja">🇯🇵 日本語 (Japanese)</option>
812
+ <option value="ko">🇰🇷 한국어 (Korean)</option>
813
+ <option value="pt">🇵🇹 Português (Portuguese)</option>
814
+ <option value="it">🇮🇹 Italiano (Italian)</option>
815
+ <option value="ar">🇸🇦 العربية (Arabic)</option>
816
+ <option value="ru">🇷🇺 Русский (Russian)</option>
817
+ <option value="hi">🇮🇳 हिन्दी (Hindi)</option>
818
+ <option value="bn">🇧🇩 বাংলা (Bengali)</option>
819
+ <option value="ur">🇵🇰 اردو (Urdu)</option>
820
+ <option value="tr">🇹🇷 Türkçe (Turkish)</option>
821
+ <option value="pl">🇵🇱 Polski (Polish)</option>
822
+ <option value="nl">🇳🇱 Nederlands (Dutch)</option>
823
+ <option value="sv">🇸🇪 Svenska (Swedish)</option>
824
+ <option value="da">🇩🇰 Dansk (Danish)</option>
825
+ <option value="no">🇳🇴 Norsk (Norwegian)</option>
826
+ <option value="fi">🇫🇮 Suomi (Finnish)</option>
827
+ <option value="is">🇮🇸 Íslenska (Icelandic)</option>
828
+ <option value="cs">🇨🇿 Čeština (Czech)</option>
829
+ <option value="sk">🇸🇰 Slovenčina (Slovak)</option>
830
+ <option value="hu">🇭🇺 Magyar (Hungarian)</option>
831
+ <option value="ro">🇷🇴 Română (Romanian)</option>
832
+ <option value="bg">🇧🇬 Български (Bulgarian)</option>
833
+ <option value="hr">🇭🇷 Hrvatski (Croatian)</option>
834
+ <option value="sr">🇷🇸 Српски (Serbian)</option>
835
+ <option value="sl">🇸🇮 Slovenščina (Slovenian)</option>
836
+ <option value="mk">🇲🇰 Македонски (Macedonian)</option>
837
+ <option value="sq">🇦🇱 Shqip (Albanian)</option>
838
+ <option value="lv">🇱🇻 Latviešu (Latvian)</option>
839
+ <option value="lt">🇱🇹 Lietuvių (Lithuanian)</option>
840
+ <option value="et">🇪🇪 Eesti (Estonian)</option>
841
+ <option value="mt">🇲🇹 Malti (Maltese)</option>
842
+ <option value="ga">🇮🇪 Gaeilge (Irish)</option>
843
+ <option value="cy">🏴󠁧󠁢󠁷󠁬󠁳󠁿 Cymraeg (Welsh)</option>
844
+ <option value="eu">🏴󠁥󠁳󠁰󠁶󠁿 Euskera (Basque)</option>
845
+ <option value="ca">🏴󠁥󠁳󠁣󠁴󠁿 Català (Catalan)</option>
846
+ <option value="gl">🏴󠁥󠁳󠁧󠁡󠁿 Galego (Galician)</option>
847
+ <option value="el">🇬🇷 Ελληνικά (Greek)</option>
848
+ <option value="he">🇮🇱 עברית (Hebrew)</option>
849
+ <option value="fa">🇮🇷 فارسی (Persian)</option>
850
+ <option value="ps">🇦🇫 پښتو (Pashto)</option>
851
+ <option value="ku">🏴󠁩󠁱󠁫󠁲󠁿 کوردی (Kurdish)</option>
852
+ <option value="az">🇦🇿 Azərbaycan (Azerbaijani)</option>
853
+ <option value="kk">🇰🇿 Қазақша (Kazakh)</option>
854
+ <option value="ky">🇰🇬 Кыргызча (Kyrgyz)</option>
855
+ <option value="uz">🇺🇿 O'zbek (Uzbek)</option>
856
+ <option value="tk">🇹🇲 Türkmen (Turkmen)</option>
857
+ <option value="tg">🇹🇯 Тоҷикӣ (Tajik)</option>
858
+ <option value="mn">🇲🇳 Монгол (Mongolian)</option>
859
+ <option value="ka">🇬🇪 ქართული (Georgian)</option>
860
+ <option value="hy">🇦🇲 Հայերեն (Armenian)</option>
861
+ <option value="th">🇹🇭 ไทย (Thai)</option>
862
+ <option value="vi">🇻🇳 Tiếng Việt (Vietnamese)</option>
863
+ <option value="lo">🇱🇦 ລາວ (Lao)</option>
864
+ <option value="km">🇰🇭 ខ្មែរ (Khmer)</option>
865
+ <option value="my">🇲🇲 မြန်မာ (Myanmar)</option>
866
+ <option value="si">🇱🇰 සිංහල (Sinhala)</option>
867
+ <option value="ta">🇱🇰 தமிழ் (Tamil)</option>
868
+ <option value="te">🇮🇳 తెలుగు (Telugu)</option>
869
+ <option value="kn">🇮🇳 ಕನ್ನಡ (Kannada)</option>
870
+ <option value="ml">🇮🇳 മലയാളം (Malayalam)</option>
871
+ <option value="gu">🇮🇳 ગુજરાતી (Gujarati)</option>
872
+ <option value="pa">🇮🇳 ਪੰਜਾਬੀ (Punjabi)</option>
873
+ <option value="or">🇮🇳 ଓଡ଼ିଆ (Odia)</option>
874
+ <option value="as">🇮🇳 অসমীয়া (Assamese)</option>
875
+ <option value="ne">🇳🇵 नेपाली (Nepali)</option>
876
+ <option value="dz">🇧🇹 རྫོང་ཁ (Dzongkha)</option>
877
+ <option value="bo">🏔️ བོད་ཡིག (Tibetan)</option>
878
+ <option value="id">🇮🇩 Bahasa Indonesia</option>
879
+ <option value="ms">🇲🇾 Bahasa Melayu (Malay)</option>
880
+ <option value="tl">🇵🇭 Filipino (Tagalog)</option>
881
+ <option value="ceb">🇵🇭 Cebuano</option>
882
+ <option value="haw">🏝️ ʻŌlelo Hawaiʻi (Hawaiian)</option>
883
+ <option value="mi">🇳🇿 Te Reo Māori (Maori)</option>
884
+ <option value="sm">🇼🇸 Gagana Samoa (Samoan)</option>
885
+ <option value="to">🇹🇴 Lea Fakatonga (Tongan)</option>
886
+ <option value="fj">🇫🇯 Na Vosa Vakaviti (Fijian)</option>
887
+ <option value="mg">🇲🇬 Malagasy</option>
888
+ <option value="sw">🇰🇪 Kiswahili (Swahili)</option>
889
+ <option value="zu">🇿🇦 isiZulu (Zulu)</option>
890
+ <option value="xh">🇿🇦 isiXhosa (Xhosa)</option>
891
+ <option value="af">🇿🇦 Afrikaans</option>
892
+ <option value="st">🇱🇸 Sesotho (Southern Sotho)</option>
893
+ <option value="tn">🇧🇼 Setswana (Tswana)</option>
894
+ <option value="ss">🇸🇿 siSwati (Swati)</option>
895
+ <option value="ve">����🇦 Tshivenḓa (Venda)</option>
896
+ <option value="ts">🇿🇦 Xitsonga (Tsonga)</option>
897
+ <option value="nr">🇿🇦 isiNdebele (Southern Ndebele)</option>
898
+ <option value="am">🇪🇹 አማርኛ (Amharic)</option>
899
+ <option value="ti">🇪🇷 ትግርኛ (Tigrinya)</option>
900
+ <option value="om">🇪🇹 Afaan Oromoo (Oromo)</option>
901
+ <option value="so">🇸🇴 Soomaali (Somali)</option>
902
+ <option value="ha">🇳🇬 Hausa</option>
903
+ <option value="yo">🇳🇬 Yorùbá (Yoruba)</option>
904
+ <option value="ig">🇳🇬 Igbo</option>
905
+ <option value="ff">🇸🇳 Fulfulde (Fulani)</option>
906
+ <option value="wo">🇸🇳 Wolof</option>
907
+ <option value="bm">🇲🇱 Bamanankan (Bambara)</option>
908
+ <option value="rn">🇧🇮 Kirundi (Rundi)</option>
909
+ <option value="rw">🇷🇼 Kinyarwanda (Rwanda)</option>
910
+ <option value="lg">🇺🇬 Luganda</option>
911
+ <option value="ny">🇲🇼 Chichewa (Nyanja)</option>
912
+ <option value="sn">🇿🇼 chiShona (Shona)</option>
913
+ <option value="nd">🇿🇼 isiNdebele (Northern Ndebele)</option>
914
+ </select>
915
+ </div>
916
+
917
+ <div class="api-key-landing">
918
+ <label for="apiKeyLanding" data-translate="api_key_label">🔑 OpenAI API Key</label>
919
+ <input type="password" id="apiKeyLanding" placeholder="Enter your OpenAI API key" data-translate-placeholder="api_key_placeholder">
920
+ </div>
921
+
922
+ <button class="start-btn" id="startBtn" data-translate="start_button">🚀 Start Process Improvement</button>
923
+ </div>
924
+
925
+ <!-- Main Application -->
926
+ <div class="main-app" id="mainApp">
927
+ <div class="container">
928
+ <!-- Language Switcher -->
929
+ <div class="language-switcher" id="languageSwitcher">
930
+ <div class="language-switch-btn" onclick="showLanguageLanding()">
931
+ <span data-translate="change_language">🌐 Change Language</span>
932
+ </div>
933
+ <div class="mini-clear-cache" onclick="clearAllTranslationCache()" title="Clear translation cache">
934
+ <span data-translate="clear_cache_mini">🗑️ Clear Cache</span>
935
+ </div>
936
+ </div>
937
+
938
+ <!-- API Key Section - Static Position Top Left -->
939
+ <div class="api-key-section">
940
+ <label for="apiKey" data-translate="api_key_short">🔑 API Key</label>
941
+ <input type="password" id="apiKey" data-translate-placeholder="api_key_placeholder" autocomplete="off">
942
+ </div>
943
+
944
+ <div class="main-content">
945
+ <!-- Header -->
946
+ <div class="header">
947
+ <h1 data-translate="app_title">ContinuousImprovement Pro</h1>
948
+ <p class="subtitle" data-translate="app_subtitle">Advanced PDCA Methodology & Process Optimization</p>
949
+ <p class="description" data-translate="app_description">Generate comprehensive PDCA cycle explanations tailored to your specific processes and continuous improvement initiatives</p>
950
+ </div>
951
+
952
+ <!-- PDCA Cycle Steps Overview -->
953
+ <div class="pdca-steps">
954
+ <div class="step-card plan">
955
+ <h4 data-translate="step_plan">📋 Plan</h4>
956
+ <p data-translate="step_plan_desc">Identify & Strategize</p>
957
+ </div>
958
+ <div class="step-card do">
959
+ <h4 data-translate="step_do">⚡ Do</h4>
960
+ <p data-translate="step_do_desc">Execute & Implement</p>
961
+ </div>
962
+ <div class="step-card check">
963
+ <h4 data-translate="step_check">📊 Check</h4>
964
+ <p data-translate="step_check_desc">Monitor & Evaluate</p>
965
+ </div>
966
+ <div class="step-card act">
967
+ <h4 data-translate="step_act">🔄 Act</h4>
968
+ <p data-translate="step_act_desc">Standardize & Improve</p>
969
+ </div>
970
+ </div>
971
+
972
+ <!-- Input Section -->
973
+ <div class="input-section">
974
+ <h3 data-translate="input_title">🔧 Process & Context Input</h3>
975
+ <p class="description" data-translate="input_description">Describe your process, improvement initiative, or any context where you need to apply PDCA methodology for continuous improvement</p>
976
+ <textarea id="textInput" data-translate-placeholder="input_placeholder" required></textarea>
977
+ <div class="char-counter" id="charCounter">0 <span data-translate="characters">characters</span></div>
978
+ </div>
979
+
980
+ <!-- Error Message -->
981
+ <div class="error-message" id="errorMessage"></div>
982
+
983
+ <!-- Generate Button -->
984
+ <button class="generate-btn" id="generatePDCABtn">
985
+ <span class="spinner" id="spinner"></span>
986
+ <span id="buttonText" data-translate="generate_button">🔄 Generate PDCA Guide</span>
987
+ </button>
988
+
989
+ <!-- Output Section -->
990
+ <div class="output-section">
991
+ <h2 data-translate="output_title">📈 Your PDCA Cycle Guide</h2>
992
+ <div class="output-area" id="apiOutput"></div>
993
+ </div>
994
+ </div>
995
+
996
+ <!-- Footer -->
997
+ <div class="footer">
998
+ Created by Shift Mind AI Labs
999
+ </div>
1000
+ </div>
1001
+ </div>
1002
+
1003
+ <script>
1004
+ // RTL languages list
1005
+ const rtlLanguages = ['ar', 'he', 'fa', 'ur', 'ps', 'ku'];
1006
+
1007
+ // Current language and API key
1008
+ let currentLanguage = 'en';
1009
+ let currentApiKey = '';
1010
+
1011
+ // Language names mapping
1012
+ const languageNames = {
1013
+ en: 'English', es: 'Spanish', fr: 'French', de: 'German', zh: 'Chinese',
1014
+ ja: 'Japanese', ko: 'Korean', pt: 'Portuguese', it: 'Italian', ar: 'Arabic',
1015
+ ru: 'Russian', hi: 'Hindi', bn: 'Bengali', ur: 'Urdu', tr: 'Turkish',
1016
+ pl: 'Polish', nl: 'Dutch', sv: 'Swedish', da: 'Danish', no: 'Norwegian',
1017
+ fi: 'Finnish', is: 'Icelandic', cs: 'Czech', sk: 'Slovak', hu: 'Hungarian',
1018
+ ro: 'Romanian', bg: 'Bulgarian', hr: 'Croatian', sr: 'Serbian', sl: 'Slovenian',
1019
+ mk: 'Macedonian', sq: 'Albanian', lv: 'Latvian', lt: 'Lithuanian', et: 'Estonian',
1020
+ mt: 'Maltese', ga: 'Irish', cy: 'Welsh', eu: 'Basque', ca: 'Catalan',
1021
+ gl: 'Galician', el: 'Greek', he: 'Hebrew', fa: 'Persian', ps: 'Pashto',
1022
+ ku: 'Kurdish', az: 'Azerbaijani', kk: 'Kazakh', ky: 'Kyrgyz', uz: 'Uzbek',
1023
+ tk: 'Turkmen', tg: 'Tajik', mn: 'Mongolian', ka: 'Georgian', hy: 'Armenian',
1024
+ th: 'Thai', vi: 'Vietnamese', lo: 'Lao', km: 'Khmer', my: 'Myanmar',
1025
+ si: 'Sinhala', ta: 'Tamil', te: 'Telugu', kn: 'Kannada', ml: 'Malayalam',
1026
+ gu: 'Gujarati', pa: 'Punjabi', or: 'Odia', as: 'Assamese', ne: 'Nepali',
1027
+ dz: 'Dzongkha', bo: 'Tibetan', id: 'Indonesian', ms: 'Malay', tl: 'Filipino',
1028
+ ceb: 'Cebuano', haw: 'Hawaiian', mi: 'Maori', sm: 'Samoan', to: 'Tongan',
1029
+ fj: 'Fijian', mg: 'Malagasy', sw: 'Swahili', zu: 'Zulu', xh: 'Xhosa',
1030
+ af: 'Afrikaans', st: 'Southern Sotho', tn: 'Tswana', ss: 'Swati', ve: 'Venda',
1031
+ ts: 'Tsonga', nr: 'Southern Ndebele', am: 'Amharic', ti: 'Tigrinya', om: 'Oromo',
1032
+ so: 'Somali', ha: 'Hausa', yo: 'Yoruba', ig: 'Igbo', ff: 'Fulani',
1033
+ wo: 'Wolof', bm: 'Bambara', rn: 'Rundi', rw: 'Rwanda', lg: 'Luganda',
1034
+ ny: 'Chichewa', sn: 'Shona', nd: 'Northern Ndebele'
1035
+ };
1036
+
1037
+ // Translation cache management
1038
+ const CACHE_PREFIX = 'continuousimprovement_translations_';
1039
+ const CACHE_VERSION = '1.0';
1040
+
1041
+ // Check if translations are cached for a language
1042
+ function isLanguageCached(language) {
1043
+ const cacheKey = CACHE_PREFIX + language;
1044
+ const cached = localStorage.getItem(cacheKey);
1045
+ return cached !== null;
1046
+ }
1047
+
1048
+ // Save translations to cache
1049
+ function saveTranslationsToCache(language, translations) {
1050
+ const cacheKey = CACHE_PREFIX + language;
1051
+ const cacheData = {
1052
+ version: CACHE_VERSION,
1053
+ timestamp: Date.now(),
1054
+ translations: translations
1055
+ };
1056
+ localStorage.setItem(cacheKey, JSON.stringify(cacheData));
1057
+ console.log(`Translations cached for ${language}`);
1058
+ }
1059
+
1060
+ // Load translations from cache
1061
+ function loadTranslationsFromCache(language) {
1062
+ const cacheKey = CACHE_PREFIX + language;
1063
+ const cached = localStorage.getItem(cacheKey);
1064
+
1065
+ if (cached) {
1066
+ try {
1067
+ const cacheData = JSON.parse(cached);
1068
+ if (cacheData.version === CACHE_VERSION) {
1069
+ console.log(`Translations loaded from cache for ${language}`);
1070
+ return cacheData.translations;
1071
+ }
1072
+ } catch (error) {
1073
+ console.error('Error parsing cached translations:', error);
1074
+ }
1075
+ }
1076
+ return null;
1077
+ }
1078
+
1079
+ // Get all cached languages
1080
+ function getCachedLanguages() {
1081
+ const cachedLanguages = [];
1082
+ for (let i = 0; i < localStorage.length; i++) {
1083
+ const key = localStorage.key(i);
1084
+ if (key && key.startsWith(CACHE_PREFIX)) {
1085
+ const language = key.replace(CACHE_PREFIX, '');
1086
+ cachedLanguages.push(language);
1087
+ }
1088
+ }
1089
+ return cachedLanguages;
1090
+ }
1091
+
1092
+ // Clear all translation cache
1093
+ function clearAllTranslationCache() {
1094
+ const cachedLanguages = getCachedLanguages();
1095
+
1096
+ if (cachedLanguages.length === 0) {
1097
+ alert('No cached translations to clear.');
1098
+ return;
1099
+ }
1100
+
1101
+ const languageList = cachedLanguages.map(lang => languageNames[lang] || lang).join(', ');
1102
+ const confirmMessage = `Are you sure you want to clear all cached translations?\n\nCached languages: ${languageList}\n\nThis will require re-downloading translations when switching languages.`;
1103
+
1104
+ if (confirm(confirmMessage)) {
1105
+ // Clear all translation caches
1106
+ cachedLanguages.forEach(language => {
1107
+ const cacheKey = CACHE_PREFIX + language;
1108
+ localStorage.removeItem(cacheKey);
1109
+ });
1110
+
1111
+ // Update cache status
1112
+ updateCacheStatus(currentLanguage);
1113
+ updateCacheStatusDisplay();
1114
+
1115
+ alert(`Cache cleared successfully!\n\n${cachedLanguages.length} language(s) removed from cache.`);
1116
+
1117
+ // Ask if user wants to reload current language translations
1118
+ if (currentLanguage !== 'en' && cachedLanguages.includes(currentLanguage)) {
1119
+ if (confirm('Would you like to reload the current language translations?')) {
1120
+ applyLanguage(currentLanguage);
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+
1126
+ // Update cache status indicator
1127
+ function updateCacheStatus(language) {
1128
+ const cacheStatus = document.getElementById('cacheStatus');
1129
+ const isCached = isLanguageCached(language);
1130
+
1131
+ if (language === 'en') {
1132
+ cacheStatus.classList.remove('cached', 'translating');
1133
+ return;
1134
+ }
1135
+
1136
+ if (isCached) {
1137
+ cacheStatus.textContent = '💾 Translations cached - instant loading!';
1138
+ cacheStatus.classList.add('cached');
1139
+ cacheStatus.classList.remove('translating');
1140
+ } else {
1141
+ cacheStatus.textContent = '🔄 First time translation - will be cached for future use';
1142
+ cacheStatus.classList.add('translating');
1143
+ cacheStatus.classList.remove('cached');
1144
+ }
1145
+ }
1146
+
1147
+ // Update cache status display in management section
1148
+ function updateCacheStatusDisplay() {
1149
+ const cacheStatusDisplay = document.getElementById('cacheStatusDisplay');
1150
+ const clearCacheBtn = document.getElementById('clearCacheBtn');
1151
+ const cachedLanguages = getCachedLanguages();
1152
+
1153
+ if (cachedLanguages.length === 0) {
1154
+ cacheStatusDisplay.textContent = '📭 No cached translations';
1155
+ cacheStatusDisplay.className = 'cache-status-display no-cache';
1156
+ clearCacheBtn.disabled = true;
1157
+ } else {
1158
+ const languageList = cachedLanguages.map(lang => languageNames[lang] || lang).join(', ');
1159
+ cacheStatusDisplay.textContent = `💾 ${cachedLanguages.length} language(s) cached: ${languageList}`;
1160
+ cacheStatusDisplay.className = 'cache-status-display';
1161
+ clearCacheBtn.disabled = false;
1162
+ }
1163
+ }
1164
+
1165
+ // Initialize the application
1166
+ function initializeApp() {
1167
+ // Load saved language and API key
1168
+ const savedLanguage = localStorage.getItem('continuousimprovement_language') || 'en';
1169
+ const savedApiKey = localStorage.getItem('continuous_improvement_api_key') || '';
1170
+
1171
+ currentLanguage = savedLanguage;
1172
+ currentApiKey = savedApiKey;
1173
+
1174
+ // Set language selector
1175
+ document.getElementById('languageSelect').value = currentLanguage;
1176
+ document.getElementById('apiKeyLanding').value = currentApiKey;
1177
+
1178
+ // Apply direction for current language
1179
+ applyDirection(currentLanguage);
1180
+
1181
+ // Update cache status
1182
+ updateCacheStatus(currentLanguage);
1183
+ updateCacheStatusDisplay();
1184
+
1185
+ // Show appropriate screen
1186
+ if (currentApiKey && currentLanguage) {
1187
+ showMainApp();
1188
+ } else {
1189
+ showLanguageLanding();
1190
+ }
1191
+ }
1192
+
1193
+ // Apply language direction
1194
+ function applyDirection(language) {
1195
+ currentLanguage = language;
1196
+
1197
+ // Set document language and direction
1198
+ document.documentElement.lang = language;
1199
+ document.documentElement.dir = rtlLanguages.includes(language) ? 'rtl' : 'ltr';
1200
+
1201
+ // Save language preference
1202
+ localStorage.setItem('continuousimprovement_language', language);
1203
+
1204
+ // Update cache status
1205
+ updateCacheStatus(language);
1206
+ }
1207
+
1208
+ // API call function for translation
1209
+ async function translateText(text, targetLanguage) {
1210
+ if (!currentApiKey) {
1211
+ throw new Error('API key is required for translation');
1212
+ }
1213
+
1214
+ const languageName = languageNames[targetLanguage] || 'English';
1215
+
1216
+ const prompt = `Translate the following text to ${languageName}. Provide ONLY the exact translation without any explanations, additional information, or formatting:
1217
+
1218
+ "${text}"`;
1219
+
1220
+ const payload = {
1221
+ model: "gpt-4o-mini",
1222
+ messages: [{ role: "user", content: prompt }],
1223
+ max_tokens: 500,
1224
+ temperature: 0.1
1225
+ };
1226
+
1227
+ const response = await fetch("https://api.openai.com/v1/chat/completions", {
1228
+ method: "POST",
1229
+ headers: {
1230
+ "Content-Type": "application/json",
1231
+ "Authorization": `Bearer ${currentApiKey}`
1232
+ },
1233
+ body: JSON.stringify(payload)
1234
+ });
1235
+
1236
+ if (!response.ok) {
1237
+ const errorData = await response.json();
1238
+ throw new Error(errorData.error?.message || "Translation API request failed");
1239
+ }
1240
+
1241
+ const data = await response.json();
1242
+ return data.choices[0].message.content.trim();
1243
+ }
1244
+
1245
+ // Apply cached translations to UI
1246
+ function applyCachedTranslations(translations) {
1247
+ // Apply text translations
1248
+ Object.keys(translations.texts).forEach(originalText => {
1249
+ const translation = translations.texts[originalText];
1250
+ const elements = document.querySelectorAll(`[data-translate]`);
1251
+
1252
+ elements.forEach(element => {
1253
+ const originalElementText = element.getAttribute('data-original-text') || element.textContent;
1254
+ if (originalElementText === originalText) {
1255
+ element.textContent = translation;
1256
+ }
1257
+ });
1258
+ });
1259
+
1260
+ // Apply placeholder translations
1261
+ Object.keys(translations.placeholders).forEach(originalPlaceholder => {
1262
+ const translation = translations.placeholders[originalPlaceholder];
1263
+ const elements = document.querySelectorAll(`[data-translate-placeholder]`);
1264
+
1265
+ elements.forEach(element => {
1266
+ const originalElementPlaceholder = element.getAttribute('data-original-placeholder') || element.placeholder;
1267
+ if (originalElementPlaceholder === originalPlaceholder) {
1268
+ element.placeholder = translation;
1269
+ }
1270
+ });
1271
+ });
1272
+ }
1273
+
1274
+ // Translate all UI elements
1275
+ async function translateInterface(targetLanguage) {
1276
+ if (targetLanguage === 'en') {
1277
+ // No translation needed for English
1278
+ return;
1279
+ }
1280
+
1281
+ // Check if translations are cached
1282
+ const cachedTranslations = loadTranslationsFromCache(targetLanguage);
1283
+ if (cachedTranslations) {
1284
+ // Use cached translations
1285
+ console.log('Using cached translations for', targetLanguage);
1286
+ applyCachedTranslations(cachedTranslations);
1287
+ return;
1288
+ }
1289
+
1290
+ // Need to translate via API
1291
+ showTranslationOverlay();
1292
+
1293
+ try {
1294
+ // Get all elements with data-translate attribute
1295
+ const elements = document.querySelectorAll('[data-translate]');
1296
+ const placeholderElements = document.querySelectorAll('[data-translate-placeholder]');
1297
+
1298
+ // Collect all texts to translate
1299
+ const textsToTranslate = [];
1300
+ const placeholdersToTranslate = [];
1301
+ const elementMap = new Map();
1302
+
1303
+ elements.forEach(element => {
1304
+ const originalText = element.getAttribute('data-original-text') || element.textContent;
1305
+ if (!element.getAttribute('data-original-text')) {
1306
+ element.setAttribute('data-original-text', originalText);
1307
+ }
1308
+ textsToTranslate.push(originalText);
1309
+ elementMap.set(originalText, element);
1310
+ });
1311
+
1312
+ placeholderElements.forEach(element => {
1313
+ const originalPlaceholder = element.getAttribute('data-original-placeholder') || element.placeholder;
1314
+ if (!element.getAttribute('data-original-placeholder')) {
1315
+ element.setAttribute('data-original-placeholder', originalPlaceholder);
1316
+ }
1317
+ placeholdersToTranslate.push(originalPlaceholder);
1318
+ elementMap.set(originalPlaceholder, element);
1319
+ });
1320
+
1321
+ // Prepare cache structure
1322
+ const translationsCache = {
1323
+ texts: {},
1324
+ placeholders: {}
1325
+ };
1326
+
1327
+ // Translate texts in batches
1328
+ const batchSize = 10;
1329
+ const allTexts = [...textsToTranslate, ...placeholdersToTranslate];
1330
+
1331
+ for (let i = 0; i < allTexts.length; i += batchSize) {
1332
+ const batch = allTexts.slice(i, i + batchSize);
1333
+
1334
+ // Update progress
1335
+ updateTranslationProgress(i, allTexts.length);
1336
+
1337
+ // Translate batch
1338
+ const translations = await Promise.all(
1339
+ batch.map(text => translateText(text, targetLanguage))
1340
+ );
1341
+
1342
+ // Apply translations and cache them
1343
+ batch.forEach((originalText, index) => {
1344
+ const element = elementMap.get(originalText);
1345
+ const translation = translations[index];
1346
+
1347
+ if (element.hasAttribute('data-translate')) {
1348
+ element.textContent = translation;
1349
+ translationsCache.texts[originalText] = translation;
1350
+ } else if (element.hasAttribute('data-translate-placeholder')) {
1351
+ element.placeholder = translation;
1352
+ translationsCache.placeholders[originalText] = translation;
1353
+ }
1354
+ });
1355
+ }
1356
+
1357
+ // Save translations to cache
1358
+ saveTranslationsToCache(targetLanguage, translationsCache);
1359
+
1360
+ // Update cache status
1361
+ updateCacheStatus(targetLanguage);
1362
+ updateCacheStatusDisplay();
1363
+
1364
+ } catch (error) {
1365
+ console.error('Translation error:', error);
1366
+ showError('Translation failed: ' + error.message);
1367
+ } finally {
1368
+ hideTranslationOverlay();
1369
+ }
1370
+ }
1371
+
1372
+ // Show translation overlay
1373
+ function showTranslationOverlay() {
1374
+ document.getElementById('translationOverlay').style.display = 'flex';
1375
+ }
1376
+
1377
+ // Hide translation overlay
1378
+ function hideTranslationOverlay() {
1379
+ document.getElementById('translationOverlay').style.display = 'none';
1380
+ }
1381
+
1382
+ // Update translation progress
1383
+ function updateTranslationProgress(current, total) {
1384
+ const percentage = Math.round((current / total) * 100);
1385
+ document.getElementById('translationMessage').textContent =
1386
+ `Translating interface... ${percentage}% complete (will be cached for future use)`;
1387
+ }
1388
+
1389
+ // Apply language with API translation or cache
1390
+ async function applyLanguage(language) {
1391
+ applyDirection(language);
1392
+
1393
+ if (language !== 'en') {
1394
+ await translateInterface(language);
1395
+ }
1396
+ }
1397
+
1398
+ // Show language landing page
1399
+ function showLanguageLanding() {
1400
+ document.getElementById('languageLanding').style.display = 'block';
1401
+ document.getElementById('mainApp').style.display = 'none';
1402
+ }
1403
+
1404
+ // Show main application
1405
+ function showMainApp() {
1406
+ document.getElementById('languageLanding').style.display = 'none';
1407
+ document.getElementById('mainApp').style.display = 'block';
1408
+
1409
+ // Set API key in main app
1410
+ document.getElementById('apiKey').value = currentApiKey;
1411
+ }
1412
+
1413
+ // Start button click handler
1414
+ document.getElementById('startBtn').addEventListener('click', async function() {
1415
+ const selectedLanguage = document.getElementById('languageSelect').value;
1416
+ const apiKey = document.getElementById('apiKeyLanding').value.trim();
1417
+
1418
+ if (!apiKey) {
1419
+ alert('Please enter your OpenAI API key');
1420
+ return;
1421
+ }
1422
+
1423
+ currentLanguage = selectedLanguage;
1424
+ currentApiKey = apiKey;
1425
+
1426
+ // Save API key
1427
+ localStorage.setItem('continuous_improvement_api_key', apiKey);
1428
+
1429
+ // Apply language with translation (cached or API)
1430
+ await applyLanguage(selectedLanguage);
1431
+
1432
+ // Show main app
1433
+ showMainApp();
1434
+ });
1435
+
1436
+ // Language selector change handler
1437
+ document.getElementById('languageSelect').addEventListener('change', async function() {
1438
+ const selectedLanguage = this.value;
1439
+ updateCacheStatus(selectedLanguage);
1440
+
1441
+ if (currentApiKey) {
1442
+ await applyLanguage(selectedLanguage);
1443
+ } else {
1444
+ applyDirection(selectedLanguage);
1445
+ }
1446
+ });
1447
+
1448
+ // Clear cache button handler
1449
+ document.getElementById('clearCacheBtn').addEventListener('click', clearAllTranslationCache);
1450
+
1451
+ // Character counter
1452
+ const textInput = document.getElementById('textInput');
1453
+ const charCounter = document.getElementById('charCounter');
1454
+
1455
+ textInput.addEventListener('input', function() {
1456
+ const count = this.value.length;
1457
+ const charactersText = charCounter.querySelector('[data-translate="characters"]')?.textContent || 'characters';
1458
+ charCounter.innerHTML = `${count} <span data-translate="characters">${charactersText}</span>`;
1459
+
1460
+ if (count > 5000) {
1461
+ charCounter.style.color = 'var(--warning)';
1462
+ } else {
1463
+ charCounter.style.color = 'var(--text-secondary)';
1464
+ }
1465
+ });
1466
+
1467
+ // Error handling
1468
+ function showError(message) {
1469
+ const errorDiv = document.getElementById('errorMessage');
1470
+ errorDiv.textContent = message;
1471
+ errorDiv.style.display = 'block';
1472
+ setTimeout(() => {
1473
+ errorDiv.style.display = 'none';
1474
+ }, 5000);
1475
+ }
1476
+
1477
+ // API call function for PDCA analysis
1478
+ async function callAPI(prompt) {
1479
+ const apiKey = currentApiKey;
1480
+
1481
+ if (!apiKey) {
1482
+ throw new Error('Please enter your OpenAI API key');
1483
+ }
1484
+
1485
+ const payload = {
1486
+ model: "gpt-4o-mini",
1487
+ messages: [{ role: "user", content: prompt }],
1488
+ max_tokens: 3500,
1489
+ temperature: 0.3
1490
+ };
1491
+
1492
+ const response = await fetch("https://api.openai.com/v1/chat/completions", {
1493
+ method: "POST",
1494
+ headers: {
1495
+ "Content-Type": "application/json",
1496
+ "Authorization": `Bearer ${apiKey}`
1497
+ },
1498
+ body: JSON.stringify(payload)
1499
+ });
1500
+
1501
+ if (!response.ok) {
1502
+ const errorData = await response.json();
1503
+ throw new Error(errorData.error?.message || "API request failed");
1504
+ }
1505
+
1506
+ const data = await response.json();
1507
+ return data.choices[0].message.content;
1508
+ }
1509
+
1510
+ // Build PDCA cycle prompt
1511
+ function buildPDCAPrompt() {
1512
+ const inputText = document.getElementById('textInput').value.trim();
1513
+ const languageName = languageNames[currentLanguage] || 'English';
1514
+
1515
+ return `Based on the following process context and improvement scenario:
1516
+
1517
+ ---------------------
1518
+ ${inputText}
1519
+ ---------------------
1520
+
1521
+ Please generate a comprehensive, structured, and professionally formatted explanation of the PDCA Cycle (Plan-Do-Check-Act) that directly reflects and addresses the specific context provided above. The output should be tailored to the user's process scenario and formatted as clean HTML with inline CSS for professional presentation. Write ENTIRELY in ${languageName} language.
1522
+
1523
+ **Required Structure:**
1524
+
1525
+ 1. **Concept & Overview**
1526
+ - Provide a thorough description of the PDCA Cycle as an iterative management method
1527
+ - Explain its role in controlling and continuously improving processes and products
1528
+ - Include historical background (Deming Cycle, Shewhart Cycle) and core principles
1529
+ - Connect the explanation to the specific context provided in the input
1530
+ - Discuss how the cycle promotes systematic continuous improvement
1531
+
1532
+ 2. **Contextual Application**
1533
+ - Explain how the PDCA cycle applies to the specific process described in the input
1534
+ - Reference relevant aspects of the process context and improvement challenges
1535
+ - Provide personalized insights based on the industry or domain mentioned
1536
+ - Discuss the potential impact and benefits for the specific scenario
1537
+
1538
+ 3. **The Four PDCA Steps (Detailed Analysis)**
1539
+ Based on the process context, provide comprehensive coverage of each step:
1540
+
1541
+ **📋 Plan (Identify & Strategize)**
1542
+ - Problem identification and root cause analysis techniques
1543
+ - Objective setting using SMART criteria
1544
+ - Data collection and baseline establishment
1545
+ - Solution development and planning methodologies
1546
+ - Risk assessment and mitigation planning
1547
+ - Resource allocation and timeline development
1548
+ - Specific examples relevant to the user's context
1549
+
1550
+ **⚡ Do (Execute & Implement)**
1551
+ - Implementation strategies and change management
1552
+ - Pilot testing and small-scale implementation
1553
+ - Training and communication requirements
1554
+ - Documentation and process standardization
1555
+ - Monitoring during implementation
1556
+ - Specific execution steps for the user's scenario
1557
+
1558
+ **📊 Check (Monitor & Evaluate)**
1559
+ - Data collection and measurement techniques
1560
+ - Performance indicators and metrics selection
1561
+ - Comparison against objectives and baselines
1562
+ - Statistical analysis and trend identification
1563
+ - Gap analysis and variance investigation
1564
+ - Specific monitoring approaches for the user's context
1565
+
1566
+ **🔄 Act (Standardize & Improve)**
1567
+ - Standardization of successful improvements
1568
+ - Process documentation and knowledge transfer
1569
+ - Corrective action for unsuccessful attempts
1570
+ - Scaling successful changes across the organization
1571
+ - Preparation for the next PDCA cycle
1572
+ - Specific standardization steps for the user's scenario
1573
+
1574
+ 4. **Implementation Strategy**
1575
+ - Step-by-step process for applying PDCA to the user's specific context
1576
+ - Team formation and stakeholder engagement
1577
+ - Tools and techniques for each PDCA phase
1578
+ - Timeline and milestone planning
1579
+ - Communication and change management strategies
1580
+
1581
+ 5. **Benefits & Value Proposition**
1582
+ - Advantages of using the PDCA Cycle for continuous improvement
1583
+ - Cultural transformation and organizational learning benefits
1584
+ - Risk reduction and quality improvement outcomes
1585
+ - Cost savings and efficiency gains
1586
+ - Specific benefits for the user's context and industry
1587
+
1588
+ 6. **Challenges & Best Practices**
1589
+ - Common implementation challenges and obstacles
1590
+ - Strategies to overcome resistance to change
1591
+ - Best practices for successful PDCA implementation
1592
+ - Tips for maintaining momentum and engagement
1593
+ - Lessons learned from successful implementations
1594
+
1595
+ 7. **Advanced Considerations**
1596
+ - Integration with other improvement methodologies (Lean, Six Sigma, Kaizen)
1597
+ - Digital tools and technology enablers
1598
+ - Scaling PDCA across multiple processes or departments
1599
+ - Long-term sustainability and continuous improvement culture
1600
+ - Performance measurement and ROI tracking
1601
+
1602
+ 8. **Complementary Tools & Techniques**
1603
+ - Quality tools that enhance PDCA effectiveness
1604
+ - Data analysis and statistical methods
1605
+ - Project management and change management frameworks
1606
+ - Technology solutions and automation opportunities
1607
+ - Training and capability development programs
1608
+
1609
+ **Formatting Requirements:**
1610
+ - Use clean HTML with inline CSS for professional presentation
1611
+ - Include proper headings (h3, h4) with attractive styling
1612
+ - Use bullet points and numbered lists for clarity
1613
+ - Apply consistent color scheme (blues for process improvement themes)
1614
+ - Ensure responsive design and readability
1615
+ - Make the content scannable with clear visual hierarchy
1616
+ - Include specific examples relevant to the user's process context
1617
+
1618
+ **Tone:** Professional, educational, and directly relevant to the user's specific process context. Focus on practical, actionable guidance that can be immediately applied to their continuous improvement needs.
1619
+
1620
+ Return only the complete HTML content with inline CSS - no additional text or explanations outside the HTML.`;
1621
+ }
1622
+
1623
+ // Validation function
1624
+ function validateInputs() {
1625
+ const inputText = document.getElementById('textInput').value.trim();
1626
+
1627
+ if (!inputText) {
1628
+ document.getElementById('textInput').focus();
1629
+ throw new Error('Please enter your process context or improvement scenario');
1630
+ }
1631
+
1632
+ if (inputText.length < 50) {
1633
+ document.getElementById('textInput').focus();
1634
+ throw new Error('Please provide at least 50 characters for meaningful PDCA analysis');
1635
+ }
1636
+ }
1637
+
1638
+ // Generate PDCA cycle explanation
1639
+ document.getElementById('generatePDCABtn').addEventListener('click', async function() {
1640
+ const button = this;
1641
+ const buttonText = document.getElementById('buttonText');
1642
+ const spinner = document.getElementById('spinner');
1643
+ const outputArea = document.getElementById('apiOutput');
1644
+
1645
+ try {
1646
+ // Validate inputs
1647
+ validateInputs();
1648
+
1649
+ // Update button state
1650
+ button.disabled = true;
1651
+ spinner.style.display = 'inline-block';
1652
+ buttonText.textContent = 'Generating Guide...';
1653
+
1654
+ // Clear previous output
1655
+ outputArea.innerHTML = '';
1656
+
1657
+ // Build prompt and call API
1658
+ const prompt = buildPDCAPrompt();
1659
+ const result = await callAPI(prompt);
1660
+
1661
+ // Display result
1662
+ outputArea.innerHTML = result;
1663
+
1664
+ } catch (error) {
1665
+ showError(error.message);
1666
+ outputArea.innerHTML = '';
1667
+ } finally {
1668
+ // Reset button state
1669
+ button.disabled = false;
1670
+ spinner.style.display = 'none';
1671
+ buttonText.textContent = '🔄 Generate PDCA Guide';
1672
+ }
1673
+ });
1674
+
1675
+ // Keyboard shortcut for generation
1676
+ document.addEventListener('keydown', function(e) {
1677
+ if (e.ctrlKey && e.key === 'Enter') {
1678
+ e.preventDefault();
1679
+ document.getElementById('generatePDCABtn').click();
1680
+ }
1681
+ });
1682
+
1683
+ // API key sync between landing and main app
1684
+ document.getElementById('apiKeyLanding').addEventListener('input', function() {
1685
+ currentApiKey = this.value;
1686
+ localStorage.setItem('continuous_improvement_api_key', this.value);
1687
+ document.getElementById('apiKey').value = this.value;
1688
+ });
1689
+
1690
+ document.getElementById('apiKey').addEventListener('input', function() {
1691
+ currentApiKey = this.value;
1692
+ localStorage.setItem('continuous_improvement_api_key', this.value);
1693
+ document.getElementById('apiKeyLanding').value = this.value;
1694
+ });
1695
+
1696
+ // Initialize the application when page loads
1697
+ document.addEventListener('DOMContentLoaded', initializeApp);
1698
+ </script>
1699
+ </body>
1700
+ </html>
1701
+
📘 Guide ContinuousImprovement Pro.txt ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 📘 Guide: ContinuousImprovement Pro
2
+ 1. Overview & Purpose
3
+ ContinuousImprovement Pro enables anyone to produce detailed, context-aware PDCA guides for any process—from factory lines and hospitals to classrooms and service industries. It’s designed for both individual learning and organizational improvement.
4
+
5
+ 2. Step-by-Step Usage
6
+ A. Setup
7
+ Open the HTML file or visit the Hugging Face Space.
8
+
9
+ Choose your language from the dropdown.
10
+
11
+ Enter your OpenAI API key (required for translation and guide generation; stays only in your browser).
12
+
13
+ B. Input Your Scenario
14
+ Write a description of the process or improvement challenge (minimum 50 characters for depth).
15
+
16
+ Examples:
17
+
18
+ “Improving order accuracy in restaurant kitchen workflows.”
19
+
20
+ “Reducing patient wait times in the emergency department.”
21
+
22
+ “Streamlining university admissions paperwork.”
23
+
24
+ C. Generate Your Guide
25
+ Click “🔄 Generate PDCA Guide.”
26
+
27
+ The tool will generate a complete HTML PDCA guide:
28
+
29
+ Concept & Overview:
30
+ Explains PDCA, history, principles, relevance.
31
+
32
+ Contextual Application:
33
+ Maps the cycle directly to your input scenario.
34
+
35
+ Detailed Step Analysis:
36
+ Plan: Root causes, objectives, SMART goals, data, planning.
37
+ Do: Execution, change management, pilot, documentation.
38
+ Check: Monitoring, indicators, gap analysis.
39
+ Act: Standardization, scaling, knowledge transfer.
40
+
41
+ Implementation Strategy:
42
+ Step-by-step for your scenario—team, tools, milestones.
43
+
44
+ Benefits & Value:
45
+ What your process/organization gains.
46
+
47
+ Challenges & Best Practices:
48
+ Common pitfalls, tips, lessons learned.
49
+
50
+ Advanced Considerations:
51
+ Lean, Six Sigma, digital tools, scaling, sustainability.
52
+
53
+ Complementary Tools:
54
+ Project management, data analysis, automation.
55
+
56
+ D. Review, Use, and Share
57
+ Copy the HTML output for reports, presentations, audits, or learning management systems.
58
+
59
+ Use in class, team meetings, quality reviews, or as a personal study aid.
60
+
61
+ Change language or clear cache any time.
62
+
63
+ 3. For Educators & Trainers
64
+ Class Demo: Use in quality/process improvement lectures—show live examples.
65
+
66
+ Student Projects: Let students analyze and present improvement scenarios.
67
+
68
+ Cross-Discipline: Supports STEM, business, health, education, and social science.
69
+
70
+ Assessment: Output can be used as assessment evidence, reflection, or project deliverable.
71
+
72
+ 4. For Professionals & Continuous Improvement Teams
73
+ Team Workshops: Generate guides for actual workflow/process improvement.
74
+
75
+ Change Facilitation: Share guides with all stakeholders for transparency and buy-in.
76
+
77
+ Documentation: Use output in SOPs, training materials, or compliance reports.
78
+
79
+ Iterative Improvement: Run PDCA cycles repeatedly, updating guides each time.
80
+
81
+ 5. Best Practices
82
+ Be specific in your input for most relevant, actionable guidance.
83
+
84
+ Update guides as your process evolves—use new data for each cycle.
85
+
86
+ Encourage feedback—use the guide as a living document.
87
+
88
+ Leverage translation for global teams or diverse classrooms.
89
+
90
+ 6. Troubleshooting & Support
91
+ If output is missing, check API key validity and input length.
92
+
93
+ Translation errors? Clear cache and retry or check network.
94
+
95
+ For help: info@shiftmind.io | www.shiftmind.io
96
+
97
+ ContinuousImprovement Pro empowers you to drive real, sustainable improvement—securely, globally, and with clarity.