

<?php $__env->startSection('title', 'Customize Your Keychain - Lindsay\'s Leather'); ?>

<?php $__env->startSection('head'); ?>
<style>
            body.with-order-header {
                font-family: 'Montserrat', sans-serif;
                background-color: #f8f9fa;
                margin: 0;
                padding: 0;
                min-height: 100vh;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .landing-container {
                max-width: 700px;
                width: 100%;
                padding: 2rem;
                margin: 0 auto; /* Center the container */
            }
            
            .lindsay-card {
                background: white;
                border-radius: 16px;
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
                padding: 2rem;
                border: 1px solid rgba(181, 112, 47, 0.1);
            }
            
            .flex {
                display: flex;
            }
            
            .justify-between {
                justify-content: space-between;
            }
            
            .items-center {
                align-items: center;
            }
            
            .mb-6 {
                margin-bottom: 1.5rem;
            }
            
            
            .body-text {
                font-family: 'Montserrat', sans-serif;
                font-weight: 400;
            }
            
            .progress-bar {
                height: 4px;
                background: #e5e7eb;
                border-radius: 2px;
                overflow: hidden;
                margin-bottom: 2rem;
            }
            
            .progress-fill {
                height: 100%;
                background: #B5702F;
                border-radius: 2px;
                transition: width 0.5s ease;
            }
            
            .landing-title {
                font-family: 'Lato', sans-serif;
                font-weight: 700;
                font-size: 2.5rem;
                color: #371C16;
                margin-bottom: 1rem;
                line-height: 1.2;
                text-align: center;
            }
            
            .letter-inputs {
                display: flex;
                flex-direction: row;
                gap: 1rem;
                margin-bottom: 2rem;
                align-items: center;
                justify-content: center;
                flex-wrap: nowrap;
            }
            
            .letter-input {
                width: 80px;
                height: 80px;
                border: 2px solid #e5e7eb;
                border-radius: 12px;
                text-align: center;
                font-family: 'Lato', sans-serif;
                font-weight: 700;
                font-size: 40px;
                text-transform: uppercase;
                transition: all 0.2s ease;
                background: white;
            }
            
            .letter-input:focus {
                outline: none;
                border-color: #B5702F;
                box-shadow: 0 0 0 3px rgba(181, 112, 47, 0.1);
            }
            
            .letter-input.filled {
                border-color: #B5702F;
                background: rgba(181, 112, 47, 0.05);
            }
            
            .stamps-section {
                margin-top: 2rem;
            }
            
            .stamps-grid {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                gap: 1rem;
                margin-top: 1rem;
            }
            
            .stamp-item {
                aspect-ratio: 1;
                border: 2px solid #e5e7eb;
                border-radius: 12px;
                cursor: pointer;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                justify-content: center;
                background: white;
                padding: 8px;
            }
            
            .stamp-item:hover {
                border-color: #B5702F;
                transform: scale(1.05);
            }
            
            .stamp-item.selected {
                border-color: #B5702F;
                background: rgba(181, 112, 47, 0.1);
                box-shadow: 0 0 0 3px rgba(181, 112, 47, 0.2);
            }
            
            .stamp-item img {
                max-width: 100%;
                max-height: 100%;
                object-fit: contain;
            }
            
            .lindsay-btn {
                font-family: 'Lato', sans-serif;
                font-weight: 600;
                border-radius: 12px;
                padding: 16px 32px;
                min-height: 52px;
                transition: all 0.3s ease;
                border: none;
                cursor: pointer;
                text-decoration: none;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                font-size: 16px;
                background: #B5702F;
                color: white;
                width: 100%;
                margin-top: 2rem;
            }
            
            .lindsay-btn:hover:not(:disabled) {
                background: #371C16;
                transform: translateY(-1px);
                box-shadow: 0 6px 20px rgba(181, 112, 47, 0.3);
            }
            
            .lindsay-btn:disabled {
                opacity: 0.5;
                cursor: not-allowed;
                transform: none;
                box-shadow: none;
            }
            
            @media (max-width: 768px) {
                .landing-title {
                    font-size: 1.8rem;
                }
                
                .letter-inputs {
                    gap: 0.5rem;
                }
                
                .letter-input {
                    width: 60px;
                    height: 60px;
                    font-size: 20px;
                }
                
                .stamps-grid {
                    grid-template-columns: repeat(3, 1fr);
                }
            }
        </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="landing-container">
            <div class="lindsay-card">
                <!-- Back Button and Step Indicator -->
                <div class="flex justify-between items-center mb-6">
                    <?php if (isset($component)) { $__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.back-button','data' => ['route' => 'student.keychain-version']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('back-button'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['route' => 'student.keychain-version']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687)): ?>
<?php $attributes = $__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687; ?>
<?php unset($__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687)): ?>
<?php $component = $__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687; ?>
<?php unset($__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687); ?>
<?php endif; ?>
                    <span class="body-text" style="color: #6b7280;">Step 3 of 3</span>
                </div>

                <!-- Progress Bar -->
                <div class="progress-bar">
                    <div class="progress-fill" style="width: 100%;"></div>
                </div>

                <!-- Page Title -->
                <h1 class="landing-title">Classic Keychain</h1>
                <p class="body-text" style="color: #6b7280; text-align: center; margin-bottom: 2rem;">
                Enter 3 letters
                </p>

                <?php if($errors->any()): ?>
                    <div style="background: #fee2e2; border: 1px solid #ef4444; border-radius: 8px; padding: 1rem; margin-bottom: 1rem;">
                        <ul style="color: #dc2626; margin-left: 1.5rem;">
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <form id="customizeForm" method="POST" action="<?php echo e(route('student.submit-keychain')); ?>">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="product_id" value="<?php echo e($product->id); ?>">
                    <input type="hidden" name="version" value="1">
                    <input type="hidden" name="selected_stamp" id="selectedStampInput">

                    <!-- 3 Letter Inputs -->
                    <div class="letter-inputs">                        
                        <?php for($i = 0; $i < 3; $i++): ?>
                            <input type="text" 
                                   name="letters[]" 
                                   class="letter-input" 
                                   maxlength="1" 
                                   pattern="[A-Z0-9]"
                                   data-index="<?php echo e($i); ?>"
                                   required>
                        <?php endfor; ?>
                    </div>

                    <!-- Large Stamps Section -->
                    <div class="stamps-section">
                        <h3 class="body-text" style="font-weight: 600; margin-bottom: 1rem;">Select 1 Large Symbol</h3>
                        <div class="stamps-grid" id="stampsGrid">
                            <?php $__currentLoopData = $stamps; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stamp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="stamp-item" data-stamp="<?php echo e($stamp->image_path); ?>" onclick="selectStamp('<?php echo e($stamp->image_path); ?>', this)">
                                    <img src="/images/stamps/large/<?php echo e($stamp->image_path); ?>" alt="<?php echo e(pathinfo($stamp->image_path, PATHINFO_FILENAME)); ?>">
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>

                    <!-- Continue Button -->
                    <button type="submit" 
                            id="continueBtn" 
                            class="lindsay-btn" 
                            disabled>
                        Continue to Preview →
                    </button>
                </form>
            </div>
        </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
        document.addEventListener('DOMContentLoaded', function() {
            const letterInputs = document.querySelectorAll('.letter-input');
            const continueBtn = document.getElementById('continueBtn');
            let selectedStamp = null;

            // Letter input handling
            letterInputs.forEach((input, index) => {
                input.addEventListener('input', function(e) {
                    let value = e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, '');
                    e.target.value = value;
                    
                    if (value) {
                        e.target.classList.add('filled');
                        if (index < letterInputs.length - 1) {
                            letterInputs[index + 1].focus();
                        }
                    } else {
                        e.target.classList.remove('filled');
                    }
                    
                    updateContinueButton();
                });

                input.addEventListener('keydown', function(e) {
                    if (e.key === 'Backspace' && !e.target.value && index > 0) {
                        letterInputs[index - 1].focus();
                    }
                });
            });

            window.selectStamp = function(stampPath, element) {
                // Deselect all
                document.querySelectorAll('.stamp-item').forEach(item => {
                    item.classList.remove('selected');
                });
                
                // Select clicked stamp
                element.classList.add('selected');
                selectedStamp = stampPath;
                document.getElementById('selectedStampInput').value = stampPath;
                
                updateContinueButton();
            };

            function updateContinueButton() {
                const allLettersFilled = Array.from(letterInputs).every(input => input.value);
                const stampSelected = selectedStamp !== null;
                
                if (allLettersFilled && stampSelected) {
                    continueBtn.disabled = false;
                    continueBtn.style.opacity = '1';
                } else {
                    continueBtn.disabled = true;
                    continueBtn.style.opacity = '0.5';
                }
            }
        });
        </script>
<?php $__env->stopSection(); ?>




<?php echo $__env->make('layouts.student', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/tqxferau/lindsay-boswell.com/resources/views/student/keychain-customize-v1.blade.php ENDPATH**/ ?>