<?php
/**
 * ITSWEBER CMS – English System Messages
 */
return [
    'created' => ':item created successfully.',
    'updated' => ':item updated successfully.',
    'deleted' => ':item deleted successfully.',
    'saved' => 'Changes saved.',
    'activated' => ':item activated.',
    'deactivated' => ':item deactivated.',

    'not_found' => ':item not found.',
    'create_failed' => 'Could not create :item.',
    'update_failed' => 'Could not update :item.',
    'delete_failed' => 'Could not delete :item.',
    'generic_error' => 'An error occurred. Please try again.',
    'permission_denied' => 'Permission denied.',

    'field_required' => 'This field is required.',
    'all_required' => 'All fields are required.',
    'invalid_email' => 'Please enter a valid e-mail address.',
    'password_min' => 'Password must be at least :min characters.',
    'password_mismatch' => 'Passwords do not match.',
    'username_taken' => 'Username already taken.',
    'email_taken' => 'Email address already in use.',
    'username_format' => 'Username may only contain letters, numbers, underscores and hyphens.',
    'invalid_credentials' => 'Invalid credentials.',

    'login_error' => 'Invalid credentials.',
    'login_locked' => 'Too many failed login attempts. Please wait :minutes minute(s).',
    'reset_sent' => 'If an account with this e-mail address exists, a reset link has been sent.',
    'reset_success' => 'Password changed successfully. You can now sign in.',
    'reset_error' => 'Could not reset password.',
    'reset_invalid_token' => 'Invalid or expired reset link.',

    'user_created' => 'User ":name" created successfully.',
    'user_updated' => 'User ":name" updated successfully.',
    'user_deleted' => 'User deleted successfully.',
    'cannot_delete_self' => 'You cannot delete your own account.',
    'cannot_deactivate_self' => 'You cannot deactivate your own account.',

    'page_created' => 'Page ":title" created successfully.',
    'page_updated' => 'Page ":title" updated successfully.',
    'page_deleted' => 'Page deleted successfully.',
    'page_duplicated' => 'Page duplicated successfully.',
    'system_page_delete_error' => 'System pages cannot be deleted.',

    'post_created' => 'Post ":title" created successfully.',
    'post_updated' => 'Post ":title" updated successfully.',
    'post_deleted' => 'Post deleted successfully.',
    'post_duplicated' => 'Post duplicated successfully.',
    'category_created' => 'Category created successfully.',
    'category_updated' => 'Category updated successfully.',
    'category_deleted' => 'Category deleted successfully.',
    'tag_deleted' => 'Tag deleted successfully.',

    'album_created' => 'Album ":title" created successfully.',
    'album_updated' => 'Album ":title" updated successfully.',
    'album_deleted' => 'Album deleted successfully.',
    'image_uploaded' => 'Image uploaded successfully.',
    'image_deleted' => 'Image deleted successfully.',
    'images_added' => ':count image(s) added to gallery.',

    'event_created' => 'Event ":title" created successfully.',
    'event_updated' => 'Event ":title" updated successfully.',
    'event_deleted' => 'Event deleted successfully.',

    'download_created' => 'Download ":title" created successfully.',
    'download_updated' => 'Download ":title" updated successfully.',
    'download_deleted' => 'Download deleted successfully.',

    'file_uploaded' => 'File uploaded successfully.',
    'file_updated' => 'File updated successfully.',
    'file_deleted' => 'File deleted successfully.',
    'folder_created' => 'Folder created successfully.',
    'folder_renamed' => 'Folder renamed successfully.',
    'folder_deleted' => 'Folder deleted successfully.',

    'menu_item_added' => 'Menu item added.',
    'menu_item_updated' => 'Menu item updated.',
    'menu_item_deleted' => 'Menu item deleted.',
    'menu_reordered' => 'Menu order updated.',

    'settings_saved' => 'Settings saved.',
    'language_changed' => 'Language changed.',
    'cache_cleared' => 'Page cache cleared (:count files removed).',
    'totp_invalid' => 'Invalid authentication code. Please try again.',
    'totp_enabled' => 'Two-factor authentication has been enabled.',
    'totp_disabled' => 'Two-factor authentication has been disabled.',
    'totp_setup_incomplete' => 'Please enter the secret and verification code.',
    'totp_codes_regenerated' => 'Recovery codes have been regenerated.',

    'theme_activated' => 'Theme ":name" activated.',
    'theme_installed' => 'Theme ":name" installed successfully.',
    'theme_uninstalled' => 'Theme uninstalled successfully.',

    'plugin_activated' => 'Plugin ":name" activated.',
    'plugin_deactivated' => 'Plugin ":name" deactivated.',
    'plugin_installed' => 'Plugin ":name" installed successfully.',
    'plugin_uninstalled' => 'Plugin uninstalled successfully.',

    'maintenance_enabled' => 'Maintenance mode enabled.',
    'maintenance_disabled' => 'Maintenance mode disabled.',
    'maintenance_updated' => 'Maintenance configuration updated.',

    // Backup & Restore
    'backup_created' => 'Backup created successfully.',
    'backup_restored' => 'Backup restored successfully.',
    'update_applied' => 'Update applied successfully.',
    'backup_select_file' => 'Please select a backup file.',
    'update_select_file' => 'Please select an update file.',
    'only_zip_allowed' => 'Only ZIP files are accepted. The uploaded file has the extension ".:ext".',
    'backup_save_failed' => 'Could not save backup file. Please check write permissions on storage/temp/.',
    'update_save_failed' => 'Could not save update file. Please check write permissions on storage/temp/.',
    'backup_invalid' => 'Invalid backup file: :error',
    'update_invalid' => 'Invalid update package: :error',
    'update_preflight_failed' => 'Update package failed preflight check: :errors',
    'restore_no_session' => 'No valid backup session found. Please upload again.',
    'update_no_session' => 'No valid update session found. Please upload again.',
    'restore_failed' => 'Restore failed: :error',
    'restore_success' => 'Restore completed successfully. The website now shows the backup state.',
    'update_failed' => 'Update failed: :error',
    'update_success' => 'Update applied successfully. New version: :version. Please clear your browser cache (Ctrl+F5).',
    'upload_err_ini_size' => 'The file exceeds the maximum size set in php.ini (upload_max_filesize).',
    'upload_err_form_size' => 'The file exceeds the maximum size specified in the form.',
    'upload_err_partial' => 'The file was only partially uploaded. Please try again.',
    'upload_err_no_file' => 'No file was selected.',
    'upload_err_no_tmp_dir' => 'Temporary directory missing. Please check server configuration.',
    'upload_err_cant_write' => 'Could not write file to disk. Please check write permissions.',
    'upload_err_extension' => 'Upload aborted by a PHP extension.',
    'upload_err_unknown' => 'Upload error (code :code). Please try again.',
    'zip_extension_missing' => 'The ZIP extension is not available on this server. Backup not possible.',

    // Contact form
    // Contact form (generic builder messages)
    'contact_field_required'      => ':label is a required field.',
    'contact_field_email_invalid' => 'Please enter a valid e-mail address.',
    'contact_field_too_long'      => ':label must not exceed :max characters.',
    'contact_form_disabled'       => 'The contact form is currently unavailable.',
    // Contact form (legacy – kept for backward compat)
    'contact_name_required' => 'Please enter your name.',
    'contact_name_max' => 'Name must not exceed 120 characters.',
    'contact_email_required' => 'Please enter your e-mail address.',
    'contact_email_invalid' => 'Please enter a valid e-mail address.',
    'contact_subject_required' => 'Please enter a subject.',
    'contact_subject_max' => 'Subject must not exceed 200 characters.',
    'contact_message_required' => 'Please enter your message.',
    'contact_message_max' => 'Message must not exceed 5,000 characters.',
    'contact_fix_errors' => 'Please correct the highlighted fields.',
    'contact_success' => 'Thank you for your message! We will get back to you as soon as possible.',
    'contact_send_failed' => 'Your message could not be sent. Please try again or contact us directly by e-mail.',

    // Additional admin messages
    'invalid_language' => 'Invalid language selected.',
    'file_required' => 'No file selected.',
    'upload_failed' => 'Upload failed.',
    'upload_too_large' => 'File too large. PHP post_max_size=:max. Please increase upload_max_filesize and post_max_size in php.ini.',
    'reload_page' => 'Please reload the page.',

    // Bulk actions
    'bulk_action_done' => ':count item(s) processed successfully.',
    'all_uploads_failed' => 'All :count uploads failed. Check file types and sizes (Images: JPG, PNG, GIF, WEBP, SVG, ICO · max 5 MB | Videos: MP4, WEBM, OGV, MOV · max 200 MB).',

    // Error variants for specific contexts
    'error' => [
        'slug_taken' => 'A category/item with this slug already exists.',
        'category_has_posts' => 'Cannot delete: :count post(s) are assigned to this category. Reassign or delete them first.',
        'name_taken' => 'An item with this name already exists.',
        'tag_has_posts' => 'Cannot delete tag: still assigned to :count post(s).',
        'invalid_input' => 'Invalid input provided.',
        'last_admin' => 'Cannot delete the last admin account. Create another admin first.',
        'no_images_added' => 'No images could be added. Some images may already be in the gallery.',

        // Validation
        'title_required' => 'Title is required.',
        'start_date_required' => 'Start date is required.',
        'category_name_required' => 'Category name is required.',
        'no_items_selected' => 'No items selected.',
        'folder_name_empty' => 'Folder name cannot be empty.',
        'category_has_items' => 'Cannot delete: :count item(s) are assigned to this category. Reassign or delete them first.',

        // System
        'storage_not_writable' => 'Error: storage/ is not writable.',
        'backup_error' => 'Backup failed: :error',
        'settings_save_error' => 'Settings could not be saved: :error',

        // Package upload (Plugin / Theme)
        'no_slug_specified' => 'No :type specified.',
        'invalid_slug' => 'Invalid :type slug.',
        'not_installed' => ':type ":name" is not installed.',
        'save_state_failed' => 'Could not save :type activation state. Check write permissions on storage/.',
        'no_file_uploaded' => 'No file uploaded. Please select a :type ZIP file.',
        'upload_error' => 'Upload failed: :error',
        'zip_too_large' => ':type ZIP exceeds the 10 MB size limit.',
        'only_zip_accepted' => 'Only .zip files are accepted as :type packages.',
        'invalid_zip_mime' => 'Uploaded file does not appear to be a valid ZIP archive (MIME: :mime).',
        'zip_not_available' => 'PHP ZipArchive extension is not available on this server. :type upload is not supported.',
        'temp_dir_failed' => 'Could not create temporary extraction directory.',
        'zip_open_failed' => 'Could not open ZIP archive. The file may be corrupted (ZipArchive error: :code).',
        'zip_path_traversal' => 'Security: :type ZIP contains unsafe path entries (path traversal detected). Installation aborted.',
        'zip_absolute_path' => 'Security: :type ZIP contains absolute path entries. Installation aborted.',
        'zip_extract_failed' => 'Failed to extract ZIP archive. The file may be corrupted or the server lacks write permissions.',
        'zip_resolve_failed' => 'Security: Could not resolve temp directory path after extraction.',
        'zip_slip_detected' => 'Security: ZIP-slip path escape detected after extraction. Installation aborted.',
        'no_manifest_found' => 'Invalid :type package: no :manifest found. The ZIP must contain a :manifest at the root or inside a single subdirectory.',
        'invalid_manifest_json' => 'Invalid :type package: :manifest is not valid JSON.',
        'manifest_missing_fields' => 'Invalid :type package: :manifest must contain "slug", "name", and "version" fields.',
        'invalid_slug_format' => 'Invalid :type slug ":slug". Slug must start with a lowercase letter or digit and contain only lowercase letters, digits, and hyphens.',
        'plugin_entry_missing' => 'Invalid plugin package: a plugin.php entry-point file is required.',
        'theme_templates_missing' => 'Invalid theme package: a templates/ directory is required.',
        'not_found_named' => ':type ":name" not found.',
        'system_theme' => 'Theme ":name" is a system theme and cannot be uninstalled.',
        'active_theme' => 'The currently active theme cannot be uninstalled. Please activate a different theme first.',
        'theme_not_found_invalid' => 'Theme ":name" not found or invalid.',
        'theme_slug_reserved' => 'The theme slug ":slug" is reserved and cannot be overwritten by upload.',
    ],
];
