File size: 37,142 Bytes
3d4c2bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>YouTube Uploader - YouTube Automation</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
    <div class="background-animation">
        <div class="gradient-orb orb-1"></div>
        <div class="gradient-orb orb-2"></div>
        <div class="gradient-orb orb-3"></div>
    </div>

    <!-- Navigation -->
    <nav class="navbar glass-card">
        <div class="nav-container">
            <a href="/" class="nav-brand">
                <i class="fab fa-youtube"></i>
                <span>YouTube Automation</span>
            </a>
            <div class="nav-menu">
                <a href="/" class="nav-link"><i class="fas fa-home"></i> Home</a>
                <a href="/downloader" class="nav-link"><i class="fas fa-download"></i> Downloader</a>
                <a href="/metadata-generator" class="nav-link"><i class="fas fa-brain"></i> Metadata</a>
                <a href="/uploader" class="nav-link active"><i class="fas fa-upload"></i> Uploader</a>
            </div>
            
            <!-- Auth Buttons (shown when not authenticated) -->
            <div id="navAuthButtons" class="nav-auth-buttons">
                <button id="navSignInBtn" class="btn btn-nav-signin">
                    <i class="fab fa-youtube"></i> Sign in
                </button>
            </div>
            
            <!-- User Menu (shown when authenticated) -->
            <div id="navUserMenu" class="nav-user-menu" style="display: none;">
                <div class="user-avatar" id="navUserAvatar">
                    <img id="navUserAvatarImg" src="" alt="User Avatar">
                </div>
                <div class="user-dropdown">
                    <div class="user-info">
                        <div class="user-name" id="navUserName">Channel Name</div>
                        <div class="user-email" id="navUserStats">Stats</div>
                    </div>
                    <div class="dropdown-divider"></div>
                    <button class="dropdown-item dropdown-logout" id="navLogoutBtn">
                        <i class="fas fa-sign-out-alt"></i> Logout
                    </button>
                </div>
            </div>
            
            <button class="mobile-menu-toggle" id="mobileMenuToggle">
                <i class="fas fa-bars"></i>
            </button>
        </div>
    </nav>

    <!-- Mobile Menu -->
    <div class="mobile-menu glass-card" id="mobileMenu">
        <a href="/" class="mobile-menu-link"><i class="fas fa-home"></i> Home</a>
        <a href="/downloader" class="mobile-menu-link"><i class="fas fa-download"></i> Downloader</a>
        <a href="/metadata-generator" class="mobile-menu-link"><i class="fas fa-brain"></i> Metadata Generator</a>
        <a href="/uploader" class="mobile-menu-link"><i class="fas fa-upload"></i> Uploader</a>
        <div class="mobile-menu-divider"></div>
        
        <!-- Mobile Sign In (shown when not authenticated) -->
        <button id="mobileSignInBtn" class="btn btn-nav-signin mobile-menu-btn">
            <i class="fab fa-youtube"></i> Sign in
        </button>
        
        <!-- Mobile User Info (shown when authenticated) -->
        <div id="mobileUserInfo" style="display: none; padding: 14px;">
            <div style="font-weight: 600; margin-bottom: 5px;" id="mobileUserName">Channel Name</div>
            <div style="font-size: 13px; color: var(--text-secondary);" id="mobileUserStats">Stats</div>
        </div>
        <button class="btn btn-logout mobile-menu-btn" id="mobileLogoutBtn" style="display: none;">
            <i class="fas fa-sign-out-alt"></i> Logout
        </button>
    </div>

    <div class="container">
        <!-- Hero Section -->
        <section class="page-hero fade-in">
            <div class="hero-badge">
                <i class="fas fa-upload"></i>
                <span>Complete Automation</span>
            </div>
            <h1>YouTube Auto Uploader</h1>
            <p class="hero-subtitle">Upload videos directly to YouTube with AI-generated metadata. Fully automated workflow from Instagram download to YouTube publish.</p>
        </section>

        <!-- Auth Section -->
        <section id="authSection" class="upload-section glass-card fade-in-delay text-center" style="display: none;">
            <div class="section-header">
                <i class="fab fa-youtube"></i>
                <h2>Connect Your YouTube Channel</h2>
                <p>Sign in to start uploading videos automatically</p>
            </div>
            
            <div class="auth-benefits" style="max-width: 600px; margin: 30px auto;">
                <div class="benefit-item">
                    <i class="fas fa-check-circle"></i>
                    <span>Secure OAuth 2.0 authentication</span>
                </div>
                <div class="benefit-item">
                    <i class="fas fa-check-circle"></i>
                    <span>Direct YouTube API integration</span>
                </div>
                <div class="benefit-item">
                    <i class="fas fa-check-circle"></i>
                    <span>Full control over your channel</span>
                </div>
                <div class="benefit-item">
                    <i class="fas fa-check-circle"></i>
                    <span>Revoke access anytime</span>
                </div>
            </div>
            
            <button id="authBtn" class="btn btn-auth btn-large">
                <i class="fab fa-youtube"></i> Sign in with YouTube
            </button>
            
            <p style="margin-top: 20px; font-size: 13px; color: var(--text-secondary);">
                We only request upload permissions. Your data is secure.
            </p>
        </section>

        <!-- Channel Info -->
        <section id="channelInfo" class="channel-info glass-card fade-in" style="display: none;">
            <div class="channel-header">
                <img id="channelAvatar" class="channel-avatar" src="" alt="Channel Avatar">
                <div class="channel-details">
                    <h2 id="channelName">Channel Name</h2>
                    <p id="channelStats">Loading...</p>
                </div>
            </div>
        </section>

        <!-- Upload Section -->
        <section id="uploadSection" class="upload-section glass-card fade-in-delay" style="display: none;">
            <div class="section-header">
                <i class="fas fa-cloud-upload-alt"></i>
                <h2>Auto Upload to YouTube</h2>
                <p>Paste Instagram Reel URL and let AI handle the rest</p>
            </div>

            <div class="input-group">
                <i class="fab fa-instagram"></i>
                <input type="text" id="reelUrl" class="glass-input" 

                       placeholder="Paste Instagram Reel URL here...">
            </div>

            <!-- Video Editing Options Section (NEW) -->
            <div class="video-editing-section glass-card" style="margin-top: 25px; padding: 25px;">
                <div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;">
                    <div>
                        <h3 style="margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px;">
                            <i class="fas fa-magic"></i> Video Editing (Optional)
                        </h3>
                        <p style="margin: 5px 0 0 0; font-size: 13px; color: var(--text-secondary);">
                            Enhance your video with background music and text overlays
                        </p>
                    </div>
                    <label class="toggle-switch">
                        <input type="checkbox" id="enableEditingToggle">
                        <span class="toggle-slider"></span>
                    </label>
                </div>

                <div id="editingOptions" style="display: none; animation: slideDown 0.3s ease;">
                    <!-- Background Music Section -->
                    <div class="editing-option" style="margin-bottom: 20px;">
                        <label style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600;">
                            <i class="fas fa-music" style="color: var(--secondary);"></i>
                            Background Music
                        </label>
                        
                        <!-- Music Source Tabs -->
                        <div style="display: flex; gap: 10px; margin-bottom: 15px;">
                            <button type="button" id="musicTabUrl" class="btn btn-secondary" style="flex: 1; padding: 10px; font-size: 14px;">
                                <i class="fab fa-youtube"></i> YouTube URL
                            </button>
                            <button type="button" id="musicTabFile" class="btn btn-secondary" style="flex: 1; padding: 10px; font-size: 14px; opacity: 0.6;">
                                <i class="fas fa-file-audio"></i> Local File
                            </button>
                        </div>

                        <!-- YouTube URL Input -->
                        <div id="musicUrlSection">
                            <div class="input-group" style="margin-bottom: 10px;">
                                <i class="fab fa-youtube"></i>
                                <input type="text" id="musicUrl" class="glass-input" 

                                       placeholder="Paste YouTube music URL (optional)...">
                            </div>
                        </div>

                        <!-- Local File Input -->
                        <div id="musicFileSection" style="display: none;">
                            <div class="input-group" style="margin-bottom: 10px; cursor: pointer;" onclick="document.getElementById('musicFileInput').click();">
                                <i class="fas fa-upload"></i>
                                <input type="text" id="musicFileName" class="glass-input" 

                                       placeholder="Choose audio file from device..." readonly>
                                <input type="file" id="musicFileInput" accept="audio/*,.mp3,.wav,.m4a,.aac" style="display: none;">
                            </div>
                            <p style="font-size: 12px; color: var(--text-secondary); margin-top: 5px;">
                                <i class="fas fa-info-circle"></i> Supported formats: MP3, WAV, M4A, AAC
                            </p>
                        </div>

                        <div style="display: flex; align-items: center; gap: 15px;">
                            <label style="font-size: 14px; color: var(--text-secondary);">
                                <i class="fas fa-volume-up"></i> Volume:
                            </label>
                            <input type="range" id="musicVolume" min="0" max="100" value="30" 

                                   style="flex: 1; accent-color: var(--secondary);">
                            <span id="volumeValue" style="min-width: 40px; font-weight: 600;">30%</span>
                        </div>
                    </div>

                    <!-- Text Overlays Section -->
                    <div class="editing-option">
                        <label style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600;">
                            <i class="fas fa-text-height" style="color: var(--primary);"></i>
                            Text Overlays
                        </label>
                        <div id="textOverlaysContainer">
                            <!-- Text overlay items will be added here -->
                        </div>
                        <button type="button" id="addTextOverlay" class="btn btn-secondary" 

                                style="width: 100%; margin-top: 10px;">
                            <i class="fas fa-plus"></i> Add Text Overlay
                        </button>
                    </div>
                </div>
            </div>

            <div class="button-group">
                <button id="uploadBtn" class="btn btn-primary">
                    <i class="fas fa-upload"></i> Auto Upload
                </button>
            </div>

            <!-- Progress Section -->
            <div id="progressSection" class="progress-section" style="display: none;">
                <div class="progress-header">
                    <h3 id="progressTitle">Processing...</h3>
                    <span id="progressPercent" class="progress-percent">0%</span>
                </div>
                <div class="progress-bar">
                    <div id="progressFill" class="progress-fill" style="width: 0%"></div>
                </div>
                <p id="progressMessage" class="progress-message">Starting...</p>
            </div>

            <!-- Metadata Preview -->
            <div id="metadataPreview" class="metadata-preview" style="display: none;">
                <h3><i class="fas fa-sparkles"></i> AI Generated Metadata</h3>
                <div class="metadata-content">
                    <div class="metadata-item">
                        <label><i class="fas fa-heading"></i> Title</label>
                        <div id="previewTitle" class="metadata-value"></div>
                    </div>
                    <div class="metadata-item">
                        <label><i class="fas fa-align-left"></i> Description</label>
                        <div id="previewDescription" class="metadata-value scrollable"></div>
                    </div>
                    <div class="metadata-item">
                        <label><i class="fas fa-tags"></i> Tags</label>
                        <div id="previewTags" class="metadata-tags"></div>
                    </div>
                    <div class="metadata-item">
                        <label><i class="fas fa-hashtag"></i> Hashtags</label>
                        <div id="previewHashtags" class="metadata-tags"></div>
                    </div>
                </div>
            </div>

            <!-- Success Result -->
            <div id="successResult" class="result-section success glass-card" style="display: none;">
                <div class="result-icon">🎉</div>
                <h3>Upload Successful!</h3>
                <p>Your video is now live on YouTube</p>
                <div class="button-group">
                    <a id="watchBtn" href="#" target="_blank" class="btn btn-watch">
                        <i class="fab fa-youtube"></i> Watch on YouTube
                    </a>
                    <button id="uploadAnotherBtn" class="btn btn-retry">
                        <i class="fas fa-plus"></i> Upload Another
                    </button>
                </div>
            </div>

            <!-- Error Result -->
            <div id="errorResult" class="result-section error glass-card" style="display: none;">
                <div class="result-icon"></div>
                <h3>Upload Failed</h3>
                <p id="errorMessage">An error occurred</p>
                <button id="retryBtn" class="btn btn-retry">
                    <i class="fas fa-redo"></i> Try Again
                </button>
            </div>
        </section>

        <!-- Features Section -->
        <section class="features-section fade-in-delay-1">
            <div class="section-header">
                <h2>Complete Automation Features</h2>
                <p>Everything you need for effortless YouTube uploads</p>
            </div>

            <div class="features-grid-small">
                <div class="feature-card glass-card">
                    <i class="fas fa-robot feature-icon-small"></i>
                    <h3>Fully Automated</h3>
                    <p>One-click upload process. No manual work required. From download to publish in minutes.</p>
                </div>

                <div class="feature-card glass-card">
                    <i class="fas fa-brain feature-icon-small"></i>
                    <h3>AI Metadata</h3>
                    <p>Automatically generates SEO-optimized titles, descriptions, tags, and hashtags using AI.</p>
                </div>

                <div class="feature-card glass-card">
                    <i class="fas fa-bolt feature-icon-small"></i>
                    <h3>Lightning Fast</h3>
                    <p>High-speed processing ensures your content is live on YouTube in record time.</p>
                </div>

                <div class="feature-card glass-card">
                    <i class="fas fa-shield-alt feature-icon-small"></i>
                    <h3>Secure OAuth</h3>
                    <p>Industry-standard OAuth 2.0 authentication. Your credentials are never stored.</p>
                </div>

                <div class="feature-card glass-card">
                    <i class="fas fa-chart-line feature-icon-small"></i>
                    <h3>Real-time Tracking</h3>
                    <p>Monitor upload progress in real-time with detailed status updates at each stage.</p>
                </div>

                <div class="feature-card glass-card">
                    <i class="fas fa-cog feature-icon-small"></i>
                    <h3>Custom Settings</h3>
                    <p>Choose privacy settings, categories, and other options for your uploads.</p>
                </div>
            </div>
        </section>

        <!-- How It Works Section -->
        <section class="how-to-use glass-card fade-in-delay-2">
            <div class="section-header">
                <h2>How Auto Upload Works</h2>
                <p>Complete automation in 4 simple steps</p>
            </div>

            <div class="steps-list">
                <div class="step-card">
                    <div class="step-number-badge">1</div>
                    <div class="step-info">
                        <h3>Authenticate with YouTube</h3>
                        <p>Click "Sign in with YouTube" to connect your channel. Uses secure OAuth 2.0 authentication. This is a one-time setup.</p>
                        <div class="step-tip">
                            <i class="fas fa-shield-alt"></i>
                            <span>Secure authentication - we never store your password</span>
                        </div>
                    </div>
                </div>

                <div class="step-card">
                    <div class="step-number-badge">2</div>
                    <div class="step-info">
                        <h3>Paste Instagram Reel URL</h3>
                        <p>Copy the link to the Instagram Reel you want to upload and paste it into the input field.</p>
                        <div class="step-tip">
                            <i class="fas fa-link"></i>
                            <span>Supports all public Instagram Reels</span>
                        </div>
                    </div>
                </div>

                <div class="step-card">
                    <div class="step-number-badge">3</div>
                    <div class="step-info">
                        <h3>AI Analyzes & Generates</h3>
                        <p>Our AI downloads the video, analyzes content, and generates optimized metadata including title, description, tags, and hashtags.</p>
                        <div class="step-tip">
                            <i class="fas fa-magic"></i>
                            <span>Powered by Google Gemini AI for best results</span>
                        </div>
                    </div>
                </div>

                <div class="step-card">
                    <div class="step-number-badge">4</div>
                    <div class="step-info">
                        <h3>Auto Upload to YouTube</h3>
                        <p>Video is automatically uploaded to your YouTube channel with all AI-generated metadata applied. Your video goes live instantly!</p>
                        <div class="step-tip">
                            <i class="fas fa-rocket"></i>
                            <span>Track real-time progress and get instant video link</span>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Benefits Section -->
        <section class="benefits-section fade-in-delay-2">
            <div class="section-header">
                <h2>Why Use Auto Uploader?</h2>
                <p>Advantages of automated YouTube uploads</p>
            </div>

            <div class="benefits-grid">
                <div class="benefit-card glass-card">
                    <i class="fas fa-clock benefit-icon"></i>
                    <h3>Save Hours</h3>
                    <p>Upload in minutes instead of hours. Automate your entire content workflow.</p>
                </div>

                <div class="benefit-card glass-card">
                    <i class="fas fa-sync benefit-icon"></i>
                    <h3>Consistent Quality</h3>
                    <p>Every upload gets professional-quality metadata automatically.</p>
                </div>

                <div class="benefit-card glass-card">
                    <i class="fas fa-search benefit-icon"></i>
                    <h3>SEO Optimized</h3>
                    <p>AI-generated metadata is optimized for YouTube's search algorithm.</p>
                </div>

                <div class="benefit-card glass-card">
                    <i class="fas fa-chart-line benefit-icon"></i>
                    <h3>Grow Faster</h3>
                    <p>Post more content consistently to grow your channel faster.</p>
                </div>

                <div class="benefit-card glass-card">
                    <i class="fas fa-shield-alt benefit-icon"></i>
                    <h3>100% Secure</h3>
                    <p>Official YouTube API with OAuth 2.0. Revoke access anytime.</p>
                </div>

                <div class="benefit-card glass-card">
                    <i class="fas fa-mobile-alt benefit-icon"></i>
                    <h3>Works Everywhere</h3>
                    <p>Upload from any device - desktop, tablet, or mobile.</p>
                </div>
            </div>
        </section>

        <!-- Use Cases Section -->
        <section class="use-cases-section glass-card fade-in-delay-3">
            <div class="section-header">
                <h2>Perfect For</h2>
                <p>Who benefits from automated YouTube uploads</p>
            </div>

            <div class="use-cases-grid">
                <div class="use-case-item">
                    <i class="fas fa-video"></i>
                    <h4>Content Creators</h4>
                    <p>Repurpose Instagram content for YouTube effortlessly</p>
                </div>

                <div class="use-case-item">
                    <i class="fas fa-users"></i>
                    <h4>Social Media Managers</h4>
                    <p>Manage multiple channels with automated workflows</p>
                </div>

                <div class="use-case-item">
                    <i class="fas fa-bullhorn"></i>
                    <h4>Digital Marketers</h4>
                    <p>Scale video marketing campaigns across platforms</p>
                </div>

                <div class="use-case-item">
                    <i class="fas fa-store"></i>
                    <h4>E-commerce Brands</h4>
                    <p>Automatically post product videos to YouTube</p>
                </div>

                <div class="use-case-item">
                    <i class="fas fa-graduation-cap"></i>
                    <h4>Educators</h4>
                    <p>Share educational content across multiple platforms</p>
                </div>

                <div class="use-case-item">
                    <i class="fas fa-music"></i>
                    <h4>Musicians & Artists</h4>
                    <p>Promote your work with automated uploads</p>
                </div>
            </div>
        </section>

        <!-- FAQ Section -->
        <section class="faq-section fade-in-delay-3">
            <div class="section-header">
                <h2>Frequently Asked Questions</h2>
                <p>Everything you need to know about auto uploading</p>
            </div>

            <div class="faq-container">
                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>Is my YouTube account safe?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>Yes, absolutely! We use YouTube's official API with OAuth 2.0 authentication, the same secure method used by Google's own applications. Your credentials are never stored on our servers, and you can revoke access anytime from your Google account settings.</p>
                    </div>
                </div>

                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>How long does the upload process take?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>The entire process typically takes 2-5 minutes depending on video size. Download takes 30-60 seconds, AI metadata generation takes 10-30 seconds, and YouTube upload takes 1-3 minutes.</p>
                    </div>
                </div>

                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>Can I customize the metadata before upload?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>Currently, metadata is automatically generated and applied. We're working on adding an editor feature where you can review and modify AI-generated metadata before the upload completes.</p>
                    </div>
                </div>

                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>What video privacy settings are used?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>By default, videos are uploaded as "Public". We're adding support for custom privacy settings (Private, Unlisted, Public) in an upcoming update.</p>
                    </div>
                </div>

                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>Are there any upload limits?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>Upload limits depend on YouTube API quotas. Standard quota allows approximately 6-10 uploads per day. For higher limits, you can request quota increase from Google Cloud Console.</p>
                    </div>
                </div>

                <div class="faq-item glass-card">
                    <div class="faq-question">
                        <i class="fas fa-question-circle"></i>
                        <h3>What happens if upload fails?</h3>
                        <i class="fas fa-chevron-down faq-toggle"></i>
                    </div>
                    <div class="faq-answer">
                        <p>If an upload fails, you'll receive a detailed error message. Common issues include expired Instagram session, YouTube quota limits, or network problems. You can retry the upload after resolving the issue.</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- CTA Section -->
        <section class="cta-section glass-card fade-in-delay-3 text-center">
            <i class="fas fa-rocket cta-icon"></i>
            <h2>Ready to Automate Your Uploads?</h2>
            <p>Start uploading to YouTube with AI-powered automation today</p>
            <div class="cta-buttons">
                <button class="btn btn-primary btn-large" onclick="document.getElementById('authSection').scrollIntoView({ behavior: 'smooth' })">
                    <i class="fas fa-play"></i> Get Started Now
                </button>
                <a href="/metadata-generator" class="btn btn-preview btn-large">
                    <i class="fas fa-brain"></i> Try Metadata First
                </a>
            </div>
            <p class="cta-note">No credit card required • Free to use</p>
        </section>
    </div>

    <!-- Loading Overlay -->
    <div id="loadingOverlay" class="loading-overlay" style="display: none;">
        <div class="loading-spinner"></div>
        <p>Processing...</p>
    </div>

    <!-- Toast Notification -->
    <div id="toast" class="toast"></div>

    <script>

        // Mobile menu toggle

        const mobileMenuToggle = document.getElementById('mobileMenuToggle');

        const mobileMenu = document.getElementById('mobileMenu');

        

        if (mobileMenuToggle) {

            mobileMenuToggle.addEventListener('click', () => {

                mobileMenu.classList.toggle('active');

            });

        }

        

        // Close mobile menu when clicking outside

        document.addEventListener('click', (e) => {

            if (mobileMenu && 

                mobileMenu.classList.contains('active') &&

                !mobileMenu.contains(e.target) &&

                !mobileMenuToggle.contains(e.target)) {

                mobileMenu.classList.remove('active');

            }

        });

        

        // FAQ Accordion

        document.querySelectorAll('.faq-question').forEach(question => {

            question.addEventListener('click', () => {

                const faqItem = question.parentElement;

                const isActive = faqItem.classList.contains('active');

                

                document.querySelectorAll('.faq-item').forEach(item => {

                    item.classList.remove('active');

                });

                

                if (!isActive) {

                    faqItem.classList.add('active');

                }

            });

        });



        // Video Editing Toggle

        const enableEditingToggle = document.getElementById('enableEditingToggle');

        const editingOptions = document.getElementById('editingOptions');

        

        if (enableEditingToggle) {

            enableEditingToggle.addEventListener('change', () => {

                editingOptions.style.display = enableEditingToggle.checked ? 'block' : 'none';

            });

        }



        // Music Volume Slider

        const musicVolume = document.getElementById('musicVolume');

        const volumeValue = document.getElementById('volumeValue');

        

        if (musicVolume && volumeValue) {

            musicVolume.addEventListener('input', () => {

                volumeValue.textContent = musicVolume.value + '%';

            });

        }



        // Text Overlay Management

        let overlayCount = 0;

        const textOverlaysContainer = document.getElementById('textOverlaysContainer');

        const addTextOverlayBtn = document.getElementById('addTextOverlay');



        if (addTextOverlayBtn) {

            addTextOverlayBtn.addEventListener('click', () => {

                overlayCount++;

                const overlayId = `overlay-${overlayCount}`;

                

                const overlayDiv = document.createElement('div');

                overlayDiv.className = 'text-overlay-item';

                overlayDiv.id = overlayId;

                overlayDiv.innerHTML = `

                    <div style="background: rgba(255, 255, 255, 0.02); padding: 15px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--border);">

                        <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">

                            <span style="font-weight: 600; font-size: 14px;">Text Overlay #${overlayCount}</span>

                            <button type="button" class="remove-overlay-btn" data-overlay-id="${overlayId}" 

                                    style="background: rgba(255, 23, 68, 0.15); border: none; color: var(--error); 

                                           padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px;">

                                <i class="fas fa-times"></i> Remove

                            </button>

                        </div>

                        <input type="text" class="glass-input overlay-text" placeholder="Enter text..." 

                               style="width: 100%; margin-bottom: 10px; padding: 10px; font-size: 14px;">

                        <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">

                            <select class="glass-input overlay-position" style="padding: 10px; font-size: 14px;">

                                <option value="top">Top</option>

                                <option value="bottom">Bottom</option>

                                <option value="center">Center</option>

                            </select>

                            <input type="number" class="glass-input overlay-duration" placeholder="Duration (sec)" 

                                   value="5" min="1" max="60" style="padding: 10px; font-size: 14px;">

                        </div>

                    </div>

                `;

                

                textOverlaysContainer.appendChild(overlayDiv);

                

                // Add remove handler

                const removeBtn = overlayDiv.querySelector('.remove-overlay-btn');

                removeBtn.addEventListener('click', () => {

                    overlayDiv.remove();

                });

            });

        }



        // Music Source Tabs

        const musicTabUrl = document.getElementById('musicTabUrl');

        const musicTabFile = document.getElementById('musicTabFile');

        const musicUrlSection = document.getElementById('musicUrlSection');

        const musicFileSection = document.getElementById('musicFileSection');



        if (musicTabUrl && musicTabFile) {

            musicTabUrl.addEventListener('click', () => {

                musicTabUrl.classList.add('active');

                musicTabFile.classList.remove('active');

                musicUrlSection.style.display = 'block';

                musicFileSection.style.display = 'none';

            });



            musicTabFile.addEventListener('click', () => {

                musicTabFile.classList.add('active');

                musicTabUrl.classList.remove('active');

                musicUrlSection.style.display = 'none';

                musicFileSection.style.display = 'block';

            });

        }



        // Music File Input

        const musicFileInput = document.getElementById('musicFileInput');

        const musicFileName = document.getElementById('musicFileName');



        if (musicFileInput) {

            musicFileInput.addEventListener('change', (event) => {

                const file = event.target.files[0];

                if (file) {

                    musicFileName.value = file.name;

                } else {

                    musicFileName.value = '';

                }

            });

        }

    </script>
    <script src="{{ url_for('static', filename='js/uploader.js') }}"></script>
</body>
</html>