@charset "UTF-8";

/* Core palette and reusable components */
:root {
	--mail-doctor-color-surface: #ffffff;
	--mail-doctor-color-border: #e2e8f0;
	--mail-doctor-color-text: #0b1c30;
	--mail-doctor-color-muted: #64748b;
	--mail-doctor-color-accent: #4f46e5;
	--mail-doctor-color-accent-soft: #e5eeff;
	--mail-doctor-color-success: #10b981;
	--mail-doctor-color-danger: #ba1a1a;
	--mail-doctor-color-warning: #f59e0b;
	--mail-doctor-color-neutral-soft: #f8f9ff;
	--mail-doctor-color-highlight: #ffddb8;
	/* Spacing scale */
	--mail-doctor-space-xxs: 4px;
	--mail-doctor-space-xs: 6px;
	--mail-doctor-space-sm: 8px;
	--mail-doctor-space-md: 12px;
	--mail-doctor-space-lg: 16px;
	--mail-doctor-space-xl: 24px;
	--mail-doctor-space-xxl: 32px;
	/* Radii */
	--mail-doctor-radius-sm: 6px;
	--mail-doctor-radius-md: 8px;
	--mail-doctor-radius-lg: 12px;
	/* Shadows */
	--mail-doctor-shadow-xs: 0 1px 2px 0 rgba(11, 28, 48, 0.05);
	--mail-doctor-shadow-sm: 0 1px 3px 0 rgba(11, 28, 48, 0.08), 0 1px 2px -1px rgba(11, 28, 48, 0.08);
	--mail-doctor-shadow-md: 0 4px 6px -1px rgba(11, 28, 48, 0.05), 0 2px 4px -2px rgba(11, 28, 48, 0.05);
	--mail-doctor-shadow-lg: 0 10px 15px -3px rgba(11, 28, 48, 0.08), 0 4px 6px -4px rgba(11, 28, 48, 0.08);
}

.mail-doctor-card {
	background: var(--mail-doctor-color-surface);
	border: 1px solid var(--mail-doctor-color-border);
	border-radius: var(--mail-doctor-radius-md);
	padding: var(--mail-doctor-space-xl);
	margin-bottom: var(--mail-doctor-space-xl);
	position: relative;
	overflow-wrap: break-word;
	box-shadow: var(--mail-doctor-shadow-sm);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mail-doctor-card:hover {
	transform: translateY(-2px);
	/* Lift effect */
	box-shadow: var(--mail-doctor-shadow-md);
}

.mail-doctor-card--inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--mail-doctor-space-lg);
}

.mail-doctor-card--stacked {
	display: flex;
	flex-direction: column;
	gap: var(--mail-doctor-space-lg);
}

.mail-doctor-card__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--mail-doctor-space-md);
	margin-bottom: var(--mail-doctor-space-md);
}

.mail-doctor-card__meta {
	margin: 0;
	font-size: 12px;
	color: var(--mail-doctor-color-muted);
}

.mail-doctor-hidden {
	display: none !important;
}

/* Modern Inputs */
.maildoctor-admin-wrap input[type="text"],
.maildoctor-admin-wrap input[type="email"],
.maildoctor-admin-wrap input[type="password"],
.maildoctor-admin-wrap select,
.maildoctor-admin-wrap textarea {
	padding: 8px 12px;
	border-radius: var(--mail-doctor-radius-sm);
	border: 1px solid var(--mail-doctor-color-border);
	line-height: 1.5;
	font-size: 14px;
	color: var(--mail-doctor-color-text);
	background-color: var(--mail-doctor-color-surface);
	box-shadow: var(--mail-doctor-shadow-xs);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.maildoctor-admin-wrap input[type="text"]:focus,
.maildoctor-admin-wrap input[type="email"]:focus,
.maildoctor-admin-wrap input[type="password"]:focus,
.maildoctor-admin-wrap select:focus,
.maildoctor-admin-wrap textarea:focus {
	border-color: var(--mail-doctor-color-accent);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
	outline: none;
}

select.mail-doctor-select {
	width: 240px;
	max-width: 100%;
	display: inline-block;
}

.mail-doctor-select--compact {
	width: 100%;
	max-width: 260px;
}

/* Inputs with Icons */
.mail-doctor-input-with-icon {
	position: relative;
	display: block;
	width: 100%;
	max-width: 260px;
}

.mail-doctor-input-with-icon .dashicons {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mail-doctor-color-muted);
	pointer-events: none;
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 1;
}

.mail-doctor-input-with-icon input[type="email"],
.mail-doctor-input-with-icon select {
	padding-left: 36px !important;
	width: 100% !important;
	box-sizing: border-box;
}


.mail-doctor-table td,
.mail-doctor-table th {
	padding: 14px 18px;
}

/**
 * Ensure datepicker popover remains readable on log filters.
 */
.ui-datepicker {
	background: var(--mail-doctor-color-surface);
	border: 1px solid var(--mail-doctor-color-border);
	box-shadow: var(--mail-doctor-shadow-lg);
	color: var(--mail-doctor-color-text);
	font-size: 13px;
	border-radius: var(--mail-doctor-radius-md);
	padding: 8px;
}

.ui-datepicker-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 12px;
	background: var(--mail-doctor-color-neutral-soft);
	border-bottom: 1px solid var(--mail-doctor-color-border);
	border-radius: var(--mail-doctor-radius-sm) var(--mail-doctor-radius-sm) 0 0;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
	position: static;
	left: auto;
	right: auto;
	top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid transparent;
	background: transparent;
	color: var(--mail-doctor-color-text);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover,
.ui-datepicker .ui-datepicker-prev:focus,
.ui-datepicker .ui-datepicker-next:focus {
	background: var(--mail-doctor-color-accent-soft);
	border-color: rgba(79, 70, 229, 0.35);
	color: var(--mail-doctor-color-accent);
	outline: none;
}

.ui-datepicker .ui-datepicker-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--mail-doctor-color-text);
	margin: 0 auto;
}

.ui-datepicker .ui-datepicker-title select {
	margin: 0;
	padding: 4px 8px;
	border-radius: var(--mail-doctor-radius-sm);
	border: 1px solid var(--mail-doctor-color-border);
	background: var(--mail-doctor-color-surface);
	font-size: 13px;
}

.ui-datepicker table {
	width: 100%;
	border-collapse: collapse;
}

.ui-datepicker-calendar th {
	padding: 8px 4px;
	font-weight: 600;
	color: var(--mail-doctor-color-muted);
	text-transform: uppercase;
	font-size: 11px;
}

.ui-datepicker-calendar td {
	text-align: center;
	padding: 2px 4px;
}

.ui-datepicker-calendar td a,
.ui-datepicker-calendar td span {
	display: block;
	padding: 6px 0;
	text-decoration: none;
	border-radius: var(--mail-doctor-radius-sm);
	color: inherit;
	transition: background 0.15s ease, color 0.15s ease;
}

.ui-datepicker-calendar td a:hover {
	background: var(--mail-doctor-color-accent-soft);
}

.ui-datepicker-calendar .ui-state-active {
	background: var(--mail-doctor-color-accent);
	color: #fff !important;
}

.ui-datepicker-calendar .ui-state-hover {
	background: var(--mail-doctor-color-accent-soft);
	color: var(--mail-doctor-color-text);
}

.spinner.is-active {
	visibility: visible;
}

.maildoctor-admin-wrap .maildoctor-header {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: flex-end;
	margin: 0 0 24px;
	border-bottom: 1px solid var(--mail-doctor-color-border) !important;
	width: 100%;
}

.maildoctor-header .nav-tab-wrapper {
	border-bottom: none !important;
	display: flex !important;
	justify-content: center !important;
	gap: 24px !important;
	padding: 0 !important;
	background: transparent !important;
	margin-bottom: -1px;
	width: 100%;
	align-items: flex-end;
}

.maildoctor-branding {
	display: flex;
	flex-direction: column;
	gap: 0;
	flex: 0 0 auto;
}

.maildoctor-branding__title {
	margin: 0;
	font-size: 25px;
	font-weight: 800;
	color: var(--mail-doctor-color-accent);
	letter-spacing: -0.02em;
	line-height: 1;
	padding-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.maildoctor-branding__version {
	font-size: 11px;
	font-weight: 600;
	color: var(--mail-doctor-color-muted);
	background: var(--mail-doctor-color-neutral-soft);
	border: 1px solid var(--mail-doctor-color-border);
	padding: 2px 8px;
	border-radius: var(--mail-doctor-radius-sm);
	text-transform: none;
	letter-spacing: normal;
	display: inline-flex;
	align-items: center;
}

/* Real-time Connection Status Dot in Header */
.mail-doctor-status-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: var(--mail-doctor-radius-sm);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-transform: none;
	letter-spacing: normal;
	vertical-align: middle;
	background: var(--mail-doctor-color-neutral-soft);
	border: 1px solid var(--mail-doctor-color-border);
}

.mail-doctor-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
	position: relative;
}

/* Status variants */
.mail-doctor-status-badge--connected {
	border-color: rgba(16, 185, 129, 0.25);
	background: rgba(16, 185, 129, 0.05);
	color: #0d9488;
}
.mail-doctor-status-badge--connected .mail-doctor-status-dot {
	background: var(--mail-doctor-color-success);
	box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
	animation: mail-doctor-pulse-green 2s infinite;
}

.mail-doctor-status-badge--degraded {
	border-color: rgba(245, 158, 11, 0.25);
	background: rgba(245, 158, 11, 0.05);
	color: #b45309;
}
.mail-doctor-status-badge--degraded .mail-doctor-status-dot {
	background: var(--mail-doctor-color-warning);
	box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
	animation: mail-doctor-pulse-orange 2s infinite;
}

.mail-doctor-status-badge--disconnected {
	border-color: rgba(186, 26, 26, 0.25);
	background: rgba(186, 26, 26, 0.05);
	color: var(--mail-doctor-color-danger);
}
.mail-doctor-status-badge--disconnected .mail-doctor-status-dot {
	background: var(--mail-doctor-color-danger);
	box-shadow: 0 0 0 0 rgba(186, 26, 26, 0.4);
	animation: mail-doctor-pulse-red 2s infinite;
}

.mail-doctor-status-badge--local {
	border-color: rgba(136, 146, 191, 0.25);
	background: rgba(136, 146, 191, 0.05);
	color: #636b95;
}
.mail-doctor-status-badge--local .mail-doctor-status-dot {
	background: #8892bf;
}

.mail-doctor-status-badge--configured,
.mail-doctor-status-badge--unconfigured {
	border-color: var(--mail-doctor-color-border);
	background: var(--mail-doctor-color-neutral-soft);
	color: var(--mail-doctor-color-muted);
}
.mail-doctor-status-badge--configured .mail-doctor-status-dot {
	background: #94a3b8;
}
.mail-doctor-status-badge--unconfigured .mail-doctor-status-dot {
	background: #cbd5e1;
}

/* Pulsing keyframes */
@keyframes mail-doctor-pulse-green {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
	}
}

@keyframes mail-doctor-pulse-orange {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
	}
}

@keyframes mail-doctor-pulse-red {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(186, 26, 26, 0.7);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 6px rgba(186, 26, 26, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(186, 26, 26, 0);
	}
}


/* Eliminate double wrap vertical margin in WP admin */
.maildoctor-admin-wrap + .maildoctor-admin-wrap {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Align and collapse margins of top containers */
.maildoctor-admin-wrap .maildoctor-header {
	margin: 0 0 16px;
}

.mail-doctor-status-layers,
.mail-doctor-settings,
.mail-doctor-filter-bar,
.mail-doctor-guides-hero {
	margin-top: 12px !important;
}

.maildoctor-header__tabs .nav-tab {
	border: none !important;
	background: transparent !important;
	margin: 0 !important;
	padding: 0 0 12px 0 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--mail-doctor-color-muted) !important;
	border-bottom: 2px solid transparent !important;
	transition: all 0.2s ease !important;
	border-radius: 0 !important;
}

.maildoctor-header__tabs .nav-tab:hover,
.maildoctor-header__tabs .nav-tab:focus {
	color: var(--mail-doctor-color-accent) !important;
	background: transparent !important;
	outline: none !important;
}

.maildoctor-header__tabs .nav-tab-active {
	color: var(--mail-doctor-color-accent) !important;
	border-bottom-color: var(--mail-doctor-color-accent) !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* Upgrade to Pro button styling override */
.maildoctor-header__actions {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	padding-bottom: 8px;
	flex: 0 0 auto;
}

.maildoctor-upgrade-btn {
	background: linear-gradient(135deg, #4f46e5 0%, #3525cd 100%) !important;
	border: none !important;
	color: #ffffff !important;
	font-weight: 600 !important;
	padding: 8px 16px !important;
	border-radius: 8px !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2) !important;
	text-decoration: none !important;
	transition: all 0.2s ease !important;
	height: auto !important;
	line-height: 1.4 !important;
}

.maildoctor-upgrade-btn:hover {
	transform: translateY(-1px) !important;
	box-shadow: 0 6px 12px -1px rgba(79, 70, 229, 0.3) !important;
}

/* Custom Form Label and Button Overrides */
.maildoctor-admin-wrap p > label,
.maildoctor-admin-wrap .mail-doctor-field-block__label,
.maildoctor-admin-wrap .mail-doctor-api-keys__label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: var(--mail-doctor-color-text);
	margin-bottom: 8px;
}

.maildoctor-admin-wrap .button-primary,
.maildoctor-admin-wrap .button.button-primary {
	background: var(--mail-doctor-color-accent) !important;
	border-color: var(--mail-doctor-color-accent) !important;
	color: #fff !important;
	font-weight: 600 !important;
	border-radius: var(--mail-doctor-radius-sm) !important;
	padding: 8px 18px !important;
	height: auto !important;
	line-height: 1.4 !important;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2) !important;
	transition: all 0.2s ease !important;
}

.maildoctor-admin-wrap .button-primary:hover,
.maildoctor-admin-wrap .button-primary:focus {
	background: #3525cd !important;
	border-color: #3525cd !important;
	transform: translateY(-1px) !important;
	box-shadow: 0 6px 12px -1px rgba(79, 70, 229, 0.3) !important;
	outline: none !important;
}

body.mail-doctor-modal-open {
	overflow: hidden;
}

@media (max-width: 782px) {
	.maildoctor-admin-wrap .maildoctor-header {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding-bottom: 0;
	}

	.maildoctor-header .nav-tab-wrapper {
		margin-bottom: 0;
		flex-wrap: wrap;
		justify-content: flex-start !important;
		gap: 12px 16px !important;
	}

	.maildoctor-branding__title {
		padding-bottom: 0;
	}

	.maildoctor-header__actions {
		width: 100%;
		justify-content: flex-start;
		padding-bottom: 12px;
	}
}