@php
            $slides = \App\Models\Backend\ContentSlider::with(['translations' => function($q) use ($lang) { $q->where('slider_translation_language', $lang); }])->where('slider_status', 'ACTIVE')->orderBy('slider_sort')->get();
            $gradients = [
                'linear-gradient(135deg, #0f172a 0%, #1c294c 50%, #c04849 100%)',
                'linear-gradient(135deg, #1a0000 0%, #8f3536 50%, #c04849 100%)',
                'linear-gradient(135deg, #0a1a00 0%, #0d9488 50%, #0369a1 100%)',
            ];
            @endphp
            @if($slides->count())
            <section class="hero-slider" id="main-content">
                <div class="slides">
                    @foreach($slides as $i => $slide)
                    @php $t = $slide->translations->first(); $g = $gradients[$i % count($gradients)]; @endphp
                    <div class="slide {{ $i === 0 ? 'active' : '' }}" data-index="{{ $i }}">
                        <div class="slide-bg" style="background: {{ $t && $t->slider_translation_img ? 'url(' . image_url($t->slider_translation_img) . ') center/cover no-repeat' : $g }};"></div>
                        <div class="hero-shapes">
                            <div class="shape"></div><div class="shape"></div><div class="shape"></div>
                        </div>
                        <div class="container">
                            <div class="slide-content">
                                @if($t)
                                <h1>{!! nl2br(e($t->slider_translation_title)) !!}</h1>
                                @endif
                                <div class="hero-buttons">
                                    @if($slide->slider_url && $slide->slider_url_type !== 'NONE')
                                    <a href="{{ $slide->slider_url }}" class="hero-btn hero-btn-primary"><i class="fas fa-arrow-right"></i> Maklumat Lanjut</a>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                    @endforeach
                </div>
                @if($slides->count() > 1)
                <button class="slider-arrows prev" onclick="slidePrev()"><i class="fas fa-chevron-left"></i></button>
                <button class="slider-arrows next" onclick="slideNext()"><i class="fas fa-chevron-right"></i></button>
                <div class="slider-dots">
                    @foreach($slides as $i => $slide)
                    <span class="dot {{ $i === 0 ? 'active' : '' }}" onclick="showSlide({{ $i }})"></span>
                    @endforeach
                </div>
                @endif
            </section>
            <style>
            .hero-slider { position: relative; overflow: hidden; }
            .hero-slider .slides { position: relative; min-height: 460px; display: flex; }
            .hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease, transform 0.8s ease; transform: scale(1.02); }
            .hero-slider .slide.active { opacity: 1; position: relative; transform: scale(1); flex: 1; }
            .hero-slider .slide::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(192,72,73,0.15) 0%, transparent 60%); z-index: 2; }
            .hero-slider .slide::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 80%, rgba(245,158,11,0.08) 0%, transparent 50%); z-index: 2; }
            .hero-slider .slide .slide-bg { position: absolute; inset: 0; z-index: 1; }
            .hero-slider .slide .hero-shapes { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
            .hero-shapes .shape { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.03); }
            .hero-shapes .shape:nth-child(1) { width: 400px; height: 400px; top: -100px; right: -80px; }
            .hero-shapes .shape:nth-child(2) { width: 200px; height: 200px; bottom: 40px; left: 10%; }
            .hero-shapes .shape:nth-child(3) { width: 120px; height: 120px; top: 30%; right: 25%; background: rgba(192,72,73,0.08); }
            .hero-slider .container { position: relative; z-index: 3; height: 100%; display: flex; align-items: center; }
            .hero-slider .slide-content { max-width: 650px; padding: 80px 0; }
            .hero-slider .slide-content h1 { font-size: 2.6rem; font-weight: 800; color: var(--white); line-height: 1.15; margin: 0 0 12px; letter-spacing: -1px; }
            .hero-slider .slide-content p { font-size: 1rem; color: rgba(255,255,255,0.7); line-height: 1.7; margin: 0 0 30px; max-width: 520px; }
            .hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
            .hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: all 0.3s; position: relative; overflow: hidden; }
            .hero-btn-primary { background: var(--accent); color: var(--white); }
            .hero-btn-primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent); opacity: 0; transition: opacity 0.3s; }
            .hero-btn-primary:hover::before { opacity: 1; }
            .hero-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(192,72,73,0.4); }
            .hero-btn-secondary { background: rgba(255,255,255,0.1); color: var(--white); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.15); }
            .hero-btn-secondary:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
            .slider-arrows { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; background: rgba(255,255,255,0.1); border: none; color: white; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(8px); transition: all 0.3s; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
            .slider-arrows:hover { background: rgba(255,255,255,0.25); transform: translateY(-50%) scale(1.08); }
            .slider-arrows.prev { left: 20px; }
            .slider-arrows.next { right: 20px; }
            .slider-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; gap: 8px; }
            .slider-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: all 0.3s; }
            .slider-dots .dot.active { background: var(--accent); width: 28px; border-radius: 5px; }
            @media (max-width: 768px) {
                .hero-slider .slides { min-height: 340px; }
                .hero-slider .slide-content { padding: 50px 0; }
                .hero-slider .slide-content h1 { font-size: 1.6rem; }
                .hero-shapes { display: none; }
                .slider-arrows { width: 36px; height: 36px; font-size: 0.75rem; }
                .slider-arrows.prev { left: 10px; }
                .slider-arrows.next { right: 10px; }
                .hero-btn { padding: 10px 20px; font-size: 0.78rem; }
            }
            </style>
            <script>
            var totalSlides = {{ $slides->count() }};
            var currentSlide = 0;
            var slideInterval;
            function showSlide(index) {
                var slides = document.querySelectorAll(".hero-slider .slide");
                var dots = document.querySelectorAll(".slider-dots .dot");
                slides.forEach(function(s) { s.classList.remove("active"); });
                dots.forEach(function(d) { d.classList.remove("active"); });
                slides[index].classList.add("active");
                dots[index].classList.add("active");
                currentSlide = index;
            }
            function slideNext() { showSlide((currentSlide + 1) % totalSlides); resetInterval(); }
            function slidePrev() { showSlide((currentSlide - 1 + totalSlides) % totalSlides); resetInterval(); }
            function resetInterval() { clearInterval(slideInterval); slideInterval = setInterval(function() { slideNext(); }, 6000); }
            if (totalSlides > 1) { slideInterval = setInterval(function() { slideNext(); }, 6000); }
            </script>
            @endif
            