/**
 * Manual Sync UI Styles for WooCommerce.
 */

/* Sync Controls */
.minicrm-sync-controls {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
	align-items: center;
	justify-content: space-between;
}

.minicrm-sync-controls-left {
	display: flex;
	gap: 10px;
	align-items: center;
}

.minicrm-sync-controls .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: middle;
	margin-right: 5px;
}

/* Loading Indicator */
.minicrm-loading {
	padding: 20px;
	text-align: center;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 20px;
}

.minicrm-loading .spinner {
	float: none;
	margin: 0 10px 0 0;
	vertical-align: middle;
}

/* Orders Table */
.minicrm-orders-table-wrapper {
	overflow-x: auto;
	margin-top: 20px;
}

#minicrm-wc-orders-table {
	width: 100%;
	border-collapse: collapse;
}

#minicrm-wc-orders-table th {
	font-weight: 600;
	text-align: left;
	padding: 12px;
	background: #f9f9f9;
	border-bottom: 2px solid #ddd;
}

#minicrm-wc-orders-table td {
	padding: 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

#minicrm-wc-orders-table tbody tr:hover {
	background: #f5f5f5;
}

#minicrm-wc-orders-table tbody tr:last-child td {
	border-bottom: none;
}

/* Checkboxes */
#minicrm-wc-select-all,
.minicrm-wc-order-checkbox {
	margin: 0;
	cursor: pointer;
}

/* Sync Status Indicators */
.sync-status {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
}

.sync-status .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.sync-success {
	background: #d4edda;
	color: #155724;
}

.sync-error {
	background: #f8d7da;
	color: #721c24;
}

.sync-pending {
	background: #e2e3e5;
	color: #383d41;
}

.error-message {
	color: #721c24;
	font-style: italic;
}

/* WooCommerce Order Status Badges */
.order-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	text-transform: capitalize;
}

.status-pending {
	background: #f8dda7;
	color: #94660c;
}

.status-processing {
	background: #c6e1c6;
	color: #5b841b;
}

.status-on-hold {
	background: #f8dda7;
	color: #94660c;
}

.status-completed {
	background: #c8d7e1;
	color: #2e4453;
}

.status-cancelled {
	background: #eba3a3;
	color: #761919;
}

.status-refunded {
	background: #ccc;
	color: #777;
}

.status-failed {
	background: #eba3a3;
	color: #761919;
}

/* Sync Notices */
.minicrm-wc-sync-notices {
	margin-bottom: 15px;
}

.minicrm-wc-sync-notices .notice {
	position: relative;
	padding: 12px 40px 12px 12px;
	margin: 5px 0 10px 0;
	background: #fff;
	border-left: 4px solid;
}

.minicrm-wc-sync-notices .notice-success {
	border-left-color: #46b450;
}

.minicrm-wc-sync-notices .notice-error {
	border-left-color: #dc3232;
}

.minicrm-wc-sync-notices .notice p {
	margin: 0;
	padding: 0;
}

/* Button States */
#minicrm-wc-sync-selected:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#minicrm-wc-refresh-orders:active .dashicons {
	animation: spin 0.5s linear;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Responsive */
@media (max-width: 782px) {
	.minicrm-sync-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.minicrm-sync-controls-left {
		flex-direction: column;
		align-items: stretch;
	}

	.minicrm-sync-controls button {
		width: 100%;
	}

	#minicrm-wc-orders-table {
		font-size: 13px;
	}

	#minicrm-wc-orders-table th,
	#minicrm-wc-orders-table td {
		padding: 8px 6px;
	}
}
