<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<?php if ( !isset($_GET['user_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['user_nonce'])), 'DialBunny') ) {} ?>
<div class="dialbunny-admin-wrap">
<?php if ($current_page == 'info' && !isset($_GET['tabpage'])) { ?>
  <div class="dialbunny-card">
        <h2 class="dialbunny-title">Twilio Account Required</h2>
        <p class="dialbunny-description">In order to use DialBunny a Twilio account is required as Twilio handles the backend infastructure for managing phone calls and texts over the internet.</p>
        <p class="dialbunny-description">To obtain a phone number for DialBunny, start by creating a Twilio account at twilio.com, a straightforward process that involves signing up with an email and funding your account with a small balance to cover call and SMS costs (a trial account often includes initial credits). Once your Twilio account is active, retrieve your Account SID and Auth Token from the Twilio Console and add them inside the Setup page.</p>
        <p class="dialbunny-description">To keep your DialBunny plugin running smoothly, maintain a sufficient balance in your Twilio account. Twilio charges on a pay-as-you-go basis for each call and text message, plus a small monthly fee for each active phone number. A sufficient balance ensures uninterrupted service and prevents failed calls or message delivery due to insufficient credit.</p>
    </div>
    <div class="dialbunny-card">
        <h2 class="dialbunny-title">Getting A Phone Number</h2>
        <p class="dialbunny-description">To get a phone number you need to have created a Twilio account and have already added the necessary API keys inside the Setup page.</p>
        <p>You can find documentation at <a href="https://dialbunny.com/documentation/?doc=easy_obtain" target="_blank">Obtain a Number</a></p>
        <p class="dialbunny-description"><p>
    </div>
    <div class="dialbunny-card">
        <h2 class="dialbunny-title">Supported Browsers</h2>
        <p class="dialbunny-description">Most modern browsers will generally work with DialBunny; however, for the best experience and full functionality, we recommend using one of the officially supported browsers listed below:</p>
        <ul class="dialbunny-list">
            <li><strong>Chrome</strong></li>
            <li><strong>Firefox</strong></li>
            <li><strong>Safari (macOS, iOS)</strong>: WebRTC support started with Safari version 11.</li>
            <li><strong>Edge</strong>: Only the Chromium-based version is supported, not the legacy Edge.</li>
        </ul>
        <h3 class="dialbunny-subtitle">Mobile Browsers</h3>
        <p class="dialbunny-description">While mobile browsers can technically support the Twilio Voice JavaScript SDK for calling, there are limitations related to call interruption handling and background call functionality that may negatively impact user experience. Mobile browsers may struggle with making and receiving calls, but all other features will work fine.</p>
    </div>
    <div class="dialbunny-card">
        <h2 class="dialbunny-title">User Roles</h2>
        <p class="dialbunny-description">The DialBunny plugin includes a dedicated user role that allows users to access the call center dashboard without modifying restricted settings. Administrators have full access to all features.</p>
        <p class="dialbunny-description"><strong>Administrators:</strong></p>
        <ul class="dialbunny-list">
            <li>DialBunny call center dashboard</li>
            <li>Settings - Admin Page</li>
            <li>Information - Admin Page</li>
            <li>Active Numbers - Admin Page</li>
            <li>Released Numbers - Admin Page</li>
            <li>Add Number - Admin Page</li>
            <li>Remove Number - Admin Page</li>
            <li>License - Admin Page</li>
        </ul>
        <p class="dialbunny-description"><strong>DialBunny Role:</strong></p>
        <ul class="dialbunny-list">
            <li>Access to the DialBunny call center dashboard only</li>
        </ul>
        <p class="dialbunny-description">To assign the DialBunny role to a WordPress user, go to their account in the WordPress admin and change their role to DialBunny.</p>
    </div>
<?php } if ($current_page == 'info' && isset($_GET['tabpage']) && sanitize_text_field(wp_unslash($_GET['tabpage']) == 'additional')) { ?>
<div class="dialbunny-card">
    <h2 class="dialbunny-title">Phone Number Availability</h2>
    <p class="dialbunny-description">DialBunny integrates with Twilio to offer voice and SMS-enabled phone numbers globally. Any phone number supported by Twilio is compatible with DialBunny. However, limitations on phone number types and capabilities may apply due to telecommunications regulations in certain countries or regions, rather than Twilio itself.</p>
    <p class="dialbunny-description">You can find regulatory requirements for all Twilio phone numbers <a href="https://www.twilio.com/guidelines/regulatory/" target="_blank" class="dialbunny-link">on this page</a>.</p>
</div>
<div class="dialbunny-card">
    <h2 class="dialbunny-title">Feature Overview and Country-Specific Limitations</h2>
    <div class="dialbunny-table-container">
        <table class="dialbunny-table">
            <thead>
                <tr>
                    <th>Feature</th>
                    <th>Description</th>
                    <th>Regulation Impact</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Send Texts (SMS)</td>
                    <td>Send outbound text messages to customers or leads.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-danger">Limited in Some Countries</span></td>
                </tr>
                <tr>
                    <td>Receive Texts (SMS)</td>
                    <td>Receive inbound text messages from customers.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Make Phone Calls</td>
                    <td>Place outbound calls to customers, leads, or contacts.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-danger">Limited in Some Countries</span></td>
                </tr>
                <tr>
                    <td>Receive Phone Calls</td>
                    <td>Receive inbound phone calls from customers.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Forward Phone Calls</td>
                    <td>Automatically route incoming calls to a chosen number.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Manage Contacts</td>
                    <td>Organize and manage your customer contact list.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Setup AI Assistant</td>
                    <td>Create a virtual voice assistant to interact with callers.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Setup Automated Responses</td>
                    <td>Configure automated responses to incoming calls.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
                <tr>
                    <td>Setup Timetable</td>
                    <td>Schedule business hours and configure how calls are handled outside of them.</td>
                    <td><span class="dialbunny-badge dialbunny-badge-success">None</span></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="dialbunny-card">
    <h2 class="dialbunny-title">Availability of Toll-Free, Mobile, and Local Numbers</h2>
    <div class="dialbunny-table-container">
        <table class="dialbunny-table">
            <thead>
                <tr>
                    <th>Number Type</th>
                    <th>General Availability</th>
                    <th>Country-Specific Limitations</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td><strong>Toll-Free</strong></td>
                    <td>Available in many countries, mainly North America and parts of Europe</td>
                    <td>May not support SMS in some countries; not always available in developing regions</td>
                </tr>
                <tr>
                    <td><strong>Mobile</strong></td>
                    <td>Widely available and supported globally</td>
                    <td>Subject to SMS regulations or filtering in some countries; opt-in required in many</td>
                </tr>
                <tr>
                    <td><strong>Local</strong></td>
                    <td>Available in most countries with regional or city-level targeting</td>
                    <td>Some countries restrict foreign businesses from obtaining local numbers</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<?php } ?>
</div>