{% extends "layout.html" %}

{% block content %}
<div class="admin-container">
    <h1>Create New User</h1>
        
    <form method="POST" action="{{ url_for('create_user') }}" class="user-form">
        <div class="form-group">
            <label for="username">Username</label>
            <input type="text" id="username" name="username" class="form-control" required autofocus>
        </div>
        
        <div class="form-group">
            <label for="email">Email</label>
            <input type="email" id="email" name="email" class="form-control" required>
        </div>
        
        <div class="form-group">
            <label for="password">Password</label>
            <input type="password" id="password" name="password" class="form-control" required>
        </div>
        
        <div class="form-group">
            <label for="role">Role</label>
            <select id="role" name="role" class="form-control">
                {% for role in roles %}
                <option value="{{ role.name }}">{{ role.value }}</option>
                {% endfor %}
            </select>
        </div>
        
        <div class="form-group">
            <label for="team_id">Team (Optional)</label>
            <select id="team_id" name="team_id" class="form-control">
                <option value="">No Team</option>
                {% for team in teams %}
                <option value="{{ team.id }}">{{ team.name }}</option>
                {% endfor %}
            </select>
        </div>
        
        <div class="form-group">
            <label class="checkbox-container">
                <input type="checkbox" name="auto_verify"> Auto-verify (skip email verification)
                <span class="checkmark"></span>
            </label>
        </div>
        
        <div class="form-group">
            <button type="submit" class="btn btn-success">Create User</button>
            <a href="{{ url_for('admin_users') }}" class="btn btn-secondary">Cancel</a>
        </div>
    </form>
</div>
{% endblock %}