{% extends "base.html" %}
{% block title %}Dashboard - LinkedIn Posts{% endblock %}

{% block content %}
<div class="mb-8">
    <h1 class="text-3xl font-bold text-white mb-2">Dashboard</h1>
    <p class="text-gray-400">Willkommen zum LinkedIn Post Creation System</p>
</div>

{% if error %}
<div class="bg-red-900/50 border border-red-500 text-red-200 px-4 py-3 rounded-lg mb-6">
    <strong>Error:</strong> {{ error }}
</div>
{% endif %}

<!-- Stats -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
    <div class="card-bg rounded-xl border p-6">
        <div class="flex items-center gap-4">
            <div class="w-12 h-12 bg-brand-highlight/20 rounded-lg flex items-center justify-center">
                <svg class="w-6 h-6 text-brand-highlight" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/></svg>
            </div>
            <div>
                <p class="text-gray-400 text-sm">Kunden</p>
                <p class="text-2xl font-bold text-white">{{ customers_count or 0 }}</p>
            </div>
        </div>
    </div>

    <div class="card-bg rounded-xl border p-6">
        <div class="flex items-center gap-4">
            <div class="w-12 h-12 bg-green-600/20 rounded-lg flex items-center justify-center">
                <svg class="w-6 h-6 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
            </div>
            <div>
                <p class="text-gray-400 text-sm">Generierte Posts</p>
                <p class="text-2xl font-bold text-white">{{ total_posts or 0 }}</p>
            </div>
        </div>
    </div>

    <div class="card-bg rounded-xl border p-6">
        <div class="flex items-center gap-4">
            <div class="w-12 h-12 bg-brand-highlight/20 rounded-lg flex items-center justify-center">
                <svg class="w-6 h-6 text-brand-highlight" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
            </div>
            <div>
                <p class="text-gray-400 text-sm">AI Agents</p>
                <p class="text-2xl font-bold text-white">5</p>
            </div>
        </div>
    </div>
</div>

<!-- Quick Actions -->
<div class="card-bg rounded-xl border p-6">
    <h2 class="text-xl font-semibold text-white mb-4">Schnellaktionen</h2>
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
        <a href="/customers/new" class="flex items-center gap-3 p-4 bg-brand-bg rounded-lg hover:bg-brand-bg-light transition-colors">
            <div class="w-10 h-10 btn-primary rounded-lg flex items-center justify-center">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/></svg>
            </div>
            <div>
                <p class="font-medium text-white">Neuer Kunde</p>
                <p class="text-sm text-gray-400">Setup starten</p>
            </div>
        </a>
        <a href="/research" class="flex items-center gap-3 p-4 bg-brand-bg rounded-lg hover:bg-brand-bg-light transition-colors">
            <div class="w-10 h-10 btn-primary rounded-lg flex items-center justify-center">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
            </div>
            <div>
                <p class="font-medium text-white">Research</p>
                <p class="text-sm text-gray-400">Topics finden</p>
            </div>
        </a>
        <a href="/create" class="flex items-center gap-3 p-4 bg-brand-bg rounded-lg hover:bg-brand-bg-light transition-colors">
            <div class="w-10 h-10 btn-primary rounded-lg flex items-center justify-center">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
            </div>
            <div>
                <p class="font-medium text-white">Post erstellen</p>
                <p class="text-sm text-gray-400">Content generieren</p>
            </div>
        </a>
        <a href="/posts" class="flex items-center gap-3 p-4 bg-brand-bg rounded-lg hover:bg-brand-bg-light transition-colors">
            <div class="w-10 h-10 btn-primary rounded-lg flex items-center justify-center">
                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/></svg>
            </div>
            <div>
                <p class="font-medium text-white">Alle Posts</p>
                <p class="text-sm text-gray-400">Übersicht anzeigen</p>
            </div>
        </a>
    </div>
</div>
{% endblock %}
