<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Send HTML Email</title>
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600&display=swap');

        body {
            font-family: 'Raleway', sans-serif;
            margin: 0;
            padding: 0;
            background: linear-gradient(135deg, #e8ecf3 0%, #f7f9fc 100%);
            color: #1a1a1a;
            min-height: 100vh;
        }

        /* Full-width layout */
        .container {
            width: 100%;
            max-width: 1850px;
            margin: 0 auto;
            padding: 10px;
        }

        /* Row layout */
        .row {
            display: flex;
            flex-wrap: wrap;
            gap: 40px;
            justify-content: space-between;
        }

        /* Columns */
        .col-md-6 {
            flex: 1 1 48%;
        }

        /* Form card */
        #mailForm {
            background: #ffffff;
            padding: 20px 35px;
            border-radius: 18px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            border: 1px solid #eef0f5;
            padding-right: 70px;
            padding-bottom: 60px;
        }

        #mailForm:hover {
            transform: translateY(-2px);
        }

        /* Headings */
        h2 {
            font-weight: 600;
            letter-spacing: 0.3px;
            color: #101828;
            font-size: 28px;
            margin-bottom: 25px;
        }

        /* Labels */
        label {
            display: block;
            font-weight: 500;
            color: #344054;
            margin-top: 18px;
        }

        /* Inputs and Textareas */
        input,
        textarea {
            width: 100%;
            padding: 12px 14px;
            margin-top: 6px;
            border: 1px solid #d0d5dd;
            border-radius: 10px;
            font-size: 15px;
            background: #f9fafb;
            transition: all 0.25s ease;
        }

        input:focus,
        textarea:focus {
            border-color: #2563eb;
            background: #fff;
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
            outline: none;
        }

        /* Buttons */
        button {
            margin-top: 20px;
            padding: 12px 26px;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 500;
            font-size: 15px;
            color: #fff;
            background: linear-gradient(135deg, #2563eb, #1d4ed8);
            transition: all 0.25s ease;
        }

        button:hover {
            transform: translateY(-1px);
            background: linear-gradient(135deg, #1d4ed8, #1e40af);
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
        }

        /* Preview button distinct color */
        #previewBtn {
            background: linear-gradient(135deg, #10b981, #059669);
        }

        #previewBtn:hover {
            background: linear-gradient(135deg, #059669, #047857);
        }

        /* Alerts */
        .error {
            background: #fef2f2;
            color: #b91c1c;
            padding: 12px 16px;
            border-radius: 10px;
            margin-top: 12px;
            font-size: 14px;
            border-left: 5px solid #ef4444;
        }

        .alert {
            background: #ecfdf5;
            color: #065f46;
            padding: 12px 16px;
            border-radius: 10px;
            border-left: 5px solid #10b981;
            margin-bottom: 16px;
        }

        /* Iframe preview */
        iframe {
            width: 100%;
            height: 770px;
            border: none;
            border-radius: 18px;
            background: #fff;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        }

        /* Responsive layout */
        @media (max-width: 992px) {
            .col-md-6 {
                flex: 1 1 100%;
            }

            .container {
                padding: 30px 20px;
            }

            #mailForm {
                padding: 30px 20px;
            }
        }
    </style>
    <!-- TinyMCE from CDN (easy way to get a WYSIWYG editor) -->
    <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
</head>

<body>
    <section>
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <h2>New Email Test</h2>

                    <?php if(session('success')): ?>
                        <div class="alert"><?php echo e(session('success')); ?></div>
                    <?php endif; ?>

                    <?php if($errors->any()): ?>
                        <div class="error"><strong>Please fix these errors:</strong>
                            <ul>
                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $err): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li><?php echo e($err); ?></li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        </div>
                    <?php endif; ?>

                    <form action="<?php echo e(route('mail.send')); ?>" method="POST" id="mailForm">
                        <?php echo csrf_field(); ?>

                        <label for="email">Recipient Email</label>
                        <input type="email" id="email" name="email" value="<?php echo e(old('email')); ?>" required>

                        <label for="subject">Subject</label>
                        <input type="text" id="subject" name="subject" value="<?php echo e(old('subject')); ?>" required>

                        <label for="body">Body (HTML allowed)</label>
                        <textarea id="body" name="body" rows="20" required><?php echo e(old('body')); ?></textarea>

                        <div style="margin-top:10px;">
                            <button type="button" id="previewBtn">Preview</button>
                            <button type="submit" style="margin-left:10px;">Send Mail</button>
                        </div>

                    </form>
                </div>
                <div class="col-md-6">
                    <h2>Preview</h2>
                    <iframe id="previewFrame" sandbox="allow-same-origin allow-forms allow-scripts"></iframe>
                </div>
            </div>
        </div>
    </section>

    <script>

        // Preview function: copy editor content into iframe
        function updatePreview() {
            let editor = tinymce.get('body');
            let content = editor ? editor.getContent() : document.getElementById('body').value;
            document.getElementById('previewFrame').srcdoc = content;
        }

        // Preview button
        document.getElementById('previewBtn').addEventListener('click', function (e) {
            e.preventDefault();
            updatePreview();
        });

    </script>

</body>

</html><?php /**PATH /home/braintreeeasysof/public_html/putsmail/resources/views/mail_form.blade.php ENDPATH**/ ?>