@extends('admin.layouts.master')
@section('title', 'Dashboard')

@section('content')
<div class="max-w-7xl mx-auto space-y-8">

    {{-- Welcome Banner --}}
    <div class="bg-white rounded-[2rem] p-8 md:p-12 relative overflow-hidden shadow-[0_8px_30px_rgb(0,0,0,0.04)] border border-slate-100 flex flex-col md:flex-row items-center justify-between gap-8 group">
        {{-- Decorative background --}}
        <div class="absolute top-0 right-0 -translate-y-1/2 translate-x-1/3 w-[30rem] h-[30rem] bg-emerald-500/5 rounded-full blur-[80px] pointer-events-none group-hover:bg-emerald-500/10 transition-colors duration-700"></div>

        <div class="relative z-10 flex-1">
            <div class="flex items-center gap-2 mb-6">
                <span class="flex h-2.5 w-2.5 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.5)] animate-pulse"></span>
                <span class="text-[11px] font-black text-emerald-600 uppercase tracking-[0.2em] bg-emerald-50 px-3 py-1 rounded-full">Sistem Aktif</span>
            </div>
            <h2 class="text-3xl md:text-5xl font-black text-slate-900 mb-4 tracking-tight leading-tight">Selamat Datang,<br><span class="text-transparent bg-clip-text bg-gradient-to-r from-emerald-600 to-teal-500">{{ auth()->user()->name }} 👋</span></h2>
            <p class="text-slate-500 text-base md:text-lg max-w-xl leading-relaxed">Pusat kendali operasional Desa Sumbersari. Pantau metrik dan kelola konten dari satu tempat.</p>

            <div class="mt-8 flex flex-wrap gap-4">
                <a href="{{ route('admin.potensi.create') }}" class="bg-white text-slate-700 font-bold px-7 py-3.5 rounded-2xl border border-slate-200 hover:border-emerald-200 hover:bg-emerald-50 hover:text-emerald-700 transition-all duration-300 text-sm flex items-center gap-2.5 shadow-sm">
                    <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.5" d="M12 4v16m8-8H4"></path></svg>
                    Tambah Potensi
                </a>
            </div>
        </div>
        
        <div class="relative z-10 hidden lg:block">
            <div class="w-64 h-64 bg-slate-50 rounded-full border-[8px] border-white shadow-2xl flex items-center justify-center p-8 relative">
                <div class="absolute inset-0 border border-slate-100 rounded-full"></div>
                <img src="https://api.dicebear.com/7.x/shapes/svg?seed=Sumbersari&backgroundColor=10b981,0f172a" alt="Illustration" class="w-full h-full object-contain rounded-full opacity-80 mix-blend-multiply">
            </div>
        </div>
    </div>

    {{-- Stats Cards --}}
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-6">
        {{-- Potensi --}}
        <div class="bg-white p-7 rounded-[1.5rem] shadow-[0_2px_10px_rgb(0,0,0,0.02)] border border-slate-100 group hover:shadow-[0_8px_30px_rgb(0,0,0,0.06)] hover:-translate-y-1 hover:border-emerald-200 transition-all duration-300 relative overflow-hidden">
            <div class="absolute top-0 right-0 p-4 opacity-5 group-hover:opacity-10 transition-opacity">
                <svg class="w-20 h-20 text-emerald-600" fill="currentColor" viewBox="0 0 24 24"><path 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"></path></svg>
            </div>
            <div class="flex items-center justify-between mb-6 relative z-10">
                <div class="w-14 h-14 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center group-hover:scale-110 group-hover:bg-emerald-500 group-hover:text-white transition-all duration-300 shadow-sm">
                    <svg class="w-7 h-7" 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"></path></svg>
                </div>
                <a href="{{ route('admin.potensi.index') }}" class="w-8 h-8 rounded-full bg-slate-50 flex items-center justify-center text-slate-400 group-hover:bg-emerald-50 group-hover:text-emerald-600 transition-colors"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></a>
            </div>
            <h3 class="text-4xl font-black text-slate-800 mb-1 relative z-10">{{ $potensiCount }}</h3>
            <p class="text-[11px] font-bold text-slate-500 uppercase tracking-widest relative z-10">Potensi Desa</p>
        </div>




    </div>

    {{-- Quick Info --}}
    <div class="bg-white p-8 rounded-[1.5rem] shadow-[0_2px_10px_rgb(0,0,0,0.02)] border border-slate-100 flex items-start gap-4 mt-4">
        <div class="w-12 h-12 bg-emerald-50 rounded-2xl flex items-center justify-center flex-shrink-0">
            <svg class="w-6 h-6 text-emerald-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
        </div>
        <div>
            <h4 class="text-base font-bold text-slate-800 mb-1">Panduan Administrator</h4>
            <p class="text-sm text-slate-500 leading-relaxed max-w-4xl">Gunakan navigasi di sebelah kiri untuk mengelola konten website seperti potensi unggulan desa, berita terkini, dan galeri visual. Semua pembaruan yang Anda lakukan di sini akan langsung terlihat (real-time) oleh pengunjung portal Desa Sumbersari.</p>
        </div>
    </div>
</div>
@endsection
