@php
    $bgStyle = match($section->bg_type) {
        'solid' => "background-color: {$section->bg_color};",
        'gradient' => "background: linear-gradient({$section->bg_gradient_angle}deg, {$section->bg_gradient_from}, {$section->bg_gradient_to});",
        'image' => $section->bg_image_path ? "background-image: url('" . Storage::disk('public')->url($section->bg_image_path) . "'); background-size: cover; background-position: center;" : '',
        default => '',
    };
@endphp
<div class="relative" style="{{ $bgStyle }}">
    @if($section->bg_type === 'image' && $section->bg_overlay_opacity > 0)
        <div class="absolute inset-0 bg-black" style="opacity: {{ $section->bg_overlay_opacity / 100 }}"></div>
    @endif
    @if($section->bg_type === 'video' && $section->bg_video_url)
        <video autoplay muted loop playsinline class="absolute inset-0 w-full h-full object-cover">
            <source src="{{ $section->bg_video_url }}" type="video/mp4">
        </video>
        <div class="absolute inset-0 bg-black" style="opacity: {{ $section->bg_overlay_opacity / 100 }}"></div>
    @endif
    <div class="relative z-10">
        @include('website.sections.' . $section->section_key->value, [
            'section' => $section,
            'academy' => $academy,
            'settings' => $settings,
            'data' => $data,
        ])
    </div>
</div>
