<%- include('partials/header') %>

<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card shadow-lg border-0">
                <div class="card-header bg-primary text-white">
                    <h3 class="mb-0"><i class="fas fa-upload me-2"></i>Upload Your Notes</h3>
                </div>
                <div class="card-body p-5">
                    <p class="text-muted mb-4">Upload your study notes and let our AI help you create better, more comprehensive study materials.</p>
                    
                    <div id="upload-area" class="border-2 border-dashed border-primary rounded p-5 text-center mb-4 upload-dropzone">
                        <i class="fas fa-cloud-upload-alt fa-3x text-primary mb-3"></i>
                        <h5>Drag & Drop your files here</h5>
                        <p class="text-muted">or click to browse</p>
                        <input type="file" id="noteFile" name="noteFile" class="d-none" accept=".pdf,.doc,.docx,.txt,.jpg,.jpeg,.png,.gif">
                        <button type="button" class="btn btn-primary" onclick="document.getElementById('noteFile').click()">
                            <i class="fas fa-folder-open me-2"></i>Choose File
                        </button>
                    </div>

                    <div id="file-info" class="d-none mb-4">
                        <div class="alert alert-info">
                            <i class="fas fa-file me-2"></i>
                            <span id="file-name"></span>
                            <span id="file-size" class="text-muted ms-2"></span>
                        </div>
                    </div>

                    <div class="d-grid gap-2">
                        <button type="button" id="upload-btn" class="btn btn-success btn-lg" disabled>
                            <i class="fas fa-upload me-2"></i>Upload & Process
                        </button>
                    </div>

                    <div id="upload-progress" class="mt-4 d-none">
                        <div class="progress">
                            <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%"></div>
                        </div>
                        <p class="text-center mt-2 mb-0">Processing your notes...</p>
                    </div>

                    <div id="upload-result" class="mt-4"></div>
                </div>
            </div>

            <div class="row mt-5">
                <div class="col-md-4">
                    <div class="text-center">
                        <i class="fas fa-file-pdf fa-2x text-danger mb-2"></i>
                        <h6>PDF Files</h6>
                        <p class="text-muted small">Upload PDF documents</p>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="text-center">
                        <i class="fas fa-file-word fa-2x text-primary mb-2"></i>
                        <h6>Word Documents</h6>
                        <p class="text-muted small">DOC & DOCX files</p>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="text-center">
                        <i class="fas fa-file-alt fa-2x text-success mb-2"></i>
                        <h6>Text Files</h6>
                        <p class="text-muted small">Plain text documents</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%- include('partials/footer') %>
