
<?php $__env->startSection('title', 'Inve Security - ' . t('Choose Branch')); ?>
<?php $__env->startSection('description', 'Select your branch to proceed with company registration.'); ?>

<?php $__env->startSection('content'); ?>
    <!-- LUXURY BRANCH SELECTION SECTION -->
    <section class="relative min-h-screen flex items-center justify-center overflow-hidden bg-gradient-to-br from-gold-50 via-white to-gold-50/30 dark:from-gray-950 dark:via-gray-900 dark:to-gold-900/10">
        <!-- Animated Background Elements -->
        <div class="absolute inset-0 overflow-hidden">
            <!-- Gradient Orbs -->
            <div class="absolute top-1/4 -left-40 lg:-left-20 w-80 lg:w-96 h-80 lg:h-96 bg-gradient-to-br from-gold-500/20 to-gold-300/30 dark:from-gold-500/10 dark:to-gold-300/5 rounded-full blur-3xl animate-pulse-gold opacity-60 dark:opacity-30"></div>
            <div class="absolute bottom-1/3 -right-32 lg:-right-24 w-64 lg:w-80 h-64 lg:h-80 bg-gradient-to-tr from-gold-500/15 to-transparent dark:from-gold-500/5 dark:to-transparent rounded-full blur-3xl opacity-40 dark:opacity-20 animate-pulse-gold" style="animation-delay: 2s"></div>
            
            <!-- Animated Grid Pattern -->
            <div class="absolute inset-0 opacity-20 dark:opacity-10">
                <div class="absolute inset-0 bg-[linear-gradient(90deg,transparent_95%,rgba(250,204,21,0.1)_100%)] animate-shimmer bg-[length:200%_100%]"></div>
                <div class="absolute inset-0 bg-[linear-gradient(rgba(250,204,21,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(250,204,21,0.03)_1px,transparent_1px)] dark:bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:64px_64px] lg:bg-[size:64px_64px] [mask-image:radial-gradient(ellipse_80%_50%_at_50%_50%,black,transparent)]"></div>
            </div>
        </div>

        <div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10 py-8 lg:py-12">
            <!-- Step Indicator -->
            <div class="md:flex items-center justify-center gap-2 lg:gap-3 mb-6 lg:mb-8 animate-slide-up overflow-x-auto pb-2 lg:pb-0 hidden">
                <?php for($i = 1; $i <= 6; $i++): ?>
                    <div class="flex items-center gap-2 lg:gap-3 flex-shrink-0">
                        <div class="w-7 h-7 lg:w-8 lg:h-8 rounded-full flex items-center justify-center text-sm lg:text-base
                            <?php if($i == 5): ?>
                                bg-gradient-to-br from-gold-500 to-gold-400 text-white font-bold
                            <?php elseif($i < 5): ?>
                                bg-green-500 text-white font-bold
                            <?php else: ?>
                                bg-gray-200 dark:bg-gray-700 text-gray-500 dark:text-gray-400 font-medium
                            <?php endif; ?>">
                            <?php echo e($i); ?>

                        </div>
                        <?php if($i < 6): ?>
                            <div class="w-6 lg:w-12 h-1 rounded-full
                                <?php if($i < 5): ?>
                                    bg-green-500
                                <?php elseif($i == 5): ?>
                                    bg-gradient-to-r from-green-500 to-gold-500
                                <?php else: ?>
                                    bg-gray-200 dark:bg-gray-700
                                <?php endif; ?>">
                            </div>
                        <?php endif; ?>
                    </div>
                <?php endfor; ?>
            </div>

            <!-- Premium Header -->
            <div class="text-center mb-8 lg:mb-12 animate-slide-up animation-delay-100 px-2">
                <!-- Progress Badge -->
                <div class="inline-flex items-center gap-2 lg:gap-3 px-4 lg:px-6 py-2 lg:py-3 bg-gradient-to-r from-gold-500/10 to-gold-300/10 dark:from-gold-500/20 dark:to-gold-300/5 border border-gold-500/30 dark:border-gold-500/40 rounded-full mb-4 lg:mb-6 backdrop-blur-sm">
                    <div class="w-1.5 h-1.5 lg:w-2 lg:h-2 bg-gradient-to-r from-gold-500 to-gold-300 rounded-full animate-pulse"></div>
                    <span class="text-xs lg:text-sm font-semibold text-gold-600 dark:text-gold-400 uppercase tracking-wider">
                        <?php echo e(t('step_5') ?? 'Step 5 of 6'); ?>

                    </span>
                </div>

                <!-- Main Heading -->
                <h1 class="text-2xl sm:text-3xl lg:text-4xl xl:text-5xl font-bold leading-tight mb-3 lg:mb-4">
                    <span class="block text-gray-900 dark:text-white"><?php echo e(t('select_your_business_branch') ?? 'Choose Your Business Branch'); ?></span>
                    <span class="block bg-gradient-to-r from-gold-500 via-gold-400 to-gold-500 bg-clip-text text-transparent animate-gradient-x mt-1 lg:mt-2 text-lg sm:text-xl lg:text-2xl">
                        <?php echo e(t('choose_branch_where') ?? 'Select the branch where your business will be registered'); ?>

                    </span>
                </h1>

                <!-- Branch Search -->
                <div class="max-w-2xl mx-auto mt-6 lg:mt-8 animate-slide-up animation-delay-200">
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-3 lg:pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-search text-gold-500/60 text-sm lg:text-base"></i>
                        </div>
                        <input type="text" 
                               id="branchSearch" 
                               placeholder="<?php echo e(t('search_branch_name') ?? 'Search branch by name or location...'); ?>"
                               class="w-full pl-10 lg:pl-12 pr-4 py-3 lg:py-4 bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm border-2 border-gray-200 dark:border-gray-700 rounded-xl lg:rounded-2xl focus:border-gold-500 focus:ring-4 focus:ring-gold-500/20 transition-all duration-300 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 shadow-lg">
                    </div>
                    <div class="text-center mt-3 lg:mt-4">
                        <span id="branchCount" class="text-sm lg:text-base font-medium text-gold-600 dark:text-gold-400">
                            <?php echo e(count($branches)); ?> <?php echo e(t('branches') ?? 'branches'); ?> <?php echo e(t('available') ?? 'available'); ?>

                        </span>
                    </div>
                </div>
            </div>

            <!-- Branch Selection Form -->
            <form action="<?php echo e(route('business.branch.store')); ?>" method="POST" id="branchForm">
                <?php echo csrf_field(); ?>

                <!-- Branches Grid -->
                <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 sm:gap-4 lg:gap-6" id="branchesContainer">
                    <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="branch-option group" data-branch-name="<?php echo e(strtolower($branch->name)); ?>" data-branch-location="<?php echo e(strtolower($branch->addressline1)); ?>" data-branch-type="<?php echo e(strtolower($branch->branch_type_name)); ?>">
                            <input type="radio" name="branch" value="<?php echo e($branch->id); ?>"
                                id="branch_<?php echo e($branch->id); ?>" class="sr-only peer"
                                <?php echo e(session('branch') == $branch->id ? 'checked' : ''); ?>>

                            <label for="branch_<?php echo e($branch->id); ?>"
                                class="relative block h-full bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-xl lg:rounded-2xl p-4 sm:p-5 lg:p-6 border-2 border-gray-100 dark:border-gray-700 shadow-lg hover:shadow-2xl hover:shadow-gold-500/10 transition-all duration-300 cursor-pointer transform hover:-translate-y-1 peer-checked:border-gold-500 peer-checked:ring-4 peer-checked:ring-gold-500/20 peer-checked:bg-gradient-to-br peer-checked:from-white/90 peer-checked:to-gold-50/30 dark:peer-checked:from-gray-800/90 dark:peer-checked:to-gold-900/10 peer-checked:shadow-2xl peer-checked:shadow-gold-500/20">

                                <!-- Selected Badge -->
                                <div class="absolute -top-2 -right-2 z-10">
                                    <div class="bg-gradient-to-r from-gold-500 to-gold-600 text-white px-2 py-1 rounded-full text-xs font-bold transform scale-0 transition-transform duration-300 peer-checked:scale-100 flex items-center gap-1 shadow-lg">
                                        <i class="fas fa-check text-[8px]"></i>
                                        <?php echo e(t('selected') ?? 'Selected'); ?>

                                    </div>
                                </div>

                                <!-- Selected Checkmark -->
                                <div class="absolute top-3 right-3 sm:top-4 sm:right-4 w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6 rounded-full border-2 border-gray-300 dark:border-gray-600 transition-all duration-300 peer-checked:bg-gold-500 peer-checked:border-gold-500 flex items-center justify-center">
                                    <svg class="w-2 h-2 sm:w-3 sm:h-3 lg:w-4 lg:h-4 text-white transform scale-0 transition-transform duration-300 peer-checked:scale-100"
                                        fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3"
                                            d="M5 13l4 4L19 7" />
                                    </svg>
                                </div>

                                <!-- Branch Icon -->
                                <div class="w-10 h-10 sm:w-12 sm:h-12 lg:w-16 lg:h-16 bg-gradient-to-br from-gold-500/10 to-gold-300/20 rounded-lg lg:rounded-xl flex items-center justify-center mb-3 sm:mb-4 group-hover:from-gold-500/20 group-hover:to-gold-300/30 transition-all duration-300 peer-checked:from-gold-500 peer-checked:to-gold-400">
                                    <?php if($branch->branch_type_name == 'Head Office'): ?>
                                        <i class="fas fa-building text-gold-500 text-base sm:text-lg lg:text-xl transition-colors duration-300 peer-checked:text-white"></i>
                                    <?php elseif($branch->branch_type_name == 'Service Center'): ?>
                                        <i class="fas fa-tools text-gold-500 text-base sm:text-lg lg:text-xl transition-colors duration-300 peer-checked:text-white"></i>
                                    <?php elseif($branch->branch_type_name == 'Outlet'): ?>
                                        <i class="fas fa-store text-gold-500 text-base sm:text-lg lg:text-xl transition-colors duration-300 peer-checked:text-white"></i>
                                    <?php else: ?>
                                        <i class="fas fa-building text-gold-500 text-base sm:text-lg lg:text-xl transition-colors duration-300 peer-checked:text-white"></i>
                                    <?php endif; ?>
                                </div>

                                <!-- Branch Name -->
                                <h3 class="text-base sm:text-lg lg:text-xl font-bold text-gray-900 dark:text-white mb-1 sm:mb-2 group-hover:text-gold-500 transition-colors duration-300 peer-checked:text-gold-600 dark:peer-checked:text-gold-400 line-clamp-1">
                                    <?php echo e($branch->name); ?>

                                </h3>

                                <!-- Branch Type Badge -->
                                <div class="inline-block mb-2">
                                    <?php if($branch->branch_type_name == 'Head Office'): ?>
                                        <span class="px-2 py-1 bg-gradient-to-r from-purple-500 to-purple-600 text-white text-xs rounded-full font-medium">
                                            <i class="fas fa-crown mr-1"></i> Head Office
                                        </span>
                                    <?php elseif($branch->branch_type_name == 'Service Center'): ?>
                                        <span class="px-2 py-1 bg-gradient-to-r from-blue-500 to-blue-600 text-white text-xs rounded-full font-medium">
                                            <i class="fas fa-tools mr-1"></i> Service Center
                                        </span>
                                    <?php elseif($branch->branch_type_name == 'Outlet'): ?>
                                        <span class="px-2 py-1 bg-gradient-to-r from-green-500 to-green-600 text-white text-xs rounded-full font-medium">
                                            <i class="fas fa-store mr-1"></i> Outlet
                                        </span>
                                    <?php else: ?>
                                        <span class="px-2 py-1 bg-gradient-to-r from-gray-500 to-gray-600 text-white text-xs rounded-full font-medium">
                                            <i class="fas fa-building mr-1"></i> <?php echo e($branch->branch_type_name); ?>

                                        </span>
                                    <?php endif; ?>
                                </div>

                                <!-- Branch Location -->
                                <div class="flex items-start gap-2 mb-2">
                                    <i class="fas fa-map-marker-alt text-gold-500 text-xs mt-0.5"></i>
                                    <p class="text-gray-600 dark:text-gray-300 text-xs leading-relaxed line-clamp-2">
                                        <?php echo e($branch->addressline1); ?>

                                        <?php if($branch->addressline2): ?>
                                            <br><?php echo e($branch->addressline2); ?>

                                        <?php endif; ?>
                                    </p>
                                </div>

                                <!-- Branch Contact -->
                                <div class="space-y-1 text-xs">
                                    <?php if($branch->phone): ?>
                                        <div class="flex items-center gap-2 text-gray-600 dark:text-gray-400">
                                            <i class="fas fa-phone text-gold-500"></i>
                                            <span><?php echo e($branch->phone); ?></span>
                                        </div>
                                    <?php endif; ?>
                                    
                                    <?php if($branch->email): ?>
                                        <div class="flex items-center gap-2 text-gray-600 dark:text-gray-400">
                                            <i class="fas fa-envelope text-gold-500"></i>
                                            <span class="truncate"><?php echo e($branch->email); ?></span>
                                        </div>
                                    <?php endif; ?>
                                </div>

                                <!-- Operating Hours -->
                                <?php if($branch->opening_hour && $branch->opening_day): ?>
                                    <div class="mt-3 pt-3 border-t border-gray-200 dark:border-gray-600">
                                        <div class="flex items-center justify-between text-xs">
                                            <span class="text-gray-500 dark:text-gray-400"><?php echo e(t('hours') ?? 'Hours:'); ?></span>
                                            <span class="font-semibold text-gold-600 dark:text-gold-400"><?php echo e($branch->opening_hour); ?></span>
                                        </div>
                                        <div class="text-xs text-gray-500 dark:text-gray-400 mt-1">
                                            <?php echo e($branch->opening_day); ?>

                                        </div>
                                    </div>
                                <?php endif; ?>

                                <!-- Hover Arrow -->
                                <div class="absolute bottom-3 right-3 sm:bottom-4 sm:right-4 opacity-0 transform translate-x-2 transition-all duration-300 group-hover:opacity-100 group-hover:translate-x-0 peer-checked:opacity-100 peer-checked:translate-x-0">
                                    <i class="fas fa-arrow-right text-gold-500 text-xs sm:text-sm"></i>
                                </div>
                            </label>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>

                <!-- No Results Message -->
                <div id="noResults" class="hidden text-center py-8 sm:py-12 animate-slide-up">
                    <div class="w-12 h-12 sm:w-16 sm:h-16 bg-gradient-to-br from-gray-100 to-gray-50 dark:from-gray-700 dark:to-gray-800 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-search text-gray-400 text-lg sm:text-2xl"></i>
                    </div>
                    <h3 class="text-lg sm:text-xl font-semibold text-gray-900 dark:text-white mb-2"><?php echo e(t('no_branches_found') ?? 'No branches found'); ?></h3>
                    <p class="text-gray-600 dark:text-gray-400 text-sm sm:text-base"><?php echo e(t('try_different_search') ?? 'Try adjusting your search terms'); ?></p>
                </div>

                <!-- Error Message -->
                <?php $__errorArgs = ['branch'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                    <div class="max-w-6xl mx-auto mt-6 animate-slide-up">
                        <div class="bg-gradient-to-r from-red-500/10 to-red-400/10 dark:from-red-500/20 dark:to-red-400/5 border border-red-200 dark:border-red-800 rounded-xl p-4">
                            <div class="flex items-center gap-3">
                                <div class="w-10 h-10 bg-red-500/20 rounded-lg flex items-center justify-center">
                                    <i class="fas fa-exclamation-circle text-red-500"></i>
                                </div>
                                <div>
                                    <h4 class="font-semibold text-red-600 dark:text-red-400"><?php echo e(t('selection_required') ?? 'Selection Required'); ?></h4>
                                    <p class="text-red-600 dark:text-red-400 text-sm"><?php echo e($message); ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

                <!-- Action Buttons -->
                <div class="mt-8 sm:mt-12 flex flex-col sm:flex-row gap-3 sm:gap-4 justify-between items-center animate-slide-up animation-delay-300">
                    <a href="<?php echo e(route('business.model')); ?>"
                        class="w-full sm:w-auto px-6 sm:px-8 py-3 sm:py-4 bg-white/50 dark:bg-gray-700/50 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 font-semibold rounded-xl hover:bg-white dark:hover:bg-gray-700 transition-all duration-200 transform hover:-translate-x-1 flex items-center justify-center gap-2 group/back">
                        <i class="fas fa-arrow-left text-sm sm:text-base group-hover/back:-translate-x-1 transition-transform"></i>
                        <span><?php echo e(t('back_to_business_model') ?? 'Back to Business Model'); ?></span>
                    </a>

                    <button type="submit"
                        class="w-full sm:w-auto px-8 sm:px-12 py-3 sm:py-4 btn-gold text-white font-bold rounded-xl hover:shadow-xl transition-all duration-300 transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none flex items-center justify-center gap-2 group/continue"
                        id="continueBtn" disabled>
                        <span id="continueText">
                            <?php echo e(t('continue_overview') ?? 'Continue to Overview'); ?>

                        </span>
                        <i class="fas fa-arrow-right text-sm sm:text-base group-hover/continue:translate-x-1 transition-transform"></i>
                    </button>
                </div>
            </form>
        </div>
    </section>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const form = document.getElementById('branchForm');
            const branchInputs = document.querySelectorAll('input[name="branch"]');
            const continueBtn = document.getElementById('continueBtn');
            const continueText = document.getElementById('continueText');
            const branchSearch = document.getElementById('branchSearch');
            const branchesContainer = document.getElementById('branchesContainer');
            const noResults = document.getElementById('noResults');
            const branchCount = document.getElementById('branchCount');
            const branchOptions = document.querySelectorAll('.branch-option');

            // Check if any branch is already selected from session
            function checkSelection() {
                const selectedBranch = document.querySelector('input[name="branch"]:checked');
                continueBtn.disabled = !selectedBranch;

                // Update button text based on selection
                if (selectedBranch) {
                    const selectedLabel = document.querySelector(`label[for="${selectedBranch.id}"] h3`);
                    const branchName = selectedLabel ? selectedLabel.textContent : 'Selected Branch';
                    continueText.textContent = `<?php echo e(t('Continue_with') ?? 'Continue with'); ?> ${branchName}`;
                    continueBtn.classList.remove('opacity-50');
                } else {
                    continueText.textContent = "<?php echo e(t('continue_overview') ?? 'Continue to Overview'); ?>";
                }
            }

            // Initial check
            checkSelection();

            // Enable continue button when a branch is selected
            branchInputs.forEach(input => {
                input.addEventListener('change', function() {
                    checkSelection();
                    
                    // Add selection animation
                    const label = this.closest('label');
                    label.classList.add('animate-pulse-gold');
                    setTimeout(() => {
                        label.classList.remove('animate-pulse-gold');
                    }, 300);
                });
            });

            // Form submission handling
            form.addEventListener('submit', function(e) {
                const selectedBranch = document.querySelector('input[name="branch"]:checked');
                if (!selectedBranch) {
                    e.preventDefault();

                    // Show error animation
                    const cards = document.querySelectorAll('.branch-option');
                    cards.forEach(card => {
                        if (card.style.display !== 'none') {
                            card.classList.add('animate-shake');
                            setTimeout(() => {
                                card.classList.remove('animate-shake');
                            }, 500);
                        }
                    });

                    // Scroll to first visible card
                    const firstVisibleCard = document.querySelector('.branch-option[style*="display: block"], .branch-option[style*="display: flex"]');
                    if (firstVisibleCard) {
                        firstVisibleCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    }

                    return;
                }

                // Add loading state
                continueBtn.disabled = true;
                continueBtn.innerHTML = `
                    <div class="flex items-center gap-2">
                        <div class="w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"></div>
                        <span><?php echo e(t('saving_selection') ?? 'Saving Selection...'); ?></span>
                    </div>
                `;
            });

            // Add click animation
            branchInputs.forEach(input => {
                input.addEventListener('click', function() {
                    const label = this.closest('label');
                    label.classList.add('scale-95');
                    setTimeout(() => {
                        label.classList.remove('scale-95');
                    }, 150);
                });
            });

            // Branch search functionality
            branchSearch.addEventListener('input', function() {
                const searchTerm = this.value.toLowerCase().trim();
                let visibleCount = 0;

                branchOptions.forEach(option => {
                    const branchName = option.dataset.branchName;
                    const branchLocation = option.dataset.branchLocation;
                    const branchType = option.dataset.branchType;
                    
                    if (branchName.includes(searchTerm) || 
                        branchLocation.includes(searchTerm) || 
                        branchType.includes(searchTerm)) {
                        option.style.display = 'block';
                        visibleCount++;
                        
                        // Add search highlight effect
                        option.classList.add('animate-slide-up');
                        setTimeout(() => {
                            option.classList.remove('animate-slide-up');
                        }, 300);
                    } else {
                        option.style.display = 'none';
                    }
                });

                // Update branch count
                branchCount.textContent = `${visibleCount} <?php echo e(t('branches') ?? 'branches'); ?> <?php echo e(t('available') ?? 'available'); ?>`;

                // Show/hide no results message
                if (visibleCount === 0 && searchTerm !== '') {
                    noResults.classList.remove('hidden');
                    branchesContainer.classList.add('hidden');
                } else {
                    noResults.classList.add('hidden');
                    branchesContainer.classList.remove('hidden');
                }
            });

            // Add keyboard navigation
            document.addEventListener('keydown', function(e) {
                if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
                    const current = document.querySelector('input[name="branch"]:checked');
                    const visibleInputs = Array.from(branchInputs).filter(input => {
                        const option = input.closest('.branch-option');
                        return option && option.style.display !== 'none';
                    });
                    const currentIndex = current ? visibleInputs.indexOf(current) : -1;
                    
                    let nextIndex;
                    if (e.key === 'ArrowRight') {
                        nextIndex = (currentIndex + 1) % visibleInputs.length;
                    } else {
                        nextIndex = (currentIndex - 1 + visibleInputs.length) % visibleInputs.length;
                    }
                    
                    if (visibleInputs[nextIndex]) {
                        visibleInputs[nextIndex].checked = true;
                        visibleInputs[nextIndex].dispatchEvent(new Event('change'));
                        visibleInputs[nextIndex].focus();
                    }
                }
            });

            // Add scroll animations for cards
            const observerOptions = {
                threshold: 0.1,
                rootMargin: '0px 0px -50px 0px'
            };

            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('animate-slide-up');
                    }
                });
            }, observerOptions);

            branchOptions.forEach((card, index) => {
                card.style.animationDelay = `${index * 50}ms`;
                observer.observe(card);
            });
        });
    </script>

    <style>
        /* Custom Animations */
        @keyframes pulse-gold {
            0%, 100% {
                opacity: 0.7;
            }
            50% {
                opacity: 0.4;
            }
        }

        @keyframes gradient-x {
            0%, 100% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        .animate-pulse-gold {
            animation: pulse-gold 0.3s ease-in-out;
        }

        .animate-gradient-x {
            background-size: 200% auto;
            animation: gradient-x 3s ease infinite;
        }

        .animate-shake {
            animation: shake 0.5s ease-in-out;
        }

        .animate-slide-up {
            animation: slideUp 0.6s ease-out forwards;
            opacity: 0;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in {
            animation: fadeIn 0.8s ease-out forwards;
            opacity: 0;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        .animation-delay-100 {
            animation-delay: 100ms;
        }

        .animation-delay-200 {
            animation-delay: 200ms;
        }

        .animation-delay-300 {
            animation-delay: 300ms;
        }

        .animation-delay-400 {
            animation-delay: 400ms;
        }

        .animation-delay-500 {
            animation-delay: 500ms;
        }

        /* Gold Button Styles */
        .btn-gold {
            background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(250, 204, 21, 0.3);
        }

        .btn-gold:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(250, 204, 21, 0.4);
            background: linear-gradient(135deg, #eab308 0%, #facc15 100%);
        }

        .btn-gold::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transform: translateX(-100%);
        }

        .btn-gold:hover::after {
            animation: shimmer 1.5s infinite;
        }
        
        @keyframes shimmer {
            0% {
                transform: translateX(-100%);
            }
            100% {
                transform: translateX(100%);
            }
        }

        /* Line clamp utilities */
        .line-clamp-1 {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .line-clamp-2 {
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(to bottom, rgba(250, 204, 21, 0.3), rgba(234, 179, 8, 0.3));
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(to bottom, rgba(250, 204, 21, 0.5), rgba(234, 179, 8, 0.5));
        }

        /* Mobile Responsive Improvements */
        @media (max-width: 640px) {
            .xl\:grid-cols-4,
            .lg\:grid-cols-3,
            .sm\:grid-cols-2 {
                grid-template-columns: 1fr !important;
                max-width: 350px;
                margin-left: auto;
                margin-right: auto;
            }
            
            .fixed.bottom-4 {
                bottom: 80px;
            }
            
            .grid-cols-1 {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .xl\:grid-cols-4,
            .lg\:grid-cols-3 {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .lg\:grid-cols-3 {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (min-width: 1280px) {
            .xl\:grid-cols-4 {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        /* Better tap targets on mobile */
        @media (max-width: 768px) {
            button, 
            input, 
            a {
                min-height: 44px;
            }
            
            .branch-option label {
                min-height: 200px;
            }
        }

        /* Focus styles for accessibility */
        input:focus + label {
            outline: 2px solid rgba(250, 204, 21, 0.5);
            outline-offset: 2px;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* Card hover effects */
        .branch-option label {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .branch-option:hover label {
            transform: translateY(-4px);
        }

        .branch-option.peer-checked label {
            transform: translateY(-2px);
        }
    </style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\crm_new\resources\views/frontend/request_services/branch.blade.php ENDPATH**/ ?>