/**
 * Admin Styles
 *
 * @package   cf7-icontact-extension
 * @author    renzo.johnson@gmail.com
 * @copyright 2014-2026 https://renzojohnson.com
 * @license   GPL-3.0+
 */

/* Hidden class for visibility toggling (JS hydration) */
.icf7ic-hidden {
	display: none !important;
}

.icf7ic-lite {
	#contact-form-editor-tabs {
		border-color: #b5bec7;
	}
	section#icontact {
		.metabox-holder {
			padding: 0;
		}
	}
}

#contact-form-editor-tabs {
	#icontact-tab[aria-selected="true"] {
		background-color: #fff;
	}
}

.icf7ic-lite {
	section#icontact {
		border-color: #b5bec7;
		padding: 0;
		background-color: #f2f4f6;
	}
}

.icf7ic-field-group {
	background-color: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	margin-bottom: 20px;
	padding: 12px 20px 20px;
}

.icf7ic-field-group .description {
	display: block;
	color: #777;
	padding-left: 0.7em;
}

.icf7ic-field-group h3 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

a.helping-field {
	font-size: 13px;
	line-height: 1.2em;
	font-weight: bold;
	padding-left: 4px;
	padding-right: 20px;
	text-decoration: none;
}

a.helping-field:hover,
a.helping-field:hover .red-icon:before {
	color: #444;
}

.red-icon {
	color: #dd3d36;
}

.dbl {
	display: block;
}

span.valid {
	background-color: #7ad03a;
	color: #fff;
}

span.invalid {
	background-color: #dd3d36;
	color: #fff;
}

.icf7ic-select {
	width: 95%;
	margin-bottom: 7px;
}

.icf7ic-type {
	color: #8c8f94 !important;
	font-weight: 400;
	font-size: 11px;
	text-transform: uppercase;
	margin-left: 8px;
}

.icf7ic-required {
	color: #d63638;
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	margin-left: 8px;
}

.icf7ic-optional {
	color: #646970;
	font-weight: 400;
	font-size: 11px;
	text-transform: uppercase;
	margin-left: 8px;
}

.icf7ic-active {
	display: block;
	height: auto;
}

.icf7ic-inactive {
	display: none;
	height: 0;
	width: 100%;
}

.icf7ic-loading {
	position: relative;
	pointer-events: none;
}

.icf7ic-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	z-index: 10;
}

.icf7ic-auto-matched {
	border-color: #46b450 !important;
	background-color: rgba(70, 180, 80, 0.05);
}

.icf7ic-auto-matched:focus {
	border-color: #46b450 !important;
	box-shadow: 0 0 0 1px #46b450;
}

.icf7ic-button-disabled,
.icf7ic-button-disabled:hover,
.icf7ic-button-disabled:focus {
	cursor: not-allowed;
	opacity: 0.6;
	pointer-events: none;
	background: #f0f0f1 !important;
	border-color: #c3c4c7 !important;
	color: #a7aaad !important;
	box-shadow: none !important;
}

.icf7ic-description-text {
	display: block;
	margin-top: 10px;
}

.icf7ic-field-mapping {
	background-color: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 12px 20px 20px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	margin-bottom: 20px;
}

.icf7ic-field-mapping h3 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.icf7ic-field-row {
	display: block;
	margin-bottom: 1.25rem;
}

.icf7ic-field-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #1d2327;
}

.icf7ic-field-row select {
	margin-left: 0;
	max-width: 400px;
}

.icf7ic-description {
	display: block;
	margin-top: 5px;
	color: #646970;
	font-size: 12px;
	font-style: italic;
}

@media only screen and (min-width: 768px) {
	.icf7ic-field-row {
		display: inline-block;
		width: 49.5%;
		box-sizing: border-box;
		vertical-align: top;
		padding-right: 2rem;
	}
	.icf7ic-field-row select {
		margin-top: 3px;
		margin-bottom: 0;
		width: 100%;
		max-width: none;
	}
}

.icf7ic-audiences {
	background-color: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 12px 20px 20px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	margin-bottom: 20px;
}

.icf7ic-audiences label {
	font-weight: 500;
	color: #1d2327;
}

.icf7ic-audiences select {
	width: 364px;
	max-width: 100%;
}

.icf7ic-audiences .button {
	min-width: 120px;
}

.icf7ic-audiences .spinner {
	float: none;
	margin-top: 0;
}

.icf7ic-audiences .description {
	display: block;
	margin-top: 8px;
	color: #646970;
	font-size: 12px;
}

.icf7ic-content {
	padding: 0 20px;
}

.icf7ic-header {
	background: #fff;
	border-bottom: 1px solid #c5d1d9;
	margin: 0 0 20px 0;
}

.icf7ic-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
}

.icf7ic-header__brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.icf7ic-header__title {
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
	letter-spacing: -0.3px;
}

.icf7ic-header__badge {
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.icf7ic-header__badge--pro,
.icf7ic-header__badge--lite {
	background: #4d5d6d;
	color: #fff;
}

.icf7ic-header__version {
	font-size: 12px;
	color: #646970;
	font-weight: 400;
}

.icf7ic-header__actions {
	display: flex;
	align-items: center;
}

.icf7ic-header__review {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #646970;
	text-decoration: none;
	font-size: 13px;
	transition: color 0.2s;
}

.icf7ic-header__review:hover {
	color: #1d2327;
}

.icf7ic-sparkles {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	width: 80px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16'%3E%3Cpath fill='%23EFBF04' d='M8 0l2.5 5 5.5.8-4 3.9.9 5.3L8 12.5 3.1 15l.9-5.3-4-3.9L5.5 5zM24 0l2.5 5 5.5.8-4 3.9.9 5.3-4.9-2.5-4.9 2.5.9-5.3-4-3.9 5.5-.8zM40 0l2.5 5 5.5.8-4 3.9.9 5.3-4.9-2.5-4.9 2.5.9-5.3-4-3.9 5.5-.8zM56 0l2.5 5 5.5.8-4 3.9.9 5.3-4.9-2.5-4.9 2.5.9-5.3-4-3.9 5.5-.8zM72 0l2.5 5 5.5.8-4 3.9.9 5.3-4.9-2.5-4.9 2.5.9-5.3-4-3.9 5.5-.8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
}

.icf7ic-header__status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: 12px;
	padding-left: 12px;
	border-left: 1px solid #c5d1d9;
}

.icf7ic-header__status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.icf7ic-header__status-dot--connected {
	background: #00a32a;
}

.icf7ic-header__status-dot--disconnected {
	background: #d63638;
}

.icf7ic-header__status-text {
	font-size: 12px;
	color: #646970;
}

.icf7ic-disconnect-link {
	color: #d63638;
	text-decoration: none;
	font-weight: 500;
	margin-left: 8px;
	cursor: pointer;
}

.icf7ic-disconnect-link:hover {
	color: #a00;
	text-decoration: underline;
}

/* iContact-specific tab styling */
li#icontact-tab,
#icontact-tab {
	border-top: 1px solid #2ea6dc;
}

/* Spinner adjustments */
#icf7ic-panel .spinner {
	float: none;
	margin-top: 0;
	vertical-align: middle;
}

#icf7ic-panel .spinner.is-active {
	visibility: visible;
}

/* Message styling */
#icf7ic-message {
	margin: 10px 20px;
	padding: 10px 15px;
}

#icf7ic-message.notice-success {
	border-left-color: #00a32a;
}

#icf7ic-message.notice-error {
	border-left-color: #d63638;
}

/* Footer Buttons */
.a-support {
	color: #222;
	background: #f7f7f7;
	box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0, 0, 0, 0.08);
	vertical-align: top;
	display: inline-block;
	text-decoration: none;
	font-size: 13px;
	line-height: 2.15384615;
	min-height: 30px;
	margin: 0;
	padding: 0 10px;
	cursor: pointer;
	border-width: 1px;
	border-style: solid;
	border-color: #ccc;
	border-radius: 3px;
	white-space: nowrap;
}

.a-support:hover {
	background: #f0f0f1;
	border-color: #999;
	color: #2c3338;
}

.a-support:focus {
	outline: none;
	box-shadow: none;
	color: #0073aa;
}

.a-support:after {
	right: 0;
	content: "\f333";
	font: 400 20px/1 dashicons;
	speak: never;
	display: inline-block;
	padding: 0 0 0 3px;
	vertical-align: middle;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.p-author {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #e5e5e5;
}

/* Collapsible Panels */
.icf7ic-collapsible-panel {
	margin-top: 0;
	margin-bottom: 0;
	background-color: rgba(255, 255, 255, 0.95);
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 12px 20px 20px;
	display: none;
}

.icf7ic-collapsible-panel.active {
	display: block;
	margin-top: 1em;
	margin-bottom: 1em;
}

.icf7ic-collapsible-panel h3 {
	margin: 0 0 15px 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.icf7ic-collapsible-panel pre {
	background: #23282d;
	color: #ccc;
	padding: 15px;
	border-radius: 4px;
	overflow-x: auto;
	font-size: 12px;
	line-height: 1.5;
	margin: 0;
}

.icf7ic-collapsible-panel code {
	background: transparent;
	color: inherit;
}

#icf7ic-panel-log.icf7ic-collapsible-panel {
	background: transparent;
	border: none;
	padding: 0;
	border-radius: 0;
}

.icf7ic-no-logs {
	color: #646970;
	font-style: italic;
}

/* Debug Log - Midnight Blue Theme */
#icf7ic-panel-log .icf7ic-log-actions {
	margin-top: 15px;
}

.icf7ic-log-container {
	background: #0d1b2a;
	border-radius: 8px;
	overflow: hidden;
}

.icf7ic-log-header {
	background: #1b263b;
	color: #778da9;
	padding: 12px 16px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.icf7ic-log-body {
	max-height: 320px;
	overflow-y: auto;
}

.icf7ic-log-container .icf7ic-log-entry {
	padding: 14px 16px;
	font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
	font-size: 12px;
	line-height: 1.6;
	color: #e0e1dd;
	background: rgba(27, 38, 59, 0.3);
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	transition: background 0.15s ease;
}

.icf7ic-log-container .icf7ic-log-entry:hover {
	background: rgba(65, 90, 119, 0.3) !important;
}

.icf7ic-log-entry:last-child {
	border-bottom: none;
}

.icf7ic-log-status {
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.icf7ic-log-time {
	opacity: 0.5;
	margin-left: 12px;
}

.icf7ic-log-message {
	display: block;
	margin-top: 6px;
	opacity: 0.85;
}

.icf7ic-log-detail {
	display: block;
	margin-top: 2px;
	opacity: 0.7;
	font-size: 11px;
}

.icf7ic-log-container .icf7ic-log-entry.ok .icf7ic-log-status {
	color: #10b981 !important;
}

.icf7ic-log-container .icf7ic-log-entry.error .icf7ic-log-status,
.icf7ic-log-container .icf7ic-log-entry.error .icf7ic-log-message,
.icf7ic-log-container .icf7ic-log-entry.error .icf7ic-log-detail {
	color: #f87171 !important;
}

.icf7ic-log-container .icf7ic-log-entry.warn .icf7ic-log-status,
.icf7ic-log-container .icf7ic-log-entry.warn .icf7ic-log-message {
	color: #fbbf24 !important;
}

.icf7ic-log-body::-webkit-scrollbar {
	width: 6px;
}

.icf7ic-log-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.2);
}

.icf7ic-log-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

.icf7ic-log-body::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* Advanced Settings Panel */
#icf7ic-panel-settings .icf7ic-settings-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#icf7ic-panel-settings .icf7ic-setting-row {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

#icf7ic-panel-settings .icf7ic-setting-row input[type="checkbox"] {
	margin: 0;
}

/* ============================================
	API Credential Masking - Eye Toggle
	(Matching Chimpmatic Lite pattern)
	============================================ */

.icf7ic-api-wrap {
	position: relative;
	display: inline-block;
	width: 364px;
	margin-bottom: 12px;
}

.icf7ic-api-wrap input {
	width: 100%;
	box-sizing: border-box;
	padding-right: 30px;
}

.icf7ic-eye {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #a7aaad;
}

.icf7ic-api-wrap input:not(:placeholder-shown) + .icf7ic-eye {
	color: #3c434a;
}

.icf7ic-eye:hover {
	color: #1d2327;
}

#icf7ic-connect {
	display: block;
	min-width: 160px;
	margin-top: 16px;
}

.icf7ic-field-group label {
	display: block;
	margin-top: 12px;
	margin-bottom: 4px;
	font-weight: 500;
}

.icf7ic-field-group label:first-of-type {
	margin-top: 0;
}

.description.need-api {
	display: block;
	margin-top: 12px;
}
