Hma47 commited on
Commit
1bb2a5a
·
verified ·
1 Parent(s): dbeb6c7

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,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "🐟 CauseMap Pro – Advanced Root Cause Analysis"
3
+ emoji: "🎯"
4
+ colorFrom: "purple"
5
+ colorTo: "red"
6
+ sdk: "static"
7
+ sdk_version: "0.1.0"
8
+ app_file: "index.html"
9
+ pinned: false
10
+ ---
11
+
12
+ # 🐟 CauseMap Pro – Advanced Root Cause Analysis
13
+ **Developed by Shift Mind AI Labs**
14
+
15
+ CauseMap Pro is an open-source, browser-based tool for advanced root cause analysis using the fishbone (Ishikawa) methodology. Designed for professionals, educators, and students, it enables comprehensive, multilingual analysis of problems in quality, operations, service, learning, and more—supported by AI-powered, context-aware guidance.
16
+
17
+ ---
18
+
19
+ ## 🚀 Features
20
+
21
+ - **Fishbone Diagram Analysis**: Input any problem or issue and generate a complete, structured fishbone analysis with root causes and actionable solutions.
22
+ - **Six Major Cause Categories**: Analyze People, Process, Equipment, Materials, Environment, and Measurement factors in detail.
23
+ - **Multilingual Support**: Instantly translate the full interface and outputs into 80+ languages.
24
+ - **AI-Powered Guidance**: Enter your OpenAI API key to unlock detailed, tailored analysis and professional recommendations.
25
+ - **Professional Formatting**: Output is clean HTML with inline CSS—ready for reports, presentations, and portfolios.
26
+ - **Privacy-First**: All processing and keys stay in your browser. No logins, no data collection.
27
+
28
+ ---
29
+
30
+ ## 🛠 How to Use
31
+
32
+ 1. **Open the app** in your browser (no installation or account required).
33
+ 2. **Select your language** (80+ supported, instantly translated with your API key).
34
+ 3. **Enter your OpenAI API key** (never leaves your device; needed for AI features).
35
+ 4. **Describe your problem or issue**—be as specific and detailed as possible.
36
+ 5. **Click “Generate Fishbone Analysis”** to receive a professional root cause analysis covering all fishbone diagram categories.
37
+ 6. **Review or copy the output** for reports, meetings, or improvement projects.
38
+ 7. **Clear your translation cache** at any time for privacy and updated translations.
39
+
40
+ ---
41
+
42
+ ## 👩‍🏫 For Educators: How It Supports Teaching
43
+
44
+ - **Scaffolded Root Cause Analysis**: Guides students through systematic problem-solving in science, engineering, business, or everyday contexts.
45
+ - **Multilingual Accessibility**: Use in any language classroom, bilingual environment, or international program.
46
+ - **Inquiry & PBL**: Integrate in project-based learning, inquiry cycles, or quality improvement projects.
47
+ - **Portfolio Evidence**: Output is ready for digital portfolios, assessment, or collaborative review.
48
+
49
+ ---
50
+
51
+ ## 👨‍🎓 For Students: Benefits & Outcomes
52
+
53
+ - **Real-World Critical Thinking**: Practice structured analysis of real problems from school, work, or life.
54
+ - **Collaboration**: Work in teams to build shared understanding and co-create solutions.
55
+ - **Practical Application**: Use in competitions, innovation challenges, or community projects.
56
+ - **Ownership & Reflection**: Develop agency as a problem-solver—see your impact clearly.
57
+
58
+ ---
59
+
60
+ ## 🔐 Data Privacy
61
+
62
+ - Your API key and analysis data are stored only on your device (browser local storage).
63
+ - No user data is transmitted to Shift Mind AI Labs, Hugging Face, or any third party.
64
+
65
+ ---
66
+
67
+ ## 📄 License
68
+
69
+ Licensed under the [Apache License 2.0](./LICENSE).
70
+
71
+ ---
72
+
73
+ ## 🧠 About Shift Mind AI Labs
74
+
75
+ Shift Mind AI Labs builds open-source, ethical AI tools for global education and practical innovation.
76
+
77
+ 🌐 https://www.shiftmind.io
78
+ ✉️ info@shiftmind.io
79
+
80
+ ---
81
+
82
+ ## 🙌 Contributing
83
+
84
+ Pull requests, feature suggestions, and collaborations welcome!
85
+ For school pilots, consulting, or research: **info@shiftmind.io**
86
+
87
+ ---
88
+
89
+ *Empowering every learner and professional to solve problems at the root.*
index.html ADDED
@@ -0,0 +1,1524 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>CauseMap Pro - Advanced Root Cause Analysis</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
+ <style>
8
+ :root {
9
+ --primary: #ea580c;
10
+ --secondary: #f97316;
11
+ --accent: #fb923c;
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
+ }
38
+
39
+ /* RTL Support */
40
+ [dir="rtl"] {
41
+ text-align: right;
42
+ }
43
+
44
+ [dir="rtl"] .api-key-section {
45
+ margin: 15px 15px 15px auto;
46
+ }
47
+
48
+ [dir="rtl"] .header h1,
49
+ [dir="rtl"] .header .subtitle,
50
+ [dir="rtl"] .header .description {
51
+ text-align: center;
52
+ }
53
+
54
+ [dir="rtl"] .char-counter {
55
+ text-align: left;
56
+ }
57
+
58
+ /* Landing Page Styles */
59
+ .landing-page {
60
+ max-width: 800px;
61
+ margin: 0 auto;
62
+ background: var(--surface);
63
+ border-radius: 16px;
64
+ box-shadow: var(--shadow-lg);
65
+ overflow: hidden;
66
+ text-align: center;
67
+ padding: 40px;
68
+ }
69
+
70
+ .landing-header h1 {
71
+ font-size: 3rem;
72
+ font-weight: 800;
73
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
74
+ -webkit-background-clip: text;
75
+ -webkit-text-fill-color: transparent;
76
+ background-clip: text;
77
+ margin-bottom: 12px;
78
+ }
79
+
80
+ .landing-header .subtitle {
81
+ font-size: 1.3rem;
82
+ color: var(--text-secondary);
83
+ font-weight: 500;
84
+ margin-bottom: 30px;
85
+ }
86
+
87
+ .language-selection {
88
+ background: rgba(234, 88, 12, 0.05);
89
+ border: 1px solid rgba(234, 88, 12, 0.1);
90
+ border-radius: 12px;
91
+ padding: 30px;
92
+ margin-bottom: 30px;
93
+ }
94
+
95
+ .language-selection h3 {
96
+ color: var(--primary);
97
+ font-size: 1.4rem;
98
+ font-weight: 700;
99
+ margin-bottom: 20px;
100
+ }
101
+
102
+ .language-dropdown {
103
+ width: 100%;
104
+ max-width: 400px;
105
+ padding: 15px 20px;
106
+ border: 2px solid var(--border);
107
+ border-radius: 8px;
108
+ font-size: 1.1rem;
109
+ background: var(--surface);
110
+ margin: 0 auto 20px;
111
+ display: block;
112
+ }
113
+
114
+ .api-key-input {
115
+ background: rgba(234, 88, 12, 0.05);
116
+ border: 1px solid rgba(234, 88, 12, 0.1);
117
+ border-radius: 12px;
118
+ padding: 30px;
119
+ margin-bottom: 30px;
120
+ }
121
+
122
+ .api-key-input h3 {
123
+ color: var(--primary);
124
+ font-size: 1.4rem;
125
+ font-weight: 700;
126
+ margin-bottom: 20px;
127
+ }
128
+
129
+ .api-input-field {
130
+ width: 100%;
131
+ max-width: 400px;
132
+ padding: 15px 20px;
133
+ border: 2px solid var(--border);
134
+ border-radius: 8px;
135
+ font-size: 1.1rem;
136
+ background: var(--surface);
137
+ margin: 0 auto;
138
+ display: block;
139
+ font-family: 'Courier New', monospace;
140
+ }
141
+
142
+ .start-button {
143
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
144
+ color: white;
145
+ padding: 18px 40px;
146
+ border: none;
147
+ border-radius: 12px;
148
+ font-size: 1.3rem;
149
+ font-weight: 700;
150
+ cursor: pointer;
151
+ transition: all 0.3s ease;
152
+ min-width: 200px;
153
+ }
154
+
155
+ .start-button:hover {
156
+ transform: translateY(-2px);
157
+ box-shadow: 0 12px 24px -8px rgba(234, 88, 12, 0.4);
158
+ }
159
+
160
+ .start-button:disabled {
161
+ opacity: 0.7;
162
+ cursor: not-allowed;
163
+ transform: none;
164
+ }
165
+
166
+ /* Clear Cache Button */
167
+ .clear-cache-button {
168
+ background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
169
+ color: white;
170
+ padding: 12px 24px;
171
+ border: none;
172
+ border-radius: 8px;
173
+ font-size: 1rem;
174
+ font-weight: 600;
175
+ cursor: pointer;
176
+ transition: all 0.3s ease;
177
+ margin-top: 20px;
178
+ min-width: 180px;
179
+ }
180
+
181
+ .clear-cache-button:hover {
182
+ transform: translateY(-1px);
183
+ box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.4);
184
+ }
185
+
186
+ .clear-cache-button:active {
187
+ transform: translateY(0);
188
+ }
189
+
190
+ .cache-info {
191
+ background: rgba(16, 185, 129, 0.1);
192
+ border: 1px solid rgba(16, 185, 129, 0.2);
193
+ border-radius: 8px;
194
+ padding: 15px;
195
+ margin-top: 20px;
196
+ font-size: 0.9rem;
197
+ color: var(--success);
198
+ }
199
+
200
+ .cache-info.no-cache {
201
+ background: rgba(156, 163, 175, 0.1);
202
+ border: 1px solid rgba(156, 163, 175, 0.2);
203
+ color: var(--text-secondary);
204
+ }
205
+
206
+ /* Translation Loading Overlay */
207
+ .translation-overlay {
208
+ position: fixed;
209
+ top: 0;
210
+ left: 0;
211
+ width: 100%;
212
+ height: 100%;
213
+ background: rgba(0, 0, 0, 0.8);
214
+ display: none;
215
+ justify-content: center;
216
+ align-items: center;
217
+ z-index: 10000;
218
+ color: white;
219
+ text-align: center;
220
+ }
221
+
222
+ .translation-content {
223
+ background: var(--surface);
224
+ color: var(--text);
225
+ padding: 40px;
226
+ border-radius: 16px;
227
+ max-width: 400px;
228
+ width: 90%;
229
+ }
230
+
231
+ .translation-spinner {
232
+ width: 40px;
233
+ height: 40px;
234
+ border: 4px solid var(--border);
235
+ border-radius: 50%;
236
+ border-top-color: var(--primary);
237
+ animation: spin 1s ease-in-out infinite;
238
+ margin: 0 auto 20px;
239
+ }
240
+
241
+ .translation-progress {
242
+ background: var(--border);
243
+ border-radius: 10px;
244
+ height: 8px;
245
+ margin: 20px 0;
246
+ overflow: hidden;
247
+ }
248
+
249
+ .translation-progress-bar {
250
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
251
+ height: 100%;
252
+ width: 0%;
253
+ transition: width 0.3s ease;
254
+ }
255
+
256
+ /* Main App Styles */
257
+ .main-app {
258
+ display: none;
259
+ }
260
+
261
+ .container {
262
+ max-width: 1000px;
263
+ margin: 0 auto;
264
+ background: var(--surface);
265
+ border-radius: 16px;
266
+ box-shadow: var(--shadow-lg);
267
+ overflow: hidden;
268
+ position: relative;
269
+ }
270
+
271
+ /* Language Switcher */
272
+ .language-switcher {
273
+ position: absolute;
274
+ top: 15px;
275
+ right: 15px;
276
+ z-index: 100;
277
+ display: flex;
278
+ gap: 10px;
279
+ align-items: center;
280
+ }
281
+
282
+ .language-switcher select {
283
+ padding: 8px 12px;
284
+ border: 1px solid var(--border);
285
+ border-radius: 6px;
286
+ background: var(--surface);
287
+ font-size: 0.9rem;
288
+ }
289
+
290
+ .clear-cache-mini {
291
+ background: var(--warning);
292
+ color: white;
293
+ border: none;
294
+ padding: 6px 12px;
295
+ border-radius: 4px;
296
+ font-size: 0.8rem;
297
+ cursor: pointer;
298
+ transition: all 0.2s ease;
299
+ }
300
+
301
+ .clear-cache-mini:hover {
302
+ background: #d97706;
303
+ }
304
+
305
+ /* API Key Section - Static Position Top Left */
306
+ .api-key-section {
307
+ background: rgba(234, 88, 12, 0.05);
308
+ border: 1px solid rgba(234, 88, 12, 0.1);
309
+ border-radius: 8px;
310
+ padding: 12px;
311
+ margin: 15px;
312
+ max-width: 280px;
313
+ }
314
+
315
+ .api-key-section label {
316
+ font-size: 12px;
317
+ font-weight: 600;
318
+ color: var(--primary);
319
+ margin-bottom: 6px;
320
+ display: block;
321
+ }
322
+
323
+ .api-key-section input {
324
+ width: 100%;
325
+ padding: 8px 12px;
326
+ border: 1px solid var(--border);
327
+ border-radius: 6px;
328
+ font-size: 14px;
329
+ background: var(--surface);
330
+ transition: all 0.2s ease;
331
+ font-family: 'Courier New', monospace;
332
+ }
333
+
334
+ .api-key-section input:focus {
335
+ outline: none;
336
+ border-color: var(--primary);
337
+ box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
338
+ }
339
+
340
+ /* Main Content */
341
+ .main-content {
342
+ padding: 20px 30px 30px;
343
+ }
344
+
345
+ /* Header */
346
+ .header {
347
+ text-align: center;
348
+ margin-bottom: 25px;
349
+ padding-bottom: 20px;
350
+ border-bottom: 2px solid var(--border);
351
+ }
352
+
353
+ .header h1 {
354
+ font-size: 2.5rem;
355
+ font-weight: 800;
356
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
357
+ -webkit-background-clip: text;
358
+ -webkit-text-fill-color: transparent;
359
+ background-clip: text;
360
+ margin-bottom: 8px;
361
+ }
362
+
363
+ .header .subtitle {
364
+ font-size: 1.1rem;
365
+ color: var(--text-secondary);
366
+ font-weight: 500;
367
+ }
368
+
369
+ .header .description {
370
+ font-size: 1rem;
371
+ color: var(--text-secondary);
372
+ margin-top: 12px;
373
+ max-width: 600px;
374
+ margin-left: auto;
375
+ margin-right: auto;
376
+ }
377
+
378
+ /* Fishbone Components */
379
+ .fishbone-components {
380
+ display: grid;
381
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
382
+ gap: 15px;
383
+ margin-bottom: 25px;
384
+ }
385
+
386
+ .component-card {
387
+ background: rgba(234, 88, 12, 0.05);
388
+ border: 1px solid rgba(234, 88, 12, 0.1);
389
+ border-radius: 8px;
390
+ padding: 15px;
391
+ text-align: center;
392
+ }
393
+
394
+ .component-card h4 {
395
+ color: var(--primary);
396
+ font-size: 0.9rem;
397
+ font-weight: 600;
398
+ margin-bottom: 6px;
399
+ }
400
+
401
+ .component-card p {
402
+ font-size: 0.8rem;
403
+ color: var(--text-secondary);
404
+ }
405
+
406
+ /* Input Section */
407
+ .input-section {
408
+ background: var(--surface);
409
+ border: 1px solid var(--border);
410
+ border-radius: 12px;
411
+ padding: 20px;
412
+ margin-bottom: 25px;
413
+ transition: all 0.3s ease;
414
+ box-shadow: var(--shadow);
415
+ }
416
+
417
+ .input-section:hover {
418
+ border-color: var(--primary);
419
+ box-shadow: 0 8px 25px -8px rgba(234, 88, 12, 0.3);
420
+ }
421
+
422
+ .input-section h3 {
423
+ font-size: 1.1rem;
424
+ font-weight: 700;
425
+ color: var(--primary);
426
+ margin-bottom: 8px;
427
+ display: flex;
428
+ align-items: center;
429
+ gap: 8px;
430
+ }
431
+
432
+ .input-section .description {
433
+ font-size: 0.9rem;
434
+ color: var(--text-secondary);
435
+ margin-bottom: 12px;
436
+ }
437
+
438
+ /* Form Elements */
439
+ label {
440
+ display: block;
441
+ margin-bottom: 6px;
442
+ font-weight: 600;
443
+ color: var(--text);
444
+ font-size: 0.95rem;
445
+ }
446
+
447
+ textarea {
448
+ width: 100%;
449
+ padding: 12px 16px;
450
+ border: 2px solid var(--border);
451
+ border-radius: 8px;
452
+ font-size: 1rem;
453
+ font-family: inherit;
454
+ background: var(--surface);
455
+ transition: all 0.2s ease;
456
+ resize: vertical;
457
+ min-height: 150px;
458
+ }
459
+
460
+ textarea:focus {
461
+ outline: none;
462
+ border-color: var(--primary);
463
+ box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
464
+ }
465
+
466
+ /* Character Counter */
467
+ .char-counter {
468
+ font-size: 0.8rem;
469
+ color: var(--text-secondary);
470
+ text-align: right;
471
+ margin-top: 4px;
472
+ }
473
+
474
+ /* Generate Button */
475
+ .generate-btn {
476
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
477
+ color: white;
478
+ padding: 16px 32px;
479
+ border: none;
480
+ border-radius: 12px;
481
+ font-size: 1.1rem;
482
+ font-weight: 700;
483
+ cursor: pointer;
484
+ transition: all 0.3s ease;
485
+ display: block;
486
+ margin: 25px auto;
487
+ min-width: 280px;
488
+ position: relative;
489
+ overflow: hidden;
490
+ }
491
+
492
+ .generate-btn:hover {
493
+ transform: translateY(-2px);
494
+ box-shadow: 0 12px 24px -8px rgba(234, 88, 12, 0.4);
495
+ }
496
+
497
+ .generate-btn:active {
498
+ transform: translateY(0);
499
+ }
500
+
501
+ .generate-btn:disabled {
502
+ opacity: 0.7;
503
+ cursor: not-allowed;
504
+ transform: none;
505
+ }
506
+
507
+ /* Loading Spinner */
508
+ .spinner {
509
+ display: none;
510
+ width: 20px;
511
+ height: 20px;
512
+ border: 2px solid rgba(255, 255, 255, 0.3);
513
+ border-radius: 50%;
514
+ border-top-color: white;
515
+ animation: spin 1s ease-in-out infinite;
516
+ margin-right: 8px;
517
+ }
518
+
519
+ @keyframes spin {
520
+ to { transform: rotate(360deg); }
521
+ }
522
+
523
+ /* Output Section */
524
+ .output-section {
525
+ margin-top: 30px;
526
+ }
527
+
528
+ .output-section h2 {
529
+ font-size: 1.5rem;
530
+ font-weight: 700;
531
+ color: var(--primary);
532
+ margin-bottom: 15px;
533
+ display: flex;
534
+ align-items: center;
535
+ gap: 8px;
536
+ }
537
+
538
+ .output-area {
539
+ background: var(--surface);
540
+ border: 2px solid var(--border);
541
+ border-radius: 12px;
542
+ padding: 20px;
543
+ min-height: 300px;
544
+ transition: all 0.3s ease;
545
+ position: relative;
546
+ overflow-x: auto;
547
+ }
548
+
549
+ .output-area:empty::before {
550
+ content: attr(data-placeholder);
551
+ color: var(--text-secondary);
552
+ font-style: italic;
553
+ }
554
+
555
+ /* Enhanced output styling */
556
+ .output-area h3 {
557
+ color: var(--primary);
558
+ border-bottom: 2px solid var(--primary);
559
+ padding-bottom: 8px;
560
+ margin: 20px 0 15px 0;
561
+ font-size: 1.2rem;
562
+ }
563
+
564
+ .output-area h4 {
565
+ color: var(--secondary);
566
+ margin: 15px 0 10px 0;
567
+ font-size: 1.1rem;
568
+ }
569
+
570
+ .output-area ul {
571
+ margin: 10px 0 15px 20px;
572
+ line-height: 1.7;
573
+ }
574
+
575
+ .output-area li {
576
+ margin-bottom: 5px;
577
+ }
578
+
579
+ .output-area p {
580
+ margin: 12px 0;
581
+ line-height: 1.7;
582
+ }
583
+
584
+ .output-area strong {
585
+ color: var(--primary);
586
+ }
587
+
588
+ /* Error Messages */
589
+ .error-message {
590
+ background: rgba(239, 68, 68, 0.1);
591
+ border: 1px solid rgba(239, 68, 68, 0.2);
592
+ color: var(--error);
593
+ padding: 12px 16px;
594
+ border-radius: 8px;
595
+ margin: 10px 0;
596
+ font-size: 0.9rem;
597
+ display: none;
598
+ }
599
+
600
+ /* Footer */
601
+ .footer {
602
+ text-align: center;
603
+ padding: 20px;
604
+ background: rgba(234, 88, 12, 0.05);
605
+ border-top: 1px solid var(--border);
606
+ color: var(--text-secondary);
607
+ font-size: 0.9rem;
608
+ }
609
+
610
+ /* Responsive Design */
611
+ @media (max-width: 768px) {
612
+ body {
613
+ padding: 10px;
614
+ }
615
+
616
+ .landing-page {
617
+ padding: 30px 20px;
618
+ }
619
+
620
+ .landing-header h1 {
621
+ font-size: 2.5rem;
622
+ }
623
+
624
+ .api-key-section {
625
+ margin: 10px;
626
+ max-width: none;
627
+ }
628
+
629
+ .main-content {
630
+ padding: 15px 20px 20px;
631
+ }
632
+
633
+ .header h1 {
634
+ font-size: 2rem;
635
+ }
636
+
637
+ .input-section {
638
+ padding: 15px;
639
+ }
640
+
641
+ .fishbone-components {
642
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
643
+ }
644
+
645
+ .generate-btn {
646
+ width: 100%;
647
+ margin: 20px 0;
648
+ }
649
+
650
+ .output-area {
651
+ padding: 15px;
652
+ }
653
+
654
+ .language-switcher {
655
+ position: static;
656
+ text-align: center;
657
+ margin-bottom: 20px;
658
+ flex-direction: column;
659
+ gap: 10px;
660
+ }
661
+ }
662
+
663
+ @media (max-width: 480px) {
664
+ .landing-header h1 {
665
+ font-size: 2rem;
666
+ }
667
+
668
+ .header h1 {
669
+ font-size: 1.8rem;
670
+ }
671
+
672
+ .input-section {
673
+ padding: 12px;
674
+ }
675
+
676
+ .fishbone-components {
677
+ grid-template-columns: 1fr 1fr;
678
+ }
679
+ }
680
+
681
+ /* Dark mode support */
682
+ @media (prefers-color-scheme: dark) {
683
+ :root {
684
+ --background: #0f172a;
685
+ --surface: #1e293b;
686
+ --text: #f1f5f9;
687
+ --text-secondary: #94a3b8;
688
+ --border: #334155;
689
+ }
690
+
691
+ body {
692
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
693
+ }
694
+ }
695
+ </style>
696
+ </head>
697
+ <body>
698
+ <!-- Translation Loading Overlay -->
699
+ <div class="translation-overlay" id="translationOverlay">
700
+ <div class="translation-content">
701
+ <div class="translation-spinner"></div>
702
+ <h3 id="translationTitle">Translating Interface...</h3>
703
+ <p id="translationStatus">💾 Translations cached - instant loading!</p>
704
+ <div class="translation-progress">
705
+ <div class="translation-progress-bar" id="translationProgressBar"></div>
706
+ </div>
707
+ <p id="translationProgress">0%</p>
708
+ </div>
709
+ </div>
710
+
711
+ <!-- Landing Page -->
712
+ <div class="landing-page" id="landingPage">
713
+ <div class="landing-header">
714
+ <h1>CauseMap Pro</h1>
715
+ <p class="subtitle">Advanced Root Cause Analysis & Problem Solving</p>
716
+ </div>
717
+
718
+ <div class="language-selection">
719
+ <h3>🌐 Select Your Language</h3>
720
+ <select class="language-dropdown" id="languageSelect">
721
+ <option value="en">🇺🇸 English</option>
722
+ <option value="es">🇪🇸 Español (Spanish)</option>
723
+ <option value="fr">🇫🇷 Français (French)</option>
724
+ <option value="de">🇩🇪 Deutsch (German)</option>
725
+ <option value="it">🇮🇹 Italiano (Italian)</option>
726
+ <option value="pt">🇵🇹 Português (Portuguese)</option>
727
+ <option value="ru">🇷🇺 Русский (Russian)</option>
728
+ <option value="ja">🇯🇵 日本語 (Japanese)</option>
729
+ <option value="ko">🇰🇷 한국어 (Korean)</option>
730
+ <option value="zh">🇨🇳 中文 (Chinese)</option>
731
+ <option value="ar">🇸🇦 العربية (Arabic)</option>
732
+ <option value="hi">🇮🇳 हिन्दी (Hindi)</option>
733
+ <option value="bn">🇧🇩 বাংলা (Bengali)</option>
734
+ <option value="ur">🇵🇰 اردو (Urdu)</option>
735
+ <option value="tr">🇹🇷 Türkçe (Turkish)</option>
736
+ <option value="pl">🇵🇱 Polski (Polish)</option>
737
+ <option value="nl">🇳🇱 Nederlands (Dutch)</option>
738
+ <option value="sv">🇸🇪 Svenska (Swedish)</option>
739
+ <option value="da">🇩🇰 Dansk (Danish)</option>
740
+ <option value="no">🇳🇴 Norsk (Norwegian)</option>
741
+ <option value="fi">🇫🇮 Suomi (Finnish)</option>
742
+ <option value="cs">🇨🇿 Čeština (Czech)</option>
743
+ <option value="hu">🇭🇺 Magyar (Hungarian)</option>
744
+ <option value="ro">🇷🇴 Română (Romanian)</option>
745
+ <option value="bg">🇧🇬 Български (Bulgarian)</option>
746
+ <option value="hr">🇭🇷 Hrvatski (Croatian)</option>
747
+ <option value="sr">🇷🇸 Српски (Serbian)</option>
748
+ <option value="sk">🇸🇰 Slovenčina (Slovak)</option>
749
+ <option value="sl">🇸🇮 Slovenščina (Slovenian)</option>
750
+ <option value="et">🇪🇪 Eesti (Estonian)</option>
751
+ <option value="lv">🇱🇻 Latviešu (Latvian)</option>
752
+ <option value="lt">🇱🇹 Lietuvių (Lithuanian)</option>
753
+ <option value="el">🇬🇷 Ελληνικά (Greek)</option>
754
+ <option value="he">🇮🇱 עברית (Hebrew)</option>
755
+ <option value="th">🇹🇭 ไทย (Thai)</option>
756
+ <option value="vi">🇻🇳 Tiếng Việt (Vietnamese)</option>
757
+ <option value="km">🇰🇭 ខ្មែរ (Khmer)</option>
758
+ <option value="my">🇲🇲 မြန်မာ (Myanmar)</option>
759
+ <option value="ta">🇮🇳 தமிழ் (Tamil)</option>
760
+ <option value="te">🇮🇳 తెలుగు (Telugu)</option>
761
+ <option value="kn">🇮🇳 ಕನ್ನಡ (Kannada)</option>
762
+ <option value="ml">🇮🇳 മലയാളം (Malayalam)</option>
763
+ <option value="gu">🇮🇳 ગુજરાતી (Gujarati)</option>
764
+ <option value="pa">🇮🇳 ਪੰਜਾਬੀ (Punjabi)</option>
765
+ <option value="ne">🇳🇵 नेपाली (Nepali)</option>
766
+ <option value="si">🇱🇰 සිංහල (Sinhala)</option>
767
+ <option value="id">🇮🇩 Bahasa Indonesia</option>
768
+ <option value="ms">🇲🇾 Bahasa Melayu (Malay)</option>
769
+ <option value="tl">🇵🇭 Filipino</option>
770
+ <option value="sw">🇰🇪 Kiswahili (Swahili)</option>
771
+ <option value="zu">🇿🇦 isiZulu (Zulu)</option>
772
+ <option value="xh">🇿🇦 isiXhosa (Xhosa)</option>
773
+ <option value="af">🇿🇦 Afrikaans</option>
774
+ <option value="am">🇪🇹 አማርኛ (Amharic)</option>
775
+ <option value="ha">🇳🇬 Hausa</option>
776
+ <option value="yo">🇳🇬 Yorùbá (Yoruba)</option>
777
+ <option value="ig">🇳🇬 Igbo</option>
778
+ <option value="so">🇸🇴 Soomaali (Somali)</option>
779
+ <option value="rw">🇷🇼 Kinyarwanda</option>
780
+ <option value="ny">🇲🇼 Chichewa</option>
781
+ <option value="mg">🇲🇬 Malagasy</option>
782
+ <option value="sn">🇿🇼 Shona</option>
783
+ <option value="st">🇱🇸 Sesotho</option>
784
+ <option value="tn">🇧🇼 Setswana</option>
785
+ <option value="ts">🇿🇦 Xitsonga</option>
786
+ <option value="ve">🇿🇦 Tshivenda</option>
787
+ <option value="ss">🇸🇿 SiSwati</option>
788
+ <option value="nr">🇿🇦 isiNdebele</option>
789
+ <option value="fa">🇮🇷 فارسی (Persian)</option>
790
+ <option value="ps">🇦🇫 پښتو (Pashto)</option>
791
+ <option value="ku">🇮🇶 کوردی (Kurdish)</option>
792
+ <option value="sd">🇵🇰 سنڌي (Sindhi)</option>
793
+ <option value="ug">🇨🇳 ئۇيغۇرچە (Uyghur)</option>
794
+ <option value="kk">🇰🇿 Қазақша (Kazakh)</option>
795
+ <option value="ky">🇰🇬 Кыргызча (Kyrgyz)</option>
796
+ <option value="uz">🇺🇿 O'zbekcha (Uzbek)</option>
797
+ <option value="tg">🇹🇯 Тоҷикӣ (Tajik)</option>
798
+ <option value="tk">🇹🇲 Türkmençe (Turkmen)</option>
799
+ <option value="mn">🇲🇳 Монгол (Mongolian)</option>
800
+ <option value="bo">🇨🇳 བོད་ཡིག (Tibetan)</option>
801
+ <option value="dz">🇧🇹 རྫོང་ཁ (Dzongkha)</option>
802
+ <option value="lo">🇱🇦 ລາວ (Lao)</option>
803
+ <option value="ka">🇬🇪 ქართული (Georgian)</option>
804
+ <option value="hy">🇦🇲 Հայերեն (Armenian)</option>
805
+ <option value="az">🇦🇿 Azərbaycan (Azerbaijani)</option>
806
+ <option value="be">🇧🇾 Беларуская (Belarusian)</option>
807
+ <option value="uk">🇺🇦 Українська (Ukrainian)</option>
808
+ <option value="mk">🇲🇰 Македонски (Macedonian)</option>
809
+ <option value="sq">🇦🇱 Shqip (Albanian)</option>
810
+ <option value="mt">🇲🇹 Malti (Maltese)</option>
811
+ <option value="is">🇮🇸 Íslenska (Icelandic)</option>
812
+ <option value="fo">🇫🇴 Føroyskt (Faroese)</option>
813
+ <option value="ga">🇮🇪 Gaeilge (Irish)</option>
814
+ <option value="gd">🏴󠁧󠁢󠁳󠁣󠁴󠁿 Gàidhlig (Scottish Gaelic)</option>
815
+ <option value="cy">🏴󠁧󠁢󠁷󠁬󠁳󠁿 Cymraeg (Welsh)</option>
816
+ <option value="br">🇫🇷 Brezhoneg (Breton)</option>
817
+ <option value="eu">🇪🇸 Euskera (Basque)</option>
818
+ <option value="ca">🇪🇸 Català (Catalan)</option>
819
+ <option value="gl">🇪🇸 Galego (Galician)</option>
820
+ <option value="oc">🇫🇷 Occitan</option>
821
+ <option value="co">🇫🇷 Corsu (Corsican)</option>
822
+ <option value="sc">🇮🇹 Sardu (Sardinian)</option>
823
+ <option value="rm">🇨🇭 Rumantsch (Romansh)</option>
824
+ <option value="lb">🇱🇺 Lëtzebuergesch (Luxembourgish)</option>
825
+ <option value="fy">🇳🇱 Frysk (Frisian)</option>
826
+ </select>
827
+ </div>
828
+
829
+ <div class="api-key-input">
830
+ <h3>🔑 Enter Your OpenAI API Key</h3>
831
+ <input type="password" class="api-input-field" id="landingApiKey" placeholder="sk-..." autocomplete="off">
832
+ </div>
833
+
834
+ <button class="start-button" id="startButton" onclick="startApp()">
835
+ 🚀 Start CauseMap Pro
836
+ </button>
837
+
838
+ <!-- Cache Management Section -->
839
+ <div class="cache-info" id="cacheInfo">
840
+ <div id="cacheStatus">💾 No cached translations found</div>
841
+ <button class="clear-cache-button" id="clearCacheButton" onclick="clearAllTranslationCache()">
842
+ 🗑️ Clear Translation Cache
843
+ </button>
844
+ </div>
845
+ </div>
846
+
847
+ <!-- Main Application -->
848
+ <div class="main-app" id="mainApp">
849
+ <div class="container">
850
+ <!-- Language Switcher -->
851
+ <div class="language-switcher">
852
+ <select id="languageSwitcher" onchange="switchLanguage()">
853
+ <option value="en">🇺🇸 English</option>
854
+ </select>
855
+ <button class="clear-cache-mini" onclick="clearAllTranslationCache()" title="Clear Translation Cache">
856
+ 🗑️ Clear Cache
857
+ </button>
858
+ </div>
859
+
860
+ <!-- API Key Section - Static Position Top Left -->
861
+ <div class="api-key-section">
862
+ <label for="apiKey" data-translate="api-key-label">🔑 API Key</label>
863
+ <input type="password" id="apiKey" data-translate="api-key-placeholder" placeholder="Enter your OpenAI API key" autocomplete="off">
864
+ </div>
865
+
866
+ <div class="main-content">
867
+ <!-- Header -->
868
+ <div class="header">
869
+ <h1 data-translate="main-title">CauseMap Pro</h1>
870
+ <p class="subtitle" data-translate="main-subtitle">Advanced Root Cause Analysis & Problem Solving</p>
871
+ <p class="description" data-translate="main-description">Generate comprehensive fishbone diagram explanations tailored to your specific problems and analysis needs</p>
872
+ </div>
873
+
874
+ <!-- Fishbone Components Overview -->
875
+ <div class="fishbone-components">
876
+ <div class="component-card">
877
+ <h4 data-translate="component-1-title">🎯 Problem Statement</h4>
878
+ <p data-translate="component-1-desc">Main Effect/Issue</p>
879
+ </div>
880
+ <div class="component-card">
881
+ <h4 data-translate="component-2-title">👥 People</h4>
882
+ <p data-translate="component-2-desc">Human Factors</p>
883
+ </div>
884
+ <div class="component-card">
885
+ <h4 data-translate="component-3-title">⚙️ Process</h4>
886
+ <p data-translate="component-3-desc">Workflow & Procedures</p>
887
+ </div>
888
+ <div class="component-card">
889
+ <h4 data-translate="component-4-title">🛠️ Equipment</h4>
890
+ <p data-translate="component-4-desc">Tools & Technology</p>
891
+ </div>
892
+ <div class="component-card">
893
+ <h4 data-translate="component-5-title">📦 Materials</h4>
894
+ <p data-translate="component-5-desc">Resources & Inputs</p>
895
+ </div>
896
+ <div class="component-card">
897
+ <h4 data-translate="component-6-title">🌍 Environment</h4>
898
+ <p data-translate="component-6-desc">External Conditions</p>
899
+ </div>
900
+ </div>
901
+
902
+ <!-- Input Section -->
903
+ <div class="input-section">
904
+ <h3 data-translate="input-title">📝 Problem & Context Input</h3>
905
+ <p class="description" data-translate="input-description">Describe your problem, issue, or situation that needs root cause analysis using the fishbone diagram methodology</p>
906
+ <textarea id="textInput" data-translate="input-placeholder" placeholder="Enter your problem description, situation analysis, quality issue, process breakdown, or any challenge that requires systematic root cause investigation. For example: describe production defects, service failures, performance issues, or operational problems..." required></textarea>
907
+ <div class="char-counter" id="charCounter" data-translate="char-counter">0 characters</div>
908
+ </div>
909
+
910
+ <!-- Error Message -->
911
+ <div class="error-message" id="errorMessage"></div>
912
+
913
+ <!-- Generate Button -->
914
+ <button class="generate-btn" id="generateDiagramBtn">
915
+ <span class="spinner" id="spinner"></span>
916
+ <span id="buttonText" data-translate="generate-button">🐟 Generate Fishbone Analysis</span>
917
+ </button>
918
+
919
+ <!-- Output Section -->
920
+ <div class="output-section">
921
+ <h2 data-translate="output-title">📊 Your Fishbone Diagram Analysis</h2>
922
+ <div class="output-area" id="apiOutput" data-translate="output-placeholder" data-placeholder="Your comprehensive fishbone diagram analysis will appear here..."></div>
923
+ </div>
924
+ </div>
925
+
926
+ <!-- Footer -->
927
+ <div class="footer">
928
+ Created by Shift Mind AI Labs
929
+ </div>
930
+ </div>
931
+ </div>
932
+
933
+ <script>
934
+ // Global variables
935
+ let currentLanguage = 'en';
936
+ let translationCache = {};
937
+ let isTranslating = false;
938
+
939
+ // RTL languages
940
+ const rtlLanguages = ['ar', 'he', 'fa', 'ur', 'ps', 'ku', 'sd', 'ug'];
941
+
942
+ // Language names for AI prompts
943
+ const languageNames = {
944
+ 'en': 'English', 'es': 'Spanish', 'fr': 'French', 'de': 'German', 'it': 'Italian',
945
+ 'pt': 'Portuguese', 'ru': 'Russian', 'ja': 'Japanese', 'ko': 'Korean', 'zh': 'Chinese',
946
+ 'ar': 'Arabic', 'hi': 'Hindi', 'bn': 'Bengali', 'ur': 'Urdu', 'tr': 'Turkish',
947
+ 'pl': 'Polish', 'nl': 'Dutch', 'sv': 'Swedish', 'da': 'Danish', 'no': 'Norwegian',
948
+ 'fi': 'Finnish', 'cs': 'Czech', 'hu': 'Hungarian', 'ro': 'Romanian', 'bg': 'Bulgarian',
949
+ 'hr': 'Croatian', 'sr': 'Serbian', 'sk': 'Slovak', 'sl': 'Slovenian', 'et': 'Estonian',
950
+ 'lv': 'Latvian', 'lt': 'Lithuanian', 'el': 'Greek', 'he': 'Hebrew', 'th': 'Thai',
951
+ 'vi': 'Vietnamese', 'km': 'Khmer', 'my': 'Myanmar', 'ta': 'Tamil', 'te': 'Telugu',
952
+ 'kn': 'Kannada', 'ml': 'Malayalam', 'gu': 'Gujarati', 'pa': 'Punjabi', 'ne': 'Nepali',
953
+ 'si': 'Sinhala', 'id': 'Indonesian', 'ms': 'Malay', 'tl': 'Filipino', 'sw': 'Swahili',
954
+ 'zu': 'Zulu', 'xh': 'Xhosa', 'af': 'Afrikaans', 'am': 'Amharic', 'ha': 'Hausa',
955
+ 'yo': 'Yoruba', 'ig': 'Igbo', 'so': 'Somali', 'rw': 'Kinyarwanda', 'ny': 'Chichewa',
956
+ 'mg': 'Malagasy', 'sn': 'Shona', 'st': 'Sesotho', 'tn': 'Setswana', 'ts': 'Xitsonga',
957
+ 've': 'Tshivenda', 'ss': 'SiSwati', 'nr': 'isiNdebele', 'fa': 'Persian', 'ps': 'Pashto',
958
+ 'ku': 'Kurdish', 'sd': 'Sindhi', 'ug': 'Uyghur', 'kk': 'Kazakh', 'ky': 'Kyrgyz',
959
+ 'uz': 'Uzbek', 'tg': 'Tajik', 'tk': 'Turkmen', 'mn': 'Mongolian', 'bo': 'Tibetan',
960
+ 'dz': 'Dzongkha', 'lo': 'Lao', 'ka': 'Georgian', 'hy': 'Armenian', 'az': 'Azerbaijani',
961
+ 'be': 'Belarusian', 'uk': 'Ukrainian', 'mk': 'Macedonian', 'sq': 'Albanian', 'mt': 'Maltese',
962
+ 'is': 'Icelandic', 'fo': 'Faroese', 'ga': 'Irish', 'gd': 'Scottish Gaelic', 'cy': 'Welsh',
963
+ 'br': 'Breton', 'eu': 'Basque', 'ca': 'Catalan', 'gl': 'Galician', 'oc': 'Occitan',
964
+ 'co': 'Corsican', 'sc': 'Sardinian', 'rm': 'Romansh', 'lb': 'Luxembourgish', 'fy': 'Frisian'
965
+ };
966
+
967
+ // Initialize app
968
+ function initializeApp() {
969
+ // Load saved preferences
970
+ const savedLanguage = localStorage.getItem('causemap_language') || 'en';
971
+ const savedApiKey = localStorage.getItem('causemap_api_key') || '';
972
+
973
+ document.getElementById('languageSelect').value = savedLanguage;
974
+ document.getElementById('landingApiKey').value = savedApiKey;
975
+
976
+ currentLanguage = savedLanguage;
977
+
978
+ // Load translation cache
979
+ const cached = localStorage.getItem('causemap_translations');
980
+ if (cached) {
981
+ translationCache = JSON.parse(cached);
982
+ }
983
+
984
+ // Update cache status
985
+ updateCacheStatus();
986
+ }
987
+
988
+ // Update cache status display
989
+ function updateCacheStatus() {
990
+ const cacheInfo = document.getElementById('cacheInfo');
991
+ const cacheStatus = document.getElementById('cacheStatus');
992
+ const cachedLanguages = Object.keys(translationCache).map(key => key.replace('causemap_', ''));
993
+
994
+ if (cachedLanguages.length > 0) {
995
+ cacheInfo.classList.remove('no-cache');
996
+ cacheStatus.textContent = `💾 Cached translations for ${cachedLanguages.length} language(s): ${cachedLanguages.join(', ')}`;
997
+ } else {
998
+ cacheInfo.classList.add('no-cache');
999
+ cacheStatus.textContent = '💾 No cached translations found';
1000
+ }
1001
+ }
1002
+
1003
+ // Clear all translation cache
1004
+ function clearAllTranslationCache() {
1005
+ if (confirm('Are you sure you want to clear all cached translations? This will require re-downloading translations for all languages.')) {
1006
+ translationCache = {};
1007
+ localStorage.removeItem('causemap_translations');
1008
+ updateCacheStatus();
1009
+
1010
+ // Show confirmation message
1011
+ const originalStatus = document.getElementById('cacheStatus').textContent;
1012
+ document.getElementById('cacheStatus').textContent = '🗑️ Translation cache cleared successfully!';
1013
+ setTimeout(() => {
1014
+ updateCacheStatus();
1015
+ }, 2000);
1016
+
1017
+ // If currently using a non-English language, offer to reload
1018
+ if (currentLanguage !== 'en') {
1019
+ if (confirm('The current language translations have been cleared. Would you like to reload the translations now?')) {
1020
+ translateInterface(currentLanguage);
1021
+ }
1022
+ }
1023
+ }
1024
+ }
1025
+
1026
+ // Start the application
1027
+ async function startApp() {
1028
+ const selectedLanguage = document.getElementById('languageSelect').value;
1029
+ const apiKey = document.getElementById('landingApiKey').value.trim();
1030
+
1031
+ if (!apiKey) {
1032
+ alert('Please enter your OpenAI API key');
1033
+ return;
1034
+ }
1035
+
1036
+ // Save preferences
1037
+ localStorage.setItem('causemap_language', selectedLanguage);
1038
+ localStorage.setItem('causemap_api_key', apiKey);
1039
+
1040
+ currentLanguage = selectedLanguage;
1041
+
1042
+ // Set up main app
1043
+ document.getElementById('apiKey').value = apiKey;
1044
+
1045
+ // Update language switcher
1046
+ const switcher = document.getElementById('languageSwitcher');
1047
+ switcher.innerHTML = '';
1048
+ const allOptions = document.getElementById('languageSelect').innerHTML;
1049
+ switcher.innerHTML = allOptions;
1050
+ switcher.value = selectedLanguage;
1051
+
1052
+ // Apply RTL if needed
1053
+ applyDirection(selectedLanguage);
1054
+
1055
+ if (selectedLanguage !== 'en') {
1056
+ await translateInterface(selectedLanguage);
1057
+ }
1058
+
1059
+ // Show main app
1060
+ document.getElementById('landingPage').style.display = 'none';
1061
+ document.getElementById('mainApp').style.display = 'block';
1062
+ }
1063
+
1064
+ // Switch language
1065
+ async function switchLanguage() {
1066
+ const newLanguage = document.getElementById('languageSwitcher').value;
1067
+ if (newLanguage === currentLanguage) return;
1068
+
1069
+ currentLanguage = newLanguage;
1070
+ localStorage.setItem('causemap_language', newLanguage);
1071
+
1072
+ applyDirection(newLanguage);
1073
+
1074
+ if (newLanguage !== 'en') {
1075
+ await translateInterface(newLanguage);
1076
+ } else {
1077
+ // Reset to English
1078
+ restoreOriginalText();
1079
+ }
1080
+ }
1081
+
1082
+ // Apply text direction
1083
+ function applyDirection(language) {
1084
+ const isRTL = rtlLanguages.includes(language);
1085
+ document.documentElement.dir = isRTL ? 'rtl' : 'ltr';
1086
+ document.documentElement.lang = language;
1087
+ }
1088
+
1089
+ // Translate interface
1090
+ async function translateInterface(targetLanguage) {
1091
+ if (isTranslating) return;
1092
+
1093
+ const cacheKey = `causemap_${targetLanguage}`;
1094
+
1095
+ // Check if translations are cached
1096
+ if (translationCache[cacheKey]) {
1097
+ showTranslationStatus('💾 Translations cached - instant loading!', false);
1098
+ applyTranslations(translationCache[cacheKey]);
1099
+ return;
1100
+ }
1101
+
1102
+ // Show first-time translation message
1103
+ showTranslationStatus('🔄 First time translation - will be cached for future use', true);
1104
+
1105
+ isTranslating = true;
1106
+
1107
+ try {
1108
+ const apiKey = document.getElementById('apiKey').value || document.getElementById('landingApiKey').value;
1109
+ if (!apiKey) {
1110
+ throw new Error('API key required for translation');
1111
+ }
1112
+
1113
+ // Get all translatable elements
1114
+ const elements = document.querySelectorAll('[data-translate]');
1115
+ const textsToTranslate = [];
1116
+ const elementMap = {};
1117
+
1118
+ elements.forEach((element, index) => {
1119
+ const key = element.getAttribute('data-translate');
1120
+ let text = '';
1121
+
1122
+ if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {
1123
+ text = element.placeholder;
1124
+ } else {
1125
+ text = element.textContent.trim();
1126
+ }
1127
+
1128
+ if (text && !elementMap[key]) {
1129
+ elementMap[key] = text;
1130
+ textsToTranslate.push({ key, text });
1131
+ }
1132
+ });
1133
+
1134
+ // Translate in batches
1135
+ const batchSize = 10;
1136
+ const translations = {};
1137
+
1138
+ for (let i = 0; i < textsToTranslate.length; i += batchSize) {
1139
+ const batch = textsToTranslate.slice(i, i + batchSize);
1140
+ const progress = Math.round(((i + batch.length) / textsToTranslate.length) * 100);
1141
+
1142
+ updateTranslationProgress(progress);
1143
+
1144
+ const batchTexts = batch.map(item => item.text).join('\n---\n');
1145
+ const prompt = `Translate the following text to ${languageNames[targetLanguage]}. Provide ONLY the exact translation without any explanations, additional information, or formatting. Separate each translation with ---:\n\n${batchTexts}`;
1146
+
1147
+ const response = await fetch('https://api.openai.com/v1/chat/completions', {
1148
+ method: 'POST',
1149
+ headers: {
1150
+ 'Content-Type': 'application/json',
1151
+ 'Authorization': `Bearer ${apiKey}`
1152
+ },
1153
+ body: JSON.stringify({
1154
+ model: 'gpt-4o-mini',
1155
+ messages: [{ role: 'user', content: prompt }],
1156
+ max_tokens: 2000,
1157
+ temperature: 0.3
1158
+ } )
1159
+ });
1160
+
1161
+ if (!response.ok) {
1162
+ throw new Error('Translation API request failed');
1163
+ }
1164
+
1165
+ const data = await response.json();
1166
+ const translatedTexts = data.choices[0].message.content.split('---').map(t => t.trim());
1167
+
1168
+ batch.forEach((item, index) => {
1169
+ if (translatedTexts[index]) {
1170
+ translations[item.key] = translatedTexts[index];
1171
+ }
1172
+ });
1173
+ }
1174
+
1175
+ // Cache translations
1176
+ translationCache[cacheKey] = translations;
1177
+ localStorage.setItem('causemap_translations', JSON.stringify(translationCache));
1178
+
1179
+ // Apply translations
1180
+ applyTranslations(translations);
1181
+
1182
+ updateTranslationProgress(100);
1183
+ setTimeout(() => {
1184
+ hideTranslationOverlay();
1185
+ showTranslationStatus('💾 Translations cached - instant loading!', false);
1186
+ updateCacheStatus();
1187
+ }, 500);
1188
+
1189
+ } catch (error) {
1190
+ console.error('Translation error:', error);
1191
+ hideTranslationOverlay();
1192
+ alert('Translation failed. Please check your API key and try again.');
1193
+ } finally {
1194
+ isTranslating = false;
1195
+ }
1196
+ }
1197
+
1198
+ // Apply translations to elements
1199
+ function applyTranslations(translations) {
1200
+ const elements = document.querySelectorAll('[data-translate]');
1201
+
1202
+ elements.forEach(element => {
1203
+ const key = element.getAttribute('data-translate');
1204
+ if (translations[key]) {
1205
+ if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA') {
1206
+ element.placeholder = translations[key];
1207
+ } else {
1208
+ element.textContent = translations[key];
1209
+ }
1210
+
1211
+ // Update data-placeholder for output area
1212
+ if (element.hasAttribute('data-placeholder')) {
1213
+ element.setAttribute('data-placeholder', translations[key]);
1214
+ }
1215
+ }
1216
+ });
1217
+ }
1218
+
1219
+ // Restore original English text
1220
+ function restoreOriginalText() {
1221
+ const originalTexts = {
1222
+ 'api-key-label': '🔑 API Key',
1223
+ 'api-key-placeholder': 'Enter your OpenAI API key',
1224
+ 'main-title': 'CauseMap Pro',
1225
+ 'main-subtitle': 'Advanced Root Cause Analysis & Problem Solving',
1226
+ 'main-description': 'Generate comprehensive fishbone diagram explanations tailored to your specific problems and analysis needs',
1227
+ 'component-1-title': '🎯 Problem Statement',
1228
+ 'component-1-desc': 'Main Effect/Issue',
1229
+ 'component-2-title': '👥 People',
1230
+ 'component-2-desc': 'Human Factors',
1231
+ 'component-3-title': '⚙️ Process',
1232
+ 'component-3-desc': 'Workflow & Procedures',
1233
+ 'component-4-title': '🛠️ Equipment',
1234
+ 'component-4-desc': 'Tools & Technology',
1235
+ 'component-5-title': '📦 Materials',
1236
+ 'component-5-desc': 'Resources & Inputs',
1237
+ 'component-6-title': '🌍 Environment',
1238
+ 'component-6-desc': 'External Conditions',
1239
+ 'input-title': '📝 Problem & Context Input',
1240
+ 'input-description': 'Describe your problem, issue, or situation that needs root cause analysis using the fishbone diagram methodology',
1241
+ 'input-placeholder': 'Enter your problem description, situation analysis, quality issue, process breakdown, or any challenge that requires systematic root cause investigation. For example: describe production defects, service failures, performance issues, or operational problems...',
1242
+ 'char-counter': '0 characters',
1243
+ 'generate-button': '🐟 Generate Fishbone Analysis',
1244
+ 'output-title': '📊 Your Fishbone Diagram Analysis',
1245
+ 'output-placeholder': 'Your comprehensive fishbone diagram analysis will appear here...'
1246
+ };
1247
+
1248
+ applyTranslations(originalTexts);
1249
+ }
1250
+
1251
+ // Show translation status
1252
+ function showTranslationStatus(message, showProgress) {
1253
+ const overlay = document.getElementById('translationOverlay');
1254
+ const status = document.getElementById('translationStatus');
1255
+ const progressContainer = overlay.querySelector('.translation-progress');
1256
+
1257
+ status.textContent = message;
1258
+ progressContainer.style.display = showProgress ? 'block' : 'none';
1259
+ overlay.style.display = 'flex';
1260
+
1261
+ if (!showProgress) {
1262
+ setTimeout(hideTranslationOverlay, 1500);
1263
+ }
1264
+ }
1265
+
1266
+ // Update translation progress
1267
+ function updateTranslationProgress(percentage) {
1268
+ const progressBar = document.getElementById('translationProgressBar');
1269
+ const progressText = document.getElementById('translationProgress');
1270
+
1271
+ progressBar.style.width = percentage + '%';
1272
+ progressText.textContent = percentage + '%';
1273
+ }
1274
+
1275
+ // Hide translation overlay
1276
+ function hideTranslationOverlay() {
1277
+ document.getElementById('translationOverlay').style.display = 'none';
1278
+ }
1279
+
1280
+ // Store API key in localStorage
1281
+ const apiKeyInput = document.getElementById('apiKey');
1282
+ if (apiKeyInput) {
1283
+ const storedApiKey = localStorage.getItem('causemap_api_key');
1284
+ if (storedApiKey) {
1285
+ apiKeyInput.value = storedApiKey;
1286
+ }
1287
+
1288
+ apiKeyInput.addEventListener('input', function() {
1289
+ localStorage.setItem('causemap_api_key', this.value);
1290
+ });
1291
+ }
1292
+
1293
+ // Character counter
1294
+ const textInput = document.getElementById('textInput');
1295
+ const charCounter = document.getElementById('charCounter');
1296
+
1297
+ if (textInput && charCounter) {
1298
+ textInput.addEventListener('input', function() {
1299
+ const count = this.value.length;
1300
+ charCounter.textContent = `${count} characters`;
1301
+
1302
+ if (count > 5000) {
1303
+ charCounter.style.color = 'var(--warning)';
1304
+ } else {
1305
+ charCounter.style.color = 'var(--text-secondary)';
1306
+ }
1307
+ });
1308
+ }
1309
+
1310
+ // Error handling
1311
+ function showError(message) {
1312
+ const errorDiv = document.getElementById('errorMessage');
1313
+ if (errorDiv) {
1314
+ errorDiv.textContent = message;
1315
+ errorDiv.style.display = 'block';
1316
+ setTimeout(() => {
1317
+ errorDiv.style.display = 'none';
1318
+ }, 5000);
1319
+ }
1320
+ }
1321
+
1322
+ // API call function
1323
+ async function callAPI(prompt) {
1324
+ const apiKey = document.getElementById('apiKey').value.trim();
1325
+
1326
+ if (!apiKey) {
1327
+ throw new Error('Please enter your OpenAI API key');
1328
+ }
1329
+
1330
+ const payload = {
1331
+ model: "gpt-4o-mini",
1332
+ messages: [{ role: "user", content: prompt }],
1333
+ max_tokens: 3500,
1334
+ temperature: 0.3
1335
+ };
1336
+
1337
+ const response = await fetch("https://api.openai.com/v1/chat/completions", {
1338
+ method: "POST",
1339
+ headers: {
1340
+ "Content-Type": "application/json",
1341
+ "Authorization": `Bearer ${apiKey}`
1342
+ },
1343
+ body: JSON.stringify(payload )
1344
+ });
1345
+
1346
+ if (!response.ok) {
1347
+ const errorData = await response.json();
1348
+ throw new Error(errorData.error?.message || "API request failed");
1349
+ }
1350
+
1351
+ const data = await response.json();
1352
+ return data.choices[0].message.content;
1353
+ }
1354
+
1355
+ // Build fishbone diagram prompt
1356
+ function buildFishbonePrompt() {
1357
+ const inputText = document.getElementById('textInput').value.trim();
1358
+
1359
+ return `Based on the following problem description and context:
1360
+
1361
+ ---------------------
1362
+ ${inputText}
1363
+ ---------------------
1364
+
1365
+ Please generate a comprehensive, structured, and professionally formatted fishbone diagram analysis that directly addresses the specific problem described above. The output should be tailored to the user's situation and formatted as clean HTML with inline CSS for professional presentation.
1366
+
1367
+ **Output Language: ${languageNames[currentLanguage]}**
1368
+
1369
+ **Required Structure:**
1370
+
1371
+ 1. **Problem Statement & Effect Analysis**
1372
+ - Clearly define the main problem or effect based on the input
1373
+ - Provide context and background information
1374
+ - Explain the significance and impact of this problem
1375
+ - Connect to the specific situation described in the input
1376
+
1377
+ 2. **Fishbone Diagram Concept Overview**
1378
+ - Define the fishbone diagram (Ishikawa diagram) as a visual tool for root cause analysis
1379
+ - Explain its purpose in systematically identifying potential causes
1380
+ - Describe how it helps teams brainstorm and categorize contributing factors
1381
+ - Highlight its value in problem-solving and quality improvement
1382
+
1383
+ 3. **Detailed Cause Categories Analysis**
1384
+ Based on the problem described, analyze each relevant category:
1385
+
1386
+ **👥 People (Human Factors)**
1387
+ - Skills, training, and competency issues
1388
+ - Communication problems
1389
+ - Motivation and engagement factors
1390
+ - Specific examples relevant to the input context
1391
+
1392
+ **⚙️ Process (Methods & Procedures)**
1393
+ - Workflow inefficiencies
1394
+ - Standard operating procedures
1395
+ - Decision-making processes
1396
+ - Specific process issues from the input
1397
+
1398
+ **🛠️ Equipment (Tools & Technology)**
1399
+ - Machine malfunctions or limitations
1400
+ - Technology gaps or failures
1401
+ - Maintenance issues
1402
+ - Relevant equipment factors from the context
1403
+
1404
+ **📦 Materials (Resources & Inputs)**
1405
+ - Quality of raw materials or inputs
1406
+ - Availability and supply chain issues
1407
+ - Specifications and standards
1408
+ - Material-related causes from the input
1409
+
1410
+ **🌍 Environment (External Conditions)**
1411
+ - Physical environment factors
1412
+ - Organizational culture and climate
1413
+ - External market or regulatory conditions
1414
+ - Environmental factors relevant to the problem
1415
+
1416
+ **📏 Measurement (Data & Metrics)**
1417
+ - Data collection and analysis issues
1418
+ - Performance measurement problems
1419
+ - Feedback and monitoring gaps
1420
+ - Measurement-related causes from the context
1421
+
1422
+ 4. **Root Cause Investigation Process**
1423
+ - Step-by-step methodology for using the fishbone diagram
1424
+ - Techniques for effective brainstorming sessions
1425
+ - Methods for validating and prioritizing causes
1426
+ - Data collection strategies for each category
1427
+
1428
+ 5. **Implementation Strategy**
1429
+ - How to facilitate a fishbone diagram session
1430
+ - Best practices for team collaboration
1431
+ - Tools and templates for documentation
1432
+ - Integration with other problem-solving methods
1433
+
1434
+ 6. **Action Planning & Next Steps**
1435
+ - Prioritization techniques for identified causes
1436
+ - Development of corrective action plans
1437
+ - Monitoring and validation strategies
1438
+ - Continuous improvement recommendations
1439
+
1440
+ 7. **Benefits & Applications**
1441
+ - Advantages of systematic root cause analysis
1442
+ - Prevention of problem recurrence
1443
+ - Team alignment and shared understanding
1444
+ - Quality improvement and process optimization
1445
+
1446
+ **Formatting Requirements:**
1447
+ - Use clean HTML with inline CSS for professional presentation
1448
+ - Include proper headings (h3, h4) with attractive styling
1449
+ - Use bullet points and numbered lists for clarity
1450
+ - Apply consistent color scheme (oranges for analysis themes)
1451
+ - Ensure responsive design and readability
1452
+ - Make the content scannable with clear visual hierarchy
1453
+ - Include specific examples relevant to the user's problem context
1454
+
1455
+ **Tone:** Professional, analytical, and directly relevant to the user's specific problem. Focus on practical, actionable guidance that can be immediately applied to their root cause analysis needs.
1456
+
1457
+ Return only the complete HTML content with inline CSS - no additional text or explanations outside the HTML.`;
1458
+ }
1459
+
1460
+ // Validation function
1461
+ function validateInputs() {
1462
+ const inputText = document.getElementById('textInput').value.trim();
1463
+
1464
+ if (!inputText) {
1465
+ document.getElementById('textInput').focus();
1466
+ throw new Error('Please enter your problem description or context for analysis');
1467
+ }
1468
+
1469
+ if (inputText.length < 50) {
1470
+ document.getElementById('textInput').focus();
1471
+ throw new Error('Please provide at least 50 characters for meaningful root cause analysis');
1472
+ }
1473
+ }
1474
+
1475
+ // Generate fishbone diagram analysis
1476
+ document.getElementById('generateDiagramBtn').addEventListener('click', async function() {
1477
+ const button = this;
1478
+ const buttonText = document.getElementById('buttonText');
1479
+ const spinner = document.getElementById('spinner');
1480
+ const outputArea = document.getElementById('apiOutput');
1481
+
1482
+ try {
1483
+ // Validate inputs
1484
+ validateInputs();
1485
+
1486
+ // Update button state
1487
+ button.disabled = true;
1488
+ spinner.style.display = 'inline-block';
1489
+ buttonText.textContent = 'Analyzing Problem...';
1490
+
1491
+ // Clear previous output
1492
+ outputArea.innerHTML = '';
1493
+
1494
+ // Build prompt and call API
1495
+ const prompt = buildFishbonePrompt();
1496
+ const result = await callAPI(prompt);
1497
+
1498
+ // Display result
1499
+ outputArea.innerHTML = result;
1500
+
1501
+ } catch (error) {
1502
+ showError(error.message);
1503
+ outputArea.innerHTML = '';
1504
+ } finally {
1505
+ // Reset button state
1506
+ button.disabled = false;
1507
+ spinner.style.display = 'none';
1508
+ buttonText.textContent = '🐟 Generate Fishbone Analysis';
1509
+ }
1510
+ });
1511
+
1512
+ // Keyboard shortcut for generation
1513
+ document.addEventListener('keydown', function(e) {
1514
+ if (e.ctrlKey && e.key === 'Enter') {
1515
+ e.preventDefault();
1516
+ document.getElementById('generateDiagramBtn').click();
1517
+ }
1518
+ });
1519
+
1520
+ // Initialize the app when page loads
1521
+ document.addEventListener('DOMContentLoaded', initializeApp);
1522
+ </script>
1523
+ </body>
1524
+ </html>
📘 Educator & Student Guide CauseMa.txt ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 📘 Educator & Student Guide: CauseMap Pro
2
+ 1. Introduction
3
+ CauseMap Pro brings advanced root cause analysis into your browser, letting students and professionals create deep, actionable fishbone analyses for any problem. Its multilingual, privacy-first design ensures accessibility everywhere.
4
+
5
+ 2. Step-by-Step Instructions
6
+ A. Getting Started
7
+ Open CauseMap Pro in your browser.
8
+
9
+ Choose your preferred language from the dropdown (80+ supported).
10
+
11
+ Enter your OpenAI API key when prompted.
12
+
13
+ Tip: Your key is stored only in your browser and is never shared externally.
14
+
15
+ B. Preparing Your Problem Statement
16
+ Be Specific:
17
+ Clearly describe the problem, its background, and context.
18
+ Example: “Our factory is experiencing a 10% increase in defective products over the past two months in Line A. The defects involve surface cracks during the molding process.”
19
+
20
+ Minimum Input:
21
+ At least 50 characters for meaningful analysis.
22
+
23
+ C. Generating Your Fishbone Analysis
24
+ Click “Generate Fishbone Analysis”.
25
+ The tool will:
26
+
27
+ Structure your problem into the six key fishbone categories:
28
+
29
+ 👥 People (human factors)
30
+
31
+ ⚙️ Process (methods & workflow)
32
+
33
+ 🛠️ Equipment (tools & technology)
34
+
35
+ 📦 Materials (inputs/resources)
36
+
37
+ 🌍 Environment (external/contextual)
38
+
39
+ 📏 Measurement (data & metrics)
40
+
41
+ Analyze each category in detail using your specific context.
42
+
43
+ Suggest actionable next steps, validation, and improvement strategies.
44
+
45
+ Review the Professional Output:
46
+
47
+ Output is in clean, responsive HTML—easy to copy, present, or share.
48
+
49
+ All cause categories are explained, with practical examples, prioritization, and implementation tips.
50
+
51
+ D. Using Multilingual Support
52
+ Select your desired language before or after generating analysis.
53
+
54
+ The interface and all outputs will be instantly translated (requires API key for first-time use).
55
+
56
+ Clear your translation cache in the app for privacy or updated translations.
57
+
58
+ 3. For Educators: Advanced Classroom Integration
59
+ Project-Based Learning:
60
+ Assign real-world problems for student teams to analyze and solve.
61
+
62
+ Cross-Curricular Use:
63
+ Integrate in STEM, business, design, and social sciences.
64
+
65
+ Group Discussion:
66
+ Have students compare, critique, and improve their analyses collaboratively.
67
+
68
+ Assessment:
69
+ Use student output as evidence of inquiry, analytical reasoning, and communication.
70
+
71
+ 4. For Students: Building Skills
72
+ Critical Thinking:
73
+ Practice breaking down complex problems and seeing all contributing factors.
74
+
75
+ Communication:
76
+ Learn to describe and present findings clearly and professionally.
77
+
78
+ Continuous Improvement:
79
+ Use the output to guide real corrective actions or project improvements.
80
+
81
+ Portfolio Building:
82
+ Save and document your analyses as evidence of your problem-solving abilities.
83
+
84
+ 5. Best Practices
85
+ Use Real Problems:
86
+ The more real and detailed the input, the more actionable the output.
87
+
88
+ Iterate:
89
+ Regenerate or revise your analysis as you gather more data.
90
+
91
+ Collaborate:
92
+ Invite feedback from peers, teachers, or colleagues.
93
+
94
+ 6. Support & Troubleshooting
95
+ If you see errors:
96
+
97
+ Check that your API key is valid.
98
+
99
+ Ensure your input has enough detail (min 50 characters).
100
+
101
+ For translation issues, try clearing the cache and reloading.
102
+
103
+ Need help?
104
+
105
+ Email info@shiftmind.io
106
+
107
+ Visit www.shiftmind.io
108
+
109
+ CauseMap Pro is your AI-powered partner in deep, actionable root cause analysis—empowering learning and results at any level.