@import url('./project_details_base.css');

/* Project-specific hero background */
.project-hero {
	background: linear-gradient(135deg, rgba(0, 255, 65, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%),
				url(../../ui/images/screenproject_kudosu2.png);
}

/* Project-specific tech grid */
.tech-grid {
	max-width: 400px;
}

/***** DEMO *****/
.demo-section {
	background: rgba(0, 0, 0, 0.25);
	scroll-margin-top: 1rem;
}

.project-section .demo-intro {
	text-align: center;
	font-size: 1.05rem;
	color: #ccc;
	max-width: 800px;
	margin: -1rem auto 2rem;
}

.demo-section [hidden] {
	display: none !important;
}

/* Onglets */
.demo-tabs {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 2rem;
}

.demo-tab,
.demo-btn {
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.7rem 1.6rem;
	background: rgba(0, 255, 65, 0.05);
	border: 2px solid rgba(0, 255, 65, 0.3);
	border-radius: 8px;
	color: #00ff41;
	cursor: pointer;
	transition: all 0.3s ease;
}

.demo-tab:hover,
.demo-btn:hover {
	border-color: #00ff41;
	background: rgba(0, 255, 65, 0.12);
}

.demo-tab.active,
.demo-btn.primary {
	background: #00ff41;
	border-color: #00ff41;
	color: #000;
	box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.demo-tab:focus-visible,
.demo-btn:focus-visible,
.terminal-example:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.demo-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Grille */
.sudoku-grid {
	--cell-size: min(48px, calc((100vw - 4rem) / 9));
	display: grid;
	grid-template-columns: repeat(9, var(--cell-size));
	border: 3px solid #00ff41;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 255, 65, 0.2);
}

.sudoku-cell {
	width: var(--cell-size);
	height: var(--cell-size);
	box-sizing: border-box;
	padding: 0;
	border: 1px solid rgba(0, 255, 65, 0.2);
	background: #111;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: calc(var(--cell-size) * 0.5);
	text-align: center;
	caret-color: transparent;
	cursor: pointer;
	transition: background 0.2s ease;
}

.sudoku-cell.box-right {
	border-right: 3px solid #00ff41;
}

.sudoku-cell.box-bottom {
	border-bottom: 3px solid #00ff41;
}

.sudoku-cell:hover {
	background: #1c2a1f;
}

.sudoku-cell:focus {
	outline: none;
	background: rgba(0, 255, 65, 0.25);
}

.sudoku-cell.given {
	font-weight: 700;
}

.sudoku-cell.solved {
	color: #00ff41;
	animation: cell-reveal 0.4s ease both;
}

.sudoku-cell.conflict {
	background: rgba(255, 60, 60, 0.35);
	color: #ff6b6b;
}

@keyframes cell-reveal {
	from {
		opacity: 0;
		transform: scale(0.4);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.demo-controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.8rem;
	margin-top: 1.5rem;
}

.project-section .demo-status {
	min-height: 1.8rem;
	margin: 1rem 0 0;
	font-size: 1rem;
	text-align: center;
}

.project-section .demo-status.success {
	color: #00ff41;
}

.project-section .demo-status.error {
	color: #ff6b6b;
}

/* Terminal */
.terminal {
	width: 100%;
	max-width: 900px;
	border: 2px solid rgba(0, 255, 65, 0.3);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 255, 65, 0.2);
	background: #0c0c0c;
}

.terminal-bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.6rem 1rem;
	background: #222;
	border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-dots {
	display: flex;
	gap: 0.4rem;
}

.terminal-dots span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ff5f56;
}

.terminal-dots span:nth-child(2) {
	background: #ffbd2e;
}

.terminal-dots span:nth-child(3) {
	background: #27c93f;
}

.terminal-title {
	flex: 1;
	color: #aaa;
	font-size: 0.9rem;
	text-align: center;
}

.terminal-example {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.8rem;
	padding: 0.3rem 0.8rem;
	background: transparent;
	border: 1px solid rgba(0, 255, 65, 0.4);
	border-radius: 6px;
	color: #00ff41;
	cursor: pointer;
	transition: all 0.3s ease;
}

.terminal-example:hover {
	background: #00ff41;
	color: #000;
}

.terminal-body {
	height: 460px;
	overflow-y: auto;
	padding: 1rem;
	font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
	font-size: 0.95rem;
	line-height: 1.35;
	color: #e6e6e6;
	cursor: text;
}

.terminal-body pre {
	margin: 0;
	font: inherit;
	white-space: pre-wrap;
	word-break: break-all;
}

.terminal-input {
	width: 100%;
	padding: 0;
	border: none;
	outline: none;
	background: transparent;
	color: #fff;
	font: inherit;
	caret-color: #00ff41;
}

.terminal-input:disabled {
	visibility: hidden;
}

.ansi-cyan {
	color: #29d3e6;
}

.ansi-red {
	color: #ff5555;
}

.ansi-bold {
	font-weight: 700;
}

.term-prompt {
	color: #00ff41;
	font-weight: 700;
}

.term-path {
	color: #5c9dff;
	font-weight: 700;
}

.term-comment {
	color: #777;
}

@media (max-width: 768px) {
	.terminal-body {
		height: 380px;
		font-size: 0.75rem;
	}

	.terminal-title {
		display: none;
	}

	.terminal-bar {
		justify-content: space-between;
	}
}

/* Clignotement doux du bouton « Coller un exemple » */
.terminal-example.hint {
	animation: example-hint 0.9s ease-in-out 3;
}

@keyframes example-hint {
	0%,
	100% {
		background: transparent;
		color: #00ff41;
		box-shadow: none;
	}
	50% {
		background: rgba(0, 255, 65, 0.25);
		color: #00ff41;
		box-shadow: 0 0 14px rgba(0, 255, 65, 0.5);
	}
}

@media (prefers-reduced-motion: reduce) {
	.terminal-example.hint {
		animation-duration: 2.7s;
		animation-iteration-count: 1;
	}
}
