@extends('layouts.winemaker')

@section('title', 'Vineyard Row Details')

@section('content')
<div class="card" style="background:#fff;border-radius:12px;padding:1.5rem;box-shadow:0 10px 30px rgba(0,0,0,0.08);max-width:720px;margin:0 auto;">
    <h1 style="font-size:1.6rem;color:#1a365d;margin-bottom:1.5rem;">Row #{{ $vineyardRow->id }}</h1>

    <dl style="display:grid;grid-template-columns:160px 1fr;row-gap:0.75rem;column-gap:1rem;">
        <dt style="font-weight:600;color:#475569;">Location</dt>
        <dd>{{ $vineyardRow->location ?? '—' }}</dd>

        <dt style="font-weight:600;color:#475569;">Vine count</dt>
        <dd>{{ $vineyardRow->vine_count }}</dd>

        <dt style="font-weight:600;color:#475569;">Status</dt>
        <dd style="text-transform:capitalize;">{{ $vineyardRow->status }}</dd>

        <dt style="font-weight:600;color:#475569;">Variation</dt>
        <dd>{{ $vineyardRow->varietyVariation?->grapeVariety?->variety_name ?? 'Unassigned' }}</dd>

        <dt style="font-weight:600;color:#475569;">Planting year</dt>
        <dd>{{ $vineyardRow->planting_year ?? '—' }}</dd>

        <dt style="font-weight:600;color:#475569;">Area (ha)</dt>
        <dd>{{ $vineyardRow->area ?? '—' }}</dd>

        <dt style="font-weight:600;color:#475569;">Notes</dt>
        <dd>{{ $vineyardRow->notes ?: '—' }}</dd>
    </dl>

    <div style="display:flex;justify-content:flex-end;gap:1rem;margin-top:1.5rem;">
        <a href="{{ route('vineyard-rows.edit', $vineyardRow) }}" style="background:#2563eb;color:#fff;padding:0.6rem 1.2rem;border-radius:8px;text-decoration:none;font-weight:600;">Edit</a>
        <form method="POST" action="{{ route('vineyard-rows.destroy', $vineyardRow) }}" onsubmit="return confirm('Delete this row?');">
            @csrf
            @method('DELETE')
            <button type="submit" style="background:#ef4444;color:#fff;padding:0.6rem 1.2rem;border-radius:8px;border:none;font-weight:600;">Delete</button>
        </form>
    </div>

    <div style="margin-top:1.5rem;">
        <a href="{{ route('vineyard-rows.index') }}" style="color:#2563eb;text-decoration:none;">Back to list</a>
    </div>
</div>
@endsection
