{% extends 'emails/base_email_template.html' %}
{% load i18n %}

{% block title %}{% trans "URGENT - Second SLA Reminder - Observation" %}{% endblock %}
{% block preheader %}{% trans "FINAL REMINDER: An observation is about to breach its SLA. Immediate action required." %}{% endblock %}

{% block content %}
<p style="margin: 0 0 15px;">
    {% trans "Dear" %} <strong>{{ recipient_name|default:'Colleague' }}</strong>,
</p>

<p style="margin: 0 0 20px;">
    {% trans "This is the final reminder that an observation is about to breach its SLA deadline. Immediate action is required." %}
</p>

<p style="margin: 0 0 5px;"><strong>{% trans "Tracking Code:" %}</strong> {{ observation.tracking_code }}</p>
{% if observation.title %}
<p style="margin: 0 0 5px;"><strong>{% trans "Title:" %}</strong> {{ observation.title }}</p>
{% endif %}
<p style="margin: 0 0 5px;"><strong>{% trans "Category:" %}</strong> {% if observation.category %}{{ observation.category.name_en }}{% else %}N/A{% endif %}</p>
<p style="margin: 0 0 5px;"><strong>{% trans "Severity:" %}</strong> {{ observation.get_severity_display }}</p>
<p style="margin: 0 0 5px;"><strong>{% trans "Status:" %}</strong> {{ observation.get_status_display }}</p>
<p style="margin: 0 0 5px;"><strong>{% trans "Due Date:" %}</strong> {{ due_date|date:"F d, Y H:i" }}</p>
<p style="margin: 0 0 20px;"><strong>{% trans "Time Remaining:" %}</strong> {{ hours_remaining }} {% trans "hours" %}</p>

<p style="margin: 0 0 5px;">- {% trans "Review and address this observation immediately" %}</p>
<p style="margin: 0 0 5px;">- {% trans "Update the observation status in the system" %}</p>
<p style="margin: 0 0 5px;">- {% trans "Add resolution notes to document actions taken" %}</p>
<p style="margin: 0 0 25px;">- {% trans "Failure to act may result in automatic escalation" %}</p>

{% if observation_url %}
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
        <td align="center">
            <a href="{{ observation_url }}"
               style="display: inline-block; padding: 12px 32px; font-size: 16px; font-weight: 600; color: #ffffff; text-decoration: none; border-radius: 6px; background-color: #005696;">
                {% trans "View Observation Now" %}
            </a>
        </td>
    </tr>
</table>
{% endif %}

<p style="margin: 25px 0 5px; font-size: 13px; color: #666666; direction: rtl; text-align: right;">
    تذكير نهائي عاجل - {{ observation.tracking_code }}
</p>
<p style="margin: 0; font-size: 12px; color: #999999; direction: rtl; text-align: right; line-height: 1.8;">
    هذا هو التذكير النهائي. الملاحظة على وشك تجاوز الموعد النهائي. يرجى اتخاذ الإجراء فوراً.<br>
    تاريخ الاستحقاق: {{ due_date|date:"Y F d H:i" }} - الوقت المتبقي: {{ hours_remaining }} ساعة
</p>
{% endblock %}
