@extends('layouts.app')
@section('content')
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Buat Katalog</title>
    <!-- Load Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: roboto;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        .container {
            max-width: 600px;
            margin: 50px auto;
            background-color: #fff;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
            animation: fadeIn 0.5s ease; /* Tambahkan animasi */
        }

        h1 {
            text-align: center;
            color: #333;
        }

        form {
            margin-top: 30px;
        }

        label {
            display: block;
            margin-bottom: 10px;
            color: #555;
        }

        input[type="text"],
        textarea,
        input[type="file"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 20px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            transition: border-color 0.3s ease; /* Tambahkan transisi untuk input */
        }

        .input-icon {
            position: relative;
        }

        .input-icon input,
        .input-icon textarea {
            padding-left: 30px;
        }

        .input-icon i {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
        }

        button {
            background-color: #007bff;
            color: #fff;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: background-color 0.3s ease; /* Tambahkan transisi untuk tombol */
        }

        button i {
            margin-right: 5px;
        }

        button:hover {
            background-color: #0056b3;
        }

        .error-message,
        .success-message {
            font-size: 0.8em;
            animation: fadeIn 0.5s ease; /* Tambahkan animasi */
        }

        .error-message {
            color: #ff0000;
        }

        .success-message {
            color: #28a745;
        }

        /* Animasi */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Tulis Katalog Baru</h1>
        <form action="{{ route('blogs.store') }}" method="POST" enctype="multipart/form-data">
            @csrf
            <div class="input-icon">
                <label for="title">Judul:</label>
                <i class="fas fa-heading"></i>
                <input type="text" id="title" name="title" required>
            </div>
            <div class="input-icon">
                <label for="content">Konten:</label>
                <i class="fas fa-align-left"></i>
                <textarea id="content" name="content" required></textarea>
            </div>
            <div class="input-icon">
                <label for="image">Gambar:</label>
                <i class="fas fa-image"></i>
                <input type="file" id="image" name="image">
            </div>
            <button type="submit"><i class="fas fa-plus"></i>Buat</button>
        </form>
        <!-- Pesan Kesalahan -->
        @if ($errors->any())
            <div class="error-message">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <!-- Pesan Sukses -->
        @if(session('success'))
            <div class="success-message">
                {{ session('success') }}
            </div>
        @endif
    </div>
</body>
</html>
@endsection
