<template>
  <div class="min-h-full py-16 bg-gray-50">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
      <h1 class="text-4xl sm:text-5xl font-display font-bold text-gray-900 mb-6">
        Content Management System
      </h1>
      <div class="w-24 h-1 bg-primary-600 mb-8" />

      <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
        <!-- Interne News -->
        <NuxtLink
          to="/mitgliederbereich/news"
          class="bg-white p-6 rounded-xl shadow-lg border border-gray-100 hover:shadow-xl transition-all group"
        >
          <div class="flex items-center mb-4">
            <div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center group-hover:bg-blue-600 transition-colors">
              <Newspaper :size="24" class="text-blue-600 group-hover:text-white" />
            </div>
            <h2 class="ml-4 text-xl font-semibold text-gray-900">Interne News</h2>
          </div>
          <p class="text-gray-600">
            News für Mitglieder erstellen und verwalten
          </p>
        </NuxtLink>

        <!-- Termine -->
        <NuxtLink
          to="/cms/termine"
          class="bg-white p-6 rounded-xl shadow-lg border border-gray-100 hover:shadow-xl transition-all group"
        >
          <div class="flex items-center mb-4">
            <div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center group-hover:bg-green-600 transition-colors">
              <Calendar :size="24" class="text-green-600 group-hover:text-white" />
            </div>
            <h2 class="ml-4 text-xl font-semibold text-gray-900">Termine</h2>
          </div>
          <p class="text-gray-600">
            Vereinstermine erstellen und verwalten
          </p>
        </NuxtLink>

        <!-- Mitglieder -->
        <NuxtLink
          to="/mitgliederbereich/mitglieder"
          class="bg-white p-6 rounded-xl shadow-lg border border-gray-100 hover:shadow-xl transition-all group"
        >
          <div class="flex items-center mb-4">
            <div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center group-hover:bg-purple-600 transition-colors">
              <Users :size="24" class="text-purple-600 group-hover:text-white" />
            </div>
            <h2 class="ml-4 text-xl font-semibold text-gray-900">Mitglieder</h2>
          </div>
          <p class="text-gray-600">
            Mitgliederliste bearbeiten
          </p>
        </NuxtLink>

        <!-- Einstellungen -->
        <NuxtLink
          to="/cms/einstellungen"
          class="bg-white p-6 rounded-xl shadow-lg border border-gray-100 hover:shadow-xl transition-all group"
        >
          <div class="flex items-center mb-4">
            <div class="w-12 h-12 bg-orange-100 rounded-lg flex items-center justify-center group-hover:bg-orange-600 transition-colors">
              <Settings :size="24" class="text-orange-600 group-hover:text-white" />
            </div>
            <h2 class="ml-4 text-xl font-semibold text-gray-900">Einstellungen</h2>
          </div>
          <p class="text-gray-600">
            Training, Trainer, Mitgliedschaft & Vorstand
          </p>
        </NuxtLink>

        <!-- Benutzerverwaltung (nur für Admin) -->
        <NuxtLink
          v-if="authStore.role === 'admin'"
          to="/cms/benutzer"
          class="bg-white p-6 rounded-xl shadow-lg border border-gray-100 hover:shadow-xl transition-all group"
        >
          <div class="flex items-center mb-4">
            <div class="w-12 h-12 bg-yellow-100 rounded-lg flex items-center justify-center group-hover:bg-yellow-600 transition-colors">
              <UserCog :size="24" class="text-yellow-600 group-hover:text-white" />
            </div>
            <h2 class="ml-4 text-xl font-semibold text-gray-900">Benutzerverwaltung</h2>
          </div>
          <p class="text-gray-600">
            Benutzer freischalten und verwalten
          </p>
        </NuxtLink>
      </div>
    </div>
  </div>
</template>

<script setup>
import { Newspaper, Calendar, Users, UserCog, Settings } from 'lucide-vue-next'

const authStore = useAuthStore()

definePageMeta({
  middleware: 'auth',
  layout: 'default'
})

useHead({
  title: 'CMS - Harheimer TC',
})
</script>
