<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div id="wpps-replace-media-modal" class="wpps-replace-media-modal" role="dialog" aria-labelledby="wpps-replace-media-title" aria-hidden="true" style="display:none;">
	<div class="wpps-replace-media-modal-backdrop"></div>
	<div class="wpps-replace-media-modal-content">
		<h2 id="wpps-replace-media-title"><?php esc_html_e( 'Replace Media', 'wp-powersuite' ); ?></h2>

		<div class="wpps-replace-current" id="wpps-replace-current-info" style="display:none;">
			<h3><?php esc_html_e( 'Current file', 'wp-powersuite' ); ?></h3>
			<div class="wpps-replace-preview">
				<img id="wpps-replace-preview-img" src="" alt="" style="max-width: 120px; max-height: 120px;" />
				<div id="wpps-replace-preview-icon" class="wpps-replace-file-icon" style="display:none;"></div>
				<div class="wpps-replace-file-details">
					<p class="wpps-replace-filename"><strong id="wpps-replace-filename"></strong></p>
					<p class="wpps-replace-meta" id="wpps-replace-meta"></p>
				</div>
			</div>
		</div>

		<div class="wpps-replace-upload">
			<h3><?php esc_html_e( 'Upload new file', 'wp-powersuite' ); ?></h3>
			<p class="wpps-replace-hint" id="wpps-replace-type-hint"></p>
			<p>
				<label for="wpps-replace-file-input" class="button button-secondary">
					<span id="wpps-replace-file-label"><?php esc_html_e( 'Choose file', 'wp-powersuite' ); ?></span>
				</label>
				<input type="file" id="wpps-replace-file-input" class="wpps-replace-file-input" accept="" />
			</p>
		</div>

		<div class="wpps-replace-options">
			<label>
				<input type="checkbox" id="wpps-replace-keep-filename" checked />
				<?php esc_html_e( 'Keep original filename', 'wp-powersuite' ); ?>
			</label>
			<p class="description"><?php esc_html_e( 'Recommended to maintain URL consistency.', 'wp-powersuite' ); ?></p>
			<label>
				<input type="checkbox" id="wpps-replace-keep-date" checked />
				<?php esc_html_e( 'Keep original upload date', 'wp-powersuite' ); ?>
			</label>
			<label>
				<input type="checkbox" id="wpps-replace-keep-backup" />
				<?php esc_html_e( 'Keep original file in media library (as backup)', 'wp-powersuite' ); ?>
			</label>
			<p class="description"><?php esc_html_e( 'Copies the old file with a new name and adds it as a separate media item.', 'wp-powersuite' ); ?></p>
		</div>

		<div class="wpps-replace-progress" id="wpps-replace-progress" style="display:none;">
			<progress id="wpps-replace-progress-bar" value="0" max="100"></progress>
			<p id="wpps-replace-progress-text"></p>
		</div>

		<div class="wpps-replace-result" id="wpps-replace-result" style="display:none;"></div>

		<div class="wpps-replace-actions">
			<button type="button" class="button button-primary" id="wpps-replace-submit" disabled>
				<?php esc_html_e( 'Replace', 'wp-powersuite' ); ?>
			</button>
			<button type="button" class="button" id="wpps-replace-cancel">
				<?php esc_html_e( 'Cancel', 'wp-powersuite' ); ?>
			</button>
		</div>
	</div>
</div>
