/* ThePlay Tasks - front-end styling
   Kept intentionally small: no big forms, no modals. */

.theplay-task {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px 0;
	padding: 2px 8px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.035);
	font-size: 12px;
	line-height: 1.6;
	vertical-align: middle;
}

.theplay-task-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 1px solid #999;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
	line-height: 1;
}

.theplay-task-check.theplay-task-check-readonly {
	cursor: default;
	opacity: 0.75;
}

.theplay-task-check.is-done {
	border-color: var(--theplay-tasks-done-color, #2e7d32);
	background: var(--theplay-tasks-done-color, #2e7d32);
	color: #fff;
}

.theplay-task-check.is-entered,
.theplay-task-line-check.is-entered {
	border-color: var(--theplay-tasks-entered-color, #ef6c00);
	background: var(--theplay-tasks-entered-color, #ef6c00);
	color: #fff;
}

.theplay-task-label.is-entered,
.theplay-task-line.is-entered .theplay-task-line-text {
	color: var(--theplay-tasks-entered-color, #ef6c00);
}

.theplay-task-state-badge {
	display: inline-block;
	padding: 0 6px;
	border-radius: 8px;
	background: var(--theplay-tasks-entered-color, #ef6c00);
	color: #fff;
	font-size: 11px;
	line-height: 16px;
	white-space: nowrap;
}

.theplay-task-state-badge[hidden] {
	display: none;
}

.theplay-task-check-icon {
	font-size: 12px;
}

.theplay-task-assign {
	position: relative;
	display: inline-block;
}

.theplay-task-assignee {
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
}

.theplay-task-assignee-name {
	font-weight: bold;
}

.theplay-task-assignee-static {
	white-space: nowrap;
	opacity: 0.8;
}

.theplay-task-assign .theplay-task-assignee-list {
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 20;
	min-width: 160px;
	max-height: 220px;
	overflow-y: auto;
	padding: 4px 0;
	background: #fff;
	border: 1px solid #b3b3b3;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.theplay-task-assignee-list a {
	display: block;
	padding: 4px 10px;
	text-decoration: none;
	white-space: nowrap;
}

.theplay-task-assignee-list a:hover {
	background: rgba(0, 0, 0, 0.06);
}

.theplay-task-assignee-list a.is-current {
	font-weight: bold;
}

.theplay-task-assignee-list em {
	display: block;
	padding: 4px 10px;
	opacity: 0.7;
}

.theplay-task-label {
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

.theplay-task-label.is-done {
	color: var(--theplay-tasks-done-color, #2e7d32);
}

.theplay-task.theplay-task-busy {
	opacity: 0.6;
	pointer-events: none;
}

.theplay-tasks-mine-link {
	display: inline-block;
	margin-left: 8px;
}

.theplay-tasks-badge {
	display: inline-block;
	min-width: 16px;
	padding: 0 5px;
	border-radius: 8px;
	background: var(--theplay-tasks-done-color, #2e7d32);
	color: #fff;
	font-size: 11px;
	line-height: 16px;
	text-align: center;
}

.theplay-tasks-mine-table td {
	vertical-align: middle;
}

.theplay-task-checkbox-list label.theplay-tasks-forum-checkbox {
	display: block;
	margin-bottom: 4px;
}

/* -- Task list mode ------------------------------------------------------ */

.theplay-task-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 6px 0;
	padding-top: 12px;
}

.theplay-task-listtoggle {
	align-self: center;
	padding: 2px 8px;
	border: 1px solid #999;
	border-radius: 4px;
	background: #fff;
	font-size: 11px;
	line-height: 1.6;
	cursor: pointer;
	white-space: nowrap;
}

.theplay-task-listtoggle:hover {
	background: rgba(0, 0, 0, 0.06);
}

.theplay-task-listtoggle[disabled] {
	opacity: 0.5;
	cursor: default;
}

.theplay-task-list {
	flex: 1 1 100%;
}

.theplay-task-list-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Keep the per-line controls clear of prosilver's report / quote / edit
   buttons at the top-right of the post (they sit above the first rows). */
@media (min-width: 701px) {
	.theplay-task-list .theplay-task-list-items {
		padding-right: 140px;
	}
}

.theplay-task-line {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 3px 6px;
	border-radius: 4px;
}

.theplay-task-line:hover {
	background: rgba(0, 0, 0, 0.035);
}

.theplay-task-line.theplay-task-busy {
	opacity: 0.6;
	pointer-events: none;
}

.theplay-task-line-check {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 1px solid #999;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	align-self: center;
}

.theplay-task-line-check.theplay-task-line-check-readonly {
	cursor: default;
	opacity: 0.75;
}

.theplay-task-line-check.is-done {
	border-color: var(--theplay-tasks-done-color, #2e7d32);
	background: var(--theplay-tasks-done-color, #2e7d32);
	color: #fff;
}

.theplay-task-line-text {
	flex: 1 1 auto;
	white-space: pre-wrap;
	word-break: break-word;
}

.theplay-task-line.is-done .theplay-task-line-text {
	color: var(--theplay-tasks-done-color, #2e7d32);
}

.theplay-task-line-assignee {
	flex: 0 0 auto;
	position: relative;
	font-size: 12px;
	white-space: nowrap;
}

.theplay-task-line-assignee-trigger {
	text-decoration: none;
}

.theplay-task-line-assignee-name {
	font-weight: bold;
}

.theplay-task-line-assignee-static {
	opacity: 0.8;
}

.theplay-task-line-assignee-menu {
	position: absolute;
	right: 0;
	top: 100%;
	z-index: 20;
	min-width: 160px;
	max-height: 220px;
	overflow-y: auto;
	padding: 4px 0;
	background: #fff;
	border: 1px solid #b3b3b3;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.theplay-task-line-assignee-menu a {
	display: block;
	padding: 4px 10px;
	text-decoration: none;
	white-space: nowrap;
}

.theplay-task-line-assignee-menu a:hover {
	background: rgba(0, 0, 0, 0.06);
}

.theplay-task-line-assignee-menu a.is-current {
	font-weight: bold;
}

.theplay-task-line-assignee-menu em {
	display: block;
	padding: 4px 10px;
	opacity: 0.7;
}

/* "not a task" line - plain heading / separator inside a checklist */
.theplay-task-line-plain {
	padding-left: 6px;
	font-weight: bold;
	opacity: 0.85;
}

.theplay-task-line-plain:hover {
	background: none;
}

.theplay-task-line-plain .theplay-task-line-text {
	white-space: pre-wrap;
}

.theplay-task-line-disable,
.theplay-task-line-enable {
	flex: 0 0 auto;
	align-self: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 3px;
	background: none;
	color: #999;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.1s ease;
}

.theplay-task-line:hover .theplay-task-line-disable,
.theplay-task-line-plain:hover .theplay-task-line-enable {
	opacity: 1;
}

.theplay-task-line-disable:hover,
.theplay-task-line-enable:hover {
	border-color: #999;
	color: #333;
}
