<?php
/**
 * Main admin page template.
 *
 * @package CoffeeWP_Media_Cleanup
 */

defined( 'ABSPATH' ) || exit;

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variables are scoped to the include() call from the render method, not actually global.

$user_theme = get_user_meta( get_current_user_id(), 'cwpm_theme_preference', true );
$theme_attr = $user_theme ? $user_theme : 'light';
$is_dark    = in_array( $theme_attr, array( 'dark', 'frappe', 'macchiato', 'mocha' ), true );
?>
<div class="color-punch-root<?php echo esc_attr( $is_dark ? ' dark' : '' ); ?>" data-theme="<?php echo esc_attr( $theme_attr ); ?>">

	<header class="cwpm-header" role="banner">
		<div class="cwpm-header__left">
			<div id="cwpm_nav">
				<?php
				$nav_items = array(
					array(
						'id'    => 'cwpm-logs-nav',
						'label' => __( 'Logs', 'coffeewp-media-cleanup' ),
						'icon'  => 'fa-file-lines',
						'color' => 'blue',
					),
					array(
						'id'    => 'cwpm-trash-nav',
						'label' => __( 'Trash', 'coffeewp-media-cleanup' ),
						'icon'  => 'fa-trash-can',
						'color' => 'red',
					),
					array(
						'id'    => 'cwpm-nav-scan',
						'label' => __( 'Scan', 'coffeewp-media-cleanup' ),
						'icon'  => 'fa-magnifying-glass',
						'color' => 'green',
					),
				);

				/**
				 * Filter the nav-bar item list. Extension plugins may append
				 * their own entries (e.g. a Settings link) here.
				 *
				 * @since 1.3.0
				 *
				 * @param array $nav_items Each entry: ['id'=>string,'label'=>string,'icon'=>string,'color'=>string].
				 */
				$nav_items = apply_filters( 'cwpm_nav_items', $nav_items );
				foreach ( $nav_items as $item ) :
					$color_class = $item['color'] ? 'hover:text-' . esc_attr( $item['color'] ) . ' active-text-' . esc_attr( $item['color'] ) : '';
					?>
					<button type="button" id="<?php echo esc_attr( $item['id'] ); ?>"
						class="btn btn--ghost no-lift <?php echo esc_attr( trim( $color_class ) ); ?>">
						<span class="icon icon--lg" aria-hidden="true"><i
								class="fa-solid <?php echo esc_attr( $item['icon'] ); ?>"></i></span>
						<span><?php echo esc_html( $item['label'] ); ?></span>
					</button>
				<?php endforeach; ?>
			</div>
		</div>
		<div class=" flex justify-center items-center gap-5">
			<div>
				<span class="cwpm-logo" aria-hidden="true"></span>
			</div>
			<div>
				<h5 class=" hide-lg cwpm-header__title text-small">
					CoffeeWP Media Cleanup
				</h5>
			</div>

		</div>
		<div class="flex justify-end">

			<div id="theme-switcher"></div>
		</div>
	</header>

	<main class="cwpm-main container">

		<div class="cwpm-steps" id="cwpm-steps">
			<div class="cwpm-scan-topbar">
				<h4 class="cwpm-scan-topbar__title">
					<span class="icon icon--xs" aria-hidden="true"><i class="fa-solid fa-magnifying-glass"></i></span>
					<?php esc_html_e( 'Scan', 'coffeewp-media-cleanup' ); ?>
				</h4>
			</div>
			<nav class="cwpm-wizard-nav" id="cwpm-wizard-nav"
				aria-label="<?php esc_attr_e( 'Wizard steps', 'coffeewp-media-cleanup' ); ?>">
				<div class="cwpm-wizard-nav__item cwpm-wizard-nav__item--completed cwpm-wizard-nav__item--active"
					data-step="1" aria-current="step">
					<span class="cwpm-wizard-nav__num">1</span>
					<span
						class="cwpm-wizard-nav__label"><?php esc_html_e( 'Settings', 'coffeewp-media-cleanup' ); ?></span>
				</div>
				<div class="cwpm-wizard-nav__item cwpm-wizard-nav__item--completed" data-step="2">
					<span class="cwpm-wizard-nav__num">2</span>
					<span class="cwpm-wizard-nav__label"><?php esc_html_e( 'Scan', 'coffeewp-media-cleanup' ); ?></span>
				</div>
				<div class="cwpm-wizard-nav__item cwpm-wizard-nav__item--completed" data-step="3">
					<span class="cwpm-wizard-nav__num">3</span>
					<span class="cwpm-wizard-nav__label"><?php esc_html_e( 'Results', 'coffeewp-media-cleanup' ); ?></span>
				</div>
			</nav>
			<?php
			require CWPM_PATH . 'templates/steps/step-settings.php';
			require CWPM_PATH . 'templates/steps/step-scan.php';
			require CWPM_PATH . 'templates/steps/step-results.php';
			?>
		</div>

		<!-- Trash view (hidden until Trash nav button is clicked) -->
		<div id="cwpm-trash-view" class="cwpm-trash-view cwpm-secondary-view" style="display: none;">
			<?php require CWPM_PATH . 'templates/views/trash-view.php'; ?>
		</div>

		<!-- Log view (hidden until Logs nav button is clicked) -->
		<div id="cwpm-logs-view" class="cwpm-logs-view cwpm-secondary-view" style="display: none;">
			<?php require CWPM_PATH . 'templates/views/logs-view.php'; ?>
		</div>

	</main>

	<!-- Trash Actions modal -->
	<div id="cwpm-trash-actions-modal" class="modal modal-medium" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-trash-actions-modal-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-trash-actions-modal-title" class="modal-title">
					<?php esc_html_e( 'Choose an Action', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<div class="grid grid-cols-3 gap-4 cwpm-action-cards justify-center">
					<button type="button" class="card card-vertical cwpm-action-card bg-green" data-action="restore"
						data-color="green"
						data-desc="<?php esc_attr_e( 'Restore selected files back to their original location.', 'coffeewp-media-cleanup' ); ?>">
						<div class="card-body">
							<span class="cwpm-action-card__icon" aria-hidden="true"><i
									class="fa-solid fa-rotate-left"></i></span>
							<span
								class="cwpm-action-card__label"><?php esc_html_e( 'Restore File', 'coffeewp-media-cleanup' ); ?></span>
						</div>
					</button>
					<button type="button" class="card card-vertical cwpm-action-card bg-red"
						data-action="permanent-delete" data-color="red"
						data-desc="<?php esc_attr_e( 'Permanently delete selected files. This cannot be undone.', 'coffeewp-media-cleanup' ); ?>">
						<div class="card-body">
							<span class="cwpm-action-card__icon" aria-hidden="true"><i
									class="fa-solid fa-trash"></i></span>
							<span
								class="cwpm-action-card__label"><?php esc_html_e( 'Permanently Delete', 'coffeewp-media-cleanup' ); ?></span>
						</div>
					</button>
				</div>
				<p class="cwpm-action-cards__desc" id="cwpm-trash-action-cards-desc">
					<?php esc_html_e( 'Select an action to perform on checked files.', 'coffeewp-media-cleanup' ); ?>
				</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--primary"
					data-modal-close><?php esc_html_e( 'Done', 'coffeewp-media-cleanup' ); ?></button>
			</div>
		</div>
	</div>

	<!-- Clean done modal -->
	<div id="cwpm-clean-done-modal" class="modal modal-medium" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-clean-done-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-clean-done-title" class="modal-title">
					<?php esc_html_e( 'Done', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<div class="cwpm-clean-done-icon" aria-hidden="true">
					<i class="fa-solid fa-circle-check"></i>
				</div>
				<p class="cwpm-clean-done-message">
					<?php esc_html_e( 'Clean complete! Here\'s a summary of what was done.', 'coffeewp-media-cleanup' ); ?>
				</p>
				<!-- Per-action result sections injected by JS -->
				<div id="cwpm-clean-action-results"></div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--primary"
					data-modal-close><?php esc_html_e( 'Done', 'coffeewp-media-cleanup' ); ?></button>
			</div>
		</div>
	</div>

	<!-- Nothing-to-clean modal -->
	<div id="cwpm-nothing-to-clean-modal" class="modal modal-small" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-nothing-to-clean-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-nothing-to-clean-title" class="modal-title">
					<?php esc_html_e( 'Nothing to Clean', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<p id="cwpm-nothing-to-clean-message">
					<?php esc_html_e( 'Select at least one file row before cleaning.', 'coffeewp-media-cleanup' ); ?>
				</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--primary"
					data-modal-close><?php esc_html_e( 'OK', 'coffeewp-media-cleanup' ); ?></button>
			</div>
		</div>
	</div>

	<!-- Disclaimer modal (first-time clean only) -->
	<div id="cwpm-disclaimer-modal" class="modal modal-large" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-disclaimer-modal-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-disclaimer-modal-title" class="modal-title">
					<?php esc_html_e( 'Before You Clean', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<div class="alert alert--info" role="alert">
					<div class="alert__message">
						<strong><?php esc_html_e( 'How cleaning works:', 'coffeewp-media-cleanup' ); ?></strong>
						<?php esc_html_e( 'Selected files will be moved to a trash folder inside your wp-content directory. They are not permanently deleted. You can restore trashed files at any time from the', 'coffeewp-media-cleanup' ); ?>
						<a href="#" id="cwpm-disclaimer-trash-link"
							style="color: inherit; text-decoration: underline;"><?php esc_html_e( "plugin's Trash view", 'coffeewp-media-cleanup' ); ?></a><?php esc_html_e( '.', 'coffeewp-media-cleanup' ); ?>
					</div>
				</div>
				<div class="cwpm-disclaimer">
					<p class="cwpm-disclaimer__lead">
						<?php esc_html_e( 'Please read before you continue:', 'coffeewp-media-cleanup' ); ?>
					</p>
					<ul class="cwpm-disclaimer__list">
						<li><?php esc_html_e( 'We strongly recommend creating a full site backup (files and database) via your hosting provider or a backup plugin before running any cleanup. This is your safety net if anything unexpected happens.', 'coffeewp-media-cleanup' ); ?>
						</li>
						<li><?php esc_html_e( 'Trashed files are moved to a plugin-managed folder and can be restored individually. However, emptying the trash is permanent and cannot be undone.', 'coffeewp-media-cleanup' ); ?>
						</li>
						<li><?php esc_html_e( 'Cleaning may affect what appears in the Media Library and on your live site. Unused thumbnails, orphaned files, and unregistered sizes will be moved based on the actions you selected. Review your selection carefully.', 'coffeewp-media-cleanup' ); ?>
						</li>
						<li><?php esc_html_e( 'No automated scan is 100% accurate. Some files flagged as unused may be referenced by third-party plugins, custom theme code, or external services in ways this plugin cannot detect.', 'coffeewp-media-cleanup' ); ?>
						</li>
						<li><?php esc_html_e( 'As long as you maintain regular backups, this is a very safe operation. You can always restore trashed files or roll back from your backup if needed.', 'coffeewp-media-cleanup' ); ?>
						</li>
					</ul>
				</div>
				<div class="cwpm-disclaimer__confirm">
					<label class="form__check">
						<input type="checkbox" id="cwpm-disclaimer-checkbox" />
						<span></span>
						<span
							class="cwpm-disclaimer__confirm-label"><?php esc_html_e( 'I have read the above and understand that I am responsible for my own backups.', 'coffeewp-media-cleanup' ); ?></span>
					</label>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--outline btn--secondary" id="cwpm-disclaimer-cancel"
					data-modal-close>
					<?php esc_html_e( 'Cancel', 'coffeewp-media-cleanup' ); ?>
				</button>
				<button type="button" class="btn btn--primary" id="cwpm-disclaimer-proceed" disabled>
					<?php esc_html_e( 'I Understand — Proceed', 'coffeewp-media-cleanup' ); ?>
				</button>
			</div>
		</div>
	</div>

	<!-- New Scan confirmation modal -->
	<div id="cwpm-confirm-new-scan-modal" class="modal modal-medium" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-confirm-new-scan-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-confirm-new-scan-title" class="modal-title">
					<?php esc_html_e( 'Start New Scan?', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<p><?php esc_html_e( 'This will replace your previous scan results. Continue?', 'coffeewp-media-cleanup' ); ?>
				</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--outline btn--secondary" id="cwpm-confirm-new-scan-cancel"
					data-modal-close><?php esc_html_e( 'Cancel', 'coffeewp-media-cleanup' ); ?></button>
				<button type="button" class="btn btn--primary"
					id="cwpm-confirm-new-scan-proceed"><?php esc_html_e( 'Start New Scan', 'coffeewp-media-cleanup' ); ?></button>
			</div>
		</div>
	</div>

	<!-- Actions modal -->
	<div id="cwpm-actions-modal" class="modal modal-large" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-actions-modal-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-actions-modal-title" class="modal-title">
					<?php esc_html_e( 'Select Actions', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<p class="cwpm-action-cards__section-label">
					<?php esc_html_e( 'Basic Actions', 'coffeewp-media-cleanup' ); ?>
				</p>
				<div class="grid grid-cols-4 gap-4 cwpm-action-cards" id="cwpm-action-cards-basic">
					<button type="button" class="card card-vertical cwpm-action-card bg-blue"
						data-action="regenerate-thumbnails" data-color="blue"
						data-desc="<?php esc_attr_e( 'Rebuild all registered thumbnail sizes for selected files.', 'coffeewp-media-cleanup' ); ?>">
						<div class="card-body">
							<span class="cwpm-action-card__icon" aria-hidden="true"><i
									class="fa-solid fa-arrows-rotate"></i></span>
							<span
								class="cwpm-action-card__label"><?php esc_html_e( 'Regenerate Thumbnails', 'coffeewp-media-cleanup' ); ?></span>
						</div>
					</button>
					<button type="button" class="card card-vertical cwpm-action-card bg-amber"
						data-action="delete-orphan-thumbnails" data-color="amber"
						data-desc="<?php esc_attr_e( 'Remove thumbnail files that are no longer linked to any registered size.', 'coffeewp-media-cleanup' ); ?>">
						<div class="card-body">
							<span class="cwpm-action-card__icon" aria-hidden="true"><i
									class="fa-solid fa-broom"></i></span>
							<span
								class="cwpm-action-card__label"><?php esc_html_e( 'Delete Orphan Thumbnails', 'coffeewp-media-cleanup' ); ?></span>
						</div>
					</button>
					<button type="button" class="card card-vertical cwpm-action-card bg-red" data-action="trash-file"
						data-color="red"
						data-desc="<?php esc_attr_e( 'Move every selected file to trash, regardless of whether it is used. Useful for trashing a specific duplicate copy.', 'coffeewp-media-cleanup' ); ?>">
						<div class="card-body">
							<span class="cwpm-action-card__icon" aria-hidden="true"><i
									class="fa-solid fa-trash"></i></span>
							<span
								class="cwpm-action-card__label"><?php esc_html_e( 'Trash File', 'coffeewp-media-cleanup' ); ?></span>
						</div>
					</button>
				</div>
				<div class="mt-12">
					<ul class="accordion">
						<li class="accordion__item">
							<details class="accordion__details">
								<summary class="accordion__summary">
									<span class="accordion__label">
										<?php esc_html_e( 'Advanced Actions', 'coffeewp-media-cleanup' ); ?>
									</span>
									<span class="accordion__icon">+</span>
								</summary>
								<div class="accordion__panel" style="background:transparent;">
									<div class="grid grid-cols-4 gap-4 cwpm-action-cards" id="cwpm-action-cards">
										<button type="button" class="card card-vertical cwpm-action-card bg-green"
											data-action="delete-unused" data-color="green"
											data-desc="<?php esc_attr_e( 'Delete files that exist in the Media Library but are not used on any page or post.', 'coffeewp-media-cleanup' ); ?>">
											<div class="card-body">
												<span class="cwpm-action-card__icon" aria-hidden="true"><i
														class="fa-solid fa-trash-can"></i></span>
												<span class="cwpm-action-card__label">
													<?php esc_html_e( 'Delete Unused Files', 'coffeewp-media-cleanup' ); ?>
												</span>
											</div>
										</button>
										<button type="button" class="card card-vertical cwpm-action-card bg-purple"
											data-action="delete-broken" data-color="purple"
											data-desc="<?php esc_attr_e( 'Remove Media Library entries whose physical files are missing from disk. Does not affect files that exist on disk — use Delete Missing for those.', 'coffeewp-media-cleanup' ); ?>">
											<div class="card-body">
												<span class="cwpm-action-card__icon" aria-hidden="true"><i
														class="fa-solid fa-link-slash"></i></span>
												<span class="cwpm-action-card__label">
													<?php esc_html_e( 'Delete Broken Entries', 'coffeewp-media-cleanup' ); ?>
												</span>
											</div>
										</button>
										<button type="button" class="card card-vertical cwpm-action-card bg-red"
											data-action="delete-missing" data-color="red"
											data-desc="<?php esc_attr_e( 'Move to trash files that exist on disk but have no Media Library entry.', 'coffeewp-media-cleanup' ); ?>">
											<div class="card-body">
												<span class="cwpm-action-card__icon" aria-hidden="true"><i
														class="fa-solid fa-file-circle-xmark"></i></span>
												<span class="cwpm-action-card__label">
													<?php esc_html_e( 'Delete Missing in Media Library', 'coffeewp-media-cleanup' ); ?>
												</span>
											</div>
										</button>
										<button type="button" class="card card-vertical cwpm-action-card bg-teal"
											data-action="add-to-media" data-color="teal"
											data-desc="<?php esc_attr_e( 'Register orphan files in the WordPress Media Library so they become manageable.', 'coffeewp-media-cleanup' ); ?>">
											<div class="card-body">
												<span class="cwpm-action-card__icon" aria-hidden="true"><i
														class="fa-solid fa-file-import"></i></span>
												<span class="cwpm-action-card__label">
													<?php esc_html_e( 'Add to Media Library', 'coffeewp-media-cleanup' ); ?>
												</span>
											</div>
										</button>
																			</div>
								</div>
							</details>
						</li>
					</ul>
				</div>
			</div>
			<div class="modal-footer cwpm-actions-modal-footer">
				<p class="cwpm-action-cards__desc" id="cwpm-action-cards-desc">
					<?php esc_html_e( 'Select one or more actions to perform on checked files.', 'coffeewp-media-cleanup' ); ?>
				</p>
				<button type="button" class="btn btn--primary"
					data-modal-close><?php esc_html_e( 'Done', 'coffeewp-media-cleanup' ); ?></button>
			</div>
		</div>
	</div>

	<!-- Trash Disclaimer modal -->
	<div id="cwpm-trash-disclaimer-modal" class="modal modal-large" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-trash-disclaimer-modal-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-trash-disclaimer-modal-title" class="modal-title">
					<?php esc_html_e( 'Before You Empty the Trash', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<div class="alert alert--error mb-6" role="alert">
					<div class="alert__message">
						<?php esc_html_e( 'You are about to permanently delete files. This action cannot be undone.', 'coffeewp-media-cleanup' ); ?>
					</div>
				</div>
				<ul class="cwpm-disclaimer__list">
					<li><?php esc_html_e( 'Permanently deleted files cannot be recovered from this plugin.', 'coffeewp-media-cleanup' ); ?>
					</li>
					<li><?php esc_html_e( 'We strongly recommend creating a full site backup before proceeding.', 'coffeewp-media-cleanup' ); ?>
					</li>
					<li><?php esc_html_e( 'If you are unsure, consider restoring files first and reviewing them.', 'coffeewp-media-cleanup' ); ?>
					</li>
				</ul>
				<div class="cwpm-disclaimer__confirm">
					<label class="form__check">
						<input type="checkbox" id="cwpm-trash-disclaimer-checkbox" />
						<span></span>
						<span
							class="cwpm-disclaimer__confirm-label"><?php esc_html_e( 'I understand this is permanent and I have made backups.', 'coffeewp-media-cleanup' ); ?></span>
					</label>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--outline" id="cwpm-trash-disclaimer-cancel" data-modal-close>
					<?php esc_html_e( 'Cancel', 'coffeewp-media-cleanup' ); ?>
				</button>
				<button type="button" class="btn btn--danger" id="cwpm-trash-disclaimer-proceed" disabled>
					<?php esc_html_e( 'Delete Permanently', 'coffeewp-media-cleanup' ); ?>
				</button>
			</div>
		</div>
	</div>

	<div id="cwpm-orphan-delete-modal" class="modal modal-medium" aria-hidden="true" role="dialog" aria-modal="true"
		aria-labelledby="cwpm-orphan-delete-modal-title">
		<div class="modal-backdrop"></div>
		<div class="modal-box">
			<button type="button" class="modal-close"
				aria-label="<?php esc_attr_e( 'Close', 'coffeewp-media-cleanup' ); ?>">&times;</button>
			<div class="modal-header">
				<h2 id="cwpm-orphan-delete-modal-title" class="modal-title"
					data-default="<?php esc_attr_e( 'Some Files No Longer Exist', 'coffeewp-media-cleanup' ); ?>">
					<?php esc_html_e( 'Some Files No Longer Exist', 'coffeewp-media-cleanup' ); ?>
				</h2>
			</div>
			<div class="modal-body">
				<div class="alert alert--warning" role="alert">
					<div class="alert__message" id="cwpm-orphan-delete-message"
						data-default="<?php esc_attr_e( 'The following files were not found and may have already been deleted from disk:', 'coffeewp-media-cleanup' ); ?>">
						<?php esc_html_e( 'The following files were not found and may have already been deleted from disk:', 'coffeewp-media-cleanup' ); ?>
					</div>
				</div>
				<ul id="cwpm-orphan-delete-list" class="cwpm-orphan-delete__list"></ul>
				<p class="text-muted" style="margin-top: 1rem;" id="cwpm-orphan-delete-desc"
					data-default="<?php esc_attr_e( 'Do you want to remove the database records for these files anyway?', 'coffeewp-media-cleanup' ); ?>">
					<?php esc_html_e( 'Do you want to remove the database records for these files anyway?', 'coffeewp-media-cleanup' ); ?>
				</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn--outline" id="cwpm-orphan-delete-cancel" data-modal-close>
					<?php esc_attr_e( 'Cancel', 'coffeewp-media-cleanup' ); ?>
				</button>
				<button type="button" class="btn btn--danger" id="cwpm-orphan-delete-proceed">
					<?php esc_attr_e( 'Delete Records', 'coffeewp-media-cleanup' ); ?>
				</button>
			</div>
		</div>
	</div>

</div>
