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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Email Builder Pro - Criador de Emails HTML</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        /* Custom styles that Tailwind can't handle easily */
        .code-textarea {
            font-family: 'Fira Code', 'Courier New', monospace;
            tab-size: 2;
        }
        
        .resize-handle {
            width: 5px;
            background-color: rgba(156, 163, 175, 0.2);
            cursor: col-resize;
            transition: background-color 0.2s;
        }
        
        .resize-handle:hover {
            background-color: rgba(156, 163, 175, 0.5);
        }
        
        .template-item:hover .template-preview {
            transform: scale(1.02);
        }
        
        .template-preview {
            transition: transform 0.2s ease;
        }
        
        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: #f1f5f9;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }
    </style>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: {
                            50: '#eff6ff',
                            100: '#dbeafe',
                            200: '#bfdbfe',
                            300: '#93c5fd',
                            400: '#60a5fa',
                            500: '#3b82f6',
                            600: '#2563eb',
                            700: '#1d4ed8',
                            800: '#1e40af',
                            900: '#1e3a8a',
                        },
                        secondary: {
                            50: '#f8fafc',
                            100: '#f1f5f9',
                            200: '#e2e8f0',
                            300: '#cbd5e1',
                            400: '#94a3b8',
                            500: '#64748b',
                            600: '#475569',
                            700: '#334155',
                            800: '#1e293b',
                            900: '#0f172a',
                        }
                    },
                    fontFamily: {
                        sans: ['Inter', 'sans-serif'],
                        mono: ['Fira Code', 'monospace']
                    }
                }
            }
        }
    </script>
</head>
<body class="font-sans bg-gray-50 text-gray-800 overflow-hidden">
    <div class="flex h-screen">
        <!-- Sidebar -->
        <div id="sidebar" class="w-80 bg-white border-r border-gray-200 flex flex-col transition-all duration-300 ease-in-out transform -translate-x-full md:translate-x-0">
            <!-- Sidebar Header -->
            <div class="p-6 bg-gradient-to-r from-primary-600 to-primary-700 text-white">
                <div class="flex items-center space-x-3">
                    <div class="p-2 bg-white/20 rounded-lg">
                        <i class="fas fa-envelope text-xl"></i>
                    </div>
                    <div>
                        <h1 class="text-xl font-bold">Email Builder Pro</h1>
                        <p class="text-sm opacity-90">Crie emails profissionais</p>
                    </div>
                </div>
            </div>
            
            <!-- Sidebar Content -->
            <div class="flex-1 overflow-y-auto p-4 space-y-6">
                <!-- Templates Section -->
                <div>
                    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center">
                        <i class="fas fa-file-alt mr-2"></i> Modelos
                    </h2>
                    <div class="grid grid-cols-1 gap-3">
                        <!-- Blank Template -->
                        <div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md active"
                             onclick="loadTemplate('blank')">
                            <div class="template-preview bg-gray-50 h-24 flex items-center justify-center">
                                <div class="text-center p-4">
                                    <i class="fas fa-file text-3xl text-gray-400 mb-2"></i>
                                    <p class="text-xs font-medium text-gray-500">Em Branco</p>
                                </div>
                            </div>
                            <div class="p-3">
                                <h3 class="font-medium text-gray-800">Comece do zero</h3>
                                <p class="text-xs text-gray-500 mt-1">Template vazio para criação personalizada</p>
                            </div>
                        </div>
                        
                        <!-- Newsletter Template -->
                        <div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md"
                             onclick="loadTemplate('asof')">
                            <div class="template-preview bg-gradient-to-br from-blue-50 to-indigo-50 h-24 flex items-center justify-center">
                                <div class="text-center p-4">
                                    <div class="inline-block px-4 py-2 bg-primary-600 text-white rounded-md text-sm font-medium">NEWSLETTER</div>
                                </div>
                            </div>
                            <div class="p-3">
                                <h3 class="font-medium text-gray-800">Newsletter</h3>
                                <p class="text-xs text-gray-500 mt-1">Modelo institucional para newsletters</p>
                            </div>
                        </div>
                        
                        <!-- Simple Email Template -->
                        <div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md"
                             onclick="loadTemplate('simple')">
                            <div class="template-preview bg-white h-24 flex items-center justify-center">
                                <div class="text-center p-4 border-b-2 border-gray-100 w-full">
                                    <h3 class="text-lg font-medium text-gray-800">Email Simples</h3>
                                </div>
                            </div>
                            <div class="p-3">
                                <h3 class="font-medium text-gray-800">Minimalista</h3>
                                <p class="text-xs text-gray-500 mt-1">Design limpo e direto ao ponto</p>
                            </div>
                        </div>
                        
                        <!-- Corporate Template -->
                        <div class="template-item bg-white border border-gray-200 rounded-lg overflow-hidden cursor-pointer transition-all duration-200 hover:border-primary-400 hover:shadow-md"
                             onclick="loadTemplate('corporate')">
                            <div class="template-preview bg-gradient-to-r from-primary-600 to-primary-700 h-24 flex items-center justify-center">
                                <div class="text-center p-4 text-white">
                                    <h3 class="text-lg font-medium">Corporativo</h3>
                                    <p class="text-sm opacity-90">Sua Empresa</p>
                                </div>
                            </div>
                            <div class="p-3">
                                <h3 class="font-medium text-gray-800">Profissional</h3>
                                <p class="text-xs text-gray-500 mt-1">Para comunicações empresariais</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Quick Settings -->
                <div>
                    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center">
                        <i class="fas fa-cog mr-2"></i> Configurações
                    </h2>
                    <div class="space-y-4">
                        <!-- Email Title -->
                        <div>
                            <label for="emailTitle" class="block text-sm font-medium text-gray-700 mb-1">Título do Email</label>
                            <div class="relative">
                                <input type="text" id="emailTitle" value="Meu Email Profissional" 
                                       class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fas fa-heading text-gray-400"></i>
                                </div>
                            </div>
                        </div>
                        
                        <!-- Primary Color -->
                        <div>
                            <label for="primaryColor" class="block text-sm font-medium text-gray-700 mb-1">Cor Principal</label>
                            <div class="flex items-center space-x-3">
                                <div class="relative">
                                    <input type="color" id="primaryColor" value="#2563eb" 
                                           class="w-10 h-10 rounded-lg border border-gray-300 cursor-pointer">
                                </div>
                                <div class="flex-1">
                                    <input type="text" id="primaryColorText" value="#2563eb" 
                                           class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 font-mono text-sm">
                                </div>
                            </div>
                        </div>
                        
                        <!-- Max Width -->
                        <div>
                            <label for="maxWidth" class="block text-sm font-medium text-gray-700 mb-1">Largura Máxima</label>
                            <div class="relative">
                                <select id="maxWidth" class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-primary-500 appearance-none">
                                    <option value="600px">600px (Padrão)</option>
                                    <option value="650px">650px</option>
                                    <option value="700px">700px</option>
                                    <option value="100%">100% (Responsivo)</option>
                                </select>
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fas fa-arrows-alt-h text-gray-400"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Actions -->
                <div class="pt-2">
                    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wider mb-3 flex items-center">
                        <i class="fas fa-bolt mr-2"></i> Ações
                    </h2>
                    <div class="space-y-3">
                        <button onclick="copyToClipboard()" class="w-full flex items-center justify-center px-4 py-3 bg-gradient-to-r from-green-500 to-green-600 text-white rounded-lg font-medium hover:from-green-600 hover:to-green-700 transition-all duration-200 shadow hover:shadow-md">
                            <i class="fas fa-copy mr-2"></i> Copiar para Gmail
                        </button>
                        
                        <button onclick="downloadHTML()" class="w-full flex items-center justify-center px-4 py-3 bg-gradient-to-r from-primary-500 to-primary-600 text-white rounded-lg font-medium hover:from-primary-600 hover:to-primary-700 transition-all duration-200 shadow hover:shadow-md">
                            <i class="fas fa-download mr-2"></i> Baixar HTML
                        </button>
                        
                        <button onclick="previewInNewTab()" class="w-full flex items-center justify-center px-4 py-3 bg-gray-100 text-gray-700 rounded-lg font-medium hover:bg-gray-200 transition-all duration-200">
                            <i class="fas fa-external-link-alt mr-2"></i> Abrir em Nova Janela
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Main Content -->
        <div class="flex-1 flex flex-col overflow-hidden">
            <!-- Toolbar -->
            <div class="bg-white border-b border-gray-200 p-4 flex items-center">
                <button onclick="toggleSidebar()" class="md:hidden mr-4 p-2 rounded-lg hover:bg-gray-100 text-gray-600">
                    <i class="fas fa-bars text-lg"></i>
                </button>
                
                <div class="flex items-center">
                    <i class="fas fa-code text-primary-600 mr-2"></i>
                    <h2 class="font-medium text-gray-800">Editor de Email HTML</h2>
                </div>
                
                <div class="ml-auto flex items-center space-x-3">
                    <button onclick="updatePreview()" class="flex items-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg font-medium hover:bg-gray-200 transition-all duration-200">
                        <i class="fas fa-sync-alt mr-2"></i> Atualizar
                    </button>
                    
                    <div class="relative">
                        <button onclick="showHelp()" class="p-2 rounded-lg hover:bg-gray-100 text-gray-600">
                            <i class="fas fa-question-circle text-lg"></i>
                        </button>
                        <div id="helpTooltip" class="hidden absolute right-0 mt-2 w-64 bg-white border border-gray-200 rounded-lg shadow-lg p-3 z-50">
                            <h3 class="font-medium text-gray-800 mb-2">Dicas Rápidas</h3>
                            <ul class="text-sm text-gray-600 space-y-1">
                                <li>• Use TAB para indentar código</li>
                                <li>• Atualize o preview com F5</li>
                                <li>• Ctrl+S para salvar HTML</li>
                                <li>• Templates são apenas pontos de partida</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Editor and Preview Panels -->
            <div class="flex-1 flex overflow-hidden">
                <!-- Code Editor -->
                <div class="flex-1 flex flex-col overflow-hidden border-r border-gray-200">
                    <div class="bg-gray-50 border-b border-gray-200 p-3 flex items-center justify-between">
                        <div class="flex items-center">
                            <i class="fas fa-code text-gray-500 mr-2"></i>
                            <span class="text-sm font-medium text-gray-700">HTML/CSS</span>
                        </div>
                        <div class="flex items-center space-x-2">
                            <button onclick="formatCode()" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200">
                                <i class="fas fa-indent mr-1"></i> Format
                            </button>
                            <button onclick="minifyCode()" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200">
                                <i class="fas fa-compress-alt mr-1"></i> Minify
                            </button>
                        </div>
                    </div>
                    <textarea id="codeEditor" class="code-textarea flex-1 p-4 bg-gray-800 text-gray-100 resize-none outline-none" spellcheck="false"></textarea>
                </div>
                
                <!-- Resize Handle -->
                <div class="resize-handle" id="resizeHandle"></div>
                
                <!-- Preview Panel -->
                <div class="flex-1 flex flex-col overflow-hidden">
                    <div class="bg-gray-50 border-b border-gray-200 p-3 flex items-center justify-between">
                        <div class="flex items-center">
                            <i class="fas fa-eye text-gray-500 mr-2"></i>
                            <span class="text-sm font-medium text-gray-700">Preview</span>
                        </div>
                        <div class="flex items-center space-x-2">
                            <button onclick="toggleDeviceView('desktop')" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200">
                                <i class="fas fa-desktop mr-1"></i> Desktop
                            </button>
                            <button onclick="toggleDeviceView('mobile')" class="text-xs px-2 py-1 bg-gray-100 text-gray-600 rounded hover:bg-gray-200">
                                <i class="fas fa-mobile-alt mr-1"></i> Mobile
                            </button>
                        </div>
                    </div>
                    <div id="previewContainer" class="flex-1 bg-gray-100 p-4 overflow-auto">
                        <div id="previewWrapper" class="mx-auto bg-white shadow-lg" style="max-width: 600px;">
                            <iframe id="previewFrame" class="w-full h-full border-0"></iframe>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Status Toast -->
    <div id="statusToast" class="fixed top-4 right-4 z-50 hidden">
        <div class="bg-white border border-gray-200 rounded-lg shadow-lg overflow-hidden w-64">
            <div class="flex items-start p-4">
                <div id="toastIcon" class="flex-shrink-0 mr-3">
                    <i class="fas fa-check-circle text-green-500 text-xl"></i>
                </div>
                <div class="flex-1">
                    <h3 id="toastTitle" class="font-medium text-gray-800">Sucesso</h3>
                    <p id="toastMessage" class="text-sm text-gray-600 mt-1">Operação realizada com sucesso</p>
                </div>
                <button onclick="hideToast()" class="text-gray-400 hover:text-gray-500">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div id="toastProgress" class="h-1 bg-green-500 w-full"></div>
        </div>
    </div>
    
    <!-- Help Modal -->
    <div id="helpModal" class="fixed inset-0 z-50 hidden flex items-center justify-center bg-black bg-opacity-50">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] overflow-hidden">
            <div class="border-b border-gray-200 p-4 flex items-center justify-between">
                <h3 class="text-lg font-medium text-gray-800">Ajuda do Email Builder</h3>
                <button onclick="hideHelpModal()" class="text-gray-400 hover:text-gray-500">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="p-6 overflow-y-auto">
                <div class="space-y-6">
                    <div>
                        <h4 class="font-medium text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-file-alt text-primary-600 mr-2"></i> Modelos
                        </h4>
                        <p class="text-gray-600 text-sm">Comece rapidamente com nossos modelos pré-definidos. Cada template pode ser completamente personalizado no editor.</p>
                    </div>
                    
                    <div>
                        <h4 class="font-medium text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-code text-primary-600 mr-2"></i> Editor HTML/CSS
                        </h4>
                        <p class="text-gray-600 text-sm">Edite livremente o código HTML e CSS do seu email. O preview é atualizado automaticamente conforme você digita.</p>
                        <div class="mt-2 bg-gray-50 p-3 rounded-lg">
                            <p class="text-xs font-mono text-gray-700">&lt;!-- Dica: Use TAB para indentar seu código --&gt;</p>
                        </div>
                    </div>
                    
                    <div>
                        <h4 class="font-medium text-gray-800 mb-3 flex items-center">
                            <i class="fas fa-download text-primary-600 mr-2"></i> Exportação
                        </h4>
                        <p class="text-gray-600 text-sm">Você pode copiar o código diretamente para o Gmail ou baixar o HTML completo para usar em outros sistemas.</p>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-200 p-4 flex justify-end">
                <button onclick="hideHelpModal()" class="px-4 py-2 bg-primary-600 text-white rounded-lg hover:bg-primary-700">
                    Entendi
                </button>
            </div>
        </div>
    </div>

    <script>
        // Templates
        const templates = {
            blank: `<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Seu Email</title>
    <style>
        /* Adicione seus estilos CSS aqui */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background: white;
        }
        .header {
            padding: 20px;
            background: #2563eb;
            color: white;
        }
        .content {
            padding: 20px;
        }
        .footer {
            padding: 20px;
            background: #f4f4f4;
            color: #666;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Título do Email</h1>
        </div>
        <div class="content">
            <!-- Adicione seu conteúdo HTML aqui -->
            <p>Olá,</p>
            <p>Este é um exemplo de email HTML.</p>
            <p>Atenciosamente,<br>Equipe</p>
        </div>
        <div class="footer">
            <p>© 2023 Sua Empresa. Todos os direitos reservados.</p>
        </div>
    </div>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=SherlockRamos/emailbuilder" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>