{% extends "base.html" %}

{% block title %}TTSFM - Free Text-to-Speech for Python{% endblock %}

{% block content %}
<!-- Hero Section -->
<section class="hero-section">
    <div class="container">
        <div class="row align-items-center min-vh-75">
            <div class="col-lg-8 mx-auto text-center">
                <div class="hero-content">
                    <div class="badge bg-primary text-white mb-3 px-3 py-2">
                        <i class="fas fa-code me-2"></i>Python Package
                    </div>
                    <h1 class="display-4 fw-bold mb-4">
                        Free Text-to-Speech for Python
                    </h1>
                    <p class="lead mb-4">
                        Generate high-quality speech from text using the free openai.fm service.
                        No API keys, no registration - just install and start creating audio.
                    </p>
                    <div class="d-flex flex-wrap gap-3 justify-content-center">
                        <a href="{{ url_for('playground') }}" class="btn btn-primary btn-lg">
                            <i class="fas fa-play me-2"></i>Try Demo
                        </a>
                        <a href="{{ url_for('docs') }}" class="btn btn-outline-secondary btn-lg">
                            <i class="fas fa-book me-2"></i>Documentation
                        </a>
                        <a href="https://github.com/dbccccccc/ttsfm" class="btn btn-outline-secondary btn-lg" target="_blank" rel="noopener noreferrer">
                            <i class="fab fa-github me-2"></i>GitHub
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Features Section -->
<section class="py-5" style="background-color: #f8fafc;">
    <div class="container">
        <div class="row">
            <div class="col-12 text-center mb-5">
                <h2 class="fw-bold mb-4">Key Features</h2>
                <p class="lead text-muted">
                    Simple, free, and powerful text-to-speech for Python developers.
                </p>
            </div>
        </div>

        <div class="row g-4">
            <div class="col-lg-3">
                <div class="text-center">
                    <div class="feature-icon text-white rounded-circle d-inline-flex align-items-center justify-content-center mb-3" style="width: 4rem; height: 4rem; background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);">
                        <i class="fas fa-key"></i>
                    </div>
                    <h5 class="fw-bold">No API Keys</h5>
                    <p class="text-muted">Completely free service with no registration or API keys required. Start using immediately.</p>
                </div>
            </div>

            <div class="col-lg-3">
                <div class="text-center">
                    <div class="feature-icon text-white rounded-circle d-inline-flex align-items-center justify-content-center mb-3" style="width: 4rem; height: 4rem; background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);">
                        <i class="fas fa-magic"></i>
                    </div>
                    <h5 class="fw-bold">Auto-Combine <span class="badge bg-success ms-1">v3.2.3</span></h5>
                    <p class="text-muted">Intelligent auto-combine with streamlined interface. Automatically handles long text for seamless audio generation.</p>
                </div>
            </div>

            <div class="col-lg-3">
                <div class="text-center">
                    <div class="feature-icon text-white rounded-circle d-inline-flex align-items-center justify-content-center mb-3" style="width: 4rem; height: 4rem; background: linear-gradient(135deg, #059669 0%, #10b981 100%);">
                        <i class="fas fa-bolt"></i>
                    </div>
                    <h5 class="fw-bold">Easy to Use</h5>
                    <p class="text-muted">Simple Python API with both sync and async support. Perfect for any project size.</p>
                </div>
            </div>

            <div class="col-lg-3">
                <div class="text-center">
                    <div class="feature-icon text-white rounded-circle d-inline-flex align-items-center justify-content-center mb-3" style="width: 4rem; height: 4rem; background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);">
                        <i class="fas fa-microphone-alt"></i>
                    </div>
                    <h5 class="fw-bold">11 Voices & 6 Formats</h5>
                    <p class="text-muted">Choose from 11 different voices and 6 audio formats (MP3, WAV, OPUS, AAC, FLAC, PCM).</p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Quick Start Section -->
<section class="py-5">
    <div class="container">
        <div class="row">
            <div class="col-12 text-center mb-5">
                <h2 class="fw-bold mb-4">Getting Started</h2>
                <p class="lead text-muted">
                    Install TTSFM and start generating speech with just a few lines of code.
                </p>
            </div>
        </div>

        <div class="row g-4">
            <div class="col-lg-6">
                <div class="card h-100">
                    <div class="card-body">
                        <h5 class="card-title">
                            <i class="fas fa-download me-2 text-primary"></i>Installation
                        </h5>
                        <pre class="bg-light p-3 rounded"><code>pip install ttsfm</code></pre>
                        <small class="text-muted">Requires Python 3.8+</small>
                    </div>
                </div>
            </div>

            <div class="col-lg-6">
                <div class="card h-100">
                    <div class="card-body">
                        <h5 class="card-title">
                            <i class="fas fa-play me-2 text-success"></i>Basic Usage
                        </h5>
                        <pre class="bg-light p-3 rounded"><code>from ttsfm import TTSClient, Voice, AudioFormat

client = TTSClient()
response = client.generate_speech(
    text="Hello, world!",
    voice=Voice.ALLOY,
    response_format=AudioFormat.MP3
)
response.save_to_file("hello")</code></pre>
                        <small class="text-muted">No API keys required</small>
                    </div>
                </div>
            </div>
        </div>

        <div class="row mt-4">
            <div class="col-12 text-center">
                <div class="d-flex justify-content-center gap-3 flex-wrap">
                    <a href="{{ url_for('playground') }}" class="btn btn-primary">
                        <i class="fas fa-play me-2"></i>Try Demo
                    </a>
                    <a href="{{ url_for('docs') }}" class="btn btn-outline-primary">
                        <i class="fas fa-book me-2"></i>Documentation
                    </a>
                </div>
            </div>
        </div>
    </div>
</section>


{% endblock %}
