/* ============================================================
   ECS Admin Styles
   ============================================================ */

.ecs-admin-wrap {
	max-width: 960px;
}

.ecs-admin-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
}

.ecs-admin-header h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
}

.ecs-version {
	font-size: 12px;
	color: #888;
	background: #f0f0f0;
	padding: 2px 8px;
	border-radius: 10px;
}

/* ── Section headers ──────────────────────────────────────── */

.ecs-section-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e0e0e0;
}

.ecs-section-header--pro {
	margin-top: 32px;
	border-bottom-color: #f0c050;
}

.ecs-section-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #50575e;
	display: flex;
	align-items: center;
	gap: 12px;
}

.ecs-pro-cta {
	font-size: 12px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: #fff;
	background: #b8860b;
	padding: 3px 10px;
	border-radius: 10px;
	text-decoration: none;
	transition: background 0.15s;
}

.ecs-pro-cta:hover {
	background: #9a6f00;
	color: #fff;
}

.ecs-pro-cta--activate {
	background: #2271b1;
}

.ecs-pro-cta--activate:hover {
	background: #135e96;
}

.ecs-pro-active-badge {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #3a7c3a;
	background: #e9f6e9;
	padding: 2px 8px;
	border-radius: 10px;
}

/* ── Grid ─────────────────────────────────────────────────── */

.ecs-modules-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 24px;
}

/* ── Module Card ──────────────────────────────────────────── */

.ecs-module-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: box-shadow 0.2s;
}

.ecs-module-card:hover {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.ecs-module-card.is-active {
	border-color: #2271b1;
}

.ecs-module-card.is-deprecated {
	border-color: #dda0a0;
	background: #fffafa;
}

.ecs-module-card.is-locked {
	border-color: #d0d0d0;
	background: #f8f8f8;
}

.ecs-module-card.is-locked:hover {
	box-shadow: none;
}

.ecs-module-card.is-locked .ecs-module-card__title,
.ecs-module-card.is-locked .ecs-module-card__desc,
.ecs-module-card.is-locked .ecs-module-card__footer,
.ecs-module-card.is-locked .ecs-badge {
	opacity: 0.45;
	filter: grayscale(50%);
}

.ecs-module-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ecs-module-card__title {
	font-size: 15px;
	font-weight: 600;
	color: #1e1e1e;
}

.ecs-module-card__badges {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.ecs-module-card__desc {
	font-size: 13px;
	color: #666;
	margin: 0;
	line-height: 1.5;
}

.ecs-module-deprecated-notice {
	font-size: 12px;
	color: #a05252;
	margin: 0;
	font-style: italic;
	line-height: 1.5;
}

.ecs-module-card__footer {
	display: flex;
	align-items: center;
	margin-top: auto;
}

/* ── Badge ────────────────────────────────────────────────── */

.ecs-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 10px;
	letter-spacing: 0.5px;
}

.ecs-badge--free {
	background: #e9f6e9;
	color: #3a7c3a;
}

.ecs-badge--pro {
	background: #fff3cd;
	color: #856404;
}

.ecs-badge--deprecated {
	background: #fde8e8;
	color: #a05252;
}

.ecs-module-locked {
	font-size: 12px;
	color: #888;
	font-style: italic;
}

/* ── Toggle Switch ────────────────────────────────────────── */

.ecs-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

.ecs-toggle input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.ecs-toggle__slider {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	background: #ccc;
	border-radius: 11px;
	transition: background 0.2s;
	flex-shrink: 0;
}

.ecs-toggle__slider::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
}

.ecs-toggle input:checked + .ecs-toggle__slider {
	background: #2271b1;
}

.ecs-toggle input:checked + .ecs-toggle__slider::after {
	transform: translateX(18px);
}

.ecs-toggle__label {
	font-size: 13px;
}

.ecs-toggle__label--active {
	display: none;
	color: #2271b1;
	font-weight: 500;
}

.ecs-toggle input:checked ~ .ecs-toggle__label--active {
	display: inline;
}

.ecs-toggle__label--inactive {
	display: inline;
	color: #555;
}

.ecs-toggle input:checked ~ .ecs-toggle__label--inactive {
	display: none;
}

/* ── Module Preview ───────────────────────────────────────── */

.ecs-preview-wrap {
	position: relative;
}

.ecs-preview-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #aaa;
	padding: 2px 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	line-height: 1;
	transition: color 0.15s, background 0.15s;
}

.ecs-preview-btn:hover,
.ecs-preview-btn.is-active {
	color: #2271b1;
	background: #e8f0f8;
}

/* Red play button for locked pro modules */
.ecs-preview-btn--locked {
	color: #c0392b;
}

.ecs-preview-btn--locked:hover,
.ecs-preview-btn--locked.is-active {
	color: #fff;
	background: #c0392b;
}

.ecs-preview-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.ecs-preview-popup {
	display: none;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 100000;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	padding: 8px;
}

.ecs-preview-wrap.is-open .ecs-preview-popup {
	display: block;
}

.ecs-preview-popup img {
	display: block;
	max-width: 320px;
	height: auto;
	border-radius: 4px;
}

/* ── Save Button ──────────────────────────────────────────── */

.ecs-save-btn {
	margin-top: 8px !important;
}

/* ── License Badge (inline in section header) ─────────────── */

.ecs-license-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	text-decoration: none;
	padding: 2px 9px;
	border-radius: 10px;
	transition: background 0.15s, color 0.15s;
	color: #3a7c3a;
	background: #e9f6e9;
	border: 1px solid #b8e0b8;
}

.ecs-license-badge:hover {
	background: #d0efd0;
	color: #2a5c2a;
}

.ecs-license-badge .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
}

.ecs-license-badge--activate {
	color: #9a6700;
	background: #fff8e1;
	border-color: #f0d080;
}

.ecs-license-badge--activate:hover {
	background: #fef0b0;
	color: #7a5000;
}

/* ── License Page Layout ──────────────────────────────────── */

.ecs-license-wrap {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

.ecs-license-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 140px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 8px;
}

.ecs-license-nav__item {
	display: block;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #50575e;
	text-decoration: none;
	transition: background 0.15s;
}

.ecs-license-nav__item:hover {
	background: #f0f0f0;
	color: #1e1e1e;
}

.ecs-license-nav__item.is-active {
	background: #e8f0f8;
	color: #2271b1;
	font-weight: 600;
}

/* ── License Card ─────────────────────────────────────────── */

.ecs-license-card {
	flex: 1;
	max-width: 560px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ecs-license-card__icon {
	font-size: 32px;
	line-height: 1;
}

.ecs-license-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1e1e1e;
}

.ecs-license-card__desc {
	margin: 0;
	font-size: 13px;
	color: #666;
	line-height: 1.6;
}

/* ── License Status Badge ─────────────────────────────────── */

.ecs-license-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	align-self: flex-start;
}

.ecs-license-status__dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}

.ecs-license-status--active {
	background: #e9f6e9;
	color: #2a6b2a;
}

.ecs-license-status--active .ecs-license-status__dot {
	background: #3a9a3a;
	box-shadow: 0 0 0 2px #b8e8b8;
}

.ecs-license-status--inactive {
	background: #faf0e0;
	color: #8a6000;
}

.ecs-license-status--inactive .ecs-license-status__dot {
	background: #c08800;
	box-shadow: 0 0 0 2px #f0d880;
}

/* ── License Key Display ──────────────────────────────────── */

.ecs-license-key-display {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #f8f8f8;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 10px 14px;
}

.ecs-license-key-display__label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
	white-space: nowrap;
}

.ecs-license-key-display__value {
	font-family: monospace;
	font-size: 13px;
	color: #1e1e1e;
	letter-spacing: 1px;
	background: none;
	padding: 0;
}

/* ── License Form ─────────────────────────────────────────── */

.ecs-license-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ecs-license-form__row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ecs-license-form__input {
	flex: 1;
	font-family: monospace;
	font-size: 13px;
	letter-spacing: 1px;
	padding: 6px 10px !important;
	border: 1px solid #c0c0c0 !important;
	border-radius: 4px !important;
	box-shadow: inset 0 1px 2px rgba(0,0,0,.07) !important;
}

.ecs-license-form__input:focus {
	border-color: #2271b1 !important;
	box-shadow: 0 0 0 1px #2271b1, inset 0 1px 2px rgba(0,0,0,.07) !important;
}

.ecs-license-form__btn {
	white-space: nowrap;
}

.ecs-license-form__hint {
	margin: 0;
	font-size: 12px;
	color: #888;
}

.ecs-license-form__hint a {
	color: #2271b1;
}

/* ── Deactivate Button ────────────────────────────────────── */

.ecs-license-deactivate-btn {
	background: none;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	padding: 6px 14px;
	font-size: 12px;
	color: #a05252;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	align-self: flex-start;
}

.ecs-license-deactivate-btn:hover {
	background: #fde8e8;
	border-color: #d09090;
}
