<?php
/**
 * Help Page Class
 *
 * @package Polanger_Dashboard_Tools
 */

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

class PDT_Help_Page {

  /**
   * Render help page.
   *
   * @return void
   */
  public function render_page() {
    $links = array(
      array(
        'title'       => __( 'Documentation', 'polanger-admin-menu-manager' ),
        'description' => __( 'Read full plugin setup guides and feature documentation.', 'polanger-admin-menu-manager' ),
        'url'         => 'https://polanger.com/documentation/polanger-admin-suite/docs/',
        'button'      => __( 'Open Documentation', 'polanger-admin-menu-manager' ),
        'badge'       => __( 'Docs', 'polanger-admin-menu-manager' ),
      ),
      array(
        'title'       => __( 'Developer Docs', 'polanger-admin-menu-manager' ),
        'description' => __( 'Explore hooks, filters, extension API, and addon development guides.', 'polanger-admin-menu-manager' ),
        'url'         => 'https://polanger.com/documentation/polanger-admin-suite/developer/',
        'button'      => __( 'Open Developer Docs', 'polanger-admin-menu-manager' ),
        'badge'       => __( 'Developer', 'polanger-admin-menu-manager' ),
      ),
      array(
        'title'       => __( 'Rate This Plugin', 'polanger-admin-menu-manager' ),
        'description' => __( 'Enjoying Polanger Admin Suite? Leave a review on WordPress.org and help us grow.', 'polanger-admin-menu-manager' ),
        'url'         => 'https://wordpress.org/plugins/polanger-admin-menu-manager/',
        'button'      => __( 'Leave a Review', 'polanger-admin-menu-manager' ),
        'badge'       => __( 'Community', 'polanger-admin-menu-manager' ),
      ),
      array(
        'title'       => __( 'Support', 'polanger-admin-menu-manager' ),
        'description' => __( 'Need help? Reach out to our support team with your setup details.', 'polanger-admin-menu-manager' ),
        'url'         => 'https://polanger.com/support/',
        'button'      => __( 'Contact Support', 'polanger-admin-menu-manager' ),
        'badge'       => __( 'Help Center', 'polanger-admin-menu-manager' ),
      ),
    );
    ?>
    <div class="wrap pdt-help-wrap">
      <div class="pdt-help-header">
        <h1><?php esc_html_e( 'Help Center', 'polanger-admin-menu-manager' ); ?></h1>
        <p><?php esc_html_e( 'Quick access to documentation, developer resources, support, and WordPress reviews.', 'polanger-admin-menu-manager' ); ?></p>
      </div>

      <div class="pdt-help-grid">
        <article class="pdt-help-card pdt-help-card--support">
          <div class="pdt-help-card__content">
            <span class="pdt-help-badge pdt-help-badge--support"><?php esc_html_e( 'Optional Support', 'polanger-admin-menu-manager' ); ?></span>
            <h2><?php esc_html_e( 'Support Development', 'polanger-admin-menu-manager' ); ?></h2>
            <div class="pdt-help-card__copy">
              <p><?php esc_html_e( 'Polanger Admin Suite is completely free.', 'polanger-admin-menu-manager' ); ?></p>
              <p><?php esc_html_e( 'If it saves you time or helps your business, you can support future development with an optional donation.', 'polanger-admin-menu-manager' ); ?></p>
              <p><?php esc_html_e( 'Every contribution helps us continue improving the plugin and releasing new features.', 'polanger-admin-menu-manager' ); ?></p>
            </div>
          </div>

          <div class="pdt-help-card__actions">
            <a class="button button-primary pdt-help-button pdt-help-button--support" href="https://polanger.com/?plm_manual_payment=1" target="_blank" rel="noopener noreferrer">
              <span class="pdt-help-button__icon" aria-hidden="true">&#10084;</span>
              <span><?php esc_html_e( 'Support Development', 'polanger-admin-menu-manager' ); ?></span>
            </a>
          </div>
        </article>

        <?php foreach ( $links as $item ) : ?>
          <article class="pdt-help-card">
            <span class="pdt-help-badge"><?php echo esc_html( $item['badge'] ); ?></span>
            <h2><?php echo esc_html( $item['title'] ); ?></h2>
            <p><?php echo esc_html( $item['description'] ); ?></p>
            <a class="button button-primary pdt-help-button" href="<?php echo esc_url( $item['url'] ); ?>" target="_blank" rel="noopener noreferrer">
              <?php echo esc_html( $item['button'] ); ?>
            </a>
          </article>
        <?php endforeach; ?>
      </div>
    </div>
    <?php
  }
}
