/* General Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	background: #0c0c0c;
	color: #fff;
	overflow-x: hidden;
}

canvas#stars {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1;
}

h1 {
	text-align: center;
	background: linear-gradient(45deg, #f06a9c, #e574a5, #c44569, #846cb2);
	background-size: 300% 300%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-size: 2.5rem;
	margin: 2rem 0;
	animation: colorChange 3s ease-in-out infinite,
		titleGlow 2s ease-in-out infinite alternate;
	transition: transform 0.3s ease;
}

h1:hover {
	transform: scale(1.05);
}

/* Barra de filtros futurista */
.filter-bar {
	position: sticky;
	top: 20px;
	z-index: 100;
	display: flex;
	justify-content: center;
	margin: 2rem 0 3rem 0;
	padding: 0 1rem;
}

.filter-container {
	display: flex;
	gap: 1rem;
	background: linear-gradient(
		135deg,
		rgba(26, 26, 26, 0.95),
		rgba(26, 26, 26, 0.8)
	);
	backdrop-filter: blur(20px);
	border: 2px solid rgba(240, 106, 156, 0.3);
	border-radius: 25px;
	padding: 1rem 1.5rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(240, 106, 156, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	animation: filterBarGlow 3s ease-in-out infinite alternate;
}

@keyframes filterBarGlow {
	0% {
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(240, 106, 156, 0.3),
			inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}
	100% {
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(240, 106, 156, 0.5),
			0 0 40px rgba(132, 108, 178, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}
}

.filter-btn {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 0.8rem 1.5rem;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.05),
		rgba(255, 255, 255, 0.02)
	);
	border: 2px solid rgba(255, 255, 255, 0.1);
	border-radius: 18px;
	color: #b0b0b0;
	font-size: 0.95rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.filter-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(240, 106, 156, 0.2),
		transparent
	);
	transition: left 0.6s ease;
}

.filter-btn:hover::before {
	left: 100%;
}

.filter-btn:hover {
	transform: translateY(-2px);
	border-color: rgba(240, 106, 156, 0.5);
	color: #ffffff;
	box-shadow: 0 8px 25px rgba(240, 106, 156, 0.3),
		0 0 20px rgba(240, 106, 156, 0.2);
}

.filter-btn.active {
	background: linear-gradient(135deg, #f06a9c, #e574a5, #c44569);
	border-color: #f06a9c;
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(240, 106, 156, 0.5),
		0 0 20px rgba(240, 106, 156, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-btn.active:hover {
	background: linear-gradient(135deg, #e55a8c, #d5648f, #b43d59);
	box-shadow: 0 12px 35px rgba(240, 106, 156, 0.6),
		0 0 30px rgba(240, 106, 156, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.filter-icon {
	font-size: 1.2rem;
	display: flex;
	align-items: center;
}

.filter-text {
	white-space: nowrap;
}

/* Animación para ocultar/mostrar cards */
.card.hidden {
	opacity: 0;
	transform: scale(0.8) translateY(20px);
	pointer-events: none;
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	/* Cancel base fade-in animation and remove from layout so filtering works */
	animation: none;
	display: none;
}

.card.show {
	opacity: 1;
	transform: scale(1) translateY(0);
	pointer-events: all;
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	/* Prevent base animation from overriding visible state */
	animation: none;
}

/* Responsive para filtros */
@media screen and (max-width: 768px) {
	.filter-container {
		flex-direction: column;
		gap: 0.5rem;
		padding: 1rem;
	}

	.filter-btn {
		justify-content: center;
		padding: 0.7rem 1rem;
		font-size: 0.85rem;
	}
}

@media screen and (max-width: 480px) {
	.filter-text {
		font-size: 0.8rem;
	}

	.filter-icon {
		font-size: 1rem;
	}
}

@keyframes colorChange {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

@keyframes titleGlow {
	0% {
		filter: drop-shadow(0 0 5px rgba(240, 106, 156, 0.3));
	}
	100% {
		filter: drop-shadow(0 0 15px rgba(240, 106, 156, 0.6));
	}
}

@keyframes fadeInCard {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.difficulty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	margin-bottom: 1rem;
	margin-top: 1rem;
}

.difficulty-label {
	font-size: 1rem;
	color: #f06a9c;
	font-weight: 600;
}

.difficulty-bars {
	display: flex;
	gap: 3px;
}

.bar {
	width: 10px;
	height: 18px;
	background: #333333;
	border-radius: 4px;
	border: 1px solid #555555;
	transition: all 0.3s ease;
}

.bar.active {
	background: linear-gradient(135deg, #f06a9c, #e574a5, #c44569);
	border: 1px solid #f06a9c;
	box-shadow: 0 2px 8px rgba(240, 106, 156, 0.5);
	animation: barGlow 2s ease-in-out infinite alternate;
}

.roadmap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4rem;
	padding: 2rem;
	margin: 0 auto;
	max-width: 1400px;
	position: relative;
	z-index: 2;
}

/* Contenedores de nivel */
.level-container {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
	position: relative;
}

/* Niveles específicos */
.level-1 {
	justify-content: center;
	flex-wrap: wrap;
	gap: 2rem;
}

.level-2 {
	justify-content: center;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.level-3 {
	justify-content: center;
	flex-wrap: wrap;
	gap: 2rem;
}

.level-4 {
	justify-content: center;
	flex-wrap: wrap;
	gap: 2rem;
}

.branches-container {
	display: flex;
	justify-content: space-between;
	width: 100%;
	gap: 2rem;
	margin-top: 3rem;
	position: relative;
}

.branch-left,
.branch-right {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7rem;
	position: relative;
	padding: 2rem 1rem;
	border-radius: 20px;
	background: linear-gradient(
		145deg,
		rgba(26, 26, 26, 0.3),
		rgba(26, 26, 26, 0.1)
	);
	border: 1px solid rgba(240, 106, 156, 0.2);
}

.node-group {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2rem;
	position: relative;
}

.node-group.codigoplusplus {
	margin-top: -10rem;
}

.card {
	position: relative;
	background: linear-gradient(135deg, #1a1a1a, #252525);
	border-radius: 12px;
	border: 2px solid transparent;
	padding: 0.9rem;
	width: 300px;
	text-align: center;
	box-shadow: 0 8px 25px rgba(132, 108, 178, 0.3), 0 4px 10px rgba(0, 0, 0, 0.3);
	animation: fadeInCard 0.7s ease forwards;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	backdrop-filter: blur(10px);
}

.card:hover {
	transform: scale(1.02);
	box-shadow: 0 0 15px #f06a9ccc, 0 0 25px #846cb2cc;
}

.card h3 {
	color: #ffffff;
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0.8rem 0 0.5rem 0;
	line-height: 1.3;
}

.card p {
	color: #b0b0b0;
	font-size: 0.9rem;
	opacity: 0.85;
	font-style: italic;
	line-height: 1.4;
	margin: 0.5rem 0;
	letter-spacing: 0.3px;
	transition: color 0.3s ease, opacity 0.3s ease;
}

.card:hover p {
	color: #d0d0d0;
	opacity: 1;
}

.card-buttons {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.8rem;
	margin-top: 0.5rem;
}

.avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #846cb2;
	margin: 0 auto 0.5rem auto;
}

.signal {
	margin-top: 0.5rem;
	color: #f06a9c;
}

.vermas {
	display: inline-block;
	padding: 0.4rem 0.8rem;
	background-color: #f06a9c;
	color: white;
	border-radius: 6px;
	text-decoration: none;
	font-size: 0.85rem;
	transition: background 0.2s ease-in-out;
}

.vermas:hover {
	background-color: #d55888;
}

.wsp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 32px;
	background-color: #25d366;
	border-radius: 6px;
	text-decoration: none;
	transition: background 0.2s ease-in-out;
}

.wsp-btn:hover {
	background-color: #20b956;
}

.wsp-btn img {
	width: 20px;
	height: 20px;
	filter: brightness(0) invert(1);
}

.vertical-line {
	position: absolute;
	top: -3.2rem;
	left: 50%;
	width: 3px;
	height: 3.2rem;
	background: #f06a9c;
	border-radius: 2px;
}

/* Arrow head pointing into the card */
.vertical-line::after {
	content: '';
	position: absolute;
	bottom: -7px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 10px solid #f06a9c;
	filter: drop-shadow(0 0 6px rgba(240, 106, 156, 0.7));
}

/* FREE badge */
.free-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #29e68f, #12c2e9);
	box-shadow: 0 0 12px rgba(41, 230, 143, 0.6),
		inset 0 0 8px rgba(255, 255, 255, 0.25);
	border: 1px solid rgba(255, 255, 255, 0.25);
	z-index: 2;
}

@keyframes sharedLabelGlow {
	0%,
	100% {
		box-shadow: 0 8px 30px rgba(242, 62, 158, 0.6),
			0 0 20px rgba(136, 101, 241, 0.4);
		transform: translateX(-50%) scale(1);
	}
	50% {
		box-shadow: 0 12px 40px rgba(242, 62, 158, 0.8),
			0 0 30px rgba(136, 101, 241, 0.6);
		transform: translateX(-50%) scale(1.02);
	}
}

@keyframes labelPulse {
	0%,
	100% {
		box-shadow: 0 6px 20px rgba(132, 108, 178, 0.7);
	}
	50% {
		box-shadow: 0 6px 25px rgba(132, 108, 178, 0.9),
			0 0 15px rgba(240, 106, 156, 0.4);
	}
}

@media screen and (max-width: 768px) {
	h1 {
		font-size: 2rem;
	}

	.level-container {
		gap: 1.5rem;
	}

	.level-1,
	.level-2,
	.level-3,
	.level-4 {
		gap: 1rem;
	}

	.branches-container {
		flex-direction: column;
		gap: 3rem;
	}

	.card {
		width: 90%;
		max-width: 320px;
	}
}

@media screen and (max-width: 480px) {
	.roadmap {
		padding: 1rem 0.5rem;
	}
}
