<?php
/**
 * Event general message component
 */
if (!defined('ABSPATH')) exit;

// Get general message settings
$em_show_general_message = $event_settings['em_show_general_message'] ?? 'no';
$em_general_message = $event_settings['em_general_message'] ?? '';
$em_general_message_bg_color = $event_settings['em_general_message_bg_color'] ?? '#EBF8FF';
$em_general_message_text_color = $event_settings['em_general_message_text_color'] ?? '#1E40AF';
$em_general_message_border_color = $event_settings['em_general_message_border_color'] ?? '#BFDBFE';

// Only show if general message is enabled and has content
if ($em_show_general_message !== 'yes' || empty($em_general_message)) {
    return;
}
?>

<div class="em-general-message em-mb-4" 
     style="background-color: <?php echo esc_attr($em_general_message_bg_color); ?>;">
    
    <div class="em-max-w-4xl em-mx-auto">
        <div class="em-flex em-items-start em-gap-3 em-p-4 em-rounded-lg em-border" 
             style="border-color: <?php echo esc_attr($em_general_message_border_color); ?>; background-color: <?php echo esc_attr($em_general_message_bg_color); ?>;">
            
            <!-- Info Icon -->
            <div class="em-flex-shrink-0 em-mt-0.5">
                <svg class="em-w-5 em-h-5" style="color: <?php echo esc_attr($em_general_message_text_color); ?>;" fill="currentColor" viewBox="0 0 20 20">
                    <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"></path>
                </svg>
            </div>
            
            <!-- Content -->
            <div class="em-flex-1 em-min-w-0">
                <div class="em-text-sm em-leading-relaxed" style="color: <?php echo esc_attr($em_general_message_text_color); ?>;">
                    <?php echo wp_kses_post(wpautop($em_general_message)); ?>
                </div>
            </div>
        </div>
    </div>
</div>
