{{-- Toast --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Page title / plan badge row --}}

{{ __('Temp Mail') }}

{{ __('Generate disposable email addresses for testing and privacy.') }}

{{ $this->planUsage['used'] }} / {{ $this->planUsage['unlimited'] ? __('Unlimited') : $this->planUsage['limit'] }} {{ __('addresses') }}
{{-- History panel — vertical list of past / expired addresses. Only rendered when the user toggles the History button on. There is no "active addresses" pill bar anymore: the workspace has at most one live address at a time, and pressing "Change" (or "Generate") replaces it. --}} @if($showHistory && $this->activeAddresses->isNotEmpty())
@foreach($this->activeAddresses as $addr) @php // Expired rows keep a red selection highlight — using // the same brand-blue/green for "selected + expired" // as for "selected + active" made the two look // identical, so the user couldn't tell the chosen // address was dead. $isActiveSel = $this->activeAddressId === $addr->id; $isExpired = $addr->isExpired(); if ($isActiveSel && $isExpired) { $btnCls = 'bg-danger/10 border-danger/40 text-danger'; } elseif ($isActiveSel) { $btnCls = 'bg-brand/10 border-brand/30 text-brand'; } else { $btnCls = 'bg-surface border-border text-ink hover:border-border'; } @endphp @endforeach
@endif @if($this->selectedAddress) @if($this->selectedAddress->isExpired()) {{-- Unmistakable red banner when the user is looking at a dead address. No new mail will ever arrive here because the catch- all mapping + TTL on the temp_mail_addresses row have already expired — without this banner the page reads as if the address is still live, which was confusing when selecting a historical entry. --}}

{{ __('This address has expired') }}

{{ __("Any mail sent to it now will be rejected. Click Change above to generate a new live address.") }}

@endif {{-- Two-column layout: left (address hero) takes 4/12 of the row, right (action bar + inbox list) takes 8/12 — so the inbox has roughly twice the width of the hero. Both columns are top- aligned (items-start) so their first visual element sits on the same horizontal line. Collapses to a single column on narrow viewports. --}}
{{-- LEFT: HERO "Your Temporary Email Address" — big pill with the address, a QR trigger, and a copy button (temp-mail.org style). --}}

{{ __('Your Temporary Email Address') }}

{{-- Floating confirmation toast — pops up above the pill so the user has an unmistakable signal the address was copied, even if they weren't watching the icon swap. --}} {{ __('Copied!') }}

{{ __('Forget about spam, advertising mailings, hacking and attacking robots. Keep your real mailbox clean and secure. Temp Mail provides temporary, secure, anonymous, free, disposable email address.') }}

{{-- Meta strip: label, expiry, message count --}}

@if($this->selectedAddress->label) {{ $this->selectedAddress->label }} · @endif {{ $this->selectedAddress->isExpired() ? __('Expired') : __('Expires') . ' ' . $this->selectedAddress->expires_at->diffForHumans() }} · {{ $this->selectedAddress->messages_count }} {{ __('message(s)') }}

{{-- QR modal --}}

{{ __('Scan to copy') }}

QR

{{ $this->selectedAddress->full_address }}

{{-- RIGHT column wrapper: action bar + message list stacked. Wrapped in a `panel` so the column's top edge aligns with the left hero panel's top edge (both share the same border/padding weight instead of the right side starting higher as bare pill-buttons). --}}
{{-- Action bar: Copy / Refresh / Change / Delete --}}
{{-- Message list / detail area — swaps between a table of messages and a single message detail view when one is clicked. Constrained width + auto-centered so the card doesn't stretch edge-to-edge; feels more focused and matches temp-mail.org. The panel chrome is dropped entirely when the inbox is empty so the "No messages yet" state reads as a light note instead of a boxy empty card. --}} @php $hasInboxContent = $this->selectedMessageDetail || $this->messages->isNotEmpty(); @endphp {{-- The outer right column is already a `panel`, so the inner list area just gets a subtle border + overflow-hidden to keep the table's rounded corners clean. No nested panel chrome. --}}
@if($this->selectedMessageDetail) {{-- DETAIL VIEW --}}
{{ strtoupper(substr($this->selectedMessageDetail->from_name ?: $this->selectedMessageDetail->from_email, 0, 2)) }}

{{ $this->selectedMessageDetail->from_name ?: __('Unknown') }}

{{ $this->selectedMessageDetail->from_email }}

{{ __('Date') }}

{{ $this->selectedMessageDetail->created_at->format('d-m-Y H:i:s') }}

{{ __('Subject') }}: {{ $this->selectedMessageDetail->subject ?: __('(No Subject)') }}
{!! $this->selectedMessageDetail->safe_body_html ?? nl2br(e($this->selectedMessageDetail->body_text ?? '')) !!}
@if($this->selectedMessageDetail->attachments && $this->selectedMessageDetail->attachments->isNotEmpty())

{{ __('Attachments') }} ({{ $this->selectedMessageDetail->attachments->count() }})

@foreach($this->selectedMessageDetail->attachments as $att)

{{ $att->file_name ?? $att->filename ?? __('Attachment') }}

@endforeach
@endif
@elseif($this->messages->isNotEmpty()) {{-- LIST VIEW — three-column table: SENDER / SUBJECT / VIEW, all on one line. Uses inline flex widths (not Tailwind grid-cols-[...]) because the JIT build doesn't always have the arbitrary grid-template-columns compiled — that's what was making the header labels stack. --}}
{{ __('Sender') }} {{ __('Subject') }} {{ __('View') }}
@foreach($this->messages as $msg) @endforeach @else {{-- EMPTY state — tight layout, no picture-frame icon (it read as a broken-image placeholder on the dark bg) and no giant blank space above/below. One short headline + one line telling the user which address to mail. --}}

{{ __('No messages yet') }}

{{ __('Send an email to') }} {{ $this->selectedAddress->full_address }} {{ __('and it will appear here.') }}

@endif
{{-- /right column --}}
{{-- /grid --}} @else

{{ __('Temp Mail') }}

{{ __('Generate a disposable email address to get started') }}

@endif {{-- Generate Modal (kept for users who want to pick a specific domain / add a label — still wired up via an advanced flow). --}} @if($showGenerator) @endif