/* Plan Item Styling */
.plan-items-list {
	margin: 1rem 0;
	padding: 0;
	list-style: none;
}

.plan-item {
	margin: 0.5rem 0;
	padding: 0;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background-color: var(--color-surface);
	transition: background-color 120ms ease, border-color 120ms ease;
	position: relative;
}



.plan-item.completed {
	background-color: rgba(34, 197, 94, 0.05);
	border-color: rgba(34, 197, 94, 0.3);
	position: relative;
}

.plan-item.completed .plan-item-word {
	opacity: 0.7;
}

.plan-item.current-item {
	background-color: rgba(15, 98, 254, 0.1);
	border-color: rgba(15, 98, 254, 0.4);
	position: relative;
	box-shadow: 0 2px 8px rgba(15, 98, 254, 0.2);
}

.plan-item.current-item .plan-item-word {
	font-weight: 700;
	color: var(--color-accent);
}

.plan-item.current-item.completed {
	background-color: rgba(34, 197, 94, 0.08);
	border-color: rgba(34, 197, 94, 0.4);
	box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.plan-item.current-item.completed .plan-item-word {
	opacity: 0.8;
}

.plan-item-header {
	display: flex;
	align-items: center;
	margin-bottom: 0.25rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.plan-item-word {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--color-text);
	margin: 0;
	line-height: 1.2;
}

.plan-item-pos {
	font-size: 0.8rem;
	color: var(--color-muted);
	font-weight: 500;
	font-style: italic;
	line-height: 1.2;
}

.plan-item-translation {
	color: var(--color-text);
	font-size: 0.85rem;
	margin: 0;
	font-style: italic;
	line-height: 1.2;
	opacity: 0.9;
}

/* Set as Current Button */
.plan-item-set-current {
	position: absolute;
	top: 0.75rem;
	right: 4rem; /* Position to the left of checkbox */
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 100;
	min-width: 6rem;
	height: 1.75rem;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background-color: var(--color-surface);
	color: var(--color-muted);
	transition: all 120ms ease;
	font-size: 0.65rem;
	font-weight: 500;
	padding: 0 0.5rem;
	white-space: nowrap;
	text-align: center;
}

.plan-item-set-current:hover {
	background-color: rgba(15, 98, 254, 0.1);
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.plan-item-set-current:active {
	background-color: rgba(15, 98, 254, 0.2);
	transform: scale(0.98);
}

/* Checkbox Styling */
.plan-item-checkbox-label {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 100;
}



.plan-item-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
}

.plan-item-checkbox-custom {
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--color-border);
	border-radius: 4px;
	background-color: var(--color-surface);
	transition: all 120ms ease;
	position: relative;
}

.plan-item-checkbox:checked + .plan-item-checkbox-custom {
	background-color: #22c55e;
	border-color: #22c55e;
}

.plan-item-checkbox:checked + .plan-item-checkbox-custom::after {
	content: "✓";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	font-size: 0.9rem;
	font-weight: bold;
}

.plan-item-checkbox-label:hover .plan-item-checkbox-custom {
	border-color: var(--color-accent);
}

.plan-item-checkbox:focus + .plan-item-checkbox-custom {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}



/* Plan Item Content Button */
.plan-item-content {
	width: 100%;
	background: none;
	border: none;
	padding: 0.75rem 1rem;
	padding-right: 10.5rem; /* Make room for checkbox (1.5rem) + button (6rem) + spacing (3rem) */
	cursor: pointer;
	border-radius: 6px;
	transition: background-color 120ms ease;
	/* Complete button reset to div-like behavior */
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	text-decoration: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	text-align: left;
	box-sizing: border-box;
	min-height: auto;
	outline: none;
}



/* Dialog Styles */
.plan-item-dialog {
	border: 1px solid var(--color-border);
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
	max-width: 90vw;
	max-height: 90vh;
	width: 500px;
	height: 70vh;
	transform: translateY(-15px);
}

.plan-item-dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.5);
}

/* Dialog Header */
.plan-dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 1.5rem 1rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 0;
	flex-shrink: 0; /* Prevent header from shrinking */
}

.plan-dialog-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-text);
}

.plan-dialog-close {
	background: none;
	border: none;
	color: var(--color-muted);
	cursor: pointer;
	font-size: 1.25rem;
	padding: 0.25rem;
	border-radius: 4px;
	transition: background-color 120ms ease, color 120ms ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	min-height: 2rem;
}

.plan-dialog-close:hover {
	background-color: rgba(239, 68, 68, 0.1);
	color: #ef4444;
}

/* Dialog Content */
.plan-dialog-content {
	padding: 1.5rem;
	height: calc(70vh - 5rem); /* Subtract header height from dialog height */
	overflow-y: auto;
	box-sizing: border-box;
}

.plan-dialog-loading {
	text-align: center;
	padding: 2rem;
}

.plan-dialog-loading p {
	margin: 0;
	color: var(--color-muted);
	font-style: italic;
}

.plan-dialog-details h4 {
	margin: 0 0 1rem 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--color-text);
}

.plan-dialog-details p {
	margin: 0.75rem 0;
	line-height: 1.5;
	color: var(--color-text);
}

.plan-dialog-details code {
	background-color: rgba(15, 98, 254, 0.1);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
	color: var(--color-accent);
}

/* Definition Content Styling */
.definition-content {
	line-height: 1.6;
}

.definition-content h2,
.definition-content h3,
.definition-content h4 {
	margin: 1rem 0 0.5rem 0;
	color: var(--color-text);
	font-weight: 600;
}

.definition-content h2 {
	font-size: 1.25rem;
}

.definition-content h3 {
	font-size: 1.1rem;
}

.definition-content h4 {
	font-size: 1rem;
}

.definition-content p {
	margin: 0.75rem 0;
	color: var(--color-text);
}

.definition-content strong {
	font-weight: 600;
	color: var(--color-text);
}

.definition-content em {
	font-style: italic;
	color: var(--color-text);
}

.definition-content br {
	margin-bottom: 0.25rem;
}

/* Error message styling */
.plan-dialog-details h4:first-child {
	margin-top: 0;
}

.plan-dialog-details p em {
	color: var(--color-muted);
	font-style: italic;
}

.plan-dialog-details small {
	color: var(--color-muted);
	font-size: 0.8rem;
	font-family: 'Courier New', monospace;
}
