/**
 * Notification Toggle CSS
 *
 * Styling for the notification enabled/disabled toggle switch.
 *
 * @package   Client Portal
 * @copyright Copyright (c) 2025, Client Portal, https://client-portal.io
 * @license   GPL-3.0+
 * @since     5.8.0
 */

/* Make the enabled checkbox row visually distinct.
   CMB2 group fields generate classes like "cmb2-id-{group}-0-enabled". */
.cmb-row[class*="-0-enabled"] {
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
	padding: 12px 10px !important;
	margin-bottom: 4px !important;
}

.cmb-row[class*="-0-enabled"] .cmb-th label {
	font-weight: 600;
	font-size: 14px;
}

/* Hide the native checkbox */
.cmb-row[class*="-0-enabled"] input[type="checkbox"].cmb2-option {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Toggle track — the pill-shaped background */
.cmb-row[class*="-0-enabled"] .cmb-td > label[for] {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding-left: 48px;
	min-height: 24px;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.cmb-row[class*="-0-enabled"] .cmb-td > label[for]::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 22px;
	border-radius: 11px;
	background: #ccc;
	transition: background-color 0.2s ease;
}

/* Toggle knob — the circle that slides */
.cmb-row[class*="-0-enabled"] .cmb-td > label[for]::after {
	content: "";
	position: absolute;
	left: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: left 0.2s ease;
}

/* Checked state — track turns blue, knob slides right */
.cmb-row[class*="-0-enabled"] input[type="checkbox"].cmb2-option:checked + label[for]::before {
	background: #00a32a;
}

.cmb-row[class*="-0-enabled"] input[type="checkbox"].cmb2-option:checked + label[for]::after {
	left: 20px;
}

/* Focus ring for keyboard accessibility */
.cmb-row[class*="-0-enabled"] input[type="checkbox"].cmb2-option:focus-visible + label[for]::before {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #00a32a;
}

/* ── Notification sub-tabs ──
   Make the section links more prominent as pill-style tabs. */
.leco_cp_options .subsubsub {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 8px 0 16px;
	padding: 0;
	float: none;
}

.leco_cp_options .subsubsub li {
	margin: 0;
	padding: 0;
	font-size: 0; /* Hide pipe separator text nodes */
}

.leco_cp_options .subsubsub a {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
	color: #2271b1;
	text-decoration: none;
	font-size: 13px;
	line-height: 1.4;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.leco_cp_options .subsubsub a:hover {
	background: #f0f0f1;
	border-color: #c3c4c7;
	color: #135e96;
}

.leco_cp_options .subsubsub a.current {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
	font-weight: 600;
}
