<?php

namespace Database\Seeders;

use App\Models\AdSenseZone;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class AdSenseZoneSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $zones = [
            [
                'name'             => 'Header Banner',
                'location'         => 'header',
                'code'             => '<!-- Google AdSense Demo Code - Header Banner -->
<div style="text-align:center;padding:12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;margin:16px 0;">
    <p style="margin:0;font-size:12px;color:#64748b;font-weight:600;">📢 Reklam Alanı</p>
    <p style="margin:4px 0 0;font-size:11px;color:#94a3b8;">728x90 Leaderboard</p>
</div>',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Sidebar Top',
                'location'         => 'sidebar',
                'code'             => '<!-- Sidebar Top Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Sidebar Bottom',
                'location'         => 'sidebar',
                'code'             => '<!-- Sidebar Bottom Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Content Top',
                'location'         => 'content',
                'code'             => '<!-- Content Top Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Content Middle',
                'location'         => 'content',
                'code'             => '<!-- Content Middle Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Blog Content Top',
                'location'         => 'blog_content_top',
                'code'             => '<!-- Google AdSense Demo Code - Blog Content Top -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
<!-- Blog Content Top - 728x90 Leaderboard -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-XXXXXXXXXXXXXXXXX"
     data-ad-slot="XXXXXXXXXX"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Blog Content Bottom',
                'location'         => 'blog_content_bottom',
                'code'             => '<!-- Google AdSense Demo Code - Blog Content Bottom -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXXXXXXXXX"
     crossorigin="anonymous"></script>
<!-- Blog Content Bottom - 728x90 Leaderboard -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-XXXXXXXXXXXXXXXXX"
     data-ad-slot="XXXXXXXXXX"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Content Bottom',
                'location'         => 'content',
                'code'             => '<!-- Content Bottom Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
            [
                'name'             => 'Footer Banner',
                'location'         => 'footer',
                'code'             => '<!-- Footer Banner Ad Code -->',
                'is_active'        => true,
                'display_count'    => 0,
                'impression_count' => 0,
            ],
        ];

        foreach ($zones as $zone) {
            AdSenseZone::firstOrCreate(
                ['name' => $zone['name'], 'location' => $zone['location']],
                $zone
            );
        }
    }
}
