/**
 * Emporiqa Admin Styles
 *
 * @package Emporiqa
 * @since   1.0.0
 */

/* Tab content visibility */
.emporiqa-tab-content {
	display: none;
}

.emporiqa-tab-content.active {
	display: block;
}

/* Tab wrapper spacing */
.emporiqa-wrap .nav-tab-wrapper {
	margin-bottom: 16px;
}

/* Info banner */
.emporiqa-info-banner {
	margin: 12px 0 16px;
	padding: 10px 14px;
	border-left-color: #2271b1;
}

.emporiqa-info-banner p {
	margin: 0;
}

/* Collapsible sections */
.emporiqa-collapsible-section {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin: 12px 0;
	background: #fff;
}

.emporiqa-section-header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	cursor: pointer;
	user-select: none;
	border-bottom: 1px solid transparent;
}

.emporiqa-section-open .emporiqa-section-header {
	border-bottom-color: #f0f0f1;
}

.emporiqa-section-header:hover {
	background: #f6f7f7;
}

.emporiqa-section-header:focus {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.emporiqa-section-header h2 {
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.4;
}

.emporiqa-section-toggle {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #50575e;
	transition: transform 0.2s ease;
}

.emporiqa-section-body {
	padding: 0 14px 14px;
}

.emporiqa-section-body .form-table {
	margin-top: 0;
}

/* Sync actions row */
.emporiqa-sync-actions {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin: 16px 0;
	align-items: flex-start;
}

.emporiqa-sync-actions .button {
	min-width: 120px;
}

.emporiqa-sync-btn-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.emporiqa-btn-description {
	font-size: 12px;
	color: #646970;
	line-height: 1.4;
}

.emporiqa-btn-disabled-reason {
	font-size: 11px;
	color: #d63638;
	font-style: italic;
	line-height: 1.4;
}

/* Sync summary on Sync tab */
.emporiqa-sync-summary {
	margin: 12px 0 16px;
}

.emporiqa-sync-summary p {
	margin: 4px 0;
}

.emporiqa-sync-disabled {
	color: #646970;
	font-style: italic;
}

/* Read-only field + copy button */
.emporiqa-readonly-field {
	display: flex;
	gap: 4px;
	align-items: center;
}

.emporiqa-readonly-field input[readonly] {
	background: #f6f7f7;
	color: #50575e;
}

.emporiqa-copy-btn {
	white-space: nowrap;
}

/* Payload preview blocks */
.emporiqa-payload-preview {
	margin: 12px 0;
}

.emporiqa-payload-toggle {
	cursor: pointer;
	user-select: none;
	color: #2271b1;
	font-weight: 600;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 6px;
}

.emporiqa-payload-toggle:hover {
	color: #135e96;
}

.emporiqa-payload-pre {
	max-height: 300px;
	overflow: auto;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 10px 12px;
	font-family: monospace;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	margin: 0 0 12px;
}

/* Progress bar */
.emporiqa-progress-wrapper {
	display: none;
	margin: 16px 0;
}

.emporiqa-progress-wrapper.visible {
	display: block;
}

.emporiqa-progress-bar {
	width: 100%;
	height: 28px;
	background: #f0f0f1;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.emporiqa-progress-bar-fill {
	height: 100%;
	background: #2271b1;
	border-radius: 4px;
	transition: width 0.3s ease;
	min-width: 0;
}

.emporiqa-progress-text {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	color: #1d2327;
}

/* Sync log area */
.emporiqa-sync-log {
	display: none;
	max-height: 300px;
	overflow-y: auto;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 8px 12px;
	margin: 16px 0;
	font-family: monospace;
	font-size: 12px;
	line-height: 1.6;
}

.emporiqa-sync-log.visible {
	display: block;
}

.emporiqa-sync-log .log-entry {
	margin: 0;
	padding: 2px 0;
}

.emporiqa-sync-log .log-info {
	color: #2271b1;
}

.emporiqa-sync-log .log-success {
	color: #00a32a;
}

.emporiqa-sync-log .log-warning {
	color: #dba617;
}

.emporiqa-sync-log .log-error {
	color: #d63638;
}

/* Dry run result */
.emporiqa-dry-run-result {
	margin: 12px 0;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

.emporiqa-dry-run-result > p:first-child {
	margin-top: 0;
}

.emporiqa-dry-run-event {
	padding: 8px 0;
	border-top: 1px solid #f0f0f1;
}

.emporiqa-dry-run-event:first-of-type {
	border-top: none;
}

.emporiqa-dry-run-pass {
	color: #00a32a;
	font-weight: 600;
}

.emporiqa-dry-run-fail {
	color: #d63638;
	font-weight: 600;
}

.emporiqa-dry-run-fields {
	border-collapse: collapse;
	margin: 8px 0;
	font-size: 13px;
}

.emporiqa-dry-run-fields th,
.emporiqa-dry-run-fields td {
	padding: 4px 12px 4px 0;
	text-align: left;
	border-bottom: 1px solid #f0f0f1;
}

.emporiqa-dry-run-fields th {
	font-weight: 600;
	color: #1d2327;
}

.emporiqa-dry-run-warnings {
	margin: 8px 0;
	padding: 8px 12px;
	background: #fcf9e8;
	border-left: 4px solid #dba617;
	border-radius: 2px;
}

.emporiqa-dry-run-warnings ul {
	margin: 4px 0 0 16px;
	padding: 0;
}

.emporiqa-dry-run-warnings li {
	margin: 2px 0;
	font-size: 13px;
}

.emporiqa-dry-run-msg-success {
	color: #00a32a;
	font-weight: 600;
}

.emporiqa-dry-run-msg-warning {
	color: #dba617;
	font-weight: 600;
}

.emporiqa-dry-run-msg-error {
	color: #d63638;
	font-weight: 600;
}

/* Developer CLI reference (collapsed by default) */
.emporiqa-cli-details {
	margin-top: 24px;
	padding: 6px 0;
	color: #646970;
	font-size: 12px;
}

.emporiqa-cli-details summary {
	cursor: pointer;
	user-select: none;
	color: #646970;
	padding: 4px 0;
}

.emporiqa-cli-details pre {
	margin-top: 8px;
	padding: 10px 12px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	font-size: 12px;
	color: #1d2327;
}
