@extends('layouts.admin')
@section('title', 'Contact Submissions')
@section('page-title', 'Contact Forms')

@section('content')
<div class="glass-card">
    <div class="section-header">
        <div class="section-title">Contact Submissions</div>
        <span style="font-family:'JetBrains Mono',monospace;font-size:10px;color:var(--muted);">{{ $submissions->total() }} TOTAL</span>
    </div>
    <table class="data-table">
        <thead>
            <tr>
                <th>Name</th>
                <th>Email</th>
                <th>Phone</th>
                <th>Message Preview</th>
                <th>Date</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @forelse($submissions as $sub)
            <tr>
                <td style="font-weight:500;color:var(--text);">{{ $sub->full_name }}</td>
                <td style="color:#ef4444;font-size:12px;">{{ $sub->email }}</td>
                <td style="color:var(--muted);font-size:12px;" class="mono">{{ $sub->phone ?? '—' }}</td>
                <td style="color:var(--muted);font-size:12px;">{{ Str::limit($sub->message, 55) }}</td>
                <td style="color:var(--muted);font-size:12px;" class="mono">{{ $sub->created_at->format('M j, Y') }}</td>
                <td style="text-align:right;"><a href="{{ route('admin.contacts.show', $sub) }}" class="link-red">OPEN →</a></td>
            </tr>
            @empty
            <tr><td colspan="6" style="padding:48px;text-align:center;color:var(--muted);font-family:'JetBrains Mono',monospace;font-size:12px;letter-spacing:2px;">NO SUBMISSIONS YET</td></tr>
            @endforelse
        </tbody>
    </table>
    @if($submissions->hasPages())
    <div style="padding:16px 20px;border-top:1px solid var(--border);">{{ $submissions->links() }}</div>
    @endif
</div>
@endsection
