/**
 * CF7 Mailchimp Bridge Admin Styles
 *
 * @package CF7_Mailchimp_Bridge
 * @since   1.0.0
 * @license GPL-2.0+
 */

.cf7mcb-panel {
	max-width: 900px;
}

.cf7mcb-panel fieldset {
	margin: 1.5em 0;
	padding: 1em;
	border: 1px solid #ccd0d4;
	background: #fff;
}

.cf7mcb-panel legend {
	font-weight: 600;
	padding: 0 0.5em;
}

.cf7mcb-panel .description {
	color: #646970;
	font-style: italic;
	margin-top: 0.5em;
}

/* API Key Row */
.cf7mcb-api-key-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cf7mcb-api-key-row input[type="text"] {
	flex: 1;
	min-width: 300px;
}

#cf7mcb-api-status,
#cf7mcb-merge-fields-status {
	font-weight: 600;
	padding: 4px 8px;
	border-radius: 3px;
}

#cf7mcb-api-status.valid,
#cf7mcb-merge-fields-status.valid {
	background: #d4edda;
	color: #155724;
}

#cf7mcb-api-status.error,
#cf7mcb-merge-fields-status.error {
	background: #f8d7da;
	color: #721c24;
}

/* Mappings Container */
.cf7mcb-mappings-container {
	margin: 15px 0;
	padding: 15px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	max-height: 400px;
	overflow-y: auto;
}

/* Checkbox Mappings */
.cf7mcb-mapping-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	padding: 10px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.cf7mcb-mapping-row:last-child {
	margin-bottom: 0;
}

.cf7mcb-mapping-row select {
	min-width: 150px;
	max-width: 200px;
}

.cf7mcb-arrow {
	color: #646970;
	font-weight: bold;
	flex-shrink: 0;
}

.cf7mcb-remove-mapping,
.cf7mcb-remove-field-mapping {
	color: #a00 !important;
	font-weight: bold;
	font-size: 18px;
	line-height: 1;
	padding: 2px 8px !important;
	flex-shrink: 0;
}

.cf7mcb-remove-mapping:hover,
.cf7mcb-remove-field-mapping:hover {
	color: #dc3232 !important;
	background: #fbeaea !important;
}

#cf7mcb-add-mapping {
	margin-top: 10px;
}

/* Field Mappings */
.cf7mcb-merge-fields-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

.cf7mcb-merge-fields-controls select {
	min-width: 250px;
}

/* Merge Fields Table */
.cf7mcb-mappings-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.cf7mcb-mappings-table th,
.cf7mcb-mappings-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #dcdcde;
}

.cf7mcb-mappings-table th {
	background: #f0f0f1;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	color: #50575e;
}

.cf7mcb-mappings-table tbody tr:hover {
	background: #f9f9f9;
}

.cf7mcb-mappings-table tbody tr:last-child td {
	border-bottom: none;
}

/* Required row highlight */
.cf7mcb-required-row {
	background: #fffbeb;
}

.cf7mcb-required-row:hover {
	background: #fff8dc !important;
}

/* Column widths */
.cf7mcb-col-tag {
	width: 120px;
}

.cf7mcb-col-label {
	width: 180px;
}

.cf7mcb-col-type {
	width: 100px;
}

.cf7mcb-col-cf7 {
	width: auto;
}

.cf7mcb-col-cf7 select {
	width: 100%;
	max-width: 250px;
}

/* Merge tag code style */
.cf7mcb-mappings-table code {
	background: #e7e8ea;
	padding: 3px 6px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
}

/* Required indicator */
.cf7mcb-required {
	color: #dc3232;
	font-weight: bold;
	font-size: 14px;
}

/* Type badge */
.cf7mcb-type-badge {
	display: inline-block;
	padding: 2px 8px;
	background: #e0e0e0;
	border-radius: 10px;
	font-size: 11px;
	color: #50575e;
	text-transform: capitalize;
}

.cf7mcb-no-mappings,
.cf7mcb-loading-hint {
	color: #646970;
	font-style: italic;
	margin: 0;
	padding: 15px;
	text-align: center;
	background: #fff;
	border-radius: 4px;
}

.cf7mcb-loading-hint {
	background: #fff8dc;
	border: 1px solid #f0c36d;
	margin-bottom: 15px;
}

/* Button link for remove */
.button-link.cf7mcb-remove-field-mapping {
	color: #b32d2e;
	text-decoration: none;
	padding: 0;
}

.button-link.cf7mcb-remove-field-mapping:hover {
	color: #dc3232;
}

.button-link.cf7mcb-remove-field-mapping .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.cf7mcb-api-key-row {
		flex-direction: column;
		align-items: stretch;
	}

	.cf7mcb-api-key-row input[type="text"] {
		min-width: 100%;
	}

	.cf7mcb-mapping-row {
		flex-direction: column;
		align-items: stretch;
	}

	.cf7mcb-mapping-row select {
		min-width: 100%;
		max-width: 100%;
	}

	.cf7mcb-arrow {
		text-align: center;
		display: block;
	}

	.cf7mcb-merge-fields-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.cf7mcb-merge-fields-controls select {
		min-width: 100%;
	}

	.cf7mcb-mappings-table {
		display: block;
		overflow-x: auto;
	}

	.cf7mcb-col-tag,
	.cf7mcb-col-label,
	.cf7mcb-col-type,
	.cf7mcb-col-cf7 {
		width: auto;
		min-width: 100px;
	}
}
