<?php
// This file is included by the AdminController, which will handle the layout
// No need to set variables here as they're already set in the controller
?>

<div class="admin-card">
    <h2 class="text-xl font-semibold mb-4">Add New Menu</h2>
    
    <?php if (isset($error) && !empty($error)): ?>
    <div class="bg-red-800 text-white p-4 rounded-md mb-6">
        <i class="fas fa-exclamation-circle mr-2"></i> <?= htmlspecialchars($error) ?>
    </div>
    <?php endif; ?>
    
    <form class="admin-form" method="POST" action="/admin/menus/add">
        <div class="mb-6">
            <label for="name">Menu Name</label>
            <input type="text" id="name" name="name" required>
            <p class="text-sm text-gray-400 mt-1">Give your menu a name to identify it.</p>
        </div>
        
        <div class="mb-6">
            <label for="location">Menu Location</label>
            <select id="location" name="location" class="form-select">
                <option value="">Not assigned</option>
                <option value="header">Header</option>
                <option value="footer">Footer</option>
            </select>
            <p class="text-sm text-gray-400 mt-1">Choose where to display this menu on your site.</p>
        </div>
        
        <div class="flex justify-between">
            <a href="/admin/menus" class="btn-secondary">
                <i class="fas fa-arrow-left mr-2"></i>Back to Menus
            </a>
            <button type="submit" class="btn-primary">
                <i class="fas fa-plus mr-2"></i>Create Menu
            </button>
        </div>
    </form>
</div> 