import { Link } from 'react-router-dom'
import { usePageMeta } from '../hooks/usePageMeta'

export default function TermsOfServicePage() {
  usePageMeta({
    title: 'Terms of Service | Grateful Journal',
    description: 'Terms of Service for Grateful Journal — a free, private gratitude journal app. Read about the rules and guidelines for using the service.',
    canonical: 'https://gratefuljournal.online/termsofservice',
    ogTitle: 'Terms of Service | Grateful Journal',
    ogDescription: 'Terms of Service for Grateful Journal — a free, private gratitude journal app. Read about the rules and guidelines for using the service.',
  })
  return (
    <div className="static-page">
      <header className="static-page__header">
        <Link to="/" className="static-page__logo">🌱 Grateful Journal</Link>
      </header>

      <main className="static-page__content">
        <h1>Terms of Service</h1>
        <p className="static-page__updated">Last updated: April 14, 2026</p>

        <p>
          By using Grateful Journal, you agree to these Terms of Service. Please read them carefully.
        </p>

        <h2>1. Use of the Service</h2>
        <p>
          Grateful Journal is a personal journaling app. You may use it for your own personal,
          non-commercial journaling purposes. You must be at least 13 years old to use the service.
        </p>

        <h2>2. Your Account</h2>
        <p>
          You are responsible for maintaining the security of your account. We use Google Sign-In for
          authentication. You agree to provide accurate information and to keep your account credentials
          confidential. Notify us immediately if you suspect unauthorized access to your account.
        </p>

        <h2>3. Your Content</h2>
        <p>
          You own all journal entries and content you create. We do not claim any ownership over your
          content. Your journal entries are end-to-end encrypted and inaccessible to us. App preferences
          such as your display name, profile photo, and background images are stored as plain account
          settings and are accessible to us at the database level. You are solely responsible for the
          content you store in the app, including any images you upload as backgrounds.
        </p>

        <h2>4. Prohibited Conduct</h2>
        <p>You agree not to:</p>
        <ul>
          <li>Use the service for any unlawful purpose or in violation of any applicable laws.</li>
          <li>Attempt to gain unauthorized access to any part of the service or its infrastructure.</li>
          <li>Reverse-engineer, decompile, or otherwise attempt to extract the source code of the app.</li>
          <li>Use the service to distribute malware or harmful code.</li>
          <li>Abuse or overload the service in a way that impairs its operation for other users.</li>
        </ul>

        <h2>5. Service Availability</h2>
        <p>
          We strive to keep Grateful Journal available at all times, but we do not guarantee
          uninterrupted access. We may perform maintenance, updates, or changes that temporarily
          affect availability. We are not liable for any downtime or data loss.
        </p>

        <h2>6. Account Termination</h2>
        <p>
          You may delete your account at any time from the Settings page. Deletion permanently removes
          your account and all associated data. We reserve the right to suspend or terminate accounts
          that violate these terms.
        </p>

        <h2>7. Disclaimer of Warranties</h2>
        <p>
          Grateful Journal is provided "as is" without warranties of any kind, express or implied.
          We do not warrant that the service will be error-free, secure, or continuously available.
          Use of the service is at your own risk.
        </p>

        <h2>8. Limitation of Liability</h2>
        <p>
          To the maximum extent permitted by law, Grateful Journal and its creators shall not be
          liable for any indirect, incidental, special, or consequential damages arising from your
          use of the service, including loss of data.
        </p>

        <h2>9. Changes to These Terms</h2>
        <p>
          We may update these Terms of Service from time to time. We will indicate the date of the
          last update at the top of this page. Continued use of the service after changes constitutes
          acceptance of the updated terms.
        </p>

        <h2>10. Contact</h2>
        <p>
          Questions about these terms? Reach us at the contact details on our <Link to="/about">About page</Link>.
        </p>
      </main>

      <footer className="static-page__footer">
        <Link to="/">← Back to Grateful Journal</Link>
        <span>·</span>
        <Link to="/privacy">Privacy Policy</Link>
        <span>·</span>
        <Link to="/about">About</Link>
      </footer>
    </div>
  )
}
