{% extends "base.html.j2" %}

{% block title %}{{ t.index_title | default('Início') }}{% endblock %}

{% block extra_styles %}
        .hero {
            text-align: center;
            padding: 3rem 1.5rem;
            background: var(--td-color-primary);
            color: white;
            border-radius: var(--td-radius);
            margin-bottom: 3rem;
            position: relative;
            overflow: hidden;
        }
        {% if theme.hero_image %}
        .hero {
            background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
                        url('{{ base_path | default('') }}{{ theme.hero_image }}') center/cover no-repeat;
            padding: 4rem 1.5rem;
        }
        {% endif %}
        .hero h1 {
            color: white;
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
            position: relative;
        }
        .hero p {
            font-size: 1.2rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
            position: relative;
        }
        .platforms {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 3rem;
        }
        .platform-card {
            background: var(--td-color-surface);
            border-radius: var(--td-radius);
            padding: 1.75rem;
            border: 1px solid var(--td-color-border);
            text-decoration: none;
            color: inherit;
            display: flex;
            flex-direction: column;
        }
        .platform-card:hover {
            border-color: var(--td-color-accent);
            transform: translateY(-2px);
        }
        .platform-card h2 {
            margin: 0 0 0.5rem 0;
            color: var(--td-color-primary);
            font-size: 1.4rem;
        }
        .platform-card .card-desc {
            margin: 0 0 1rem 0;
            color: var(--td-color-text-secondary);
            flex: 1;
        }
        .platform-card .card-footer {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            margin-top: auto;
            padding-top: 0.75rem;
            border-top: 1px solid var(--td-color-border-light);
        }
        .platform-card .card-count {
            font-size: 0.9rem;
            color: var(--td-color-text-muted);
        }
        .platform-card .card-count strong {
            font-size: 1.1rem;
            color: var(--td-color-accent);
        }
        .platform-card .card-cta {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--td-color-accent);
        }
        .about {
            background: var(--td-color-surface);
            border-radius: var(--td-radius);
            padding: 2rem;
            border: 1px solid var(--td-color-border);
        }
        .about h2 {
            margin-top: 0;
            color: var(--td-color-primary);
        }
{% endblock %}

{% block content %}
    <div class="hero">
        <h1>{{ t.index_hero_title | default(site.title) }}</h1>
        <p>{{ t.index_hero_subtitle | default(site.tagline) }}</p>
    </div>

    <div class="platforms">
        {% for mod in modules %}
        <a href="{{ mod.slug }}.html" class="platform-card">
            <h2>{{ t['card_' + mod.slug + '_title'] | default(mod.name) }}</h2>
            <p class="card-desc">{{ t['card_' + mod.slug + '_desc'] | default('') }}</p>
            <div class="card-footer">
                <span class="card-count"><strong>{{ data[0][mod.slug + '_count'] }}</strong> {{ t['card_' + mod.slug + '_label'] | default('') }}</span>
                <span class="card-cta">{{ t.card_cta | default('Explorar') }} &rarr;</span>
            </div>
        </a>
        {% endfor %}
    </div>

    <div class="about">
        <h2>{{ t.index_about_title | default('Sobre o Projeto') }}</h2>
        <p>{{ t.index_about_p1 | default('') }}</p>
        <p>{{ t.index_about_p2 | default('') }}</p>
    </div>
{% endblock %}
