/**
 * RSM Suite — shared wp-admin button, link, chip, and pagination styles.
 *
 * Scoped via `rsmspark-suite-ui` on modals/panels, hub shells, and settings wraps.
 * Secondary screens: `body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]` (no extra class).
 * Enqueued suite-wide on RSM admin screens via Rsmspark_Suite::enqueue_assets().
 * Hub settings tabs: admin-suite.css nav-tab rules (not bucket chips).
 */

:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) {
	--rsm-brand: #ff6b35;
	--rsm-brand-hover: #e85a24;
	--rsm-brand-dark: #c2410c;
	--rsm-border: #e2e8f0;
	--rsm-surface: #f8fafc;
}

/* Primary */
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary {
	background: var(--rsm-brand) !important;
	border-color: var(--rsm-brand-hover) !important;
	color: #fff !important;
	box-shadow: none;
	text-shadow: none;
}

:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary:hover,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary:focus {
	background: var(--rsm-brand-hover) !important;
	border-color: #d14d1a !important;
	color: #fff !important;
}

:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary:disabled,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary.disabled,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-primary[disabled] {
	background: #f1f5f9 !important;
	border-color: #cbd5e1 !important;
	color: #94a3b8 !important;
	cursor: not-allowed;
	opacity: 1;
}

/* Secondary / default */
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button:not(.button-primary),
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-secondary,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button.button-secondary {
	border-color: #cbd5e1 !important;
	background: #fff !important;
	color: #334155 !important;
	box-shadow: none;
}

:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button:not(.button-primary):hover,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button:not(.button-primary):focus,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-secondary:hover,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-secondary:focus {
	border-color: var(--rsm-brand) !important;
	color: var(--rsm-brand-dark) !important;
	background: #fff !important;
}

/* Action links (not section subnav / settings tabs) */
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-link,
.rsmspark-suite-ui .rsm-media-picker__library-link {
	color: var(--rsm-brand-dark);
}

:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-link:hover,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) .button-link:focus,
.rsmspark-suite-ui .rsm-media-picker__library-link:hover,
.rsmspark-suite-ui .rsm-media-picker__library-link:focus {
	color: var(--rsm-brand);
}

/* Search / text focus */
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) input[type="search"]:focus,
:is(.rsmspark-suite-ui, body.rsmspark-suite-admin-screen .wrap[class*="rsm-"]) input[type="text"]:focus,
.rsmspark-suite-ui input[type="search"]:focus,
.rsmspark-suite-ui input[type="text"]:focus {
	border-color: var(--rsm-brand);
	box-shadow: 0 0 0 1px var(--rsm-brand);
	outline: 2px solid transparent;
}

/* Media bucket chips (library + picker) */
.rsmspark-suite-ui .rsm-media-chip,
.rsmspark-suite-ui .rsm-media-picker__chip {
	border: 1px solid var(--rsm-border);
	background: #fff;
	color: #334155;
}

.rsmspark-suite-ui .rsm-media-chip:hover,
.rsmspark-suite-ui .rsm-media-chip:focus,
.rsmspark-suite-ui .rsm-media-picker__chip:hover,
.rsmspark-suite-ui .rsm-media-picker__chip:focus {
	border-color: var(--rsm-brand);
	color: var(--rsm-brand-dark);
}

.rsmspark-suite-ui .rsm-media-chip.is-active,
.rsmspark-suite-ui .rsm-media-chip.is-active:hover,
.rsmspark-suite-ui .rsm-media-chip.is-active:focus,
.rsmspark-suite-ui .rsm-media-picker__chip.is-active,
.rsmspark-suite-ui .rsm-media-picker__chip.is-active:hover,
.rsmspark-suite-ui .rsm-media-picker__chip.is-active:focus {
	background: var(--rsm-brand);
	border-color: var(--rsm-brand);
	color: #fff;
}

/* Picker selection ring */
.rsmspark-suite-ui .rsm-media-picker__card.is-selected {
	border-color: var(--rsm-brand);
	box-shadow: 0 0 0 1px var(--rsm-brand);
}

.rsmspark-suite-ui .rsm-media-picker__card-meta.is-missing-alt {
	color: #b45309;
}

/* Pagination (library + picker) */
.rsmspark-suite-ui .rsm-media-pagination .button:not(.button-primary):hover,
.rsmspark-suite-ui .rsm-media-pagination .button:not(.button-primary):focus,
.rsmspark-suite-ui .rsm-media-picker__pagination .button:not(.button-primary):hover,
.rsmspark-suite-ui .rsm-media-picker__pagination .button:not(.button-primary):focus {
	border-color: var(--rsm-brand) !important;
	color: var(--rsm-brand-dark) !important;
}
