<?php
declare(strict_types=1);

require_once __DIR__ . '/../../app/auth.php';
require_once __DIR__ . '/../../app/helpers.php';
require_once __DIR__ . '/../../app/csrf.php';

$u = require_role('artist');

ob_start();
?>
<div class="glass rounded-2xl p-5">
  <div class="flex items-center justify-between gap-3">
    <div>
      <div class="text-sm text-white/60">Yeni İlan</div>
      <div class="text-2xl font-semibold">Ürün Oluştur</div>
    </div>
    <a href="<?=h(app_base('seller/products.php'))?>" class="rounded-2xl px-4 py-2 bg-white/5 border border-white/10 hover:border-white/20 transition flex items-center gap-2">
      <i data-lucide="arrow-left" class="w-4 h-4"></i> Geri
    </a>
  </div>

  <form class="mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4" method="post" enctype="multipart/form-data">
    <input type="hidden" name="_csrf" value="<?=h(csrf_token())?>">

    <div class="rounded-2xl bg-white/5 border border-white/10 p-4">
      <div class="font-semibold mb-3 flex items-center gap-2">
        <i data-lucide="type" class="w-4 h-4 text-white/70"></i> Temel Bilgiler
      </div>

      <label class="block mb-3">
        <div class="text-sm text-white/70">Başlık</div>
        <input name="title" required class="mt-1 w-full rounded-2xl bg-white/5 border border-white/10 px-3 py-3 text-white" placeholder="Örn: Yağlı boya tablo - İstanbul">
      </label>

      <label class="block mb-3">
        <div class="text-sm text-white/70">Fiyat (₺)</div>
        <input name="price" type="number" min="0" step="1" required class="mt-1 w-full rounded-2xl bg-white/5 border border-white/10 px-3 py-3 text-white" placeholder="0">
      </label>

      <label class="block">
        <div class="text-sm text-white/70">Açıklama</div>
        <textarea name="description" rows="6" class="mt-1 w-full rounded-2xl bg-white/5 border border-white/10 px-3 py-3 text-white" placeholder="Eserin hikayesi, boyut, teknik..."></textarea>
      </label>
    </div>

    <div class="rounded-2xl bg-white/5 border border-white/10 p-4">
      <div class="font-semibold mb-3 flex items-center gap-2">
        <i data-lucide="image" class="w-4 h-4 text-white/70"></i> Medya (yakında)
      </div>

      <div class="rounded-2xl border border-dashed border-white/20 bg-white/5 p-4 text-white/70 text-sm">
        Bir sonraki adımda: çoklu fotoğraf yükleme, sürükle-bırak sıralama, kapak görseli, otomatik optimize.
      </div>

      <button type="button" disabled class="mt-4 w-full rounded-2xl py-3 bg-white/5 border border-white/10 text-white/40 cursor-not-allowed">
        Medya Yükleme (sonraki adım)
      </button>

      <button class="mt-3 w-full rounded-2xl py-3 bg-[#ff800a] text-black font-semibold hover:brightness-110 transition flex items-center justify-center gap-2">
        <i data-lucide="check" class="w-4 h-4"></i> Taslak Oluştur
      </button>
    </div>
  </form>

  <div class="mt-4 text-xs text-white/55">
    Bu ekran şimdilik UI iskeleti. Bir sonraki adımda DB’ye kayıt + taslak/yayında mantığı + komisyon grupları bağlanacak.
  </div>
</div>
<?php
$content = ob_get_clean();
$title = 'Yeni Ürün';
$active = 'new';
include __DIR__ . '/_layout.php';
