---
import Layout from '../layouts/Layout.astro';
---

<Layout>
  <section class="contact-section">
    <div class="container">
      <h1>聯絡我們</h1>
      <form id="contact-form">
        <div class="form-group">
          <label for="name">姓名</label>
          <input type="text" id="name" name="name" required />
        </div>
        <div class="form-group">
          <label for="email">電子郵件</label>
          <input type="email" id="email" name="email" required />
        </div>
        <div class="form-group">
          <label for="message">訊息</label>
          <textarea id="message" name="message" required></textarea>
        </div>
        <button type="submit">送出</button>
      </form>
      <div class="contact-info">
        <p>諮詢電話: 02 5570 0527</p>
        <p>電子郵件: <a href="mailto:enchuntaiwan@gmail.com">enchuntaiwan@gmail.com</a></p>
      </div>
    </div>
  </section>
</Layout>

<script>
  // Basic form handler - would integrate with Cloudflare Worker
  document.getElementById('contact-form')?.addEventListener('submit', async (e) => {
    e.preventDefault();
    // Submit to Cloudflare Worker
    alert('Form submitted (placeholder)');
  });
</script>

<style>
  .contact-section {
    padding: 40px 0;
  }
  .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
  }
  h1 {
    text-align: center;
    margin-bottom: 30px;
  }
  .form-group {
    margin-bottom: 20px;
  }
  label {
    display: block;
    margin-bottom: 5px;
  }
  input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  textarea {
    height: 150px;
  }
  button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
  }
  button:hover {
    background: #0056b3;
  }
  .contact-info {
    margin-top: 40px;
    text-align: center;
  }
</style>