/**
 * Terminal Touch Selection Styles
 */

.terminal-selection-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 100;
	overflow: hidden;
}

.terminal-selection-handle {
	position: absolute;
	background: #2196f3;
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	display: none;
	pointer-events: auto;
	touch-action: none;
	z-index: 101;
	cursor: grab;
	transition: transform 0.15s ease;
	border-radius: 50% 50% 50% 0;
}

.terminal-selection-handle:active {
	cursor: grabbing;
}

.terminal-selection-handle-start {
	transform: rotate(180deg) translateX(87%);
}
.terminal-selection-handle-end {
	transform: rotate(90deg) translateY(-13%);
}

.terminal-context-menu {
	position: absolute;
	background-color: var(--secondary-color);
	border-radius: 4px;
	height: 40px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	box-shadow: 0 4px 12px var(--box-shadow-color);
	border: none;
	border: solid 1px var(--popup-border-color);
	z-index: 1000;
	min-width: 200px;
	animation: fadeIn 0.2s ease;
	flex-direction: row;
	align-items: center;
	justify-content: space-around;
	pointer-events: auto;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.terminal-context-menu button {
	display: inline-block;
	flex: 1;
	padding: 12px 16px;
	border: none;
	background: transparent;
	color: var(--primary-text-color);
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	border-radius: 16px;
	margin: 0 4px;
	transition: background-color 0.15s ease;
	white-space: nowrap;
	pointer-events: auto;
}

.terminal-context-menu button:hover,
.terminal-context-menu button:focus {
	background: var(--popup-border-color);
	outline: none;
}

.terminal-context-menu button:active {
	background: rgba(var(--secondary-color), 0.5);
}

@media (min-width: 768px) {
	.terminal-selection-handle {
		width: 28px;
		height: 28px;
	}

	.terminal-context-menu {
		min-width: 240px;
	}

	.terminal-context-menu button {
		padding: 14px 18px;
		font-size: 16px;
	}
}

@media (prefers-contrast: high) {
	.terminal-selection-handle {
		border-width: 3px;
		box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
	}

	.terminal-context-menu {
		border: 2px solid #000;
	}
}

@media (prefers-reduced-motion: reduce) {
	.terminal-selection-handle {
		transition: none;
	}

	.terminal-context-menu {
		animation: none;
	}

	.terminal-context-menu button {
		transition: none;
	}
}
