<!--
|--------------------------------------------------------------------------
| DevExportTab.vue — Exportar banco → .md (stub read-only por ora)
|--------------------------------------------------------------------------
-->
<script setup>
import { useToast } from 'primevue/usetoast';

const toast = useToast();

function notImplemented() {
    toast.add({
        severity: 'info',
        summary: 'Pendente — Parte C',
        detail: 'Geração de .md a partir do banco será implementada na próxima etapa.',
        life: 4000
    });
}
</script>

<template>
    <div class="export-tab">
        <div class="notice">
            <i class="pi pi-info-circle" />
            <div>
                <strong>Área de exportação — pendente na Parte C</strong>
                <p>
                    Nesta aba você vai poder regenerar os arquivos <code>.md</code> em <code>development/</code> a partir dos dados do banco (banco vira source-of-truth, arquivo vira artefato versionável).
                </p>
                <p class="text-[var(--text-color-secondary)]" style="margin-top: 6px">
                    Detalhes do que falta estão em <code>development/PENDENTE.md</code>.
                </p>
            </div>
        </div>

        <div class="export-grid">
            <article class="export-card">
                <div class="export-icon">
                    <i class="pi pi-flag" />
                </div>
                <div class="export-body">
                    <h3>ROADMAP.md</h3>
                    <p>Regenera o arquivo roadmap a partir de <code>dev_roadmap_phases</code> + <code>dev_roadmap_items</code>.</p>
                </div>
                <button class="export-btn" disabled @click="notImplemented">
                    <i class="pi pi-download" /> Gerar (Parte C)
                </button>
            </article>

            <article class="export-card">
                <div class="export-icon">
                    <i class="pi pi-verified" />
                </div>
                <div class="export-body">
                    <h3>AUDITORIA.md</h3>
                    <p>Regenera a auditoria técnica a partir de <code>dev_auditoria_items</code>.</p>
                </div>
                <button class="export-btn" disabled @click="notImplemented">
                    <i class="pi pi-download" /> Gerar (Parte C)
                </button>
            </article>

            <article class="export-card">
                <div class="export-icon">
                    <i class="pi pi-globe" />
                </div>
                <div class="export-body">
                    <h3>concorrentes.md</h3>
                    <p>Regenera o benchmark a partir de <code>dev_competitors</code> + <code>dev_competitor_features</code> + <code>dev_comparison_matrix</code>.</p>
                </div>
                <button class="export-btn" disabled @click="notImplemented">
                    <i class="pi pi-download" /> Gerar (Parte C)
                </button>
            </article>

            <article class="export-card">
                <div class="export-icon">
                    <i class="pi pi-sitemap" />
                </div>
                <div class="export-body">
                    <h3>ESTRUTURA.md</h3>
                    <p>Regenera o snapshot da estrutura — hoje é estático, futuro será derivado do menu + banco.</p>
                </div>
                <button class="export-btn" disabled @click="notImplemented">
                    <i class="pi pi-download" /> Gerar (Parte C)
                </button>
            </article>
        </div>
    </div>
</template>

<style scoped>
.export-tab { display: flex; flex-direction: column; gap: 16px; }

.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: color-mix(in srgb, #f59e0b 8%, transparent);
    border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-color);
}
.notice i { color: #f59e0b; font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notice strong { color: #d97706; display: block; margin-bottom: 6px; }
.notice p { line-height: 1.5; margin: 0; }
.notice code { font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 3px; }

.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.export-card {
    background: var(--surface-card, #fff);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
    font-size: 16px;
}

.export-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 4px;
    font-family: 'IBM Plex Mono', monospace;
}
.export-body p {
    font-size: 11px;
    color: var(--text-color-secondary);
    line-height: 1.5;
    margin: 0;
}
.export-body code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
    padding: 1px 5px;
    border-radius: 3px;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.export-btn:disabled {
    background: var(--surface-border);
    color: var(--text-color-secondary);
    cursor: not-allowed;
}
</style>
