@extends('layouts.app')

@section('content')
<div class="max-w-xl mx-auto py-10 sm:px-6 lg:px-8">
    <h2 class="text-2xl font-semibold text-gray-800 mb-6">Subir nueva imagen</h2>

    <form action="{{ route('images.store') }}" method="POST" enctype="multipart/form-data" class="bg-white p-6 rounded shadow">
        @csrf

        <div class="mb-4">
            <label class="block font-medium text-sm text-gray-700">Nombre</label>
            <input type="text" name="name" class="input w-full" required>
        </div>

        <div class="mb-4">
            <label class="block font-medium text-sm text-gray-700">Texto alternativo (alt)</label>
            <input type="text" name="alt" class="input w-full">
        </div>

        <div class="mb-4">
            <label class="block font-medium text-sm text-gray-700">Archivo de imagen</label>
            <input type="file" name="image" accept="image/*" class="input w-full" required>
        </div>

        <div class="flex justify-end">
            <a href="{{ route('images.index') }}" class="btn btn-secondary mr-2">Cancelar</a>
            <button type="submit" class="btn btn-primary">Subir</button>
        </div>
    </form>
</div>
@endsection
