/*
 * 16Deza Block Curator – Admin Styles
 * Juuroku Design
 */

/* ─────────────────────────────────────────────
   Layout
───────────────────────────────────────────── */
.bc-wrap {
	max-width: 860px;
	margin-top: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

/* ─────────────────────────────────────────────
   Header
───────────────────────────────────────────── */
.bc-header {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px 28px 20px;
	margin-bottom: 20px;
}

.bc-header__inner {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 6px;
}

.bc-header__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.3;
}

.bc-header__icon {
	font-size: 20px;
}

.bc-header__version {
	font-size: 12px;
	color: #999;
	background: #f0f0f0;
	border-radius: 10px;
	padding: 1px 8px;
	margin: 0;
}

.bc-header__description {
	margin: 0;
	color: #646970;
	font-size: 14px;
	line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Notice
───────────────────────────────────────────── */
.bc-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
	font-size: 14px;
	font-weight: 500;
}

.bc-notice--success {
	background: #edfaee;
	border: 1px solid #00a32a;
	color: #007017;
}

/* ─────────────────────────────────────────────
   Card
───────────────────────────────────────────── */
.bc-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	margin-bottom: 20px;
	overflow: hidden;
}

.bc-card--option {
	padding: 18px 24px;
}

.bc-card__header {
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f0f0f0;
}

.bc-card__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.bc-card__desc {
	margin: 0 0 14px;
	font-size: 13px;
	color: #646970;
}

/* ─────────────────────────────────────────────
   Admin toggle row
───────────────────────────────────────────── */
.bc-toggle-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
}

.bc-toggle-row input[type="checkbox"] {
	margin: 3px 0 0;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: #2271b1;
}

.bc-toggle-row__label {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.bc-toggle-row__label strong {
	font-size: 14px;
	color: #1d2327;
}

.bc-toggle-row__note {
	font-size: 12px;
	color: #646970;
	line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Global actions
───────────────────────────────────────────── */
.bc-global-actions {
	display: flex;
	gap: 8px;
}

/* ─────────────────────────────────────────────
   Buttons
───────────────────────────────────────────── */
.bc-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 5px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	line-height: 1;
	text-decoration: none;
}

.bc-btn--primary {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}
.bc-btn--primary:hover {
	background: #135e96;
	border-color: #135e96;
	color: #fff;
}

.bc-btn--secondary {
	background: #f6f7f7;
	color: #2271b1;
	border-color: #d0d5d9;
}
.bc-btn--secondary:hover {
	background: #f0f0f1;
	border-color: #8c8f94;
	color: #135e96;
}

.bc-btn--xs {
	padding: 4px 10px;
	font-size: 11px;
	border-radius: 4px;
}

.bc-btn--cat-enable {
	background: #f0f8f0;
	color: #007017;
	border-color: #b0d9b0;
}
.bc-btn--cat-enable:hover {
	background: #e0f2e0;
}

.bc-btn--cat-disable {
	background: #fdf3f2;
	color: #b32d2e;
	border-color: #e8b4b4;
}
.bc-btn--cat-disable:hover {
	background: #fce8e8;
}

/* ─────────────────────────────────────────────
   Category groups
───────────────────────────────────────────── */
.bc-categories {
	padding: 0;
}

.bc-category {
	border-bottom: 1px solid #f0f0f0;
}

.bc-category:last-child {
	border-bottom: none;
}

.bc-category__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 24px;
	background: #fafafa;
	gap: 12px;
}

.bc-category__title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.bc-category__toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.bc-category__toggle:hover {
	color: #2271b1;
}

.bc-category__chevron {
	font-size: 11px;
	display: inline-block;
	width: 12px;
	color: #8c8f94;
}

.bc-category__name {
	font-size: 13px;
	font-weight: 600;
}

.bc-category__count {
	font-size: 11px;
	color: #8c8f94;
	background: #ebebeb;
	border-radius: 10px;
	padding: 1px 8px;
	white-space: nowrap;
}

.bc-category__actions {
	display: flex;
	gap: 6px;
}

/* ─────────────────────────────────────────────
   Block items grid
───────────────────────────────────────────── */
.bc-category__blocks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 0;
	padding: 8px 16px 12px;
}

.bc-block-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.1s;
}

.bc-block-item:hover {
	background: #f6f7f7;
}

.bc-block-item--off {
	opacity: 0.45;
}

.bc-block-item input[type="checkbox"] {
	display: none; /* hidden – we use custom indicator */
}

.bc-block-item__indicator {
	width: 16px;
	height: 16px;
	border: 2px solid #8c8f94;
	border-radius: 3px;
	flex-shrink: 0;
	margin-top: 2px;
	background: #fff;
	transition: background 0.15s, border-color 0.15s;
	position: relative;
}

/* Checked state = disabled block → show X indicator */
.bc-block-item input[type="checkbox"]:checked ~ .bc-block-item__indicator {
	background: #f0f0f0;
	border-color: #c9c9c9;
}

.bc-block-item input[type="checkbox"]:checked ~ .bc-block-item__indicator::after {
	content: "✕";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 9px;
	color: #b0b0b0;
	line-height: 1;
}

/* Unchecked = enabled block → show checkmark */
.bc-block-item input[type="checkbox"]:not(:checked) ~ .bc-block-item__indicator {
	background: #2271b1;
	border-color: #2271b1;
}

.bc-block-item input[type="checkbox"]:not(:checked) ~ .bc-block-item__indicator::after {
	content: "✓";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -52%);
	font-size: 11px;
	color: #fff;
	line-height: 1;
	font-weight: 700;
}

/* [2] Block icon */
.bc-block-item__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
}

.bc-block-icon {
	width: 20px;
	height: 20px;
	fill: #1d2327;
	display: block;
	transition: fill 0.15s;
}

.bc-block-item--off .bc-block-icon {
	fill: #c0c0c0;
}

.bc-block-item:hover .bc-block-icon {
	fill: #2271b1;
}

.bc-block-item--off:hover .bc-block-icon {
	fill: #aaa;
}

/* Category note (embed disclaimer) */
.bc-category__note {
	font-size: 11px;
	color: #8c8f94;
	font-style: italic;
	margin-left: 4px;
}

.bc-block-item__info {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.bc-block-item__title {
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	line-height: 1.3;
}

.bc-block-item__name {
	font-size: 10px;
	color: #8c8f94;
	font-family: "Courier New", Courier, monospace;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   Save actions
───────────────────────────────────────────── */
.bc-actions {
	display: flex;
	justify-content: flex-end;
	padding: 4px 0 24px;
}

.bc-actions .bc-btn--primary {
	padding: 10px 28px;
	font-size: 14px;
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 600px) {
	.bc-category__blocks {
		grid-template-columns: 1fr 1fr;
	}
	.bc-category__header {
		flex-wrap: wrap;
	}
	.bc-global-actions {
		flex-wrap: wrap;
	}
}

/* ─────────────────────────────────────────────
   [1] Header save button (top-right)
───────────────────────────────────────────── */
.bc-header__inner {
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.bc-header__left {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-shrink: 0;
}

.bc-btn--top-save {
	padding: 9px 22px;
	font-size: 13px;
	flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   [2] Dashicon fallback for block icons
───────────────────────────────────────────── */
.bc-block-dashicon {
	font-size: 20px;
	width: 20px;
	height: 20px;
	line-height: 1;
	color: #1d2327;
	transition: color 0.15s;
}

.bc-block-item--off .bc-block-dashicon {
	color: #c0c0c0;
}

.bc-block-item:hover .bc-block-dashicon {
	color: #2271b1;
}

/* ─────────────────────────────────────────────
   [3] Embed variation sub-grid
───────────────────────────────────────────── */
.bc-embed-variations__header {
	border-top: 1px dashed #e0e0e0;
	margin: 4px 16px 0;
	padding: 10px 0 4px;
}

.bc-embed-variations__label {
	margin: 0 0 3px;
	font-size: 12px;
	font-weight: 600;
	color: #1d2327;
}

.bc-embed-variations__note {
	margin: 0;
	font-size: 11px;
	color: #f0a500;
	line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Embed variation grid (independent — cannot reuse
   bc-category__blocks because #bc-cat-embed IS
   that class, causing nested grid breakage)
───────────────────────────────────────────── */
.bc-embed-var-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 0;
	padding: 8px 16px 12px;
}

/* ─────────────────────────────────────────────
   Embed category: 2-part sub-wrapper structure
   (prevents grid-in-grid layout breakage)
───────────────────────────────────────────── */
.bc-cat-embed-wrap {
	/* Outer wrapper: simple block flow, not a grid */
	display: block;
}

.bc-cat-embed-toggle {
	/* Sub-wrapper 1: contains core/embed single item as a grid */
}

.bc-cat-embed-variation {
	/* Sub-wrapper 2: contains header note + variation grid */
	width: 100%;
}
