/**
 * WPBuoy Endpoint Manager Pro Admin Styles
 *
 * @package WPBuoy_Endpoint_Manager_Pro
 */

.wrap h1 {
	margin-bottom: 16px;
}

.rest-api-namespace {
	margin-bottom: 15px;
	border: 1px solid #c3c4c7; /* WordPress border gray */
	background: #fff;
}

/* Namespace Header (Accordion Header) */
.namespace-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .5rem .75rem;
	background: #f6f7f7; /* WordPress admin background */
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.namespace-header:hover {
	background: #f0f0f1; /* WordPress hover gray */
}

/* Remove expanded highlighting */
.namespace-header.expanded {
	background: #f6f7f7; /* Same as default */
	border-bottom-color: #c3c4c7; /* Same as def ault */
}

.namespace-title {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.rest-api-namespace h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327; /* WordPress heading color */
}

.disabled-count {
	background: #d63638; /* WordPress notification red */
	color: white;
	font-size: 11px;
	font-weight: 500;
	padding: 2px 6px;
	border-radius: 10px;
	white-space: nowrap;
}

/* Namespace Bulk Toggle (switch) */
.namespace-bulk-toggle-label {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
}

.namespace-bulk-toggle-label input[type="checkbox"] {
	display: none;
}

.namespace-bulk-toggle-label input[type="checkbox"]:checked + .toggle-switch {
	background: #d63638; /* WordPress notification red = Blocked */
}

.namespace-bulk-toggle-label input[type="checkbox"]:not(:checked) + .toggle-switch::before {
	transform: translateX(25.5px);
}

.namespace-bulk-toggle-label input[type="checkbox"]:not(:checked) + .toggle-switch::after {
	content: 'ON';
	left: 6px;
	right: auto;
}

.namespace-bulk-toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
	content: 'OFF';
	right: 6px;
	left: auto;
}

.namespace-bulk-toggle-label input[type="checkbox"]:focus-visible + .toggle-switch {
	outline: 2px solid #2271b1; /* WordPress link blue */
	outline-offset: 2px;
}

/* Toggle Button */
.namespace-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px;
	border-radius: 3px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
}

.namespace-toggle:hover {
	background: rgba(0, 0, 0, 0.05);
}

.namespace-toggle:focus {
	outline: 2px solid #2271b1; /* WordPress link blue */
	outline-offset: 2px;
}

.toggle-icon {
	width: 24px;
	height: 24px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23666'%3E%3Cpath d='M480-360 280-560h400L480-360Z'/%3E%3C/svg%3E") no-repeat center;
	background-size: 24px 24px;
	transition: all 0.3s ease;
	display: inline-block;
	opacity: 0.7; /* Slightly muted to match WordPress style */
}

.namespace-header.expanded .toggle-icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23666'%3E%3Cpath d='m280-400 200-200 200 200H280Z'/%3E%3C/svg%3E");
}


.rest-api-routes {
	transition: all 0.3s ease;
	position: relative;
}

.rest-api-route {
	display: flex;
	flex-direction: column;
	padding: .25rem .75rem .25rem 2rem;
	border-bottom: 1px solid #f0f0f1; /* WordPress light gray */
	position: relative;
}

/* Tree connector: vertical trunk down the indent gutter, with a horizontal
   tick branching into each row. The last row's trunk stops halfway so it
   reads as an L instead of continuing past the final branch. */
.rest-api-route::before {
	content: '';
	position: absolute;
	top: 0;
	left: 1rem;
	width: 1px;
	height: 100%;
	background: #c3c4c7; /* WordPress border gray */
}

.rest-api-route:last-child::before {
	height: 50%;
}

.rest-api-route::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 1rem;
	width: 1rem;
	height: 1px;
	background: #c3c4c7; /* WordPress border gray */
}

.rest-api-route:last-child {
	border-bottom: none;
}

.route-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.rest-api-route label {
	display: flex;
	align-items: center;
	cursor: pointer;
}

/* Hide the actual checkbox */
.rest-api-route input[type="checkbox"] {
	display: none;
}

/* Toggle Switch Styles */
.toggle-switch {
	position: relative;
	display: inline-block;
	width: 51px;
	height: 25.5px;
	background: #00a32a;
	border-radius: 25.5px;
	transition: background-color 0.3s ease;
	cursor: pointer;
	flex-shrink: 0;
}

/* When checkbox is checked (endpoint disabled), switch turns red */
.rest-api-route input[type="checkbox"]:checked + .toggle-switch {
	background: #d63638; /* WordPress notification red = Disabled */
}

.toggle-switch::before {
	content: '';
	position: absolute;
	top: 2.55px;
	left: 2.55px;
	width: 20.4px;
	height: 20.4px;
	background: white;
	border-radius: 50%;
	transition: transform 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* When unchecked (enabled), move knob to right */
.rest-api-route input[type="checkbox"]:not(:checked) + .toggle-switch::before {
	transform: translateX(25.5px);
}

/* Toggle Labels */
.toggle-switch::after {
	content: 'ON';
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	color: white;
	font-size: 8.5px;
	font-weight: bold;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	opacity: 1;
	transition: all 0.3s ease;
	z-index: 1;
}

/* Unchecked (enabled): knob right, ON label left */
.rest-api-route input[type="checkbox"]:not(:checked) + .toggle-switch::after {
	content: 'ON';
	left: 6px;
	right: auto;
}

/* Checked (disabled): knob left, OFF label right */
.rest-api-route input[type="checkbox"]:checked + .toggle-switch::after {
	content: 'OFF';
	right: 6px;
	left: auto;
}

.route-path {
	font-size: 13px;
	color: #50575e; /* WordPress gray text */
	font-weight: 500;
}

.route-type {
	background: #00A32A;
	color: #fff;
	font-size: 10px;
	padding: 1px 5px;
	border-radius: 3px;
	font-weight: 600;
	text-transform: uppercase;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.route-restricted {
	position: relative;
	background: #50575e;
	color: #fff;
	border: none;
	font-size: 10px;
	padding: 1px 5px;
	border-radius: 3px;
	font-weight: 600;
	text-transform: uppercase;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: default;
}

.route-restricted::before,
.route-restricted::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.route-restricted::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	text-transform: initial;
	padding: 6px 10px;
	border-radius: 3px;
	width: 200px;
	z-index: 100000;
}

.route-restricted::after {
	content: "";
	position: absolute;
	bottom: calc(100% + 0px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	width: auto;
	z-index: 100000;
}

.route-restricted:hover::before,
.route-restricted:hover::after {
	opacity: 1;
}

/* Method badges */
.route-methods {
	display: inline-flex;
	gap: .5rem;
}

.method-badge {
	font-size: 10px;
	padding: 1px 5px;
	border-radius: 3px;
	font-weight: 600;
	text-transform: uppercase;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.method-get { background: #00A32A; color: #fff; }
.method-post { background: #2271B1; color: #fff; }
.method-put { background: #DBA617; color: #fff; }
.method-delete { background: #DC3232; color: #fff; }
.method-patch { background: #3B00C0; color: #fff; }

.route-preview {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #999;
	text-decoration: none;
	width: 40px;
	height: 40px;
	line-height: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.route-preview:hover {
	text-decoration: none;
}

.route-preview-unavailable {
	color: #646970; /* WordPress gray text */
	font-size: 12px;
	padding: 4px 8px;
	font-style: italic;
	flex-shrink: 0;
}

.rest-api-route:hover {
	background: #FCFCFC; /* WordPress hover background */
}

/* Responsive design */
@media (max-width: 782px) {
	.route-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.rest-api-route {
		padding: 15px 0 15px 1.5rem;
	}

	.route-info {
		width: 100%;
	}

	.route-preview {
		align-self: flex-end;
	}

	.toggle-switch {
		margin-bottom: 10px;
	}
}

/* Settings page specific styles */

.wpbyem-footer {
	position: sticky;
	bottom: 0;
	z-index: 20;
	padding: 16px 0;
	background: #f0f0f1; /* WordPress admin content background */
}
.wpbyem-footer .submit {
	margin: 0;
	padding: 0;
}

/* Route info container */
.route-info {
	display: flex;
	align-items: center;
	flex: 1;
	flex-wrap: wrap;
	gap: .5rem;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.button {
	text-align: center;
}

/* Controls container */
.rest-api-controls-container {
	padding: 20px;
	background:#f6f7f7;
	border: 1px solid #c3c4c775;
	margin-bottom: 20px;
	padding-bottom: 20px;
}

.rest-api-controls-row {
	display: flex;
	align-items: flex-end;
	gap: 15px;
	flex-wrap: wrap;
}

.control-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 150px;
	flex: 1;
}

.control-group:last-child {
	flex: 0 0 auto;
	min-width: auto;
}

/* When clear filters button is hidden, let other controls expand and remove its gap */
.rest-api-controls-row.no-clear-button .control-group:last-child {
	display: none;
}

.control-group label {
	font-size: 13px;
	font-weight: 500;
	color: #1d2327; /* WordPress heading color */
	margin: 0;
}

.rest-api-search-input-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

.rest-api-search {
	width: 100%;
	max-width: none !important;
	padding: 3px 40px 3px 8px;
	font-size: 14px;
	line-height: 2;
	border: 1px solid #8c8f94; /* WordPress input border */
	border-radius: 0;
	background: #fff;
	color: #2c3338; /* WordPress input text color */
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
	transition: border-color 0.05s ease-in-out;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.rest-api-search:focus {
	border-color: #2271b1; /* WordPress link blue */
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.rest-api-search::placeholder {
	color: #646970; /* WordPress placeholder gray */
}

.rest-api-search-clear {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	border-radius: 2px;
	transition: all 0.15s ease-in-out;
	z-index: 10;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rest-api-search-clear:hover {
	background-color: rgba(214, 54, 56, 0.1); /* Light red background on hover */
}

.rest-api-search-clear:focus {
	outline: 2px solid #2271b1; /* WordPress link blue */
	outline-offset: 2px;
}

.rest-api-search-clear::before {
	content: "";
	width: 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23646970'%3E%3Cpath d='m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56Z'/%3E%3C/svg%3E") no-repeat center center;
	background-size: 16px 16px;
	display: block;
	transition: all 0.15s ease-in-out;
	flex-shrink: 0;
}

.rest-api-search-clear:hover::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23646970'%3E%3Cpath d='m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56Z'/%3E%3C/svg%3E");
	filter: brightness(0) saturate(100%) invert(18%) sepia(87%) saturate(5506%) hue-rotate(348deg) brightness(83%) contrast(91%); /* Convert to red #d63638 */
}

.search-results-info {
	margin-top: 12px;
	font-size: 13px;
}

.search-results-count.has-results {
	color: #50575e; /* WordPress gray text */
}

.search-results-count.no-results {
	color: #d63638; /* WordPress notification red */
	font-weight: 500;
}

/* Search highlighting */
mark {
	background-color: #fff3cd;
	color: #1d2327;
	padding: 0 2px;
	border-radius: 2px;
	font-weight: 500;
}



.rest-api-filter-select {
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #8c8f94; /* WordPress input border */
	border-radius: 0;
	background: #fff;
	color: #2c3338; /* WordPress input text color */
	min-height: 30px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	max-width: none !important;
	width: 100%;
}

.rest-api-filter-select:focus {
	border-color: #2271b1; /* WordPress link blue */
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.rest-api-clear-filters {
	padding: 6px 12px;
	font-size: 13px;
	border: 1px solid #2271b1; /* WordPress link blue */
	border-radius: 3px;
	background: #fff;
	color: #2271b1;
	cursor: pointer;
	transition: all 0.15s ease-in-out;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	height: 30px;
	white-space: nowrap;
}

.rest-api-clear-filters:hover {
	background: #2271b1;
	color: #fff;
}

.rest-api-clear-filters:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.rest-api-filter-date {
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #8c8f94;
	border-radius: 0;
	background: #fff;
	color: #2c3338;
	min-height: 30px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.rest-api-filter-date:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

/* Responsive filters */
@media (max-width: 782px) {
	.rest-api-filters-container {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}


	.rest-api-clear-filters {
		align-self: flex-start;
	}
}

/* Logs page — all filter controls equal width */
.rest-api-controls-row--equal .control-group:last-child {
	flex: 1;
	min-width: 150px;
}

/* Logs page styles */
.wpbuoy-em-logs-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 12px;
}

.wpbuoy-em-logs-actions-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wpbuoy-em-logs-actions-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpbuoy-em-logs-total {
	font-size: 13px;
	color: #50575e;
}

.wpbuoy-em-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
}

.wpbuoy-em-pagination .button {
	width: 40px;
	min-width: 28px;
	padding: 0 6px;
	text-align: center;
	line-height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpbuoy-em-pagination .button svg {
	width: 16px;
	height: 16px;
}

.wpbuoy-em-page-info {
	font-size: 13px;
	color: #50575e;
	padding: 0 4px;
}

.wpbuoy-em-logs-table {
	margin-bottom: 12px;
}

/* Dims the table while an AJAX search/filter/pagination request
   (fetchLogs() in logs.js) is in flight, and blocks interaction with the
   stale rows so a second click can't fire before the first request lands. */
.wpbuoy-em-logs-table.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease-in-out;
}

.wpbuoy-em-logs-table td {
	vertical-align: middle;
}

.wpbuoy-em-logs-table .log-user-agent {
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpbuoy-em-logs-table .log-actions,
.wpbuoy-em-logs-table th:last-child {
	width: 60px;
	text-align: center;
	white-space: nowrap;
}

/* Log reason badges */
.log-reason {
	position: relative;
	font-size: 10px;
	padding: 1px 5px;
	border-radius: 3px;
	font-weight: 600;
	text-transform: uppercase;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	white-space: nowrap;
}

.log-reason--success {
	background: #00A32A;
	color: #fff;
}

.log-reason--error {
	background: #DC3232;
	color: #fff;
}

.log-reason::before,
.log-reason::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.log-reason::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 100000;
}

.log-reason::after {
	content: "";
	position: absolute;
	bottom: calc(100% - 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	z-index: 100000;
}

.log-reason:hover::before,
.log-reason:hover::after {
	opacity: 1;
}

button[disabled][data-tooltip] {
	position: relative;
	pointer-events: auto;
}

button[disabled][data-tooltip]::before,
button[disabled][data-tooltip]::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

button[disabled][data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 11px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 100000;
}

button[disabled][data-tooltip]::after {
	content: "";
	position: absolute;
	bottom: calc(100% + 0px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	width: auto;
	z-index: 100000;
}

button[disabled][data-tooltip]:hover::before,
button[disabled][data-tooltip]:hover::after {
	opacity: 1;
}

/**
 * License Status Widget
 */
.license-badge {
	align-items: center;
	border-radius: 3px;
	border-style: solid;
	border-width: 1px;
	display: flex;
	font-weight: 600;
	gap: 4px;
	min-height: 30px;
	padding: 0 10px;
}
.license-badge.active {
	background: #f0f9f5;
	border-color: #00a32a;
	color: #00a32a;
}
.license-badge.inactive {
	background: #fbeaea;
	border-color: #dc3232;
	color: #dc3232;
}
.license-badge .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}


/* Pro badge styles */
.pro-badge {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	font-size: 9px;
	font-weight: 600;
	padding: 2px 5px;
	border-radius: 3px;
	text-transform: uppercase;
	margin-left: 5px;
	vertical-align: middle;
	line-height: 1;
}

button[disabled] .pro-badge {
	background: #646970;
}

/* Disabled button styles */
button[disabled] {
	cursor: not-allowed !important; /* stylelint-disable-line declaration-no-important */
}

/**
 * JavaScript-controlled initial states.
 * These elements start hidden; admin.js shows/hides them via inline styles.
 */
.rest-api-routes,
.rest-api-search-clear,
.rest-api-clear-filters,
.search-results-info {
	display: none;
}

/**
 * License locked page utility styles.
 */
.wpbyem-license-cta {
	margin-left: 10px;
}

/**
 * License management page styles.
 */
.rest-api-license-container {
	margin-top: 20px;
	max-width: 800px;
}

.license-status-card,
.license-form-card,
.license-features-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	padding: 20px;
	margin-bottom: 20px;
}

.license-status-info {
	margin-top: 15px;
}

.status-row {
	display: flex;
	margin-bottom: 10px;
}

.status-label {
	font-weight: 600;
	min-width: 120px;
}

.status-active {
	color: #46b450;
	font-weight: 600;
}

.status-inactive {
	color: #dc3232;
	font-weight: 600;
}

.feature-list {
	list-style: none;
	padding: 0;
	margin: 15px 0 0;
}

.feature-list li {
	padding: 8px 0 8px 30px;
	position: relative;
}

.feature-list li::before {
	content: '✓';
	position: absolute;
	left: 0;
	color: #46b450;
	font-weight: bold;
	font-size: 18px;
}

.feature-list li.disabled {
	opacity: 0.5;
}

.feature-list li.disabled::before {
	content: '✗';
	color: #dc3232;
}

.rest-api-license-upgrade-cta {
	margin-top: 20px;
}

/* Per-endpoint rate limit overrides */
.route-rate-limit-toggle,
.route-stats-toggle {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #999;
	width: 40px;
	height: 40px;
	line-height: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.route-rate-limit-toggle[disabled] svg,
.route-stats-toggle[disabled] svg,
.route-preview[disabled] svg {
	opacity: 0.6;
}

.route-preview[disabled] {
	cursor: not-allowed;
}

.route-rate-limit-toggle svg path,
.route-stats-toggle svg path,
.route-preview svg path {
	fill: #999;
}

.route-rate-limit-toggle.has-override {
	color: #2271b1;
}

.route-rate-limit-toggle:disabled,
.route-stats-toggle:disabled {
	cursor: not-allowed;
}

.route-rate-limit-toggle:disabled:hover,
.route-stats-toggle:disabled:hover {
	color: #838485;
}

.route-rate-limit-toggle,
.route-stats-toggle,
.route-preview {
	position: relative;
}

.route-rate-limit-toggle::before,
.route-rate-limit-toggle::after,
.route-stats-toggle::before,
.route-stats-toggle::after,
.route-preview::before,
.route-preview::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.route-rate-limit-toggle::before,
.route-stats-toggle::before,
.route-preview::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% - 2px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 100000;
}

.route-rate-limit-toggle::after,
.route-stats-toggle::after,
.route-preview::after {
	content: "";
	position: absolute;
	bottom: calc(100% - 10px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	z-index: 100000;
}

.route-rate-limit-toggle:hover::before,
.route-rate-limit-toggle:hover::after,
.route-stats-toggle:hover::before,
.route-stats-toggle:hover::after,
.route-preview:hover::before,
.route-preview:hover::after {
	opacity: 1;
}

.route-rate-limit-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 8px;
	padding: 8px;
	background: #f6f7f7;
	border-radius: 3px;
}

.rate-limit-field-group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.rate-limit-field-group label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	width: auto;
}

.route-rate-limit-fields .small-text {
	width: 60px;
}

.rate-limit-field-group span {
	font-size: 12px;
	color: #50575e;
}

/* Locked toggle for dynamic (Pro-gated) routes */
.route-toggle-locked {
	position: relative;
	display: inline-flex;
	cursor: not-allowed;
}

.route-toggle-locked label {
	cursor: not-allowed;
}

.toggle-switch--locked,
.rest-api-route input[type="checkbox"]:checked + .toggle-switch--locked {
	background-color: #999;
	opacity: 0.6;
	cursor: not-allowed;
}

.route-toggle-locked::before,
.route-toggle-locked::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.route-toggle-locked::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 11px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 100000;
}

.route-toggle-locked::after {
	content: "";
	position: absolute;
	bottom: calc(100% + 1px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	z-index: 100000;
}

.route-toggle-locked:hover::before,
.route-toggle-locked:hover::after {
	opacity: 1;
}

/* Pro-locked filter control group */
.wpbyem-filter-pro {
	opacity: 0.55;
	cursor: not-allowed;
	position: relative;
}

.wpbyem-filter-pro select {
	pointer-events: none;
}

.wpbyem-filter-pro::before,
.wpbyem-filter-pro::after {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.wpbyem-filter-pro::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #1d2327;
	color: #fff;
	font-size: 10px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 16px;
	padding: 6px 10px;
	border-radius: 3px;
	white-space: nowrap;
	z-index: 100000;
}

.wpbyem-filter-pro::after {
	content: "";
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1d2327;
	z-index: 100000;
}

.wpbyem-filter-pro:hover::before,
.wpbyem-filter-pro:hover::after {
	opacity: 1;
}

/* Pro upgrade banner */
.wpby-upgrade-banner {
	color: #fff;
	margin: 0;
	margin-top: 16px;
	padding: 0 16px;
	background: linear-gradient(135deg, #03142D, #02557C);
}
.wpby-upgrade-banner__wrap {
	margin: 0 auto;
	max-width: 1024px;
}
.wpby-upgrade-banner__grid {
	display: grid;
	grid-template-columns: 3fr 7fr;
	gap: 40px;
	padding: 64px 0;
}

.wpby-upgrade-value-prop {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wpby-upgrade-banner__heading {
	color: #fff;
	font-size: 24px;
	font-weight: 600;
	line-height: 32px;
	margin: 0 0 16px;
}

.wpby-upgrade-banner__desc {
	font-size: 16px;
	margin: 0 0 24px;
}

.wpby-upgrade-banner__ctas {
	display: flex;
	gap: 16px;
	justify-content: start;
}

.wpby-upgrade-banner__ctas .button:first-child {
	background: transparent;
	border-color: #fff;
	color: #fff;
}

.wpby-upgrade-banner__ctas .button:last-child {
	background-color: #4F46E5;
	border-color: #4F46E5;
	color: #fff;
}

.wpby-upgrade-features {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wpby-upgrade-banner__features {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: left;
}
.wpby-upgrade-banner__features li {
	font-size: 16px;
	line-height: 24px;
	margin-bottom: 16px;
	padding: 0 0 0 32px;
	position: relative;
}
.wpby-upgrade-banner__features li:last-child {
	margin-bottom: 0;
}

.wpby-upgrade-banner__features li::before {
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="%23e8eaed"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"/></svg>');
	background-size: 100%;
	content: '';
	height: 24px;
	left: 0;
	position: absolute;
	top: 0;
	width: 24px;
}

.wpby-upgrade-banner__footer {
	border-top: 1px solid rgba(255,255,255,.25);
	padding: 16px 0;
}

.wpby-upgrade-banner__footer p {
	color: rgba(255, 255, 255, .5);
	font-size: 14px;
	margin: 0;
}

.wpby-upgrade-banner__footer a {
	color: rgba(255, 255, 255, .5);
	text-decoration: underline;
}

.wpby-upgrade-banner__footer a:hover {
	color: #fff;
}

/* -------------------------------------------------- *
 * Endpoint preview modal
 * -------------------------------------------------- */

.wpb-emp-preview-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpb-emp-preview-modal {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
	max-width: 680px;
	width: 90%;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 80vh;
}

.wpb-emp-preview-title {
	display: flex;
	align-items: center;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	margin: 0;
}

.wpb-emp-preview-title .mr-3 {
	margin-right: 8px;
	display: flex;
	align-items: center;
}

.wpb-emp-preview-route {
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 13px;
	color: #50575e;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	padding: 10px 12px;
	word-break: break-all;
}

.wpb-emp-preview-response-wrap {
	overflow-y: auto;
	max-height: 360px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
}

.wpb-emp-preview-response {
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 12px;
	line-height: 1.6;
	color: #1d2327;
	background: #f6f7f7;
	padding: 12px;
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.wpb-emp-preview-response--error {
	color: #d63638;
	background: #fcf0f1;
}

.wpb-emp-preview-loading {
	font-size: 13px;
	color: #50575e;
	padding: 12px;
	margin: 0;
}

.wpb-emp-preview-error {
	font-size: 13px;
	color: #d63638;
	padding: 12px;
	margin: 0;
}

.wpb-emp-preview-admin-note {
	display: inline-block;
	background: #fef9c3;
	color: #3c434a;
	padding: 10px 12px;
	margin: 0;
}

.wpb-emp-preview-admin-note a {
	color: inherit;
	text-decoration: underline;
}

.wpb-emp-preview-instruction {
	margin: 0;
}

.wpb-emp-preview-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.wpb-emp-preview-actions .button-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.wpb-emp-preview-actions .button-primary:hover {
	background: #135e96;
	border-color: #135e96;
}

.wpb-emp-preview-actions .button-primary:disabled {
	background: #a7aaad;
	border-color: #a7aaad;
	cursor: not-allowed;
}

.wpb-emp-preview-actions .button-link {
	color: #50575e;
	text-decoration: none;
}

.wpb-emp-preview-actions .button-link:hover {
	color: #2271b1;
}

/* Settings page tabs */
.wpbyem-settings-tabs {
	border-bottom: 1px solid #c3c4c7;
	display: flex;
	gap: 0;
	margin: 12px 0 0;
	padding: 0;
}

.wpbyem-tab-button {
	background: none;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: 3px 3px 0 0;
	color: #50575e;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: -1px;
	padding: 15px 20px;
	transition: color 0.15s ease;
}

.wpbyem-tab-button:hover {
	color: #1d2327;
}

.wpbyem-tab-button:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.wpbyem-tab-button.active {
	background: #fafafa;
	border-color: #c3c4c7;
	border-bottom-color: #fafafa;
	color: #1d2327;
}

.wpbyem-tab-panel {
	background: #fafafa;
	border-bottom: 1px solid #c3c4c7;
	border-left: 1px solid #c3c4c7;
	border-right: 1px solid #c3c4c7;
	padding: 20px;
}

/* Export/Import tab */
#wpbyem-tab-export-import hr {
	margin: 24px 0;
}

#wpbyem-tab-export-import fieldset p {
	margin-top: 0;
	margin-bottom: 16px;
}

#wpbyem-tab-export-import .wpbyem-eim-submit {
	margin: 0;
}

.wpbyem-import-file {
	display: none;
}
