<?php
/**
 * Admin rating notice (core admin_notices markup).
 *
 * @var string $review_url
 * @var string $support_url
 * @var string $personalized_line
 * @var bool   $can_remind
 */
?>
<div
    class="notice notice-info is-dismissible neurogenesis-theme-rating-notice"
    data-neurogenesis-theme-rating
>
    <div class="neurogenesis-theme-rating-notice__panel" data-rating-state="issues">
        <div class="neurogenesis-theme-rating-notice__badge neurogenesis-theme-rating-notice__badge--rate">
            <span class="neurogenesis-theme-rating-notice__badge-icon" aria-hidden="true">
                <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                    <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
                </svg>
            </span>
            <?php esc_html_e('Quick check-in', 'thinko'); ?>
        </div>

        <h2 class="neurogenesis-theme-rating-notice__headline"><?php esc_html_e('Enjoying Thinko?', 'thinko'); ?></h2>

        <p class="neurogenesis-theme-rating-notice__description neurogenesis-theme-rating-notice__description--personal">
            <?php echo esc_html($personalized_line); ?>
        </p>

        <p class="neurogenesis-theme-rating-notice__description">
            <?php esc_html_e('Having any issues we should know about?', 'thinko'); ?>
        </p>

        <div class="neurogenesis-theme-rating-notice__choice-row">
            <button type="button" class="neurogenesis-theme-rating-notice__btn neurogenesis-theme-rating-notice__btn--primary" data-rating-action="no-issues">
                <?php esc_html_e('No, happy to rate', 'thinko'); ?>
            </button>
            <a
                class="neurogenesis-theme-rating-notice__btn neurogenesis-theme-rating-notice__btn--ghost"
                href="<?php echo esc_url($support_url); ?>"
                target="_blank"
                rel="noopener noreferrer"
                data-rating-action="need-help"
            >
                <?php esc_html_e('Report a problem', 'thinko'); ?>
            </a>
        </div>
    </div>

    <div class="neurogenesis-theme-rating-notice__panel" data-rating-state="rate" hidden>
        <div class="neurogenesis-theme-rating-notice__badge neurogenesis-theme-rating-notice__badge--rate">
            <span class="neurogenesis-theme-rating-notice__badge-icon" aria-hidden="true">
                <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                    <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
                </svg>
            </span>
            <?php esc_html_e('Feel free to rate', 'thinko'); ?>
        </div>

        <h2 class="neurogenesis-theme-rating-notice__headline"><?php esc_html_e('Enjoying Thinko?', 'thinko'); ?></h2>

        <p class="neurogenesis-theme-rating-notice__description neurogenesis-theme-rating-notice__description--personal">
            <?php echo esc_html($personalized_line); ?>
        </p>

        <p class="neurogenesis-theme-rating-notice__description">
            <?php esc_html_e('Would you take 5 seconds to rate us?', 'thinko'); ?>
        </p>

        <div class="neurogenesis-theme-rating-notice__stars" role="group" aria-label="<?php esc_attr_e('Rate Thinko', 'thinko'); ?>">
            <?php for ($star = 1; $star <= 5; $star++) : ?>
                <button
                    type="button"
                    class="neurogenesis-theme-rating-notice__star"
                    data-rating-star="<?php echo (int) $star; ?>"
                    aria-label="<?php echo esc_attr(sprintf(_n('%d star', '%d stars', $star, 'thinko'), $star)); ?>"
                >
                    <svg width="28" height="28" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
                        <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
                    </svg>
                </button>
            <?php endfor; ?>
        </div>

        <div class="neurogenesis-theme-rating-notice__actions" style="display: none;">
            <?php if ($can_remind) : ?>
                <button type="button" class="neurogenesis-theme-rating-notice__action" data-rating-action="remind">
                    <span><?php esc_html_e('Remind me later', 'thinko'); ?></span>
                    <span class="neurogenesis-theme-rating-notice__action-icon" aria-hidden="true">
                        <svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <path d="M5 12h14M13 6l6 6-6 6" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>
                        </svg>
                    </span>
                </button>
            <?php endif; ?>
            <button type="button" class="neurogenesis-theme-rating-notice__action" data-rating-action="already-reviewed">
                <span><?php esc_html_e('Already rated', 'thinko'); ?></span>
                <span class="neurogenesis-theme-rating-notice__action-icon" aria-hidden="true">
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/>
                    </svg>
                </span>
            </button>
            <button type="button" class="neurogenesis-theme-rating-notice__action neurogenesis-theme-rating-notice__action--muted" data-rating-action="not-for-me">
                <span><?php esc_html_e("This isn't for me", 'thinko'); ?></span>
            </button>
        </div>
    </div>

    <div class="neurogenesis-theme-rating-notice__panel" data-rating-state="thanks-low" hidden>
        <div class="neurogenesis-theme-rating-notice__badge neurogenesis-theme-rating-notice__badge--saved">
            <span class="neurogenesis-theme-rating-notice__badge-icon" aria-hidden="true">
                <svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M12 3l7 3v6c0 5-3.5 8.5-7 9-3.5-.5-7-4-7-9V6l7-3z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
                    <path d="M9 12l2 2 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
                </svg>
            </span>
            <?php esc_html_e('Feedback saved', 'thinko'); ?>
        </div>

        <h2 class="neurogenesis-theme-rating-notice__headline"><?php esc_html_e('Thank you for your rating!', 'thinko'); ?></h2>

        <p class="neurogenesis-theme-rating-notice__description">
            <?php esc_html_e('We appreciate your honest rating. We will keep refining Thinko to earn a perfect score next time.', 'thinko'); ?>
        </p>

        <div class="neurogenesis-theme-rating-notice__footer">
            <button type="button" class="neurogenesis-theme-rating-notice__btn neurogenesis-theme-rating-notice__btn--ghost" data-rating-action="dismiss-permanent">
                <?php esc_html_e('Dismiss', 'thinko'); ?>
            </button>
        </div>
    </div>

    <div class="neurogenesis-theme-rating-notice__panel" data-rating-state="thanks-high" hidden>
        <div class="neurogenesis-theme-rating-notice__badge neurogenesis-theme-rating-notice__badge--saved">
            <span class="neurogenesis-theme-rating-notice__badge-icon" aria-hidden="true">
                <svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M12 3l7 3v6c0 5-3.5 8.5-7 9-3.5-.5-7-4-7-9V6l7-3z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
                    <path d="M9 12l2 2 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
                </svg>
            </span>
            <?php esc_html_e('Feedback saved', 'thinko'); ?>
        </div>

        <h2 class="neurogenesis-theme-rating-notice__headline" data-rating-high-headline>
            <?php esc_html_e('You gave us 5 stars!', 'thinko'); ?> &#128525;
        </h2>

        <p class="neurogenesis-theme-rating-notice__description">
            <?php esc_html_e('Sharing your experience on WordPress.org helps our team keep improving Thinko.', 'thinko'); ?>
        </p>
    </div>
</div>
