/**
 * Vive Countdown Pro - Estilos Frontend Profesionales
 * Con soporte para imágenes de fondo, capas de superposición y temas festivos.
 *
 * @package ViveCountdownPro
 */

:root {
	--vcp-gold: #f59e0b;
	--vcp-amber: #fbbf24;
	--vcp-ruby: #e11d48;
	--vcp-red: #b91c1c;
	--vcp-accent: #f59e0b;
	--vcp-overlay-opacity: 0.70;
	--vcp-bg-blur: 0px;
}

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL Y CAPAS
   ========================================================================== */
.vcp-countdown-wrap {
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
	width: 100%;
	max-width: 680px;
	margin: 28px auto;
	padding: 28px 24px;
	border-radius: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
	text-align: center;
	transition: all 0.35s ease;
	isolation: isolate;
}

.vcp-countdown-wrap *,
.vcp-countdown-wrap *::before,
.vcp-countdown-wrap *::after {
	box-sizing: border-box;
}

/* Capa 1: Fondo / Imagen */
.vcp-bg-layer {
	position: absolute;
	inset: 0;
	z-index: -3;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	filter: blur(var(--vcp-bg-blur));
	transform: scale(1.02); /* Evita bordes blancos al desenfocar */
	transition: background-image 0.4s ease, filter 0.3s ease;
}

.vcp-has-bg .vcp-bg-layer {
	background-image: var(--vcp-bg-image);
}

/* Capa 2: Overlay Protector con opacidad configurable */
.vcp-overlay-layer {
	position: absolute;
	inset: 0;
	z-index: -2;
	background: #090d16;
	opacity: var(--vcp-overlay-opacity);
	transition: opacity 0.3s ease;
}

/* Capa 3: Resplandor Festivo en esquinas */
.vcp-glow-layer {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: 
		radial-gradient(circle at 10% 15%, rgba(245, 158, 11, 0.15) 0%, transparent 45%),
		radial-gradient(circle at 90% 85%, rgba(225, 29, 72, 0.15) 0%, transparent 45%);
}

/* Capa 4: Contenido */
.vcp-inner {
	position: relative;
	z-index: 1;
}

/* Alineaciones */
.vcp-align-center { margin-left: auto; margin-right: auto; text-align: center; }
.vcp-align-left { margin-left: 0; margin-right: auto; text-align: left; }
.vcp-align-right { margin-left: auto; margin-right: 0; text-align: right; }

/* ==========================================================================
   2. TEMAS VISUALES
   ========================================================================== */
/* Tema Dark (Obsidiana Slate + Oro Candelaria) */
.vcp-theme-candelaria-dark {
	background: linear-gradient(135deg, #090d16 0%, #151f32 50%, #0f172a 100%);
	border: 1px solid rgba(245, 158, 11, 0.4);
	color: #f8fafc;
}
.vcp-theme-candelaria-dark.vcp-has-bg {
	background: transparent;
}
.vcp-theme-candelaria-dark .vcp-num {
	color: var(--vcp-accent);
	text-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

/* Tema Ruby Festivo (Rojo Candelaria Carmesí + Oro) */
.vcp-theme-candelaria-ruby {
	background: linear-gradient(135deg, #4c0519 0%, #881337 50%, #1c1917 100%);
	border: 1px solid rgba(251, 191, 36, 0.6);
	box-shadow: 0 16px 40px rgba(136, 19, 55, 0.35), 0 0 0 1px rgba(251, 191, 36, 0.2);
	color: #fff1f2;
}
.vcp-theme-candelaria-ruby.vcp-has-bg {
	background: transparent;
}
.vcp-theme-candelaria-ruby .vcp-num {
	color: #fbbf24;
	text-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}
.vcp-theme-candelaria-ruby .vcp-unit-box {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(76, 5, 25, 0.7) 100%);
	border-color: rgba(251, 191, 36, 0.3);
}

/* Tema Light Elegante */
.vcp-theme-candelaria-light {
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid #cbd5e1;
	color: #0f172a;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
}
.vcp-theme-candelaria-light.vcp-has-bg {
	background: transparent;
}
.vcp-theme-candelaria-light .vcp-overlay-layer {
	background: #ffffff;
}
.vcp-theme-candelaria-light .vcp-title {
	color: #0f172a;
}
.vcp-theme-candelaria-light .vcp-subtitle {
	color: #475569;
}
.vcp-theme-candelaria-light .vcp-num {
	color: #b91c1c;
}
.vcp-theme-candelaria-light .vcp-label {
	color: #475569;
}
.vcp-theme-candelaria-light .vcp-unit-box {
	background: #ffffff;
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Tema Minimalista */
.vcp-theme-minimal {
	background: transparent;
	border: 1.5px dashed rgba(245, 158, 11, 0.4);
	box-shadow: none;
	color: inherit;
}
.vcp-theme-minimal .vcp-unit-box {
	background: rgba(15, 23, 42, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. PRESETS DE FONDOS FESTIVOS
   ========================================================================== */
.vcp-preset-candelaria-gold .vcp-bg-layer {
	background: radial-gradient(circle at center, #78350f 0%, #291205 60%, #090d16 100%);
}
.vcp-preset-puno-night .vcp-bg-layer {
	background: linear-gradient(180deg, #030712 0%, #0c1527 50%, #1e1b4b 100%);
}
.vcp-preset-fiesta-colors .vcp-bg-layer {
	background: linear-gradient(135deg, #831843 0%, #312e81 50%, #701a75 100%);
}

/* ==========================================================================
   4. CABECERA Y TEXTOS
   ========================================================================== */
.vcp-header {
	margin-bottom: 22px;
}

.vcp-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 14px;
	border-radius: 9999px;
	background: rgba(245, 158, 11, 0.15);
	border: 1px solid rgba(245, 158, 11, 0.4);
	color: var(--vcp-accent);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 12px;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.vcp-badge-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--vcp-accent);
	box-shadow: 0 0 10px var(--vcp-accent);
	animation: vcp-pulse 1.8s infinite;
}

@keyframes vcp-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.35; transform: scale(0.85); }
}

.vcp-title {
	margin: 0 0 6px 0;
	font-size: 1.45rem;
	font-weight: 900;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: #ffffff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.vcp-subtitle {
	margin: 0;
	font-size: 0.88rem;
	font-weight: 500;
	color: #cbd5e1;
	line-height: 1.45;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   5. REJILLA DE CONTEO Y CAJAS (UNITS)
   ========================================================================== */
.vcp-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-top: 18px;
}

.vcp-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
}

/* Caja del dígito con estilo biselado y flap clock */
.vcp-unit-box {
	position: relative;
	width: 100%;
	padding: 16px 8px;
	border-radius: 16px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-top: 1px solid rgba(255, 255, 255, 0.3);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* Línea de corte horizontal decorativa (estilo marcador de estadio) */
.vcp-unit-split {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: rgba(0, 0, 0, 0.35);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	pointer-events: none;
}

.vcp-num {
	display: block;
	position: relative;
	z-index: 2;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	font-size: 2.1rem;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.03em;
	transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.vcp-label {
	display: block;
	margin-top: 8px;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #94a3b8;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   6. TAMAÑOS (SM, MD, LG)
   ========================================================================== */
/* Small */
.vcp-size-sm { padding: 18px 16px; border-radius: 18px; max-width: 520px; }
.vcp-size-sm .vcp-num { font-size: 1.45rem; }
.vcp-size-sm .vcp-unit-box { padding: 10px 4px; border-radius: 12px; }
.vcp-size-sm .vcp-title { font-size: 1.15rem; }
.vcp-size-sm .vcp-label { font-size: 9.5px; }

/* Large (Hero gigante) */
.vcp-size-lg { padding: 36px 32px; border-radius: 28px; max-width: 820px; }
.vcp-size-lg .vcp-num { font-size: 3rem; }
.vcp-size-lg .vcp-unit-box { padding: 22px 12px; border-radius: 20px; }
.vcp-size-lg .vcp-title { font-size: 1.85rem; }
.vcp-size-lg .vcp-subtitle { font-size: 1rem; }
.vcp-size-lg .vcp-label { font-size: 12px; margin-top: 10px; }

/* ==========================================================================
   7. BANNER CELEBRACIÓN / EXPIRADO
   ========================================================================== */
.vcp-hidden {
	display: none !important;
}

.vcp-expired-banner {
	margin-top: 18px;
	padding: 16px 20px;
	background: rgba(225, 29, 72, 0.25);
	border: 1px solid rgba(225, 29, 72, 0.6);
	border-radius: 16px;
	backdrop-filter: blur(8px);
}

.vcp-celebrate-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.vcp-celebrate-icon {
	font-size: 1.6rem;
	animation: vcp-bounce 1s infinite alternate;
}

@keyframes vcp-bounce {
	from { transform: translateY(0); }
	to { transform: translateY(-5px); }
}

.vcp-celebrate-text {
	font-size: 1rem;
	font-weight: 800;
	color: #fbbf24;
}

/* ==========================================================================
   8. HITOS FESTIVOS AL PIE
   ========================================================================== */
.vcp-milestones {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px;
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 11.5px;
	color: #cbd5e1;
}

.vcp-milestone-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 9999px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	white-space: nowrap;
}

.vcp-milestone-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}
.vcp-dot-gold { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.vcp-dot-ruby { background: #e11d48; box-shadow: 0 0 6px #e11d48; }

/* ==========================================================================
   9. BARRA FLOTANTE GLOBAL (STICKY BAR)
   ========================================================================== */
.vcp-floating-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999998;
	background: rgba(15, 23, 42, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid rgba(245, 158, 11, 0.35);
	color: #f8fafc;
	padding: 10px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.vcp-bar-top { top: 0; }
body.admin-bar .vcp-bar-top { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .vcp-bar-top { top: 46px; }
}

.vcp-bar-bottom {
	bottom: 0;
	border-bottom: none;
	border-top: 1px solid rgba(245, 158, 11, 0.35);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.vcp-bar-container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 14px;
}

.vcp-bar-lead {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
}

.vcp-bar-pulse {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #f59e0b;
	box-shadow: 0 0 8px #f59e0b;
	animation: vcp-pulse 1.5s infinite;
}

.vcp-bar-countdown {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(0, 0, 0, 0.45);
	padding: 4px 12px;
	border-radius: 8px;
	border: 1px solid rgba(245, 158, 11, 0.3);
	font-family: ui-monospace, monospace;
	font-size: 12px;
	color: #f59e0b;
}

.vcp-bar-countdown strong {
	font-weight: 800;
	color: #ffffff;
}

.vcp-bar-sep { opacity: 0.5; }

.vcp-bar-btn {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: #0f172a !important;
	font-size: 11px;
	font-weight: 800;
	text-decoration: none !important;
	border-radius: 9999px;
	box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
	transition: transform 0.2s ease, filter 0.2s ease;
}

.vcp-bar-btn:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.vcp-bar-close {
	background: transparent;
	border: none;
	color: #94a3b8;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	margin-left: 4px;
	transition: color 0.2s ease;
}

.vcp-bar-close:hover { color: #ffffff; }

/* Responsive móvil */
@media screen and (max-width: 600px) {
	.vcp-countdown-wrap {
		padding: 22px 14px;
		border-radius: 20px;
	}
	.vcp-grid {
		gap: 6px;
	}
	.vcp-unit-box {
		padding: 12px 4px;
		border-radius: 12px;
	}
	.vcp-num {
		font-size: 1.55rem;
	}
	.vcp-label {
		font-size: 9px;
		margin-top: 6px;
	}
	.vcp-title {
		font-size: 1.25rem;
	}
	.vcp-subtitle {
		font-size: 0.8rem;
	}
	.vcp-bar-container {
		gap: 8px;
		justify-content: space-between;
	}
	.vcp-bar-lead {
		font-size: 11px;
	}
	.vcp-bar-countdown {
		font-size: 11px;
	}
}
