diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..db6fe2b
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,121 @@
+
+body {
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
+ background-color: #F9FAFB;
+ color: #111827;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: Georgia, 'Times New Roman', serif;
+ font-weight: 700;
+}
+
+.navbar {
+ background-color: #FFFFFF;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+}
+
+.navbar-brand {
+ font-family: Georgia, 'Times New Roman', serif;
+ font-weight: 700;
+ color: #4F46E5 !important;
+}
+
+.hero {
+ padding: 6rem 0;
+ background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(139, 92, 246, 0.05));
+}
+
+.hero h1 {
+ font-size: 3.5rem;
+ line-height: 1.2;
+}
+
+.hero .lead {
+ font-size: 1.25rem;
+ color: #4B5563;
+}
+
+.btn-primary {
+ background-color: #4F46E5;
+ border-color: #4F46E5;
+ padding: 0.75rem 1.5rem;
+ border-radius: 0.375rem;
+ font-weight: 600;
+ transition: background-color 0.2s ease-in-out;
+}
+
+.btn-primary:hover {
+ background-color: #4338CA;
+ border-color: #4338CA;
+}
+
+.btn-secondary {
+ background-color: transparent;
+ border-color: #4F46E5;
+ color: #4F46E5;
+ padding: 0.75rem 1.5rem;
+ border-radius: 0.375rem;
+ font-weight: 600;
+ transition: all 0.2s ease-in-out;
+}
+
+.btn-secondary:hover {
+ background-color: #4F46E5;
+ color: #FFFFFF;
+}
+
+.section {
+ padding: 5rem 0;
+}
+
+.feature-card {
+ background-color: #FFFFFF;
+ border: 1px solid #E5E7EB;
+ border-radius: 0.5rem;
+ padding: 2rem;
+ box-shadow: 0 4px 6px rgba(0,0,0,0.05);
+ transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
+ height: 100%;
+}
+
+.feature-card:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 10px 15px rgba(0,0,0,0.1);
+}
+
+.feature-card h3 {
+ color: #4F46E5;
+}
+
+.contact-section {
+ background-color: #FFFFFF;
+}
+
+.form-control:focus {
+ border-color: #8B5CF6;
+ box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25);
+}
+
+footer {
+ background-color: #111827;
+ color: #E5E7EB;
+ padding: 3rem 0;
+}
+
+footer a {
+ color: #9CA3AF;
+ text-decoration: none;
+ transition: color 0.2s ease-in-out;
+}
+
+footer a:hover {
+ color: #FFFFFF;
+}
+
+.toast-container {
+ position: fixed;
+ bottom: 1rem;
+ right: 1rem;
+ z-index: 1090;
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..e92657a
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,74 @@
+document.addEventListener('DOMContentLoaded', function () {
+ const contactForm = document.getElementById('contactForm');
+ if (contactForm) {
+ contactForm.addEventListener('submit', function (e) {
+ e.preventDefault();
+
+ const name = document.getElementById('name').value;
+ const email = document.getElementById('email').value;
+ const message = document.getElementById('message').value;
+ const submitButton = this.querySelector('button[type="submit"]');
+ const originalButtonText = submitButton.innerHTML;
+
+ // Basic validation
+ if (!name || !email || !message) {
+ showToast('Please fill out all fields.', 'danger');
+ return;
+ }
+
+ submitButton.innerHTML = ' Sending...';
+ submitButton.disabled = true;
+
+ const formData = new FormData(this);
+
+ fetch('contact_handler.php', {
+ method: 'POST',
+ body: formData
+ })
+ .then(response => response.json())
+ .then(data => {
+ if (data.success) {
+ showToast('Thank you! Your message has been sent.', 'success');
+ contactForm.reset();
+ } else {
+ showToast(data.error || 'An unknown error occurred.', 'danger');
+ }
+ })
+ .catch(error => {
+ showToast('An error occurred while sending the message.', 'danger');
+ console.error('Error:', error);
+ })
+ .finally(() => {
+ submitButton.innerHTML = originalButtonText;
+ submitButton.disabled = false;
+ });
+ });
+ }
+});
+
+function showToast(message, type = 'success') {
+ const toastContainer = document.getElementById('toast-container');
+ if (!toastContainer) return;
+
+ const toastId = 'toast-' + Date.now();
+ const toastHTML = `
+
+ `;
+
+ toastContainer.insertAdjacentHTML('beforeend', toastHTML);
+
+ const toastElement = document.getElementById(toastId);
+ const toast = new bootstrap.Toast(toastElement, { delay: 5000 });
+ toast.show();
+
+ toastElement.addEventListener('hidden.bs.toast', function () {
+ toastElement.remove();
+ });
+}
diff --git a/contact_handler.php b/contact_handler.php
new file mode 100644
index 0000000..d9d8e7d
--- /dev/null
+++ b/contact_handler.php
@@ -0,0 +1,70 @@
+ false, 'error' => 'An unknown error occurred.'];
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+ $response['error'] = 'Invalid request method.';
+ echo json_encode($response);
+ exit;
+}
+
+$name = trim($_POST['name'] ?? '');
+$email = trim($_POST['email'] ?? '');
+$message = trim($_POST['message'] ?? '');
+
+if (empty($name) || empty($email) || empty($message)) {
+ $response['error'] = 'Please fill out all fields.';
+ echo json_encode($response);
+ exit;
+}
+
+if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
+ $response['error'] = 'Invalid email format.';
+ echo json_encode($response);
+ exit;
+}
+
+try {
+ $pdo = db();
+
+ // Idempotent table creation
+ $pdo->exec("CREATE TABLE IF NOT EXISTS contact_submissions (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL,
+ email VARCHAR(255) NOT NULL,
+ message TEXT NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ );");
+
+ // Insert data
+ $stmt = $pdo->prepare("INSERT INTO contact_submissions (name, email, message) VALUES (?, ?, ?)");
+ $stmt->execute([$name, $email, $message]);
+
+ // Send email notification
+ $mailTo = getenv('MAIL_TO') ?: 'support@flatlogic.com'; // Fallback recipient
+ $subject = 'New Contact Form Submission from AI Web App Generator';
+ $mailResult = MailService::sendContactMessage($name, $email, $message, $mailTo, $subject);
+
+ if (!empty($mailResult['success'])) {
+ $response['success'] = true;
+ unset($response['error']);
+ } else {
+ // Still a success for the user, but log the mail error
+ $response['success'] = true;
+ $response['warning'] = 'Could not send notification email.';
+ error_log('MailService Error: ' . ($mailResult['error'] ?? 'Unknown mail error'));
+ }
+
+} catch (PDOException $e) {
+ error_log("Database Error: " . $e->getMessage());
+ $response['error'] = 'Database error. Please try again later.';
+} catch (Exception $e) {
+ error_log("General Error: " . $e->getMessage());
+ $response['error'] = 'A server error occurred. Please try again later.';
+}
+
+echo json_encode($response);
diff --git a/index.php b/index.php
index 7205f3d..f579519 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,143 @@
-
-
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ AI Web App Generator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
-
-
-
- Page updated: = htmlspecialchars($now) ?> (UTC)
-
+
+
+
+
+
+
+
+
+
Build Your Web App in Minutes, Not Months
+
Describe your vision. Our AI generates the full-stack code, from frontend to database. You own it all.
+
Start Building for Free
+
Explore Features
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The Future of Application Development
+
Go from idea to deployment at lightspeed.
+
+
+
+
+
+
AI-Powered Generation
+
Use plain text, voice commands, or even screenshots. Our AI understands your requirements and generates a complete application, including UI, logic, and database schema.
+
+
+
+
+
+
Visual Schema Builder
+
Design your data model with an intuitive drag-and-drop interface. Create tables, define fields, and establish relationships without writing a single line of SQL.
+
+
+
+
+
+
Full Source Code Ownership
+
Download the complete source code for your application. No vendor lock-in. Push it to your GitHub, customize it, and host it wherever you want. You have total control.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+