<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ __('Alerta de Convênio') }}</title>
</head>
<body style="margin: 0; padding: 0; background-color: #f0f4f8; font-family: 'Georgia', 'Times New Roman', serif;">

    <!-- Wrapper -->
    <table width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color: #f0f4f8; padding: 32px 16px;">
        <tr>
            <td align="center">
                <table width="620" cellpadding="0" cellspacing="0" border="0" style="max-width: 620px; width: 100%;">

                    <!-- Header institucional -->
                    <tr>
                        <td style="background: linear-gradient(135deg, #003366 0%, #004d99 60%, #005cb8 100%); border-radius: 12px 12px 0 0; padding: 0; overflow: hidden;">
                            
                            <!-- Faixa verde -->
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td style="background-color: #2e7d32; height: 6px; font-size: 0; line-height: 0;">&nbsp;</td>
                                </tr>
                            </table>

                            <!-- Conteúdo do header -->
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td style="padding: 28px 36px 24px 36px;">
                                        
                                        <!-- Brasão + Nome -->
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td style="vertical-align: middle; padding-right: 14px;">
                                                    <img src="https://angra.rj.gov.br/pmar/assets/img/brasao-2026.png"
                                                         alt="{{ __('Brasão da Prefeitura Municipal de Angra dos Reis') }}"
                                                         width="52"
                                                         height="52"
                                                         style="display: block; width: 52px; height: 52px; border: 0; outline: none;">
                                                </td>
                                                <td style="vertical-align: middle;">
                                                    <div style="color: #a8d4ff; font-family: Georgia, serif; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 3px;">Prefeitura Municipal de</div>
                                                    <div style="color: #ffffff; font-family: Georgia, serif; font-size: 20px; font-weight: bold; letter-spacing: 0.5px; line-height: 1.1;">Angra dos Reis</div>
                                                    <div style="color: #7fc4fd; font-family: Arial, sans-serif; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px;">Estado do Rio de Janeiro</div>
                                                </td>
                                            </tr>
                                        </table>

                                        <!-- Divider -->
                                        <table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-top: 20px;">
                                            <tr>
                                                <td style="height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.05) 100%); font-size: 0; line-height: 0;">&nbsp;</td>
                                            </tr>
                                        </table>

                                        <!-- Título do alerta -->
                                        <table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-top: 20px;">
                                            <tr>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
                                                        <tr>
                                                            <td style="background-color: #e65100; border-radius: 4px; padding: 4px 10px; vertical-align: middle;">
                                                                <span style="color: #ffffff; font-family: Arial, sans-serif; font-size: 10px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase;">&#9888; Alerta Automático</span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <div style="color: #ffffff; font-family: Georgia, serif; font-size: 22px; font-weight: bold; margin-top: 10px; line-height: 1.3;">
                                                        {{ __('Acompanhamento de Convênio') }}
                                                    </div>
                                                    <div style="color: #a8d4ff; font-family: Arial, sans-serif; font-size: 12px; margin-top: 4px; letter-spacing: 0.3px;">
                                                        Sistema de Gestão de PPPs e Convênios
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>

                                    </td>
                                </tr>
                            </table>

                            <!-- Faixa inferior do header -->
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td style="background-color: #2e7d32; height: 4px; font-size: 0; line-height: 0;">&nbsp;</td>
                                </tr>
                            </table>

                        </td>
                    </tr>

                    <!-- Corpo -->
                    <tr>
                        <td style="background-color: #ffffff; padding: 36px 36px 28px 36px;">

                            <!-- Dados do convênio -->
                            <div style="font-family: Arial, sans-serif; font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; color: #003366; margin-bottom: 14px;">
                                Dados do Instrumento
                            </div>

                            <table width="100%" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #dce8f5; border-radius: 8px; overflow: hidden;">
                                
                                <!-- Objeto -->
                                <tr>
                                    <td style="background-color: #f7fafd; padding: 14px 18px; border-bottom: 1px solid #dce8f5; width: 38%; vertical-align: top;">
                                        <span style="font-family: Arial, sans-serif; font-size: 11px; font-weight: bold; color: #4a6fa5; text-transform: uppercase; letter-spacing: 0.8px;">{{ __('Objeto') }}</span>
                                    </td>
                                    <td style="background-color: #ffffff; padding: 14px 18px; border-bottom: 1px solid #dce8f5; vertical-align: top;">
                                        <span style="font-family: Georgia, serif; font-size: 13px; color: #212529; line-height: 1.5;">{{ $convenio->objeto ?? '-' }}</span>
                                    </td>
                                </tr>

                                @if($convenio->numero_instrumento)
                                <!-- Número do instrumento -->
                                <tr>
                                    <td style="background-color: #f7fafd; padding: 14px 18px; border-bottom: 1px solid #dce8f5; width: 38%; vertical-align: middle;">
                                        <span style="font-family: Arial, sans-serif; font-size: 11px; font-weight: bold; color: #4a6fa5; text-transform: uppercase; letter-spacing: 0.8px;">{{ __('Nº do Instrumento') }}</span>
                                    </td>
                                    <td style="background-color: #ffffff; padding: 14px 18px; border-bottom: 1px solid #dce8f5; vertical-align: middle;">
                                        <span style="font-family: 'Courier New', monospace; font-size: 13px; color: #003366; background-color: #eef4fb; padding: 3px 8px; border-radius: 4px; display: inline-block;">{{ $convenio->numero_instrumento }}</span>
                                    </td>
                                </tr>
                                @endif

                                @if($convenio->numero_processo_sei)
                                <!-- Número SEI -->
                                <tr>
                                    <td style="background-color: #f7fafd; padding: 14px 18px; width: 38%; vertical-align: middle;">
                                        <span style="font-family: Arial, sans-serif; font-size: 11px; font-weight: bold; color: #4a6fa5; text-transform: uppercase; letter-spacing: 0.8px;">{{ __('Processo SEI') }}</span>
                                    </td>
                                    <td style="background-color: #ffffff; padding: 14px 18px; vertical-align: middle;">
                                        <span style="font-family: 'Courier New', monospace; font-size: 13px; color: #003366; background-color: #eef4fb; padding: 3px 8px; border-radius: 4px; display: inline-block;">{{ $convenio->numero_processo_sei }}</span>
                                    </td>
                                </tr>
                                @endif

                            </table>

                            <!-- Alertas -->
                            <div style="margin-top: 32px;">
                                <div style="font-family: Arial, sans-serif; font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; color: #003366; margin-bottom: 14px;">
                                    {{ __('Alertas Disparados') }}
                                </div>

                                @foreach($alertas as $alerta)
                                <table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-bottom: 10px;">
                                    <tr>
                                        <td style="background-color: #fff8f0; border-left: 4px solid #e65100; border-radius: 0 6px 6px 0; padding: 13px 16px; vertical-align: top;">
                                            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                <tr>
                                                    <td style="vertical-align: top; width: 22px; padding-top: 1px;">
                                                        <span style="font-size: 14px; color: #e65100;">&#9888;</span>
                                                    </td>
                                                    <td style="vertical-align: top;">
                                                        <span style="font-family: Arial, sans-serif; font-size: 13px; color: #3d2600; line-height: 1.5;">{{ $alerta['mensagem'] }}</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                                @endforeach
                            </div>

                        </td>
                    </tr>

                    <!-- Footer -->
                    <tr>
                        <td style="background-color: #f7fafd; border-top: 1px solid #dce8f5; border-radius: 0 0 12px 12px; padding: 20px 36px 24px 36px;">
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td>
                                        <div style="font-family: Arial, sans-serif; font-size: 11px; color: #6c757d; line-height: 1.6;">
                                            {{ __('Este é um aviso automático do sistema de gestão de PPPs e Convênios da Prefeitura de Angra dos Reis.') }}
                                            {{ __('Por favor, não responda a este e-mail.') }}
                                        </div>
                                        <table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-top: 14px;">
                                            <tr>
                                                <td style="height: 1px; background-color: #dce8f5; font-size: 0; line-height: 0;">&nbsp;</td>
                                            </tr>
                                        </table>
                                        <table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-top: 12px;">
                                            <tr>
                                                <td>
                                                    <span style="font-family: Georgia, serif; font-size: 12px; color: #4a6fa5; font-weight: bold;">Prefeitura Municipal de Angra dos Reis</span>
                                                    <span style="font-family: Arial, sans-serif; font-size: 11px; color: #adb5bd;"> &nbsp;|&nbsp; </span>
                                                    <span style="font-family: Arial, sans-serif; font-size: 11px; color: #9aafcc;">Estado do Rio de Janeiro</span>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>

</body>
</html>