<?php
/**
 * New Order Admin Email
 * Sent to admin when a new paid order is received
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

class GGM_Commerce_Email_New_Order_Admin extends GGM_Commerce_Email_Template {

    /**
     * Constructor
     */
    public function __construct() {
        $this->id             = 'new_order_admin';
        $this->title          = __( 'New Order (Admin)', 'ggm-commerce' );
        $this->description    = __( 'Sent to admin when a new paid order is received.', 'ggm-commerce' );
        $this->recipient_type = 'admin';
    }

    /**
     * Get default subject
     *
     * @return string
     */
    public function get_default_subject() {
        return __( '[{site_name}] New order #{order_number} - {order_total}', 'ggm-commerce' );
    }

    /**
     * Get default heading
     *
     * @return string
     */
    public function get_default_heading() {
        return __( 'New Order Received', 'ggm-commerce' );
    }

    /**
     * Get default content
     *
     * @return string
     */
    public function get_default_content() {
        return '
<p>You have received a new order from {customer_name} ({customer_email}).</p>

<div class="address-box" style="margin: 24px 0; background: #d1fae5; border-left: 4px solid #059669;">
    <h4 style="color: #065f46;">Order Summary</h4>
    <p><strong>Order Number:</strong> #{order_number}<br>
    <strong>Order Date:</strong> {order_date}<br>
    <strong>Order Total:</strong> {order_total}<br>
    <strong>Payment Method:</strong> {payment_method}<br>
    <strong>Payment Status:</strong> {payment_status}</p>
</div>

{order_items_table}

{checkout_fields}

<div style="display: flex; gap: 24px; margin-top: 32px;">
    <div class="address-box" style="flex: 1;">
        <h4>Billing Address</h4>
        <p>{billing_address}</p>
    </div>
    <div class="address-box" style="flex: 1;">
        <h4>Shipping Address</h4>
        <p>{shipping_address}</p>
    </div>
</div>

<p style="margin-top: 32px; text-align: center;">
    <a href="{site_url}/wp-admin/admin.php?page=ggmc-orders" class="button">View Order in Dashboard</a>
</p>
';
    }
}
