{{-- AdSense Widget - Modern Tasarım --}}
@php
    $cfg = $widget->content_with_defaults;
    $location = $cfg['location'] ?? 'homepage_middle';
    $adSenseZones = \App\Models\AdSenseZone::where('is_active', true)->where('location', 'like', $location . '%')->get();
@endphp

@if($adSenseZones->isNotEmpty() || ($cfg['show_placeholder'] ?? true))
<div style="padding: 40px 24px; background: #f8fafc;">
    <div style="max-width: 1200px; margin: 0 auto;">
        <div style="background: #fff; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 32px; text-align: center; min-height: 120px; display: flex; align-items: center; justify-content: center;">
            @if($adSenseZones->isNotEmpty())
                @foreach($adSenseZones as $ad)
                    <div>{!! $ad->code !!}</div>
                @endforeach
            @elseif($cfg['show_placeholder'] ?? true)
                <div style="color: #94a3b8; font-size: 14px; font-weight: 500;">
                    @if($location === 'homepage_top') 
                        728×90 Banner Alanı
                    @elseif($location === 'homepage_middle') 
                        300×250 Rectangle Alanı
                    @else 
                        728×90 Banner Alanı
                    @endif
                </div>
            @endif
        </div>
    </div>
</div>
@endif
