/* GreenRoom Admin Styles */

/* ── AI progress indicator ──────────────────────────────────── */

.grbios-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #ccc;
	border-top-color: #3b7e30;
	border-radius: 50%;
	animation: grbios-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

.grbios-spinner--button {
	width: 12px;
	height: 12px;
	margin-right: 6px;
}

@keyframes grbios-spin {
	to { transform: rotate(360deg); }
}

.grbios-ai-progress {
	margin-top: 8px;
	font-size: 13px;
	color: #555;
	font-style: italic;
}

.grbios-ai-dots {
	display: inline-block;
	min-width: 1em;
	text-align: left;
}

/* ── License badge ──────────────────────────────────────────── */

.grbios-license-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	vertical-align: middle;
}

.grbios-license-badge--pro {
	background: #d4edda;
	color: #155724;
}

.grbios-license-badge--free {
	background: #e9ecef;
	color: #495057;
}

/* ── Upgrade notice ─────────────────────────────────────────── */

.grbios-upgrade-notice {
	margin: 1em 0;
	padding: 12px 16px;
	background: #f0f6ef;
	border-left: 4px solid #3b7e30;
	max-width: 800px;
}

.grbios-upgrade-notice p {
	margin: 0;
}

/* ── Tables: enhanced wp-list-table ─────────────────────────── */

.wrap .wp-list-table.widefat {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	border-collapse: separate;
	border-spacing: 0;
}

.wrap .wp-list-table.widefat thead th,
.wrap .wp-list-table.widefat thead td {
	background: #f6f7f7;
	border-bottom: 1px solid #c3c4c7;
	font-weight: 600;
	color: #1d2327;
	font-size: 13px;
	padding: 10px 12px;
}

.wrap .wp-list-table.widefat tbody td,
.wrap .wp-list-table.widefat tbody th {
	padding: 10px 12px;
	vertical-align: middle;
	border-bottom: 1px solid #e0e0e0;
}

.wrap .wp-list-table.widefat tbody tr:last-child td,
.wrap .wp-list-table.widefat tbody tr:last-child th {
	border-bottom: none;
}

.wrap .wp-list-table.widefat tbody tr:hover {
	background-color: #f0f6fc;
}

/* Row actions: softer until hovered */
.wrap .wp-list-table.widefat tbody td a {
	text-decoration: none;
}

.wrap .wp-list-table.widefat tbody td a:hover {
	text-decoration: underline;
}

/* ── Status badges ──────────────────────────────────────────── */

.grbios-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.grbios-status--open {
	background: #d4edda;
	color: #155724;
}

.grbios-status--closed {
	background: #f8d7da;
	color: #721c24;
}

.grbios-status--submitted {
	background: #d4edda;
	color: #155724;
}

.grbios-status--draft {
	background: #fff3cd;
	color: #856404;
}

.grbios-status--pending {
	background: #e2e3e5;
	color: #383d41;
}

.grbios-status--ai {
	background: #e8daef;
	color: #6c3483;
	margin-left: 4px;
}

/* ── Bio summary & stats bar ────────────────────────────────── */

.grbios-bio-summary {
	font-size: 14px;
	margin: 10px 0 20px;
}

/* ── Bios toolbar ──────────────────────────────────────────── */

.grbios-bios-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 14px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-bottom: 12px;
}

.grbios-bios-stats {
	color: #50575e;
	font-size: 13px;
}

.grbios-bios-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.grbios-ai-bulk-status {
	margin-left: 4px;
	font-style: italic;
	color: #646970;
	font-size: 13px;
}

/* ── Export links bar ───────────────────────────────────────── */

.grbios-export-links {
	padding: 10px 14px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-bottom: 16px;
	display: inline-block;
}

.grbios-export-links a {
	text-decoration: none;
}

.grbios-export-links a:hover {
	text-decoration: underline;
}

/* ── Designation section headings ───────────────────────────── */

.wrap h2 {
	padding-bottom: 6px;
	border-bottom: 2px solid #3b7e30;
	margin-top: 24px;
	margin-bottom: 8px;
	color: #1d2327;
}

/* ── People autocomplete ────────────────────────────────────── */

.grbios-autocomplete-list {
	display: none;
	position: absolute;
	z-index: 100;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 240px;
	overflow-y: auto;
	width: 25em;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.grbios-autocomplete-item {
	padding: 8px 12px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1.4;
	border-bottom: 1px solid #f0f0f0;
}

.grbios-autocomplete-item:last-child {
	border-bottom: none;
}

.grbios-autocomplete-item:hover {
	background: #f0f6fc;
}

.grbios-autocomplete-item .grbios-autocomplete-email {
	color: #646970;
}

.grbios-autocomplete-item .grbios-autocomplete-type {
	color: #a7aaad;
	font-size: 12px;
	text-transform: capitalize;
}

/* ── Pronouns (inline in name column) ───────────────────────── */

.grbios-pronouns {
	font-weight: 400;
	font-size: 12px;
	color: #646970;
}

.grbios-pronouns::before {
	content: '(';
}

.grbios-pronouns::after {
	content: ')';
}

/* ── Contenteditable bio editor (admin) ─────────────────────── */

.grbios-bio-editor {
	width: 100%;
	min-height: 12em;
	max-width: 800px;
	padding: 10px;
	border: 1px solid #8c8f94;
	border-radius: 0 0 4px 4px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
	box-sizing: border-box;
	overflow-y: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
	background: #fff;
}

.grbios-bio-editor:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 1px #2271b1;
}

.grbios-bio-editor:empty::before {
	content: attr(data-placeholder);
	color: #a7aaad;
	pointer-events: none;
}

.grbios-admin-toolbar {
	margin-top: 0;
	margin-bottom: 0;
	padding: 6px 8px;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #f0f0f1;
	border: 1px solid #8c8f94;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	max-width: 800px;
	box-sizing: border-box;
}

.grbios-toolbar-btn {
	padding: 4px 12px;
	border: 1px solid #8c8f94;
	background: #fff;
	border-radius: 3px;
	cursor: pointer;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 14px;
	font-weight: 700;
	font-style: italic;
	line-height: 1.4;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.grbios-toolbar-btn:hover {
	background: #dcdcde;
	border-color: #50575e;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.grbios-toolbar-btn:active {
	background: #d7d7d7;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.grbios-char-count {
	text-align: right;
	font-size: 12px;
	color: #646970;
	margin-top: 4px;
	max-width: 800px;
	transition: color 0.2s;
}

.grbios-limit-notice {
	margin-top: 8px;
	max-width: 800px;
}

/* ── Admin headshot picker ─────────────────────────────────── */

.grbios-headshot-preview {
	margin-bottom: 10px;
}

.grbios-headshot-preview img {
	max-width: 150px;
	height: auto;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

.grbios-headshot-actions {
	display: flex;
	gap: 8px;
}

/* ── AI preview panel ───────────────────────────────────────── */

.grbios-ai-admin-preview {
	margin-top: 12px;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	max-width: 800px;
}

.grbios-ai-admin-preview p:first-child {
	margin-top: 0;
}

/* ── Delete link ────────────────────────────────────────────── */

.grbios-delete-link {
	color: #b32d2e;
}

.grbios-delete-link:hover {
	color: #dc3232;
}

/* ── Withdrawn section (collapsible) ────────────────────────── */

.wrap details {
	margin-top: 24px;
}

.wrap details > summary {
	cursor: pointer;
	font-weight: 600;
	color: #50575e;
	padding: 8px 0;
	user-select: none;
}

.wrap details > summary:hover {
	color: #1d2327;
}

.wrap details[open] > summary {
	margin-bottom: 8px;
}

.wrap details .wp-list-table {
	margin-top: 4px;
}

/* ── Responsive: admin tables ─────────────────────────────────── */
@media (max-width: 782px) {
	.wrap .form-table th {
		width: auto;
		display: block;
		padding: 10px 0 2px;
	}

	.wrap .form-table td {
		display: block;
		padding: 4px 0 10px;
	}

	.grbios-bios-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.grbios-show-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.grbios-export-links {
		display: block;
	}

	/* Card layout for admin list tables */
	.grbios-table-wrap {
		margin-bottom: 1em;
	}

	.grbios-table-wrap .wp-list-table.widefat,
	.grbios-table-wrap .wp-list-table.widefat thead,
	.grbios-table-wrap .wp-list-table.widefat tbody,
	.grbios-table-wrap .wp-list-table.widefat tr,
	.grbios-table-wrap .wp-list-table.widefat th,
	.grbios-table-wrap .wp-list-table.widefat td {
		display: block !important;
		width: auto !important;
		float: none !important;
	}

	.grbios-table-wrap .wp-list-table.widefat {
		border: none !important;
		min-width: 0 !important;
	}

	.grbios-table-wrap .wp-list-table.widefat thead {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
	}

	.grbios-table-wrap .wp-list-table.widefat tbody tr {
		background: #fff !important;
		border: 1px solid #c3c4c7 !important;
		border-radius: 4px;
		margin-bottom: 0.75em;
		padding: 0.75em !important;
		position: relative !important;
	}

	.grbios-table-wrap .wp-list-table.widefat tbody tr:hover {
		background: #fff !important;
	}

	.grbios-table-wrap .wp-list-table.widefat tbody td,
	.grbios-table-wrap .wp-list-table.widefat tbody th {
		border: none !important;
		padding: 0.2em 0 !important;
	}

	/* Suppress data-label pseudo-elements — WP admin CSS conflicts */
	.grbios-table-wrap .wp-list-table.widefat td[data-label]::before {
		content: none !important;
		display: none !important;
	}

	/* Title cell — card heading */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-title {
		display: block !important;
		font-size: 14px !important;
		padding: 0 0 0.2em 3.5em !important;
	}

	/* Non-title data cells — smaller, muted for visual hierarchy */
	.grbios-table-wrap .wp-list-table.widefat td[data-label] {
		display: block !important;
		font-size: 12px !important;
		color: #50575e;
	}

	/* Status — keep normal size */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-status {
		display: block !important;
	}

	/* Bio preview — hide on mobile to save space */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-preview {
		display: none !important;
	}

	/* Checkbox — top-left of card */
	.grbios-table-wrap .wp-list-table.widefat th.check-column {
		position: absolute !important;
		top: 0.75em !important;
		left: 0.75em !important;
		padding: 0 !important;
		width: auto !important;
	}

	/* Tables without checkboxes — no indent needed */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-title:first-child {
		padding-left: 0 !important;
	}

	/* Actions — full width at bottom */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-actions {
		display: block !important;
		padding-top: 0.5em !important;
		margin-top: 0.25em;
		border-top: 1px solid #e0e0e0 !important;
	}

	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-actions::before {
		display: none !important;
	}

	/* Photo cell — no label, just show the image */
	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-photo {
		display: block !important;
	}

	.grbios-table-wrap .wp-list-table.widefat td.grbios-col-photo::before {
		display: none !important;
	}
}

/* ── Form tables: tighter spacing ───────────────────────────── */

.wrap .form-table th {
	padding: 15px 10px 15px 0;
	width: 200px;
}

.wrap .form-table td {
	padding: 10px;
}

/* Headshot preview in bio edit form */
.wrap .form-table td img {
	max-width: 150px;
	border-radius: 4px;
	display: block;
	margin-bottom: 8px;
	border: 1px solid #e0e0e0;
}

/* ── Show edit toolbar ──────────────────────────────────────── */

.grbios-show-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 14px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-bottom: 16px;
}

.grbios-row-actions {
	display: inline-block;
	margin-left: 8px;
	font-size: 13px;
}

.grbios-row-actions a {
	text-decoration: none;
}

.grbios-row-actions a:hover {
	text-decoration: underline;
}

/* ── Show picker (select-a-show pages) ──────────────────────── */

.wrap ul li a {
	text-decoration: none;
}

.wrap ul li a:hover {
	text-decoration: underline;
}

/* ── Action link separators (pipe-delimited) ────────────────── */

.wrap .wp-list-table.widefat tbody td {
	font-size: 13px;
}

/* ── Page title actions ─────────────────────────────────────── */

.wrap .page-title-action {
	margin-left: 4px;
}

/* ── Support box on settings page ───────────────────────────── */

.grbios-support-box {
	margin: 1em 0;
	padding: 12px 16px;
	background: #f0f6ef;
	border-left: 4px solid #3b7e30;
	border-radius: 0 4px 4px 0;
}

.grbios-support-box p {
	margin: 0 0 0.4em;
}

.grbios-support-box p:last-child {
	margin-bottom: 0;
}

.grbios-support-box a {
	text-decoration: none;
	font-weight: 500;
}

.grbios-support-box a:hover {
	text-decoration: underline;
}

/* ── Show picker stats ──────────────────────────────────────── */

.grbios-show-stats {
	color: #646970;
	margin-left: 0.5em;
}

/* ── Drag-and-drop reorder indicator ────────────────────────── */

.grbios-drag-handle {
	cursor: grab;
	color: #a7aaad;
	font-size: 18px;
	padding: 0 4px;
	user-select: none;
}

.grbios-drag-handle:hover {
	color: #50575e;
}

tr.grbios-dragging {
	opacity: 0.4;
}

tr.grbios-drag-over {
	border-top: 2px solid #3b7e30;
}
