/**
 * Bulk Import/Export Modal Styling
 * Matches EPOFW design system with exact colors and component specs
 *
 * @package EPOFW
 * @since 4.4.8
 */

:root {
	--epofw-bg: #eef0f3;
	--epofw-ink: #1d2939;
	--epofw-ink-2: #344054;
	--epofw-muted: #667085;
	--epofw-muted-2: #98a2b3;
	--epofw-line: #e4e7ec;
	--epofw-line-2: #eceef1;
	--epofw-card: #ffffff;
	--epofw-navy: #14304a;
	--epofw-navy-2: #0f2438;
	--epofw-blue: #2271b1;
	--epofw-blue-2: #135e96;
	--epofw-blue-soft: #eaf2fb;
	--epofw-green: #12805c;
	--epofw-green-bg: #e7f6ef;
	--epofw-green-line: #bfe6d4;
	--epofw-red: #d92d20;
	--epofw-red-bg: #fdeceb;
	--epofw-amber: #b54708;
	--epofw-amber-bg: #fef6ee;
}

/* Modal Overlay - Backdrop */
.epofw-bulk-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(16, 24, 40, 0.45);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 24px;
}

.epofw-bulk-modal-overlay.show {
	display: flex;
	animation: epofw-fade 0.16s ease;
}

@keyframes epofw-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Modal Container */
.epofw-bulk-modal {
	background: var(--epofw-card);
	border-radius: 16px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow: hidden;
	box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.4);
	animation: epofw-pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
	display: flex;
	flex-direction: column;
}

@keyframes epofw-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Modal Header */
.epofw-bulk-modal-header {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	padding: 20px 22px 16px;
	border-bottom: 1px solid var(--epofw-line-2);
}

.epofw-bulk-modal-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	font-size: 20px;
}

.epofw-bulk-modal-icon.export {
	background: var(--epofw-blue-soft);
	color: var(--epofw-blue);
}

.epofw-bulk-modal-icon.import {
	background: var(--epofw-amber-bg);
	color: var(--epofw-amber);
}

.epofw-bulk-modal-text {
	flex: 1;
}

.epofw-bulk-modal-text h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--epofw-ink);
}

.epofw-bulk-modal-text p {
	margin: 3px 0 0;
	font-size: 12.5px;
	color: var(--epofw-muted);
	line-height: 1.5;
}

.epofw-bulk-modal-close {
	margin-left: auto;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	border: 0;
	background: #f4f5f7;
	color: var(--epofw-muted);
	display: grid;
	place-items: center;
	flex-shrink: 0;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	transition: all 0.14s ease;
}

.epofw-bulk-modal-close:hover {
	background: #e9ebef;
	color: var(--epofw-ink);
}

/* Modal Body */
.epofw-bulk-modal-body {
	padding: 18px 22px;
	overflow-y: auto;
	flex: 1;
}

/* Radio Options */
.epofw-bulk-export-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.epofw-bulk-option-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	border: 1.5px solid var(--epofw-line);
	border-radius: 11px;
	padding: 13px 14px;
	transition: all 0.14s ease;
	cursor: pointer;
	background: transparent;
	font-family: inherit;
}

.epofw-bulk-option-row:hover {
	border-color: var(--epofw-muted-2);
}

.epofw-bulk-option-row input[type="radio"] {
	flex-shrink: 0;
	margin-top: 1px;
	cursor: pointer;
}

.epofw-bulk-option-row input[type="radio"]:checked ~ .epofw-bulk-option-text {
	color: var(--epofw-ink);
}

.epofw-bulk-option-row input[type="radio"]:checked {
	border-color: var(--epofw-blue);
}

.epofw-bulk-option-row.on {
	border-color: var(--epofw-blue);
	background: var(--epofw-blue-soft);
}

.epofw-bulk-option-row.on input[type="radio"]:checked {
	border-color: var(--epofw-blue);
}

.epofw-bulk-option-text {
	flex: 1;
}

.epofw-bulk-option-text b {
	font-size: 13.5px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--epofw-ink);
}

.epofw-bulk-addon-tag {
	font-size: 10.5px;
	font-weight: 600;
	color: var(--epofw-blue);
	background: #fff;
	border: 1px solid var(--epofw-green-line);
	padding: 1px 7px;
	border-radius: 999px;
	display: inline-block;
	margin-left: 4px;
}

.epofw-bulk-option-text span {
	font-size: 12px;
	color: var(--epofw-muted);
	display: block;
	margin-top: 2px;
	line-height: 1.45;
}

/* Addon Checklist */
.epofw-bulk-addon-checklist {
	display: none;
	margin-top: 14px;
	border: 1px solid var(--epofw-line);
	border-radius: 11px;
	overflow: scroll;
	height: 250px;
}

.epofw-bulk-addon-checklist.show {
	display: block;
}

.epofw-bulk-checklist-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 12px;
	background: #f8f9fb;
	border-bottom: 1px solid var(--epofw-line-2);
	font-size: 11.5px;
	color: var(--epofw-muted);
}

.epofw-bulk-checklist-select-all {
	background: none;
	border: 0;
	color: var(--epofw-blue);
	font-weight: 600;
	font-size: 11.5px;
	cursor: pointer;
	text-decoration: none;
	padding: 0;
	font-family: inherit;
	transition: color 0.14s ease;
}

.epofw-bulk-checklist-select-all:hover {
	color: var(--epofw-blue-2);
}

.epofw-bulk-checklist-body {
	max-height: 350px;
	overflow-y: auto;
	overflow-x: hidden;
}

.epofw-bulk-checklist-row {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 12px;
	border-bottom: 1px solid var(--epofw-line-2);
	font-size: 13px;
	cursor: pointer;
	transition: background 0.12s ease;
}

.epofw-bulk-checklist-row:last-child {
	border-bottom: 0;
}

.epofw-bulk-checklist-row:hover {
	background: #fafbfc;
}

.epofw-bulk-addon-check {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.epofw-bulk-checklist-checkbox {
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--epofw-line);
	border-radius: 5px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	cursor: pointer;
	background: transparent;
	transition: all 0.12s ease;
}

.epofw-bulk-checklist-row input[type="checkbox"]:checked ~ .epofw-bulk-checklist-checkbox {
	background: var(--epofw-blue);
	border-color: var(--epofw-blue);
}

.epofw-bulk-checklist-row.on .epofw-bulk-checklist-checkbox {
	background: var(--epofw-blue);
	border-color: var(--epofw-blue);
}

.epofw-bulk-checklist-checkbox svg {
	opacity: 0;
	transition: opacity 0.12s ease;
}

.epofw-bulk-checklist-row.on .epofw-bulk-checklist-checkbox svg {
	opacity: 1;
}

.epofw-bulk-addon-name {
	font-weight: 500;
	color: var(--epofw-ink);
	flex: 1;
}

.epofw-bulk-addon-status {
	margin-left: auto;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.epofw-bulk-addon-status.active {
	color: var(--epofw-green);
}

.epofw-bulk-addon-status.inactive {
	color: var(--epofw-muted-2);
}

/* File Format Info Box */
.epofw-bulk-format-box {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 11px 13px;
	background: #f8f9fb;
	border: 1px solid var(--epofw-line-2);
	border-radius: 10px;
}

.epofw-bulk-format-icon {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--epofw-line);
	display: grid;
	place-items: center;
	color: var(--epofw-blue);
	flex-shrink: 0;
	font-size: 16px;
}

.epofw-bulk-format-text {
	flex: 1;
	font-size: 12px;
	color: var(--epofw-muted);
}

.epofw-bulk-format-text b {
	color: var(--epofw-ink-2);
	font-weight: 600;
	display: block;
	font-size: 12.5px;
}

/* Upload Zone (Import) */
.epofw-bulk-upload-zone {
	border: 1.5px dashed #cfd6e0;
	border-radius: 13px;
	padding: 30px 20px;
	text-align: center;
	background: #fafbfd;
	transition: all 0.15s ease;
	cursor: pointer;
}

.epofw-bulk-upload-zone:hover {
	border-color: var(--epofw-blue);
	background: var(--epofw-blue-soft);
}

.epofw-bulk-upload-zone.dragover {
	border-color: var(--epofw-blue);
	background: var(--epofw-blue-soft);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.epofw-bulk-upload-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: #fff;
	border: 1px solid var(--epofw-line);
	display: grid;
	place-items: center;
	margin: 0 auto 12px;
	color: var(--epofw-blue);
	font-size: 24px;
}

.epofw-bulk-upload-text {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--epofw-ink);
}

.epofw-bulk-upload-text b {
	color: var(--epofw-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.epofw-bulk-upload-hint {
	font-size: 11.5px;
	color: var(--epofw-muted-2);
	margin-top: 5px;
}

/* Uploaded File State */
.epofw-bulk-file-row {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var(--epofw-line);
	border-radius: 11px;
	padding: 12px 14px;
	margin-top: 0;
}

.epofw-bulk-file-icon {
	width: 38px;
	height: 38px;
	border-radius: 9px;
	background: var(--epofw-green-bg);
	color: var(--epofw-green);
	display: grid;
	place-items: center;
	flex-shrink: 0;
	font-size: 18px;
}

.epofw-bulk-file-meta {
	flex: 1;
	min-width: 0;
}

.epofw-bulk-file-meta b {
	font-size: 13px;
	font-weight: 600;
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--epofw-ink);
}

.epofw-bulk-file-meta span {
	font-size: 11.5px;
	color: var(--epofw-muted);
}

.epofw-bulk-file-remove {
	width: 28px;
	height: 28px;
	border-radius: 7px;
	border: 0;
	background: #f4f5f7;
	color: var(--epofw-muted);
	display: grid;
	place-items: center;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.12s ease;
	flex-shrink: 0;
}

.epofw-bulk-file-remove:hover {
	background: var(--epofw-line);
	color: var(--epofw-ink);
}

/* Import Preview/Validation */
.epofw-bulk-import-preview {
	margin-top: 14px;
	border: 1px solid var(--epofw-green-line);
	background: var(--epofw-green-bg);
	border-radius: 11px;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 12.5px;
	color: #0d5b41;
}

.epofw-bulk-import-preview svg {
	flex-shrink: 0;
	width: 17px;
	height: 17px;
}

.epofw-bulk-import-preview b {
	font-weight: 700;
}

/* Import Options */
.epofw-bulk-import-options {
	margin-top: 14px;
	display: grid;
	gap: 9px;
}

.epofw-bulk-import-option {
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 12.5px;
	color: var(--epofw-ink-2);
	cursor: pointer;
}

.epofw-bulk-import-option input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
}

.epofw-bulk-import-option-checkbox {
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--epofw-line);
	border-radius: 5px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	cursor: pointer;
	background: transparent;
	transition: all 0.12s ease;
}

.epofw-bulk-import-option input[type="checkbox"]:checked ~ .epofw-bulk-import-option-checkbox {
	background: var(--epofw-blue);
	border-color: var(--epofw-blue);
}

.epofw-bulk-import-option.on .epofw-bulk-import-option-checkbox {
	background: var(--epofw-blue);
	border-color: var(--epofw-blue);
}

.epofw-bulk-import-option-checkbox svg {
	opacity: 0;
	transition: opacity 0.12s ease;
	width: 11px;
	height: 11px;
}

.epofw-bulk-import-option.on .epofw-bulk-import-option-checkbox svg {
	opacity: 1;
}

.epofw-bulk-import-option span b {
	font-weight: 600;
	color: var(--epofw-ink);
}

/* Modal Footer */
.epofw-bulk-modal-footer {
	padding: 15px 22px;
	border-top: 1px solid var(--epofw-line-2);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #fafbfc;
}

.epofw-bulk-modal-hint {
	font-size: 11.5px;
	color: var(--epofw-muted-2);
}

.epofw-bulk-modal-actions {
	display: flex;
	gap: 10px;
	margin-left: auto;
}

/* Buttons */
.epofw-bulk-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 15px;
	border-radius: 9px;
	font: 600 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	border: 1px solid transparent;
	white-space: nowrap;
	transition: all 0.14s ease;
	cursor: pointer;
	background: transparent;
}

.epofw-bulk-btn svg {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
}

.epofw-bulk-btn:disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Button Variants */
.epofw-bulk-btn-ghost {
	background: #fff;
	border-color: var(--epofw-line);
	color: var(--epofw-ink-2);
}

.epofw-bulk-btn-ghost:hover {
	border-color: var(--epofw-muted-2);
	background: #fafbfc;
}

.epofw-bulk-btn-primary {
	background: var(--epofw-navy);
	color: #fff;
	border: none;
}

.epofw-bulk-btn-primary:hover {
	background: var(--epofw-navy-2);
}

.epofw-bulk-btn-blue {
	background: var(--epofw-blue);
	color: #fff;
	border: none;
}

.epofw-bulk-btn-blue:hover {
	background: var(--epofw-blue-2);
}

.epofw-bulk-btn-blue:disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Hidden Input */
#epofw-bulk-import-file {
	display: none;
}

/* Responsive */
@media (max-width: 600px) {
	.epofw-bulk-modal {
		max-width: 100%;
		max-height: 90vh;
	}

	.epofw-bulk-modal-header {
		padding: 16px 18px 12px;
	}

	.epofw-bulk-modal-body {
		padding: 14px 18px;
	}

	.epofw-bulk-modal-footer {
		padding: 12px 18px;
		flex-direction: column-reverse;
	}

	.epofw-bulk-modal-actions {
		width: 100%;
		margin-left: 0;
	}

	.epofw-bulk-btn {
		flex: 1;
	}

	.epofw-bulk-checklist-body {
		max-height: 150px;
	}
}
