<?php

if ( in_array($initial_theme, $free_themes) ) return;

if ( $is_preview || current_user_can('publish_pages') ) {

    ?>
    
    <div class="gs-coach-restrict--pro-template">

        <div class="gs-coach-restrict--pro-template-inner">

            <button class="gs-coach-restrict--hide-btn" onclick="hide_restrict_notice(event)">X</button>

            <h2><?php _e( 'Sorry!', 'gscoach' ); ?></h2>

            <p style="margin-bottom: 16px;"><?php _e( 'This theme is not available in free version.<br>Please upgrade the plan to use this theme. Thanks!', 'gscoach' ); ?></p>

            <a href="https://www.gsplugins.com/product/wordpress-coaches-plugin/" target="_blank"><?php _e( 'Learn more details', 'gscoach' ); ?></a>
            
            <p class="gs-coach-restrict--notice"><?php _e( 'Only Admin & Editor will see this message, visitor will see <strong>Grid 1 (Hover)</strong> template.', 'gscoach' ); ?></p>
            
            <p class="gs-coach-restrict--info"><?php _e( 'This message is generated by <strong>GS Coach</strong> plugin.', 'gscoach' ); ?></p>

        </div>

    </div>

    <style>
        .gs_coach_area{position:relative;min-height:600px}.gs-coach-restrict--pro-template{width:100%;max-width:100%;padding:2.5em!important;margin-left:auto;margin-right:auto;position:absolute;top:0;left:0;height:100%;z-index:99;background:rgb(62 68 84 / 60%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.gs-coach-restrict--pro-template-inner{background:#fff;border-radius:4px;padding:2em;-webkit-box-shadow:0 0 2em rgb(133 134 156 / 20%);box-shadow:0 0 2em rgb(133 134 156 / 20%);position:relative}.gs-coach-restrict--pro-template-inner h2{margin:0;margin-bottom:20px;font-size:2em;letter-spacing:1px}.gs-coach-restrict--pro-template-inner .gs-coach-restrict--notice{background:#ffefd5;padding:20px;margin-top:30px;border-radius:4px;font-size:.8em}.gs-coach-restrict--pro-template-inner .gs-coach-restrict--info{margin-top:20px;margin-bottom:0;font-size:.7em}.gs-coach-restrict--pro-template-inner .gs-coach-restrict--hide-btn{position:absolute;top:20px;right:20px;width:34px;height:34px;z-index:9999;line-height:34px;font-size:16px;padding:0;margin:0;border-radius:50%;background:#e3e4e8;color:#454356;outline:0;text-decoration:none;text-indent:unset}
    </style>

    <script>
        function hide_restrict_notice( event ) {jQuery( event.target ).closest('.gs-coach-restrict--pro-template').fadeOut();}
    </script>

    <?php
    
}