/* Theme Modal */
.theme-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 40px;
}

.theme-modal[aria-hidden="false"] {
	display: flex;
}

.theme-modal-overlay {
	position: absolute;
	inset: 0;
	/* thicker veil to improve contrast while keeping background visible */
	background: rgba(0, 0, 0, 0.65);
}

.theme-modal-content {
	position: relative;
	/* keep transparency but increase opacity and blur for readability */
	background: rgba(18, 18, 18, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.06);
	backdrop-filter: blur(12px);
	padding: 28px;
	max-width: 760px;
	width: 100%;
	border-radius: 12px;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7);
	color: var(--text-primary);
	background-clip: padding-box;
}

/* Improve swatch label readability */
.theme-swatch .swatch-label {
	font-size: 11px;
	color: #ffffff;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
	background: rgba(0, 0, 0, 0.12);
	padding: 3px 6px;
	border-radius: 4px;
}

.theme-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: transparent;
	border: none;
	color: var(--text-primary);
	font-size: 20px;
	cursor: pointer;
}

.theme-modal h2 {
	margin-bottom: 8px;
}

.theme-modal-desc {
	color: var(--text-secondary);
	margin-bottom: 16px;
}

.modal-image {
	text-align: center;
	margin-bottom: 16px;
}

.modal-image img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.modal-tech {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.modal-section {
	margin: 2rem 0;
}

.modal-section p {
	margin-bottom: 1rem;
	line-height: 1.6;
	color: #e0e0e0;
}

.modal-section h3 {
	font-size: 1.3rem;
	font-weight: 600;
	margin-bottom: 1rem;
	color: #fff;
	border-bottom: 2px solid #7c3aed;
	padding-bottom: 0.5rem;
}

.stack-list {
	color: #b8b8b8;
	line-height: 1.8;
}

.missions-list {
	list-style: disc;
	padding-left: 1.5rem;
	margin-top: 1rem;
}

.missions-list li {
	padding: 0.5rem 0;
	line-height: 1.6;
	color: #e0e0e0;
}

.missions-list li::marker {
	color: #7c3aed;
}

.theme-modal-content {
	max-height: 85vh;
	overflow-y: auto;
	padding: 2rem;
}

/* Scrollbar personnalisée */
.theme-modal-content::-webkit-scrollbar {
	width: 8px;
}

.theme-modal-content::-webkit-scrollbar-track {
	background: #1a1a1a;
}

.theme-modal-content::-webkit-scrollbar-thumb {
	background: #7c3aed;
	border-radius: 4px;
}

/* Responsive Design for Modals */
@media (max-width: 768px) {
	.theme-modal {
		padding: 15px;
		/* Reduce padding to use more screen real estate */
	}

	.theme-modal-content {
		padding: 20px 15px;
		/* Less side/top padding */
		max-height: 90vh;
		/* Allow it to be slightly taller on mobile */
	}

	.theme-modal h2 {
		font-size: 1.5rem;
		/* Smaller title */
		margin-right: 20px;
		/* Don't overlap with close button */
	}

	.theme-modal-close {
		top: 15px;
		right: 15px;
		font-size: 24px;
		/* Slightly larger hit area for touch */
		padding: 5px;
	}

	.modal-section {
		margin: 1.5rem 0;
		/* Less breathing room needed vertically */
	}

	.modal-section h3 {
		font-size: 1.1rem;
	}

	.modal-section p,
	.missions-list li {
		font-size: 0.95rem;
		/* Better readability length */
		line-height: 1.5;
	}
}