<?php
/**
 * Enqueue Easy Invoice form styles
 */
function easy_invoice_enqueue_form_styles() {
    // Only on Easy Invoice admin pages
    $page = $_GET['page'] ?? '';
    if (!empty($page) && (
        strpos($page, 'easy-invoice') === 0 ||
        strpos($page, 'easy-quote') === 0 ||
        strpos($page, 'easy-invoice-builder') === 0 ||
        strpos($page, 'easy-invoice-quote-builder') === 0
    )) {
        // Form styling is handled by Tailwind CSS classes
        // No separate form.css needed
    }
}
add_action('admin_enqueue_scripts', 'easy_invoice_enqueue_form_styles');

/**
 * Dequeue WordPress default form CSS for Easy Invoice plugin
 */
function easy_invoice_dequeue_form_styles() {
    // Only on Easy Invoice admin pages
    $page = $_GET['page'] ?? '';
    if (!empty($page) && (
        strpos($page, 'easy-invoice') === 0 ||
        strpos($page, 'easy-quote') === 0 ||
        strpos($page, 'easy-invoice-builder') === 0 ||
        strpos($page, 'easy-invoice-quote-builder') === 0
    )) {
        // Only remove form-related WordPress default styles
		wp_deregister_style('colors');
		wp_dequeue_style('colors');


		wp_deregister_style('wp-admin');
		wp_dequeue_style('wp-admin');


        wp_deregister_style('forms');
        wp_dequeue_style('forms');
    }
}
add_action('wp_print_styles', 'easy_invoice_dequeue_form_styles', 999);
add_action('admin_enqueue_scripts', 'easy_invoice_dequeue_form_styles', 1);
