/* ═══════════════════════════════════════════
   DEMO PAGE — Estilos exclusivos
   Hereda variables y navbar de landing.css
═══════════════════════════════════════════ */

/* ── HERO ── */
.demo-hero {
  padding: 100px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.demo-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.demo-hero > .container { position: relative; z-index: 1; }

.demo-hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 18px;
  letter-spacing: -1px;
}

.demo-hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.demo-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.demo-hero-stats {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 720px;
  margin: 0 auto;
}

.demo-stat {
  flex: 1;
  min-width: 160px;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}

.demo-stat:hover {
  border-color: var(--primary-glow);
  transform: translateY(-3px);
}

.demo-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--primary-glow), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Excepción: cuando el valor es un emoji (bandera, icono).
   Los emojis pierden color con background-clip: text, así que les
   quitamos el gradient y les damos un drop-shadow azul para mantener el feeling. */
.demo-stat[data-emoji] .demo-stat-value {
  background: none;
  -webkit-text-fill-color: initial;
  font-size: 2.5rem;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
}


.demo-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── LAYOUT 2 COLUMNAS ── */
.demo-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding: 60px 0 80px;
  align-items: start;
}

/* ── SIDEBAR ── */
.demo-sidebar {
  position: sticky;
  top: 96px; /* navbar height + offset */
  align-self: start;
  /* Limita el alto al viewport disponible. Si el contenido del sidebar
     (13 módulos + cross-link) excede esta altura, scroll interno propio.
     Sin esto, sticky queda "atrapado" al inicio porque el sidebar es más
     alto que la pantalla. */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  /* Scrollbar discreto para que no compita con el contenido */
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}

.demo-sidebar::-webkit-scrollbar {
  width: 6px;
}
.demo-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.demo-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}
.demo-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow);
}

.demo-sidebar-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.demo-sidebar-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.demo-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.demo-sidebar-link span {
  font-size: 1rem;
  flex-shrink: 0;
}

.demo-sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.demo-sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.08));
  color: var(--text-primary);
  font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

/* ── CONTENIDO ── */
.demo-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.demo-loading-placeholder {
  padding: 60px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* Cada módulo: header + descripción + grid de capturas */
.demo-module {
  scroll-margin-top: 96px; /* anchor offset bajo el navbar */
}

.demo-module-head {
  margin-bottom: 28px;
}

.demo-module-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--primary-dim);
  color: var(--primary-glow);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.demo-module-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.demo-module-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 760px;
}

.demo-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

/* Tarjeta de captura */
.demo-shot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.demo-shot:hover {
  transform: translateY(-4px);
  border-color: var(--primary-glow);
  box-shadow: var(--shadow-md);
}

.demo-shot-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: zoom-in;
  position: relative;
}

.demo-shot-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.demo-shot:hover .demo-shot-img-wrap img {
  transform: scale(1.04);
}

.demo-shot-img-wrap.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.04));
  border-bottom: 1px dashed var(--border);
}

.demo-shot-img-wrap.is-empty::before {
  content: '📸 Captura próxima';
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.demo-shot-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-shot-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.demo-shot-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-shot-bullets li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.demo-shot-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ── LIGHTBOX (zoom de captura al hacer click) ── */
.demo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
  cursor: zoom-out;
}

.demo-lightbox.is-open {
  display: flex;
  animation: lightboxFade 0.25s ease;
}

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

.demo-lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-bright);
}

.demo-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.demo-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── CTA FINAL ── */
.demo-cta-final {
  text-align: center;
  padding: 80px 0;
  background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-surface) 100%);
  border-top: 1px solid var(--border);
}

.demo-cta-final h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.demo-cta-final p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ── FOOTER MINI ── */
.footer-min {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
  text-align: center;
}

.footer-min p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-min a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 4px;
  transition: color var(--transition);
}

.footer-min a:hover {
  color: var(--primary-glow);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .demo-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .demo-sidebar {
    position: static;
    order: -1;
  }
  .demo-sidebar-inner {
    padding: 16px;
  }
  .demo-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .demo-sidebar-link {
    padding: 7px 12px;
    font-size: 0.82rem;
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .demo-hero { padding: 60px 0 40px; }
  .demo-hero-stats { flex-direction: column; }
  .demo-hero-stats .demo-stat { width: 100%; }
  .demo-module-grid { grid-template-columns: 1fr; }
  .demo-content { gap: 56px; }
}


/* ════════════════════════════════════════
   CROSS-LINK — botón al final del sidebar
   que invita a ir a la otra sección (demo / ayuda)
════════════════════════════════════════ */
.sidebar-cross-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.10), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(37, 99, 235, 0.25);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-cross-link:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.55);
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.18), rgba(16, 185, 129, 0.08));
}

.sidebar-cross-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-cross-link strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 2px;
}

.sidebar-cross-link span:not(.sidebar-cross-icon):not(.sidebar-cross-arrow) {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
}

.sidebar-cross-arrow {
  margin-left: auto;
  color: var(--primary-light, #3b82f6);
  font-size: 1.1rem;
  font-weight: 800;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-cross-link:hover .sidebar-cross-arrow {
  transform: translateX(4px);
}

/* Variante "ayuda → demo": acento azul (default arriba) */
/* Variante "demo → ayuda": acento verde */
.sidebar-cross-link-help {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.10), rgba(245, 158, 11, 0.04));
  border-color: rgba(16, 185, 129, 0.30);
}
.sidebar-cross-link-help:hover {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.18), rgba(245, 158, 11, 0.08));
  border-color: rgba(16, 185, 129, 0.55);
}
.sidebar-cross-link-help .sidebar-cross-arrow {
  color: var(--accent, #10b981);
}
