/* ════════════════════════════════════════════════════════════════════
   TUTORIAL CIUDADANO — Estilo neón / glassmorphism / gamificado
   Cargado en index.html DESPUÉS de mobile.css. No depende de app.js.
   Todo el namespace usa el prefijo .vct- (Voz Ciudadana Tutorial).
   ════════════════════════════════════════════════════════════════════ */

:root {
    --vct-gold:    #fbbf24;
    --vct-gold-2:  #ffd700;
    --vct-cyan:    #00e5ff;
    --vct-purple:  #7c3aed;
    --vct-bg:      rgba(8, 14, 28, 0.78);
    --vct-glass:   rgba(15, 23, 42, 0.62);
    --vct-border:  rgba(251, 191, 36, 0.45);
    --vct-text:    #f8fafc;
    --vct-muted:   #cbd5e1;
}

/* ─── OVERLAY GLOBAL (transparente — sólo contenedor) ────────────── */
/* El tutorial NO oscurece la página: la flecha SVG y el mensaje
   compacto acompañan al usuario sin tapar nada. El sitio queda
   completamente interactivo durante todo el tour. */
.vct-overlay {
    position: fixed;
    inset: 0;
    z-index: 99000;
    display: none;
    pointer-events: none;
    background: transparent;
    animation: vct-fade-in 0.2s ease-out;
}
/* will-change activado SOLO mientras el tutorial está visible para
   promover ring/cursor/card a capa GPU sin gastar memoria fuera de uso. */
.vct-overlay.vct-visible .vct-ring,
.vct-overlay.vct-visible .vct-arrow,
.vct-overlay.vct-visible .vct-card {
    will-change: transform, top, left;
}
.vct-overlay.vct-visible { display: block; }

/* Sólo el card y la flecha capturan clicks (los botones del card).
   El ring es decorativo. El sitio sigue respondiendo normal. */
.vct-overlay .vct-card,
.vct-overlay .vct-skip-btn {
    pointer-events: auto;
}
.vct-overlay .vct-ring,
.vct-overlay .vct-arrow {
    pointer-events: none;
}

/* ─── RING DE SPOTLIGHT (anillo neón que rodea al target) ────────── */
.vct-ring {
    position: fixed;
    border: 2px solid var(--vct-gold);
    border-radius: 18px;
    box-shadow:
        0 0 0 4px rgba(251,191,36,0.18),
        0 0 24px 6px rgba(251,191,36,0.55),
        0 0 60px 12px rgba(0,229,255,0.25),
        inset 0 0 20px rgba(255,215,0,0.18);
    background: transparent;
    /* Solo transitamos las dimensiones/posición; el pulse animado del
       box-shadow corre por su cuenta y no se ve "frenado" por el all. */
    transition:
        top    0.26s cubic-bezier(0.22, 1, 0.36, 1),
        left   0.26s cubic-bezier(0.22, 1, 0.36, 1),
        width  0.26s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    animation: vct-ring-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
    transform: translateZ(0);
}
/* Pulse más liviano: blur máximo 70px (antes 90px) y un shadow menos en
   el pico. Misma identidad visual neón con ~30% menos trabajo de GPU. */
@keyframes vct-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(251,191,36,0.18), 0 0 24px 6px rgba(251,191,36,0.55), 0 0 60px 12px rgba(0,229,255,0.25), inset 0 0 20px rgba(255,215,0,0.18); }
    50%      { box-shadow: 0 0 0 8px rgba(251,191,36,0.28), 0 0 36px 9px rgba(251,191,36,0.72), 0 0 70px 16px rgba(0,229,255,0.32), inset 0 0 26px rgba(255,215,0,0.26); }
}

/* ─── CURSOR DE MOUSE NEÓN — única guía del avance ───────────────── */
/* z-index alto: SIEMPRE encima del card y de modales del sitio. */
.vct-arrow {
    position: fixed;
    width: 56px;
    height: 56px;
    z-index: 99005;
    pointer-events: none;
    /* Transición sutil cuando el cursor "viaja" entre pasos — 180ms
       se siente como un swipe ágil sin perder la sensación de que
       respondió al evento. Sin animación entra/sale instantáneo. */
    transition:
        top   0.18s cubic-bezier(0.22, 1, 0.36, 1),
        left  0.18s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateZ(0);
}
.vct-cursor-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    filter:
        drop-shadow(0 2px 4px rgba(0,0,0,0.55))
        drop-shadow(0 0 10px rgba(251,191,36,0.85))
        drop-shadow(0 0 22px rgba(255,215,0,0.55));
    animation: vct-cursor-tap 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: 12% 12%; /* tip del cursor */
}
/* Ripple/halo que sale del tip — sugiere el clic */
.vct-cursor-ripple {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--vct-cyan);
    background: radial-gradient(circle, rgba(0,229,255,0.35) 0%, rgba(0,229,255,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: vct-cursor-ripple-anim 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes vct-cursor-tap {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    45%      { transform: translate3d(2px, 2px, 0) scale(0.85); }
    55%      { transform: translate3d(2px, 2px, 0) scale(0.85); }
}
@keyframes vct-cursor-ripple-anim {
    0%   { transform: translate3d(-50%, -50%, 0) scale(0);   opacity: 0; }
    45%  { transform: translate3d(-50%, -50%, 0) scale(0.4); opacity: 0; }
    55%  { transform: translate3d(-50%, -50%, 0) scale(1);   opacity: 0.9; }
    100% { transform: translate3d(-50%, -50%, 0) scale(2.6); opacity: 0; }
}

/* ─── CARD COMPACTA — mensaje que acompaña la flecha ─────────────── */
/* No es un modal: es un tooltip glass pequeño anclado al lado de la
   flecha SVG. No oscurece el fondo. */
.vct-card {
    position: fixed;
    z-index: 99003;
    width: min(300px, calc(100vw - 32px));
    background: linear-gradient(160deg, rgba(15,23,42,0.95) 0%, rgba(7,12,26,0.96) 100%);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1.5px solid var(--vct-border);
    border-radius: 18px;
    padding: 12px 14px 10px;
    color: var(--vct-text);
    box-shadow:
        0 0 0 1px rgba(0,229,255,0.18),
        0 10px 30px rgba(0,0,0,0.55),
        0 0 30px rgba(251,191,36,0.22),
        inset 0 1px 0 rgba(255,255,255,0.08);
    font-family: 'Inter', system-ui, sans-serif;
    animation: vct-card-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    transition:
        top       0.22s cubic-bezier(0.22, 1, 0.36, 1),
        left      0.22s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    /* Drag: el card capta el gesto en mouse y touch. Bloqueamos el
       comportamiento default del browser (scroll/zoom al arrastrar) y
       mostramos cursor grab para sugerir que se puede mover. Los pasos
       centrados (bienvenida/fin) anulan ambos abajo. */
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
/* Los botones y enlaces dentro del card deben sentirse como botones,
   no como zona de arrastre. */
.vct-card button,
.vct-card a,
.vct-card [data-vct-action] {
    cursor: pointer;
    touch-action: auto;
}
.vct-card.vct-centrado {
    cursor: default;
    touch-action: auto;
    user-select: text;
    -webkit-user-select: text;
}
/* Mientras se arrastra: cursor agarrado + glow más intenso + sin
   transición de top/left para que siga al dedo sin retardo. */
.vct-card.vct-dragging {
    cursor: grabbing;
    transition: none !important;
    opacity: 0.97;
    box-shadow:
        0 0 0 1.5px rgba(0,229,255,0.36),
        0 18px 40px rgba(0,0,0,0.65),
        0 0 40px rgba(251,191,36,0.38),
        inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Handle visual: barrita dorada arriba del card que sugiere "moveme".
   Sin eventos propios — el drag se captura en el card entero. */
.vct-card-handle {
    width: 36px;
    height: 3px;
    margin: -2px auto 6px;
    border-radius: 2px;
    background: rgba(251,191,36,0.32);
    transition: background 0.2s ease, width 0.2s ease;
    pointer-events: none;
}
.vct-card:hover .vct-card-handle,
.vct-card.vct-dragging .vct-card-handle {
    background: rgba(251,191,36,0.7);
    width: 44px;
}

@keyframes vct-card-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vct-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.vct-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--vct-gold) 0%, var(--vct-gold-2) 100%);
    color: #1a1206;
    font-weight: 800;
    font-size: 0.72em;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(251,191,36,0.55);
}
.vct-card-titulo {
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    background: linear-gradient(90deg, var(--vct-gold) 0%, var(--vct-gold-2) 50%, var(--vct-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.vct-card-cerrar {
    margin-left: auto;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--vct-muted);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.95em;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vct-card-cerrar:hover { background: rgba(239,68,68,0.18); color: #fca5a5; border-color: rgba(239,68,68,0.35); }

.vct-card-body {
    font-size: 0.84em;
    line-height: 1.45;
    color: var(--vct-text);
    margin: 2px 0 8px;
}
.vct-card-body strong { color: var(--vct-gold); }

/* Footer: progress + botones */
.vct-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.vct-progress-dots {
    display: flex;
    gap: 6px;
    margin-right: auto;
}
.vct-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(203,213,225,0.25);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.vct-dot.activo {
    background: var(--vct-gold);
    box-shadow: 0 0 8px rgba(251,191,36,0.85);
    transform: scale(1.25);
}
.vct-dot.completado {
    background: var(--vct-cyan);
    box-shadow: 0 0 6px rgba(0,229,255,0.6);
}

.vct-btn {
    border: none;
    padding: 9px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s, color 0.16s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vct-btn-primario {
    background: linear-gradient(135deg, var(--vct-gold) 0%, var(--vct-gold-2) 100%);
    color: #1a1206;
    box-shadow: 0 4px 14px rgba(251,191,36,0.45), 0 0 0 1px rgba(255,255,255,0.15) inset;
}
.vct-btn-primario:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(251,191,36,0.65), 0 0 0 1px rgba(255,255,255,0.2) inset;
}
.vct-btn-secundario {
    background: rgba(255,255,255,0.06);
    color: var(--vct-muted);
    border: 1px solid rgba(255,255,255,0.14);
}
.vct-btn-secundario:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ─── PASO SIN TARGET (bienvenida / final) ───────────────────────── */
/* Píldora flotante abajo-centro — no oscurece nada, sólo da contexto
   antes de que aparezca la primera flecha o tras completar el tour. */
.vct-card.vct-centrado {
    position: fixed;
    bottom: 24px;
    left: 50%;
    top: auto;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 32px));
    text-align: left;
    padding: 14px 16px 12px;
    animation: vct-card-slide-up 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes vct-card-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(18px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.vct-card.vct-centrado .vct-card-header {
    flex-direction: row;
    gap: 8px;
    margin-bottom: 6px;
}
.vct-card.vct-centrado .vct-card-cerrar {
    margin-left: auto;
}
.vct-emoji-grande {
    font-size: 1.6em;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(251,191,36,0.6));
    animation: vct-emoji-float 3s ease-in-out infinite;
}
@keyframes vct-emoji-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
.vct-card.vct-centrado .vct-card-titulo {
    font-size: 1em;
    text-align: left;
}
.vct-card.vct-centrado .vct-card-body {
    font-size: 0.86em;
    margin: 2px 0 8px;
    text-align: left;
}
.vct-card.vct-centrado .vct-card-footer {
    flex-direction: row;
    gap: 8px;
    margin-top: 6px;
}
.vct-card.vct-centrado .vct-card-footer .vct-btn { padding: 8px 14px; font-size: 0.82em; }
.vct-card.vct-centrado .vct-progress-dots { margin: 0; }

@media (min-width: 769px) {
    .vct-card.vct-centrado {
        bottom: 32px;
        left: auto;
        right: 24px;
        transform: none;
        animation: vct-card-slide-up-desktop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
    }
}
@keyframes vct-card-slide-up-desktop {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Confeti suave del paso final */
.vct-confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 14px;
    pointer-events: none;
    border-radius: 2px;
    z-index: 99001;
    animation: vct-confetti-fall 2.5s linear forwards;
}
@keyframes vct-confetti-fall {
    0%   { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ─── BOTÓN FLOTANTE REABRIR ─────────────────────────────────────── */
.vct-fab {
    position: fixed;
    bottom: 88px; /* arriba de la nav móvil */
    right: 14px;
    z-index: 9800;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--vct-border);
    background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(7,12,26,0.95) 100%);
    color: var(--vct-gold);
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 4px 18px rgba(0,0,0,0.45),
        0 0 16px rgba(251,191,36,0.35),
        inset 0 1px 0 rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    font-weight: 800;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    opacity: 0.85;
}
.vct-fab:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(0,0,0,0.55), 0 0 26px rgba(251,191,36,0.6);
}
.vct-fab-tooltip {
    position: absolute;
    bottom: 50%;
    right: calc(100% + 8px);
    transform: translateY(50%);
    background: rgba(15,23,42,0.95);
    color: var(--vct-gold);
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--vct-border);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.vct-fab:hover .vct-fab-tooltip { opacity: 1; }

@media (min-width: 769px) {
    .vct-fab { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 1.3em; }
}

/* ─── RESPONSIVE MÓVIL ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .vct-card {
        width: calc(100vw - 24px);
        padding: 14px 16px 12px;
    }
    .vct-card-titulo  { font-size: 0.98em; }
    .vct-card-body    { font-size: 0.88em; }
    .vct-arrow        { width: 44px; height: 44px; }
    .vct-cursor-ripple { width: 16px; height: 16px; }
    .vct-card.vct-centrado { padding: 20px 18px 16px; }
    .vct-emoji-grande      { font-size: 2.4em; }
}

@keyframes vct-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Cuando hay un modal del sitio activo (z-index 10000+), promovemos
   card, ring y cursor por encima. El cursor SIEMPRE va arriba del card. */
.vct-overlay.vct-encima-modal .vct-card  { z-index: 10103; }
.vct-overlay.vct-encima-modal .vct-arrow { z-index: 10105; }
.vct-overlay.vct-encima-modal .vct-ring  { z-index: 10101; }

/* Paso "Tu Poder Ciudadano": ring CEÑIDO a la fila de pills (target =
   .perfil-pill-row, no el grupo) con border-radius más pill-like y
   glow contenido (≤6px de extensión) para no contaminar el label del
   siguiente grupo, que está apenas 10px más abajo en el popup. */
.vct-overlay.vct-paso-perfil .vct-ring {
    border-radius: 12px;
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.14),
        0 0 4px 1px rgba(251, 191, 36, 0.22),
        inset 0 0 4px rgba(255, 215, 0, 0.10);
    animation-name: vct-ring-pulse-suave;
    animation-duration: 3.5s;
}
@keyframes vct-ring-pulse-suave {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(251, 191, 36, 0.14),
            0 0 4px 1px rgba(251, 191, 36, 0.22),
            inset 0 0 4px rgba(255, 215, 0, 0.10);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(251, 191, 36, 0.20),
            0 0 7px 2px rgba(251, 191, 36, 0.32),
            inset 0 0 7px rgba(255, 215, 0, 0.14);
    }
}

/* Paso "Tu Poder Ciudadano" en MÓVIL: el popup-perfil ahora tiene 6
   pills generacionales que ocupan más alto. Comprimimos el card del
   tutorial para que no se trague el botón "Subir mi Poder al 100%"
   cuando se ubica al borde inferior, y para que se vea ligero/elegante
   en pantallas chicas. */
@media (max-width: 768px) {
    .vct-overlay.vct-paso-perfil .vct-card {
        width: min(280px, calc(100vw - 28px));
        padding: 9px 12px 8px;
        border-radius: 14px;
    }
    .vct-overlay.vct-paso-perfil .vct-card-header { margin-bottom: 4px; }
    .vct-overlay.vct-paso-perfil .vct-card-titulo { font-size: 0.92em; }
    .vct-overlay.vct-paso-perfil .vct-card-body   { font-size: 0.82em; line-height: 1.32; }
    .vct-overlay.vct-paso-perfil .vct-card-footer { margin-top: 6px; gap: 6px; }
    .vct-overlay.vct-paso-perfil .vct-btn         { padding: 5px 10px; font-size: 0.78em; }
    .vct-overlay.vct-paso-perfil .vct-progress-dots .vct-dot { width: 5px; height: 5px; }
}

/* Fallback cuando el target del paso no tiene layout real (display:none
   o tamaño 0): el card flota abajo-derecha sin cursor ni ring, esperando
   a que el target aparezca. */
.vct-card.vct-flotante {
    bottom: 24px;
    left: 50%;
    top: auto;
    right: auto;
    transform: translateX(-50%);
}
@media (min-width: 769px) {
    .vct-card.vct-flotante {
        bottom: 32px;
        left: auto;
        right: 24px;
        transform: none;
    }
}
