<?php

namespace email\templates;

use email\helpers\email_template;

class email_template_head
{
    use email_template;

    public function generate_text(): string
    {
        return "";
    }

    public function generate_html(): string
    {
        ob_start();
        # Start of the html
        ?>
        <!-- Styles -->
        <style>
            /* Reset/legacy helpers for broad email client support */
            html, body { margin: 0 !important; padding: 0 !important; height: 100% !important; width: 100% !important; }
            * { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
            table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
            table { border-collapse: collapse !important; }
            img { -ms-interpolation-mode: bicubic; border: 0; outline: none; text-decoration: none; display: block; }
            a { text-decoration: none; }
            /* Outlook.com (a.k.a. Hotmail) line-height fix */
            .ExternalClass { width: 100%; }
            .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }

            /* Base container used by all custom email templates */
            .email-template {
                width: 100%;
                max-width: 600px;
                margin: 0 auto;
                font-family: Arial, sans-serif;
                color: #000000;
            }

            /* New-customer specific layout (names reused from provided HTML) */
            .container-blue {
                background-color: #001244; /* brand blue */
                padding: 48px 24px; /* responsive friendly */
            }

            .container-inner {
                background-color: #ffffff;
                border-radius: 0;
                padding: 32px 24px;
            }

            .container-text-lg {
                color: #000000;
                font-size: 24px;
                line-height: 1.5;
                margin: 0 0 24px 0;
            }

            .container-text-md {
                color: #000000;
                font-size: 16px;
                line-height: 1.5;
                margin: 0 0 18px 0;
            }

            .container-text-sm {
                color: #000000;
                font-size: 14px;
                line-height: 1.5;
                margin: 0 0 14px 0;
            }

            .no-margin { margin: 0; }

            .container-button {
                background-color: #477fae;
                color: #ffffff !important;
                padding: 16px 24px;
                text-decoration: none;
                border-radius: 15px;
                font-size: 18px; /* slightly smaller for mobile/email clients */
                display: inline-block;
            }

            .container-button-shadow {
                box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            }

            /* Signature columns */
            .signature-columns {
                width: 100%;
                display: table; /* email-safe two columns */
                table-layout: fixed;
            }
            .signature-column {
                display: table-cell;
                vertical-align: top;
                width: 50%;
                padding-right: 8px;
            }
            .signature-image {
                width: 100px; height: auto; display: block; margin: 0 0 8px 0;
            }
            .signature-link, .signature-name, .signature-role { color: #001244; text-decoration: none; }
            .signature-name { font-weight: bold; }
            .signature-role { font-style: italic; }
        </style>

        <!--[if mso]>
        <style type="text/css">
            /* Outlook (Word) specific adjustments to mimic web rendering */
            body, table, td, p, a, span { font-family: Arial, sans-serif !important; }
            p { margin: 0 0 18px 0 !important; mso-line-height-rule: exactly; line-height: 150% !important; }
            .container-text-lg { font-size: 24px !important; }
            .container-text-md { font-size: 16px !important; }
            .container-text-sm { font-size: 14px !important; }
            .no-margin { margin: 0 !important; }
            .email-template { width: 600px !important; }
        </style>
        <![endif]-->

        <?php
        # End of the html
        return ob_get_clean();
    }
}