<!-- create word modal -->
<div class="modal-dialog modal-xl">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="addWordModalLabel">Add New Word</h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <form action="/dictionary/word/create" method="post" enctype="multipart/form-data">
            <div class="modal-body">
                <div class="alert alert-info mb-3">
                    <small><i class="bi bi-info-circle"></i> Translations are optional. Fill these if you want to add translations now.</small>
                </div>

                <div class="row g-4">
                    <!-- Left Card: Original Content (Your original layout) -->
                    <div class="col-md-6">
                        <div class="card h-100">
                            <div class="card-header">
                                <h6 class="mb-0">Original Language</h6>
                            </div>
                            <div class="card-body">
                                <div class="row g-3">
                                    <!-- Category Selection -->
                                    <div class="col-md-6">
                                        <label for="category_id" class="form-label">Category *</label>
                                        <select class="form-select searchSelect" id="category_id" name="category_id" required>
                                            <option value="">Select Category</option>
                                            <?php foreach ($categories as $category): ?>
                                                <option value="<?= htmlspecialchars($category['id']) ?>">
                                                    <?= htmlspecialchars($category['name']) ?>
                                                </option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>

                                    <!-- Word Type Selection -->
                                    <div class="col-md-6">
                                        <label for="word_type_id" class="form-label">Word Type *</label>
                                        <select class="form-select searchSelect" id="word_type_id" name="word_type_id" required>
                                            <option value="">Select Word Type</option>
                                            <?php foreach ($wordTypes as $type): ?>
                                                <option value="<?= htmlspecialchars($type['id']) ?>">
                                                    <?= htmlspecialchars($type['name']) ?>
                                                </option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>

                                    <!-- Word Input -->
                                    <div class="col-md-12">
                                        <label for="original_word" class="form-label">Word *</label>
                                        <input type="text" class="form-control" id="original_word" name="original_word" placeholder="Enter the original word" required>
                                    </div>

                                    <!-- Meaning Input -->
                                    <div class="col-md-12">
                                        <label for="original_meaning" class="form-label">Meaning *</label>
                                        <textarea class="form-control" id="original_meaning" name="original_meaning" rows="3" placeholder="Enter the meaning of the original word" required></textarea>
                                    </div>

                                    <!-- Example Input -->
                                    <div class="col-md-12">
                                        <label for="original_example" class="form-label">Example Sentence</label>
                                        <textarea class="form-control" id="original_example" name="original_example" rows="3" placeholder="Enter an example sentence using the original_word"></textarea>
                                    </div>

                                    <div class="col-12">
                                        <hr class="my-2">
                                    </div>

                                    <!-- Status Selection -->
                                    <div class="col-md-6">
                                        <label for="origStatus" class="form-label">Status *</label>
                                        <select class="form-select searchSelect" id="origStatus" name="status" required>
                                            <option value="published" selected>Published</option>
                                            <option value="draft">Draft</option>
                                            <option value="archived">Archived</option>
                                        </select>
                                    </div>

                                    <!-- Optional: Image/File Upload -->
                                    <div class="col-md-6">
                                        <label for="word_image" class="form-label">Word Image (Optional)</label>
                                        <input class="form-control" type="file" id="word_image" name="word_image" accept="image/*">
                                        <div class="form-text">Upload an image (max 2MB)</div>
                                    </div>

                                    <!-- Optional: Audio Pronunciation -->
                                    <div class="col-12">
                                        <label for="pronunciation" class="form-label">Pronunciation Audio (Optional)</label>
                                        <input class="form-control" type="file" id="pronunciation" name="pronunciation" accept="audio/*">
                                        <div class="form-text">Upload audio pronunciation (max 5MB)</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Right Card: Translations Secluded -->
                    <div class="col-md-6">
                        <div class="card h-100">
                            <div class="card-header">
                                <h6 class="mb-0">Translations (Optional)</h6>
                            </div>
                            <div class="card-body">
                                <div class="row g-3"> 
                                    <!-- Translation Language -->
                                    <div class="col-12">
                                        <label for="translation_language" class="form-label">Target Language</label>
                                        <select class="form-select searchSelect" id="translation_language" name="translation_language">
                                            <option value="">Select target language</option>
                                            <?php foreach ($languages as $lang): ?>
                                                <option value="<?= htmlspecialchars($lang['language_code']) ?>">
                                                    <?= htmlspecialchars($lang['language_name']) ?>
                                                </option>
                                            <?php endforeach; ?>
                                        </select>
                                    </div>

                                    <!-- Translated Word -->
                                    <div class="col-12">
                                        <label for="translated_word" class="form-label">Translated Word</label>
                                        <input type="text" class="form-control" id="translated_word" name="translated_word" placeholder="Enter the translated word">
                                    </div>

                                    <!-- Translated Meaning -->
                                    <div class="col-12">
                                        <label for="translated_meaning" class="form-label">Translated Meaning</label>
                                        <textarea class="form-control" id="translated_meaning" name="translated_meaning" rows="3" placeholder="Enter the meaning in translated language"></textarea>
                                    </div>

                                    <!-- Translated Example -->
                                    <div class="col-12">
                                        <label for="translated_example" class="form-label">Translated Example</label>
                                        <textarea class="form-control" id="translated_example" name="translated_example" rows="3" placeholder="Enter example in translated language"></textarea>
                                    </div>

                                    <div class="col-12">
                                        <hr class="my-2">
                                    </div>

                                    <!-- Status Selection -->
                                    <div class="col-md-6">
                                        <label for="transStatus" class="form-label">Status *</label>
                                        <select class="form-select searchSelect" id="transStatus" name="trans_status" required>
                                            <option value="published" selected>Published</option>
                                            <option value="draft">Draft</option>
                                            <option value="archived">Archived</option>
                                        </select>
                                    </div>

                                    <!-- Optional: Image/File Upload -->
                                    <div class="col-md-6">
                                        <label for="word_image" class="form-label">Word Image (Optional)</label>
                                        <input class="form-control" type="file" id="word_image" name="trans_word_image" accept="image/*">
                                        <div class="form-text">Upload an image (max 2MB)</div>
                                    </div>

                                    <!-- Optional: Audio Pronunciation -->
                                    <div class="col-12">
                                        <label for="pronunciation" class="form-label">Pronunciation Audio (Optional)</label>
                                        <input class="form-control" type="file" id="pronunciation" name="trans_pronunciation" accept="audio/*">
                                        <div class="form-text">Upload audio pronunciation (max 5MB)</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
                <button type="button" class="btn btn-primary create-word-submit-btn" id="saveWord">Save Word</button>
            </div>
        </form>
    </div>
</div>