/**
 * Bloque Features Showcase Video
 * 
 * Bloque showcase de features con video en modal, columnas de información e imagen con fade.
 * Incluye background con gradiente sutil morado a negro, badge personalizable, 
 * video con modal, dos columnas inferiores y efectos visuales modernos.
 * 
 * @package Vitruve_Custom_Theme
 */

@import '../styles/design-tokens.css';

/**
 * ANIMACIONES DE ENTRADA (estilo Apple)
 */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

:root {
	--ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/**
 * CONTENEDOR PRINCIPAL CON GRADIENTE (FULL WIDTH)
 */
.vitruve-features-showcase-video {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: var(--space-20) 0;
	/*	background: linear-gradient(
		to bottom,
		rgba(47, 47, 47, 0.15) 0%,
		var(--color-neutral-800) 100%
	);*/
	background: transparent;
	position: relative;
	overflow: hidden;
}

/**
 * CONTAINER INTERNO CON OVERLAY
 */
.vitruve-features-showcase-video__container {
	max-width: var(--container-max-width);
	margin: 0 auto;
	padding: 0 var(--container-padding);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-8);
	text-align: left;
	position: relative;
	z-index: 1;
	/* Animación de entrada */
	opacity: 0;
	transform: translateY(30px);
}

.vitruve-features-showcase-video.is-visible .vitruve-features-showcase-video__container {
	animation: fadeInUp 1s var(--ease-apple) forwards;
}


@media (min-width: 1024px) {
	.vitruve-features-showcase-video__container {
		padding: 0 var(--container-padding-lg);
		gap: var(--space-10);
	}
}

/**
 * BADGE - ALINEACIÓN (los estilos de color vienen de badges.css)
 */
.vitruve-features-showcase-video .vitruve-badge {
	align-self: flex-start;
	max-width: 1200px;
}

/**
 * TÍTULO PRINCIPAL - ALINEADO CON VIDEO
 */
.vitruve-features-showcase-video__title {
	font-family: var(--font-heading);
	font-size: var(--text-5xl);
	font-weight: var(--font-bold);
	line-height: 1.2;
	color: var(--text-primary);
	margin: 0;
	width: 100%;
	max-width: 1200px;
	align-self: flex-start;
}

/**
 * SUBTÍTULO - ALINEADO CON VIDEO
 */
.vitruve-features-showcase-video__subtitle {
	font-family: var(--font-sans);
	font-size: var(--text-lg);
	line-height: 1.6;
	color: var(--text-muted);
	margin: 0;
	width: 100%;
	max-width: 1200px;
	align-self: flex-start;
}

/**
 * SECCIÓN DE MEDIA (VIDEO LOCAL, VIDEO EXTERNO O IMAGEN) - ALINEADO CON TÍTULO
 */
.vitruve-features-showcase-video__media-section {
	position: relative;
	width: 100%;
	max-width: 1200px;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-2xl);
	overflow: hidden;
	margin-top: var(--space-8);
	align-self: flex-start;
	box-shadow: 
		0 -15px 40px -20px rgba(0, 255, 229, 0.15);
}

/**
 * DEGRADADO SOBRE LA IMAGEN/VIDEO PRINCIPAL
 */
.vitruve-features-showcase-video__media-section::after {
	content: '';
	position: absolute;
	inset: 0;
	background: 
		linear-gradient(
			to left,
			var(--bg-primary) 0%,
			transparent 25%
		),
		linear-gradient(
			to top,
			var(--bg-primary) 0%,
			transparent 25%
		);
	pointer-events: none;
	z-index: 1;
}

/* Cursor pointer solo cuando hay video externo */
.vitruve-features-showcase-video__media-section--external_video {
	cursor: pointer;
}

/**
 * VIDEO LOCAL AUTOPLAY
 */
.vitruve-features-showcase-video__local-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/**
 * IMAGEN DE FONDO PARA VIDEO EXTERNO
 */
.vitruve-features-showcase-video__video-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/**
 * IMAGEN ESTÁTICA (cuando solo hay imagen)
 */
.vitruve-features-showcase-video__static-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Retrocompatibilidad con la clase antigua */
.vitruve-features-showcase-video__video-section {
	position: relative;
	width: 100%;
	max-width: 1200px;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-2xl);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	overflow: hidden;
	cursor: pointer;
	margin-top: var(--space-8);
	align-self: flex-start;
	box-shadow: 
		0 -15px 40px -20px rgba(0, 255, 229, 0.15);
}


/**
 * BOTÓN DE PLAY
 */
.vitruve-features-showcase-video__play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-4);
	background: none;
	border: none;
	cursor: pointer;
	padding: var(--space-6);
	transition: all var(--transition-base) var(--ease-in-out);
	z-index: 2;
}

.vitruve-features-showcase-video__play-button:hover {
	transform: translate(-50%, -50%) scale(1.1);
}

.vitruve-features-showcase-video__play-button:focus-visible {
	outline: 2px solid var(--color-secondary);
	outline-offset: 4px;
	border-radius: var(--radius-xl);
}

/**
 * ICONO DE PLAY
 */
.vitruve-features-showcase-video__play-icon {
	width: 80px;
	height: 80px;
	color: var(--color-secondary);
	filter: drop-shadow(0 4px 12px rgba(0, 255, 229, 0.4));
	transition: all var(--transition-base) var(--ease-in-out);
}

.vitruve-features-showcase-video__play-button:hover .vitruve-features-showcase-video__play-icon {
	filter: drop-shadow(0 6px 16px rgba(0, 255, 229, 0.6));
}

/**
 * TEXTO DEL BOTÓN
 */
.vitruve-features-showcase-video__play-text {
	font-family: var(--font-sans);
	font-size: var(--text-base);
	font-weight: var(--font-semibold);
	color: var(--text-primary);
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
	white-space: nowrap;
}

/**
 * COLUMNAS INFERIORES - MISMO ANCHO QUE VIDEO Y ALINEADAS
 */
.vitruve-features-showcase-video__columns {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-10);
	width: 100%;
	max-width: 1200px;
	margin-top: var(--space-8);
	align-self: flex-start;
}

/**
 * COLUMNA INDIVIDUAL (TÍTULO Y TEXTO ENCIMA DE IMAGEN)
 */
.vitruve-features-showcase-video__column {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-4);
	text-align: left;
}

/**
 * TÍTULO DE COLUMNA (VA SEGUNDO)
 */
.vitruve-features-showcase-video__column-title {
	order: 2;
	font-family: var(--font-heading);
	font-size: var(--text-xl);
	font-weight: var(--font-bold);
	line-height: 1.3;
	color: var(--text-primary);
	margin: 0;
}

/**
 * IMAGEN DE COLUMNA (VA PRIMERA)
 */
.vitruve-features-showcase-video__column-image {
	order: 1;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-xl);
	overflow: hidden;
	background-color: var(--bg-secondary);
	position: relative;
}

/**
 * TEXTO DE COLUMNA (VA TERCERO)
 */
.vitruve-features-showcase-video__column-text {
	order: 3;
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: 1.6;
	color: var(--text-muted);
	margin: 0;
}

/**
 * ENLACE "LEARN MORE" (VA CUARTO Y ES OPCIONAL)
 */
.vitruve-features-showcase-video__column-link {
	order: 4;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: var(--font-semibold);
	color: var(--color-primary);
	text-decoration: none;
	margin-top: var(--space-3);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.vitruve-features-showcase-video__column-link:hover {
	opacity: 0.8;
	transform: translateX(4px);
}

.vitruve-features-showcase-video__column-link-arrow {
	font-size: var(--text-lg);
	transition: transform 0.2s ease;
}

.vitruve-features-showcase-video__column-link:hover .vitruve-features-showcase-video__column-link-arrow {
	transform: translateX(4px);
}

.vitruve-features-showcase-video__column-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: 
		linear-gradient(
			to left,
			var(--bg-primary) 0%,
			transparent 25%
		),
		linear-gradient(
			to top,
			var(--bg-primary) 0%,
			transparent 25%
		);
	pointer-events: none;
}

.vitruve-features-showcase-video__column-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/**
 * ========================================
 * MODAL DE VIDEO
 * ========================================
 */
.vitruve-features-showcase-video-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/**
 * OVERLAY DEL MODAL
 */
.vitruve-features-showcase-video-modal__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.92);
	backdrop-filter: blur(8px);
}

/**
 * CONTENIDO DEL MODAL
 */
.vitruve-features-showcase-video-modal__content {
	position: relative;
	width: 90%;
	max-width: 1200px;
	z-index: 10000;
	animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
	from {
		transform: scale(0.9);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

/**
 * BOTÓN DE CERRAR
 */
.vitruve-features-showcase-video-modal__close {
	position: absolute;
	top: -50px;
	right: 0;
	background: none;
	border: none;
	color: var(--text-primary);
	cursor: pointer;
	padding: var(--space-2);
	transition: all var(--transition-base) var(--ease-in-out);
	z-index: 10001;
	border-radius: var(--radius-md);
}

.vitruve-features-showcase-video-modal__close:hover {
	color: var(--color-secondary);
	transform: rotate(90deg);
}

.vitruve-features-showcase-video-modal__close:focus-visible {
	outline: 2px solid var(--color-secondary);
	outline-offset: 4px;
}

/**
 * CONTAINER DEL VIDEO EN MODAL
 */
.vitruve-features-showcase-video-modal__video-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
	border-radius: var(--radius-2xl);
	background-color: var(--bg-secondary);
	
}

/**
 * IFRAME DEL VIDEO EN MODAL
 */
.vitruve-features-showcase-video-modal__iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
	border-radius: var(--radius-2xl);
}

/**
 * ========================================
 * RESPONSIVE - TABLETS (max-width: 1024px)
 * ========================================
 */
@media (max-width: 1024px) {
	.vitruve-features-showcase-video {
		padding: var(--space-16) 0;
	}

	.vitruve-features-showcase-video__title {
		font-size: var(--text-4xl);
	}

	.vitruve-features-showcase-video__subtitle {
		font-size: var(--text-base);
	}

	.vitruve-features-showcase-video__video-section,
	.vitruve-features-showcase-video__media-section {
		margin-top: var(--space-6);
	}

	.vitruve-features-showcase-video__play-icon {
		width: 64px;
		height: 64px;
	}

	.vitruve-features-showcase-video__play-text {
		font-size: var(--text-sm);
	}

	.vitruve-features-showcase-video__columns {
		gap: var(--space-8);
	}

	.vitruve-features-showcase-video__column-title {
		font-size: var(--text-lg);
	}

	.vitruve-features-showcase-video__column-text {
		font-size: var(--text-sm);
	}

	.vitruve-features-showcase-video__column-link {
		font-size: var(--text-base);
	}
}

/**
 * ========================================
 * RESPONSIVE - MOBILE (max-width: 768px)
 * ========================================
 */
@media (max-width: 768px) {
	.vitruve-features-showcase-video {
		padding: var(--space-12) 0;
	}

	.vitruve-features-showcase-video__container {
		gap: var(--space-6);
	}

	.vitruve-features-showcase-video__badge {
		font-size: 10px;
		padding: var(--space-1) var(--space-3);
	}

	.vitruve-features-showcase-video__title {
		font-size: var(--text-3xl);
	}

	.vitruve-features-showcase-video__subtitle {
		font-size: var(--text-sm);
	}

	.vitruve-features-showcase-video__video-section,
	.vitruve-features-showcase-video__media-section {
		margin-top: var(--space-4);
		border-radius: var(--radius-2xl);
	}

	.vitruve-features-showcase-video__play-button {
		gap: var(--space-3);
		padding: var(--space-4);
	}

	.vitruve-features-showcase-video__play-icon {
		width: 48px;
		height: 48px;
	}

	.vitruve-features-showcase-video__play-text {
		font-size: var(--text-xs);
	}

	.vitruve-features-showcase-video__columns {
		grid-template-columns: 1fr;
		gap: var(--space-6);
		margin-top: var(--space-6);
	}

	.vitruve-features-showcase-video__column-image {
		border-radius: var(--radius-xl);
	}

	.vitruve-features-showcase-video__column-title {
		font-size: var(--text-base);
	}

	.vitruve-features-showcase-video__column-text {
		font-size: var(--text-sm);
	}

	/* Modal responsive */
	.vitruve-features-showcase-video-modal__content {
		width: 95%;
	}

	.vitruve-features-showcase-video-modal__close {
		top: -40px;
		right: -5px;
	}

	.vitruve-features-showcase-video-modal__video-container {
		border-radius: var(--radius-xl);
	}

	.vitruve-features-showcase-video-modal__iframe {
		border-radius: var(--radius-xl);
	}
}

/**
 * ========================================
 * ACCESIBILIDAD
 * ========================================
 */
@media (prefers-reduced-motion: reduce) {
	.vitruve-features-showcase-video__badge,
	.vitruve-features-showcase-video__video-section,
	.vitruve-features-showcase-video__media-section,
	.vitruve-features-showcase-video__play-button,
	.vitruve-features-showcase-video__play-icon,
	.vitruve-features-showcase-video-modal__close {
		transition: none;
	}

	.vitruve-features-showcase-video-modal,
	.vitruve-features-showcase-video-modal__content {
		animation: none;
	}

	.vitruve-features-showcase-video__container {
		opacity: 1;
		transform: none;
		animation: none;
	}
}

/**
 * ========================================
 * ALINEACIÓN DEL BLOQUE (GUTENBERG)
 * ========================================
 * Nota: El bloque es full-width por defecto.
 * Las reglas de alineación de Gutenberg no son necesarias ya que
 * el contenedor principal ya ocupa todo el ancho disponible.
 */
