document.addEventListener('DOMContentLoaded', function () { const targetElement = document.querySelector('.flex.flex-col.items-start.lg\\:flex-row.pb-6.lg\\:pb-20'); if (targetElement) { const formContainer = document.createElement('div'); formContainer.style.padding = '15px'; formContainer.style.background = '#f7f7f7'; formContainer.style.borderRadius = '12px'; formContainer.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)'; formContainer.style.display = 'flex'; formContainer.style.flexDirection = 'column'; formContainer.style.marginTop = '20px'; const formHeader = document.createElement('div'); formHeader.textContent = 'أدخل بياناتك، نحن في خدمتك!'; formHeader.style.color = '#333'; formHeader.style.fontSize = '18px'; formHeader.style.fontWeight = 'bold'; formHeader.style.marginBottom = '15px'; formHeader.style.textAlign = 'center'; formContainer.appendChild(formHeader); function createInputField(placeholder, type = 'text') { const input = document.createElement(type === 'textarea' ? 'textarea' : 'input'); input.type = type; input.placeholder = placeholder; input.style.padding = '10px'; input.style.border = '1px solid #ccc'; input.style.borderRadius = '8px'; input.style.marginBottom = '10px'; input.style.resize = type === 'textarea' ? 'none' : 'initial'; return input; } const nameInput = createInputField('الاسم'); const ageInput = createInputField('العمر'); const phoneInput = createInputField('رقم الجوال'); const tripInput = createInputField('تفاصيل الرحلة', 'textarea'); const submitButton = document.createElement('button'); submitButton.textContent = 'إرسال البيانات'; submitButton.style.padding = '10px'; submitButton.style.backgroundColor = '#F6561A'; submitButton.style.color = '#fff'; submitButton.style.fontWeight = 'bold'; submitButton.style.border = 'none'; submitButton.style.borderRadius = '8px'; submitButton.style.cursor = 'pointer'; submitButton.addEventListener('click', function () { const name = nameInput.value.trim(); const age = ageInput.value.trim(); const phone = phoneInput.value.trim(); const trip = tripInput.value.trim(); if (name && age && phone && trip) { const message = `الاسم: ${name}\nالعمر: ${age}\nرقم الجوال: ${phone}\nتفاصيل الرحلة: ${trip}`; const whatsappNumber = '+1234567890'; const whatsappURL = `https://wa.me/${whatsappNumber}?text=${encodeURIComponent(message)}`; window.open(whatsappURL, '_blank'); } else { alert('يرجى إدخال كافة البيانات المطلوبة'); } }); formContainer.appendChild(nameInput); formContainer.appendChild(ageInput); formContainer.appendChild(phoneInput); formContainer.appendChild(tripInput); formContainer.appendChild(submitButton); const footer = document.createElement('div'); footer.textContent = 'جميع الحقوق محفوظة © متجر رحلتنا'; footer.style.textAlign = 'center'; footer.style.color = '#888'; footer.style.marginTop = '10px'; footer.style.fontSize = '12px'; formContainer.appendChild(footer); targetElement.insertAdjacentElement('afterend', formContainer); } });