<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Salary Certificate - {{ $employee->name }}</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: DejaVu Sans, sans-serif; font-size: 12px; color: #1a1a2e; background: #fff; padding: 60px; }
        .border-frame { border: 2px solid #1a1a2e; padding: 40px; min-height: 600px; position: relative; }
        .company-name { text-align: center; font-size: 22px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
        .subtitle { text-align: center; font-size: 11px; color: #6b7280; margin-bottom: 30px; }
        .divider { border-top: 2px solid #1a1a2e; margin: 10px 0 30px; }
        .cert-title { text-align: center; font-size: 18px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 30px; text-decoration: underline; }
        .cert-body { font-size: 13px; line-height: 2; }
        .highlight { font-weight: bold; }
        .signature-area { margin-top: 60px; display: flex; justify-content: space-between; }
        .sig-block { text-align: center; }
        .sig-line { border-top: 1px solid #374151; width: 180px; margin: 0 auto 6px; }
        .stamp-note { font-size: 10px; color: #9ca3af; text-align: center; margin-top: 40px; font-style: italic; }
    </style>
</head>
<body>
    <div class="border-frame">
        <div class="company-name">{{ $companyName }}</div>
        <div class="subtitle">Human Resources Department</div>
        <div class="divider"></div>
        <div class="cert-title">Salary Certificate</div>

        <div class="cert-body">
            <p>To Whom It May Concern,</p>
            <br>
            <p>
                This is to certify that <span class="highlight">{{ $employee->name }}</span> is currently employed with
                <span class="highlight">{{ $companyName }}</span> as <span class="highlight">{{ $employee->employeeProfile?->job_title ?? 'Staff' }}</span>
                in the <span class="highlight">{{ $employee->employeeProfile?->departmentRel?->name ?? '' }}</span> Department
                since <span class="highlight">{{ $employee->employeeProfile?->joining_date?->format('d M Y') ?? 'N/A' }}</span>.
            </p>
            <br>
            <p>
                Their current gross salary is <span class="highlight">{{ number_format((float) ($employee->salaryAssignment?->gross_salary ?? 0), 2) }}</span> per
                {{ $employee->salaryAssignment?->salary_type === 'yearly' ? 'year' : 'month' }}.
            </p>
            <br>
            <p>
                This certificate is issued upon the request of the employee for official purposes only.
            </p>
        </div>

        <div class="signature-area">
            <div class="sig-block">
                <div class="sig-line"></div>
                <div>HR Manager</div>
                <div style="font-size:10px; color:#6b7280;">{{ $companyName }}</div>
            </div>
            <div class="sig-block">
                <div style="font-size:11px; color:#9ca3af; margin-bottom:30px;">[Company Seal]</div>
                <div class="sig-line"></div>
                <div>Authorized Signatory</div>
            </div>
        </div>

        <div class="stamp-note">Date of Issue: {{ now()->format('d F Y') }}</div>
    </div>
</body>
</html>
