/**
 * Up Down Slide Effect Styles
 * Recreating CodePen behavior exactly - container 1 slides up, container 2 slides down, meeting at center
 */

.ccws-up-down-slide-container {
	position: relative;
	cursor: pointer;
	margin: 0 auto;
}

/* Subtle edge glow to indicate interactivity */
.ccws-up-down-slide-container::after {
	content: '';
	position: absolute;
	bottom: -100px;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, 
		transparent 0%, 
		rgba(214, 0, 28, 0.4) 30%, 
		rgba(214, 0, 28, 0.8) 50%, 
		rgba(214, 0, 28, 0.4) 70%, 
		transparent 100%
	);
	border-radius: 0 0 2px 2px;
	animation: gentle-pulse 3s ease-in-out infinite;
	z-index: 10;
}


/* First child element - Image container that slides up from bottom */
.ccws-up-down-slide-container > *:first-child {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	z-index: 2;
	transition: transform 0.7s ease;
	/* Initially positioned down (like CodePen slide1) */
	transform: translateY(100px);
}

/* Second child element - Text content that slides down from top */
.ccws-up-down-slide-container > *:nth-child(2) {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	padding: 20px;
	box-sizing: border-box;
	/* box-shadow: 0 20px 40px rgba(0,0,0,0.4);*/
	z-index: 1;
	transition: transform 0.8s ease;
	/* Initially positioned up (like CodePen slide2) */
	transform: translateY(100px);
	opacity: 1; /* Make sure it's visible */
}

/* Add decorative bottom bar like CodePen 
.ccws-up-down-slide-container > *:nth-child(2)::after {
	content: "";
	position: absolute;
	width: 30px;
	height: 4px;
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
	background: #2c73df;
}
	*/

/* Dark theme support */
@media (prefers-color-scheme: dark) {
	.ccws-up-down-slide-container > *:nth-child(2) {
		background: var(--base);
		color: var(--contrast);
	}
}

/* Hover state - both containers move to center (translateY(0)) */
.ccws-up-down-slide-container:hover > *:first-child {
	transform: translateY(20px);
}

.ccws-up-down-slide-container:hover > *:nth-child(2) {
	transform: translateY(280px);
}

/* Ensure text in second container is readable */
.ccws-up-down-slide-container > *:nth-child(2) h1,
.ccws-up-down-slide-container > *:nth-child(2) h2,
.ccws-up-down-slide-container > *:nth-child(2) h3,
.ccws-up-down-slide-container > *:nth-child(2) h4,
.ccws-up-down-slide-container > *:nth-child(2) h5,
.ccws-up-down-slide-container > *:nth-child(2) h6 {
	margin: 0 0 10px 0;
	padding: 0;
	text-align: center;
	color: #414141;
}

.ccws-up-down-slide-container > *:nth-child(2) p {
	margin: 0;
	padding: 0;
	text-align: center;
	color: #414141;
	background: var(--base);
}

/* Mobile optimizations */
@media (max-width: 768px) {
	.ccws-up-down-slide-container {
		/* Remove fixed dimensions to prevent overlap */
		margin-bottom: 50px; /* Add space to prevent stacking overlap */
	}
	
	.ccws-up-down-slide-container > *:nth-child(2) {
		padding: 15px;
	}
	
	/* On mobile, use tap instead of hover - match your transforms */
	.ccws-up-down-slide-container.active > *:first-child {
		transform: translateY(20px);
	}
	
	.ccws-up-down-slide-container.active > *:nth-child(2) {
		transform: translateY(280px);
	}
}

/* Focus styles for accessibility - match your transforms */
.ccws-up-down-slide-container:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.ccws-up-down-slide-container:focus > *:first-child {
	transform: translateY(20px);
}

.ccws-up-down-slide-container:focus > *:nth-child(2) {
	transform: translateY(280px);
}

/* Gentle pulse animation for edge glow */
@keyframes gentle-pulse {
	0%, 100% {
		opacity: 0.3;
		transform: scaleX(0.8);
	}
	50% {
		opacity: 0.8;
		transform: scaleX(1);
	}
}

/* Hide glow when effect is active/hovered */
.ccws-up-down-slide-container:hover::after,
.ccws-up-down-slide-container.active::after,
.ccws-up-down-slide-container:focus::after {
	opacity: 0 !important;
	transition: opacity 0.3s ease;
}