@extends('layouts.admin')

@section('admin-content')

<div class="admin-page-header">
    <div class="admin-page-header-content">
        <div class="admin-page-title">
            <h1>Add Package Version</h1>
        </div>
    </div>
</div>

<div class="card shadow-sm">
    <div class="card-body">

        <form action="{{ route('admin.packageversions.store') }}" method="POST" enctype="multipart/form-data">
            @csrf

            <div class="row g-3">

                <!-- Tech Stack -->
                <div class="col-md-6">
                    <label class="form-label fw-bold">Tech Stack</label>
                    <select name="tech_stack" class="form-select" required>
                        <option value="">Select Technology</option>
                        @foreach($tech_stacks as $t)
                        <option value="{{ $t->id }}">{{ $t->name }}</option>
                        @endforeach
                    </select>
                </div>

                <!-- Version -->
                <div class="col-md-6">
                    <label class="form-label fw-bold">Version</label>
                    <input type="text" name="version" class="form-control" placeholder="e.g. v1.0.0" required>
                </div>

                <!-- ZIP Upload -->
                <div class="col-md-12">
                    <label class="form-label fw-bold">Upload ZIP (max 5MB)</label>
                    <input type="file" name="zip_file" class="form-control" accept=".zip" required>
                </div>

                <div class="col-md-12 mt-3">
                    <button class="btn btn-primary">
                        <i class="fas fa-save me-1"></i> Save
                    </button>

                    <a href="{{ route('admin.packageversions.index') }}" class="btn btn-secondary ms-2">
                        Cancel
                    </a>
                </div>

            </div>
        </form>

    </div>
</div>

@endsection
