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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
<!-- <!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <title>AI Interview Simulator</title>

</head>

<body>

  <h1>Upload Your Resume</h1>

  <form id="upload-form" enctype="multipart/form-data">

    <input type="file" name="resume" accept=".pdf" required />

    <button type="submit">Generate Questions</button>

  </form>



  <h2>Generated Questions:</h2>

  <ul id="question-list"></ul>



  <script>

    const form = document.getElementById("upload-form");

    const questionList = document.getElementById("question-list");



    form.addEventListener("submit", async (e) => {

      e.preventDefault();

      const formData = new FormData(form);

      const response = await fetch("/upload-resume", {

        method: "POST",

        body: formData

      });

      const questions = await response.json();

      questionList.innerHTML = "";

      questions.forEach(q => {

        const li = document.createElement("li");

        li.textContent = q;

        questionList.appendChild(li);

      });

    });

  </script>

</body>

</html> -->


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>AI Interview Simulator</title>
  <style>

    :root {

      --primary: #4f46e5;

      --primary-dark: #4338ca; 

      --secondary: #f3f4f6;

      --text: #1f2937;

      --light-text: #6b7280;

      --accent: #fef3c7;

      --border: #e5e7eb;

      --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    }

    

    * {

      margin: 0;

      padding: 0;

      box-sizing: border-box;

      font-family: 'Inter', system-ui, -apple-system, sans-serif;

    }

    

    body {

      background-color: #f9fafb;

      color: var(--text);

      line-height: 1.5;

    }

    

    .container {

      max-width: 800px;

      margin: 0 auto;

      padding: 2rem 1rem;

    }

    

    header {

      text-align: center;

      margin-bottom: 3rem;

    }

    

    h1 {

      color: var(--primary);

      font-size: 2.5rem;

      margin-bottom: 1rem;

    }

    

    .tagline {

      color: var(--light-text);

      font-size: 1.2rem;

      max-width: 600px;

      margin: 0 auto;

    }

    

    .card {

      background-color: white;

      border-radius: 12px;

      box-shadow: var(--shadow);

      padding: 2rem;

      margin-bottom: 2rem;

    }

    

    .card-title {

      color: var(--text);

      font-size: 1.5rem;

      margin-bottom: 1.5rem;

      display: flex;

      align-items: center;

      gap: 10px;

    }

    

    .icon {

      background-color: var(--accent);

      width: 40px;

      height: 40px;

      border-radius: 50%;

      display: flex;

      align-items: center;

      justify-content: center;

      font-weight: bold;

      color: var(--primary);

    }

    

    .upload-area {

      border: 2px dashed var(--border);

      border-radius: 8px;

      padding: 2rem;

      text-align: center;

      transition: all 0.3s;

      cursor: pointer;

      position: relative;

      margin-bottom: 1.5rem;

    }

    

    .upload-area:hover {

      border-color: var(--primary);

      background-color: rgba(79, 70, 229, 0.03);

    }

    

    .upload-area p {

      color: var(--light-text);

      margin: 1rem 0;

    }

    

    .file-input {

      position: absolute;

      width: 100%;

      height: 100%;

      top: 0;

      left: 0;

      opacity: 0;

      cursor: pointer;

    }

    

    .button {

      background-color: var(--primary);

      color: white;

      border: none;

      border-radius: 8px;

      padding: 12px 24px;

      font-size: 1rem;

      font-weight: 600;

      cursor: pointer;

      transition: all 0.2s;

      display: inline-flex;

      align-items: center;

      justify-content: center;

      gap: 8px;

    }

    

    .button:hover {

      background-color: var(--primary-dark);

      transform: translateY(-1px);

    }

    

    .file-name {

      background-color: var(--secondary);

      padding: 8px 16px;

      border-radius: 6px;

      display: none;

      align-items: center;

      justify-content: space-between;

      margin-bottom: 1.5rem;

    }

    

    .file-name.active {

      display: flex;

    }

    

    .remove-file {

      background: none;

      border: none;

      color: var(--light-text);

      cursor: pointer;

      font-size: 1.2rem;

    }

    

    .question-list {

      list-style-type: none;

    }

    

    .question-item {

      padding: 16px;

      border-radius: 8px;

      background-color: var(--secondary);

      margin-bottom: 12px;

      animation: fadeIn 0.5s ease-in-out;

    }

    

    .question-number {

      font-weight: 600;

      color: var(--primary);

      margin-right: 8px;

    }

    

    .loading {

      display: none;

      align-items: center;

      justify-content: center;

      gap: 12px;

      margin: 2rem 0;

    }

    

    .loading.active {

      display: flex;

    }

    

    .spinner {

      width: 24px;

      height: 24px;

      border: 3px solid rgba(79, 70, 229, 0.3);

      border-radius: 50%;

      border-top-color: var(--primary);

      animation: spin 1s linear infinite;

    }

    

    .no-questions {

      text-align: center;

      color: var(--light-text);

      padding: 2rem;

    }

    

    @keyframes fadeIn {

      from { opacity: 0; transform: translateY(10px); }

      to { opacity: 1; transform: translateY(0); }

    }

    

    @keyframes spin {

      to { transform: rotate(360deg); }

    }

    

    @media (max-width: 640px) {

      .container {

        padding: 1rem;

      }

      

      h1 {

        font-size: 2rem;

      }

      

      .card {

        padding: 1.5rem;

      }

    }

  </style>
</head>
<body>
  <div class="container">
    <header>
      <h1>AI Interview Simulator</h1>
      <p class="tagline">Upload your resume and receive tailored interview questions to help you prepare for your next job interview</p>
    </header>
    
    <div class="card">
      <h2 class="card-title">
        <span class="icon">1</span>
        Upload Your Resume
      </h2>
      
      <form id="upload-form" enctype="multipart/form-data">
        <div class="upload-area" id="drop-area">
          <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-upload" style="color: var(--primary);">
            <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
            <polyline points="17 8 12 3 7 8"></polyline>
            <line x1="12" y1="3" x2="12" y2="15"></line>
          </svg>
          
          <p>Drag and drop your resume, or click to browse</p>
          <p style="font-size: 0.9rem;">Supported format: PDF</p>
          
          <input type="file" name="resume" accept=".pdf" required class="file-input" id="file-input" />
        </div>
        
        <div class="file-name" id="file-display">
          <span id="file-name">document.pdf</span>
          <button type="button" class="remove-file" id="remove-file">×</button>
        </div>
        
        <button type="submit" class="button" id="generate-btn">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
            <circle cx="12" cy="12" r="10"></circle>
            <polygon points="10 8 16 12 10 16 10 8"></polygon>
          </svg>
          Generate Interview Questions
        </button>
      </form>
    </div>
    
    <div class="loading" id="loading">
      <div class="spinner"></div>
      <span>Analyzing your resume...</span>
    </div>
    
    <div class="card" id="questions-card" style="display: none;">
      <h2 class="card-title">
        <span class="icon">2</span>
        Your Interview Questions
      </h2>
      
      <div id="questions-container">
        <ul class="question-list" id="question-list"></ul>
        <div class="no-questions" id="no-questions">
          Upload your resume to see personalized interview questions
        </div>
      </div>
    </div>
  </div>
  
  <script>

    const form = document.getElementById("upload-form");

    const fileInput = document.getElementById("file-input");

    const fileDisplay = document.getElementById("file-display");

    const fileName = document.getElementById("file-name");

    const removeFile = document.getElementById("remove-file");

    const questionList = document.getElementById("question-list");

    const questionsCard = document.getElementById("questions-card");

    const noQuestions = document.getElementById("no-questions");

    const loading = document.getElementById("loading");

    

    // File input handling

    fileInput.addEventListener("change", (e) => {

      if (fileInput.files.length > 0) {

        fileName.textContent = fileInput.files[0].name;

        fileDisplay.classList.add("active");

      }

    });

    

    removeFile.addEventListener("click", () => {

      fileInput.value = "";

      fileDisplay.classList.remove("active");

    });

    

    // Form submission

    form.addEventListener("submit", async (e) => {

      e.preventDefault();

      

      if (fileInput.files.length === 0) {

        alert("Please select a resume file first");

        return;

      }

      

      loading.classList.add("active");

      

      try {

        const formData = new FormData(form);

        

        // Simulate API call with timeout

        setTimeout(async () => {

          // In a real application, this would be an actual API call

          // const response = await fetch("/upload-resume", {

          //   method: "POST",

          //   body: formData

          // });

          // const questions = await response.json();

          

          // Sample questions for demonstration

          const questions = [

            "Tell me about your experience with front-end development frameworks mentioned in your resume.",

            "Can you explain a challenging project you worked on and how you approached it?",

            "How do you stay updated with the latest technologies in your field?",

            "What made you interested in applying for this position?",

            "Describe a situation where you had to learn a new technology quickly. How did you approach it?",

            "How do you handle tight deadlines and pressure?",

            "Can you elaborate on your experience with team collaboration tools?",

            "What is your process for debugging complex issues in your code?"

          ];

          

          // Display questions

          questionList.innerHTML = "";

          questions.forEach((q, index) => {

            const li = document.createElement("li");

            li.className = "question-item";

            li.innerHTML = `<span class="question-number">Q${index + 1}:</span> ${q}`;

            questionList.appendChild(li);

          });

          

          loading.classList.remove("active");

          questionsCard.style.display = "block";

          noQuestions.style.display = "none";

        }, 2000); // Simulate loading delay

        

      } catch (error) {

        console.error("Error:", error);

        loading.classList.remove("active");

        alert("There was an error processing your request. Please try again.");

      }

    });

  </script>
</body>
</html>