/**
 * Attribute Mapping Styles for miniOrange WooCommerce Amazon Sync Plugin
 *
 * @package    MOMCS_Sync
 */

/* Amazon Mapping Container */
.momcs-mapping-container {
	padding: 0;
	background-color: transparent;
	border-radius: 0;
	box-shadow: none;
	margin-bottom: 20px;
}

/* Mapping Section Header – matches Price Markup style */
.momcs-mapping-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}

.momcs-mapping-header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}

.momcs-mapping-header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
	color: #ea580c;
	flex-shrink: 0;
}

.momcs-mapping-description {
	margin-bottom: 20px;
}

/* Accordion Styles – Modern Card Look */
.momcs-mapping-accordion {
	margin-bottom: 16px;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	overflow: visible;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.momcs-mapping-accordion:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.momcs-mapping-accordion-header {
	background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
	padding: 14px 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	transition: background-color 0.2s ease;
	border-radius: 10px 10px 0 0;
}

.momcs-mapping-accordion-header:hover {
	background: #f1f5f9;
}

.momcs-mapping-accordion-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: #fff;
	border: 1.5px solid #e2e8f0;
	color: #64748b;
	flex-shrink: 0;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.momcs-mapping-accordion-header:hover .momcs-mapping-accordion-icon {
	color: #ea580c;
	border-color: #fed7aa;
}

.momcs-mapping-accordion-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	flex: 1;
}

.momcs-mapping-accordion-toggle {
	color: #94a3b8;
	transition: transform 0.3s ease, color 0.2s ease;
}

.momcs-mapping-accordion-header:hover .momcs-mapping-accordion-toggle {
	color: #64748b;
}

.momcs-mapping-accordion-toggle.dashicons-arrow-up-alt2 {
	transform: rotate(180deg);
}

.momcs-mapping-accordion-content {
	padding: 20px;
	border-top: 1px solid #f1f5f9;
	background-color: #fff;
	display: none; /* Collapsed by default */
	border-radius: 0 0 10px 10px;
}

/* Field Headers */
.momcs-mapping-field-headers {
	display: flex;
	margin-bottom: 16px;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
	border-bottom: 1.5px solid #e2e8f0;
	padding-bottom: 12px;
}

.momcs-mapping-field-header-label {
	flex: 0 0 30%;
	padding-right: 15px;
}

.momcs-mapping-field-header-input {
	flex: 0 0 70%;
}

/* Field Rows */
.momcs-mapping-field {
	margin-bottom: 0;
}

.momcs-mapping-field:not(:last-child) {
	border-bottom: 1px solid #f1f5f9;
}

.momcs-mapping-field-row {
	display: flex;
	align-items: center;
	padding: 12px 0;
	transition: background-color 0.15s ease;
	border-radius: 8px;
}

.momcs-mapping-field-label {
	flex: 0 0 30%;
	padding-right: 15px;
}

.momcs-mapping-field-label label {
	font-size: 13px;
	font-weight: 500;
	color: #334155;
}

.momcs-mapping-field-input {
	flex: 0 0 70%;
}

.momcs-mapping-select {
	width: 100%;
	max-width: 100%;
	padding: 9px 36px 9px 12px !important;
	border: 1.5px solid #e2e8f0 !important;
	border-radius: 8px !important;
	font-size: 13px !important;
	color: #1e293b !important;
	background-color: #fff !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2.22 4.47a.75.75 0 0 1 1.06 0L6 7.19l2.72-2.72a.75.75 0 1 1 1.06 1.06L6.53 8.78a.75.75 0 0 1-1.06 0L2.22 5.53a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 12px !important;
	height: auto !important;
	line-height: 1.5 !important;
}

.momcs-mapping-select:focus {
	border-color: #f97316 !important;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12) !important;
	outline: none !important;
}

.momcs-mapping-select:hover {
	border-color: #cbd5e1 !important;
}

/* Actions */
.momcs-mapping-actions {
	margin-top: 30px;
	display: flex;
	align-items: center;
}

.momcs-mapping-status {
	margin-left: 15px;
	display: flex;
	align-items: center;
	font-weight: 500;
}

.momcs-mapping-status-saving {
	color: #646970;
}

.momcs-mapping-status-success {
	color: #00a32a;
}

.momcs-mapping-status-success .dashicons {
	color: #fff;
	background-color: #00a32a;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.momcs-mapping-status-error {
	color: #d63638;
}

.momcs-mapping-status-error .dashicons {
	color: #fff;
	background-color: #d63638;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Template Mapping Styles */
.momcs-template-mapping-container {
	padding: 20px;
	background-color: #fff;
	border-radius: 5px;
	margin-top: 20px;
}

.momcs-template-mapping-description {
	margin-bottom: 20px;
}

.momcs-template-mapping-content {
	margin-top: 20px;
}

.momcs-template-mapping-header {
	font-weight: 600;
	border-bottom: 2px solid #ddd;
	margin-bottom: 10px;
	padding-bottom: 10px;
}

.momcs-template-mapping-row {
	display: flex;
	margin-bottom: 10px;
	align-items: center;
}

.momcs-template-mapping-col {
	flex: 1;
	padding: 0 10px;
}

.momcs-template-mapping-col:first-child {
	padding-left: 0;
}

.momcs-template-mapping-col:last-child {
	padding-right: 0;
}

.momcs-template-mapping-actions-col {
	flex: 0 0 80px;
	text-align: center;
}

.momcs-template-mapping-wc-category,
.momcs-template-mapping-amazon-category {
	width: 100%;
}

.momcs-template-mapping-add-row {
	margin-top: 20px;
	margin-bottom: 20px;
}

#momcs-template-mapping-add {
	display: flex;
	align-items: center;
}

#momcs-template-mapping-add .dashicons {
	margin-right: 5px;
}

.momcs-template-mapping-remove {
	color: #d63638;
}

.momcs-template-mapping-notice {
	padding: 15px;
	background-color: #f9f9f9;
	border-left: 4px solid #ddd;
	margin-bottom: 20px;
}

.momcs-template-mapping-actions {
	margin-top: 30px;
	display: flex;
	align-items: center;
}

.momcs-template-mapping-status {
	margin-left: 15px;
	display: flex;
	align-items: center;
	font-weight: 500;
}

.momcs-template-mapping-status-saving {
	color: #646970;
}

.momcs-template-mapping-status-success {
	color: #00a32a;
}

.momcs-template-mapping-status-success .dashicons {
	color: #fff;
	background-color: #00a32a;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.momcs-template-mapping-status-error {
	color: #d63638;
}

.momcs-template-mapping-status-error .dashicons {
	color: #fff;
	background-color: #d63638;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Edit mapping section – all buttons in orange */
.momcs-field-mapping-container .button,
.momcs-field-mapping-container .button-primary,
.momcs-field-mapping-actions .button,
.momcs-template-mapping-container .button,
.momcs-template-mapping-container .button-primary,
.momcs-template-mapping-actions .button,
.momcs-mapping-container .button,
.momcs-mapping-actions .button {
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
	border-color: #ea580c !important;
	color: #fff !important;
	border-radius: 6px;
}

.momcs-field-mapping-container .button:hover,
.momcs-field-mapping-container .button-primary:hover,
.momcs-field-mapping-actions .button:hover,
.momcs-template-mapping-container .button:hover,
.momcs-template-mapping-container .button-primary:hover,
.momcs-template-mapping-actions .button:hover,
.momcs-mapping-container .button:hover,
.momcs-mapping-actions .button:hover {
	background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
	border-color: #c2410c !important;
	color: #fff !important;
}

/* Ensure the save button is visible and properly styled (orange) */
#momcs-template-mapping-save,
#momcs-mapping-save,
#momcs-field-mapping-save {
	margin-top: 10px;
	margin-right: 10px;
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
	color: #fff !important;
	border-color: #ea580c !important;
	padding: 5px 15px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 3px;
}

#momcs-template-mapping-save:hover,
#momcs-mapping-save:hover,
#momcs-field-mapping-save:hover {
	background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
	border-color: #c2410c !important;
	color: #fff !important;
}

/* Make sure template mapping save button is hidden by default */
#momcs-template-mapping-save {
	display: none !important;
}

/* Remove styles for the deleted main save button */
/* #momcs-mapping-save styles removed as button no longer exists */

/* Accordion toggle overrides */
.momcs-mapping-accordion-header {
	cursor: pointer !important;
}

.momcs-mapping-accordion-toggle {
	transition: transform 0.3s ease !important;
	display: inline-block !important;
	margin-left: auto;
}

.momcs-mapping-accordion-toggle.dashicons-arrow-up-alt2 {
	transform: rotate(180deg) !important;
}

/* Fetch Categories Container Styles */
.momcs-fetch-categories-container {
	margin-bottom: 30px;
	display: flex;
	align-items: center;
}

#momcs-fetch-categories {
	display: flex;
	align-items: center;
}

#momcs-fetch-categories .dashicons {
	margin-right: 5px;
}

.momcs-fetch-categories-status {
	margin-left: 15px;
	display: flex;
	align-items: center;
	font-weight: 500;
}

.momcs-fetch-categories-status-loading {
	color: #646970;
}

.momcs-fetch-categories-status-success {
	color: #00a32a;
}

.momcs-fetch-categories-status-success .dashicons {
	color: #fff;
	background-color: #00a32a;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.momcs-fetch-categories-status-error {
	color: #d63638;
}

.momcs-fetch-categories-status-error .dashicons {
	color: #fff;
	background-color: #d63638;
	border-radius: 50%;
	margin-right: 5px;
	font-size: 16px;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Required Fields Container Styles */
#momcs-required-fields-container {
	margin-top: 30px;
	margin-bottom: 30px;
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

#momcs-required-fields-container h3 {
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 16px;
	font-weight: 600;
}

.momcs-required-fields-content {
	position: relative;
	min-height: 100px;
}

.momcs-loading-message {
	text-align: center;
	padding: 20px;
	font-style: italic;
	color: #646970;
}

.momcs-required-fields-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
}

.momcs-required-fields-table th {
	background-color: #f0f0f0;
	padding: 10px;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid #ddd;
}

.momcs-required-fields-table td {
	padding: 10px;
	border-bottom: 1px solid #eee;
	vertical-align: top;
}

.momcs-required-fields-table tr:hover {
	background-color: #f5f5f5;
}

.momcs-error {
	color: #d63638;
	font-weight: 500;
}

/* Validation Error Styles */
.momcs-mapping-field-error {
	border: 2px solid #d63638 !important;
	background-color: #fbeaea !important;
}

.momcs-mapping-field-error:focus {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638 !important;
}

.momcs-mapping-validation-error {
	color: #d63638;
	font-size: 12px;
	margin-top: 5px;
	display: flex;
	align-items: center;
}

.momcs-mapping-validation-error .dashicons {
	margin-right: 5px;
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.momcs-mapping-validation-summary {
	background-color: #fbeaea;
	border-left: 4px solid #d63638;
	padding: 12px 16px;
	margin: 15px 0;
	border-radius: 4px;
	color: #d63638;
	font-weight: 500;
}

.momcs-mapping-validation-summary .dashicons {
	margin-right: 8px;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.momcs-mapping-validation-summary ul {
	margin: 8px 0 0 0;
	padding-left: 20px;
}

.momcs-mapping-validation-summary ul li {
	margin: 4px 0;
	font-weight: normal;
}

/* Template field error styling */
.momcs-field-mapping-row.momcs-mapping-field-error {
	background-color: #fbeaea;
}

.momcs-field-mapping-row.momcs-mapping-field-error select {
	border-color: #d63638;
	background-color: #fff;
}

/* Success state styling */
.momcs-mapping-validation-success {
	background-color: #edfaef;
	border-left: 4px solid #46b450;
	padding: 12px 16px;
	margin: 15px 0;
	border-radius: 4px;
	color: #1e8a38;
	font-weight: 500;
}

/* Shimmer skeleton for template mapping selects */
.momcs-skeleton-wrapper { position: relative; width: 100%; }
.momcs-skeleton-select {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	border-radius: 3px;
	background: linear-gradient(90deg, #f4f5f7 0%, #e9ecef 40%, #f4f5f7 80%);
	background-size: 200% 100%;
	animation: momcs-skeleton-shimmer 1.2s ease-in-out infinite;
}

.momcs-select-loading {
	visibility: hidden !important;
}

@keyframes momcs-skeleton-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Mapping Table */
.momcs-mapping-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.momcs-mapping-table th {
	background-color: #f9f9f9;
	padding: 10px;
	text-align: left;
	border-bottom: 2px solid #ddd;
	font-weight: 600;
}

.momcs-mapping-table td {
	padding: 10px;
	border-bottom: 1px solid #ddd;
}

/* Template Mapping Table Styles */
.momcs-field-mapping-table-container {
	margin: 25px 0;
}

.momcs-field-mapping-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.momcs-field-mapping-table th {
	padding: 16px 24px;
	background-color: #f9fafb;
	border-bottom: 2px solid #e5e7eb;
	font-weight: 600;
	text-align: left;
}

.momcs-field-mapping-table td {
	padding: 16px 24px;
	border-bottom: 1px solid #e5e7eb;
}

.momcs-field-mapping-row {
	transition: background-color 0.2s;
}

.momcs-field-mapping-row:hover {
	background-color: #f9fafb;
}

/* Add vertical spacing between rows */
.momcs-field-mapping-row:not(:last-child) {
	margin-bottom: 8px;
}

/* Field name styling */
.momcs-field-mapping-row-amazon-field {
	font-family: monospace;
	font-size: 14px;
	line-height: 1.5;
	padding-right: 24px;
}

/* Dropdown container spacing */
.momcs-field-wrapper {
	padding: 4px 0;
}

/* Description column spacing */
.momcs-field-mapping-row-description {
	padding-left: 24px;
	color: #6b7280;
	font-size: 13px;
}

@media screen and (max-width: 782px) {
	.momcs-mapping-field-row,
	.momcs-mapping-field-headers {
		flex-direction: column;
	}

	.momcs-mapping-field-label,
	.momcs-mapping-field-header-label {
		flex: 0 0 100%;
		margin-bottom: 10px;
	}

	.momcs-mapping-field-input,
	.momcs-mapping-field-header-input {
		flex: 0 0 100%;
	}

	.momcs-template-mapping-row {
		flex-direction: column;
	}

	.momcs-template-mapping-col {
		flex: 0 0 100%;
		margin-bottom: 10px;
		padding: 0;
	}

	.momcs-template-mapping-actions-col {
		flex: 0 0 100%;
		text-align: left;
	}

	.momcs-required-fields-table {
		display: block;
		overflow-x: auto;
	}
} 