/* Item row actions (remove spinner, removed rows, summary bar). */

/*
 * Toolbar background lives here—not Tailwind `bg-*` on the element—so the Pursue
 * stylesheet wins over the Tailwind CDN <style> block (order differs by device).
 */
.pursue-item-row-actions {
	background-color: rgba(255, 255, 255, 0.85);
}

/*
 * Listed row + plus (Add to list): same structure as done/green, blue palette.
 */
li.pursue-item-row.pursue-item-row--listed {
	border-width: 1px !important;
	border-style: solid !important;
	border-color: #1e40af !important;
	background-color: #eff6ff;
}

li.pursue-item-row.pursue-item-row--listed:hover {
	border-color: #1d4ed8 !important;
	background-color: #dbeafe;
}

li.pursue-item-row.pursue-item-row--listed div.pursue-item-row-actions,
li.pursue-item-row.pursue-item-row--listed:hover div.pursue-item-row-actions {
	background: #ffffff !important;
	background-color: #ffffff !important;
}

.pursue-item-row--listed .pursue-item-row-actions button[data-pursue-row-action='plus-circle'] {
	-webkit-appearance: none;
	appearance: none;
	background: #eff6ff !important;
	background-color: #eff6ff !important;
	color: #1e40af !important;
}

.pursue-item-row--listed .pursue-item-row-actions button[data-pursue-row-action='plus-circle']:hover {
	background: #dbeafe !important;
	background-color: #dbeafe !important;
	color: #1e3a8a !important;
}

/*
 * Done row + check button: theme Tailwind utilities on the same elements win on cascade order
 * unless we use !important here.
 */
li.pursue-item-row.pursue-item-row--done {
	border-width: 1px !important;
	border-style: solid !important;
	border-color: #166534 !important; /* dark green frame around the row */
	background-color: #f0fdf4;
}

li.pursue-item-row.pursue-item-row--done:hover {
	border-color: #14532d !important;
	background-color: #ecfdf5;
}

/*
 * Row background tints the whole <li>. The theme uses bg-white/60 here, which is
 * translucent—parent green still shows through. Opaque white matches what works
 * when setting background in devtools; only the check button keeps the done tint.
 */
li.pursue-item-row.pursue-item-row--done div.pursue-item-row-actions,
li.pursue-item-row.pursue-item-row--done:hover div.pursue-item-row-actions {
	background: #ffffff !important;
	background-color: #ffffff !important;
}

/* Same fill as the title side of the row (#f0fdf4)—this button only. */
.pursue-item-row--done .pursue-item-row-actions button[data-pursue-row-action='check-circle'] {
	-webkit-appearance: none;
	appearance: none;
	background: #f0fdf4 !important;
	background-color: #f0fdf4 !important;
	color: #166534 !important;
}

.pursue-item-row--done .pursue-item-row-actions button[data-pursue-row-action='check-circle']:hover {
	background: #ecfdf5 !important;
	background-color: #ecfdf5 !important;
	color: #14532d !important;
}

/* Muted appearance when removed rows are visible (eye toggle on). */
.pursue-item-rows-root:not(.pursue-hide-removed) .pursue-item-row--removed {
	opacity: 0.55;
}

.pursue-item-rows-root.pursue-hide-removed .pursue-item-row--removed {
	display: none;
}

/* Bottom filter bar: hide listed / done rows (removed uses pursue-hide-removed above). */
.pursue-item-rows-root.pursue-filter-hide-listed li.pursue-item-row.pursue-item-row--listed {
	display: none !important;
}

.pursue-item-rows-root.pursue-filter-hide-done li.pursue-item-row.pursue-item-row--done {
	display: none !important;
}

/* Filter bar: flush to viewport bottom; safe-area only as inner padding (no gap below bar). */
.pursue-item-filter-bar {
	box-sizing: border-box;
}

.pursue-item-filter-bar__panel {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0;
	background: linear-gradient(180deg, #334155 0%, #0f172a 100%);
	border-top: 1px solid #64748b;
	box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.5);
}

.pursue-item-filter-bar__inner {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom, 0px)) 1rem;
}

.pursue-item-filter-bar__label {
	color: #e2e8f0;
}

/* Colored = rows visible; pressed = filtered out (subtle chip on dark bar). */
.pursue-item-filter-bar__btn {
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.pursue-item-filter-bar__btn--removed[aria-pressed='false'] {
	background: #fee2e2 !important;
	color: #991b1b !important;
	border: 1px solid transparent !important;
}

.pursue-item-filter-bar__btn--removed[aria-pressed='true'] {
	background: rgba(255, 255, 255, 0.07) !important;
	color: #cbd5e1 !important;
	border: 1px solid rgba(148, 163, 184, 0.5) !important;
}

.pursue-item-filter-bar__btn--listed[aria-pressed='false'] {
	background: #eff6ff !important;
	color: #1e40af !important;
	border: 1px solid transparent !important;
}

.pursue-item-filter-bar__btn--listed[aria-pressed='true'] {
	background: rgba(255, 255, 255, 0.07) !important;
	color: #cbd5e1 !important;
	border: 1px solid rgba(148, 163, 184, 0.5) !important;
}

.pursue-item-filter-bar__btn--done[aria-pressed='false'] {
	background: #f0fdf4 !important;
	color: #166534 !important;
	border: 1px solid transparent !important;
}

.pursue-item-filter-bar__btn--done[aria-pressed='true'] {
	background: rgba(255, 255, 255, 0.07) !important;
	color: #cbd5e1 !important;
	border: 1px solid rgba(148, 163, 184, 0.5) !important;
}

.pursue-btn-spinner {
	display: none;
}

.pursue-btn-icon--restore {
	display: none;
}

/* When removed rows are visible, show restore (arrow-path) on removed rows. */
.pursue-item-rows-root:not(.pursue-hide-removed)
	.pursue-item-row--removed
	.pursue-item-row-actions
	button[data-pursue-row-action='minus-circle']
	.pursue-btn-icon--minus {
	display: none;
}

.pursue-item-rows-root:not(.pursue-hide-removed)
	.pursue-item-row--removed
	.pursue-item-row-actions
	button[data-pursue-row-action='minus-circle']
	.pursue-btn-icon--restore {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pursue-item-row-actions button.is-loading .pursue-btn-icon--minus,
.pursue-item-row-actions button.is-loading .pursue-btn-icon--restore {
	display: none !important;
}

.pursue-item-row-actions button.is-loading .pursue-btn-spinner {
	display: block;
}

.pursue-item-row-actions button[data-pursue-row-action='plus-circle'].is-loading .pursue-btn-icon--plus,
.pursue-item-row-actions button[data-pursue-row-action='check-circle'].is-loading .pursue-btn-icon--check {
	display: none;
}

.pursue-removed-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid #f1f5f9;
	font-size: 0.875rem;
	color: #64748b;
}

.pursue-removed-summary__count strong {
	color: #0f172a;
	font-weight: 600;
}

.pursue-toggle-removed {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.375rem;
	border: 1px solid #e2e8f0;
	background: #fff;
	color: #64748b;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pursue-toggle-removed:hover {
	background: #f8fafc;
	color: #0f172a;
	border-color: #cbd5e1;
}

.pursue-toggle-removed[aria-pressed='true'] {
	background: #f1f5f9;
	color: #0f172a;
	border-color: #94a3b8;
}

.pursue-toggle-removed:focus {
	outline: 2px solid #0f172a;
	outline-offset: 2px;
}

.pursue-toggle-removed svg {
	width: 1.25rem;
	height: 1.25rem;
}

/*
 * Flowbite tooltips on row actions: taps focus the button and can pop the tooltip
 * after AJAX updates the label (e.g. "Mark as not completed"). Desktop hover is fine;
 * hide these tooltips on small viewports and touch-primary devices. aria-label remains.
 */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
	/* Class travels with the node if Flowbite moves tooltips to <body>. */
	.pursue-item-row-tooltip[role='tooltip'] {
		display: none !important;
	}
}
