<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Update Author</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
        }

        .container {
            max-width: 600px;
            margin: 50px auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h2 {
            margin-top: 0;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            font-weight: bold;
            margin-bottom: 5px;
        }

        input[type="text"],
        input[type="number"],
        textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
        }

        textarea {
            resize: vertical;
        }

        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .back-button {
            display: block;
            width: 100%;
            padding: 10px;
            background-color: #ccc;
            color: #333;
            text-align: center;
            text-decoration: none;
            border-radius: 5px;
            margin-bottom: 20px;
        }

        .btn:hover {
            background-color: #0056b3;
        }
    </style>
</head>

<body>
    <div class="container">
        <a href="/index1" class="back-button">Quay lại Trang Chủ</a>
        <h2>Update Author</h2>
        <form action="/authors/update/<%= author._id %>" method="post">
            <div class="form-group">
                <label for="name">Tên tác giả:</label>
                <input type="text" id="name" name="name" value="<%= author.name %>" required>
            </div>
            <div class="form-group">
                <label for="birthDate">Năm sinh:</label>
                <input type="text" id="birthDate" name="birthDate" value="<%= author.birthDate %>" required>
            </div>
            <div class="form-group">
                <label for="biography">Tiểu sử:</label>
                <input type="text" id="biography" name="biography" value="<%= author.biography %>" required>
            </div>
            <div style="display:flex;">
                <a href="/authors/list" style="text-align: center;
                background-color: grey;
                margin-right: 10px;
                color: white;
                width: 80px;
                text-decoration: none;
                padding-top: 9px; border-radius: 8px;" class="">Quay lại</a>
                <button type="submit" class="btn">Update</button>
            </div>
        </form>
    </div>
</body>

</html>
