/* ============================================================
   npc.css — Modal de Cliente: Diagnóstico Encadenado
   Growth City Serious Game
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
#npc-v2-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    transition: background .25s ease;
}
#npc-v2-overlay.visible {
    background: rgba(0,0,0,.74);
    pointer-events: all;
}

/* ── Card ─────────────────────────────────────────────────── */
#npc-v2-card {
    background: #080f14;
    border: 2px solid #0d2818;
    border-radius: 18px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    transform: scale(.88) translateY(20px);
    opacity: 0;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(0,255,120,.06);
}
#npc-v2-card.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Barra de fases (4 pasos) ─────────────────────────────── */
#npc-phase-bar {
    display: flex;
    background: rgba(0,0,0,.35);
    border-bottom: 1px solid rgba(255,255,255,.05);
    flex-shrink: 0;
    transition: opacity .3s;
}
.npc-phase-step {
    flex: 1;
    padding: 9px 4px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.22);
    letter-spacing: .4px;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: color .3s, border-color .3s, background .3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.npc-phase-step.active {
    color: #00FF88;
    border-bottom-color: #00FF88;
    background: rgba(0,255,136,.06);
}
.npc-phase-step.done {
    color: rgba(0,255,136,.42);
    border-bottom-color: rgba(0,255,136,.25);
}

/* ── Header del NPC ──────────────────────────────────────── */
#npc-v2-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,.055);
    flex-shrink: 0;
}
#npc-v2-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a2818, #061410);
    border: 2px solid #00FF88;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    box-shadow: 0 0 12px rgba(0,255,136,.2);
}
#npc-v2-name {
    font-size: 16px; font-weight: 700; color: #00FF88;
    margin: 0 0 2px;
    line-height: 1.2;
}
#npc-v2-role {
    font-size: 12px; color: rgba(0,255,136,.45);
    line-height: 1.3;
}
.npc-v2-close {
    margin-left: auto;
    background: none; border: none;
    color: rgba(255,255,255,.28); font-size: 20px;
    cursor: pointer; padding: 4px 6px; line-height: 1;
    transition: color .2s;
    flex-shrink: 0;
}
.npc-v2-close:hover { color: rgba(255,255,255,.65); }

/* ── Cuerpo scrollable ───────────────────────────────────── */
#npc-v2-body {
    padding: 18px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 120px;
    transition: opacity .16s ease, transform .16s ease;
}
#npc-v2-body::-webkit-scrollbar { width: 3px; }
#npc-v2-body::-webkit-scrollbar-thumb {
    background: rgba(0,255,136,.2); border-radius: 3px;
}

/* ── Tag de zona ─────────────────────────────────────────── */
.npc-zone-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255,255,255,.3);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 12px;
}

/* ── Etiqueta de fase ────────────────────────────────────── */
.npc-phase-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0,255,136,.5);
    margin-bottom: 10px;
}

/* ── Burbuja de diálogo ──────────────────────────────────── */
.npc-speech-bubble {
    background: rgba(0,255,136,.04);
    border: 1px solid rgba(0,255,136,.14);
    border-left: 3px solid #00FF88;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    color: #c0dcc8;
    line-height: 1.75;
    font-style: italic;
    margin-bottom: 12px;
}

/* Prompt al pie de la fase 1 */
.npc-phase1-prompt {
    font-size: 11px;
    color: rgba(255,255,255,.28);
    text-align: center;
    padding: 6px 0 2px;
    font-style: italic;
}

/* ── Caja de pista / diagnóstico ─────────────────────────── */
.npc-hint-box {
    background: rgba(255,215,0,.04);
    border: 1px solid rgba(255,215,0,.18);
    border-radius: 12px;
    padding: 15px 16px;
    margin-bottom: 12px;
}
.npc-diagnosis-box {
    background: rgba(56,189,248,.04);
    border-color: rgba(56,189,248,.2);
}
.npc-hint-concept {
    font-size: 13px;
    color: #d8c880;
    line-height: 1.72;
}
.npc-diagnosis-box .npc-hint-concept {
    color: #a8d0e8;
}
.npc-hint-example {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    border-top: 1px solid rgba(255,215,0,.1);
    padding-top: 10px;
    margin-top: 10px;
    line-height: 1.6;
}
.npc-diagnosis-box .npc-hint-example {
    border-top-color: rgba(56,189,248,.12);
    color: rgba(168,208,232,.55);
}
.npc-hint-question {
    font-size: 12px;
    font-weight: 700;
    color: #FFD700;
    margin-top: 12px;
    line-height: 1.5;
}

/* ── Opciones de diagnóstico (Fase 2) ────────────────────── */
.npc-diagnosis-choices {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
}
.npc-diag-btn {
    background: rgba(56,189,248,.06);
    border: 1px solid rgba(56,189,248,.2);
    border-radius: 10px;
    padding: 11px 14px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #a8d0e8;
    text-align: left;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .12s;
    line-height: 1.45;
}
.npc-diag-btn:hover:not(:disabled) {
    background: rgba(56,189,248,.14);
    border-color: rgba(56,189,248,.45);
    transform: translateX(3px);
}
.npc-diag-btn:active:not(:disabled) { transform: scale(.97); }
.npc-diag-btn.npc-diag-correct {
    background: rgba(34,197,94,.14);
    border-color: rgba(34,197,94,.5);
    color: #4ade80;
}
.npc-diag-btn.npc-diag-wrong {
    background: rgba(248,113,113,.12);
    border-color: rgba(248,113,113,.4);
    color: #f87171;
}

/* ── Feedback de diagnóstico ─────────────────────────────── */
.npc-diag-feedback {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 10px;
    padding: 11px 13px;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.6;
}
.npc-diag-feedback.hidden { display: none; }
.npc-diag-feedback.correct {
    background: rgba(34,197,94,.07);
    border: 1px solid rgba(34,197,94,.25);
    color: #86efac;
}
.npc-diag-feedback.wrong {
    background: rgba(248,113,113,.07);
    border: 1px solid rgba(248,113,113,.22);
    color: #fca5a5;
}
.npc-diag-fb-icon { font-size: 17px; flex-shrink: 0; line-height: 1.4; }
.npc-diag-fb-text { flex: 1; }

/* ── Aviso de artefacto no recolectado ───────────────────── */
.npc-missing-artifact-warn {
    font-size: 11px;
    color: rgba(251,191,36,.6);
    background: rgba(251,191,36,.05);
    border: 1px solid rgba(251,191,36,.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 12px;
    line-height: 1.5;
}

/* ── Grid de artefactos (Fase 4) ─────────────────────────── */
.npc-select-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0,255,136,.45);
    margin-bottom: 10px;
}
#npc-v2-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}
.npc-v2-choice {
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
    position: relative;
}
.npc-v2-choice:hover:not(:disabled) {
    background: color-mix(in srgb, var(--choice-color, #00ff88) 12%, transparent);
    border-color: color-mix(in srgb, var(--choice-color, #00ff88) 55%, transparent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.npc-v2-choice:active:not(:disabled) { transform: scale(.96); }
.npc-v2-choice:disabled { opacity: .42; pointer-events: none; }

/* Artefacto no recolectado */
.npc-choice-unowned {
    opacity: .5;
    background: rgba(255,255,255,.02);
    border-style: dashed;
    border-color: rgba(255,255,255,.1);
}
.npc-choice-unowned:hover:not(:disabled) {
    opacity: .72;
}
.npc-choice-lock {
    position: absolute;
    top: 5px; right: 6px;
    font-size: 11px;
    opacity: .6;
}

.npc-v2-choice-emoji {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}
.npc-v2-choice-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.npc-v2-choice-name {
    font-size: 12px;
    font-weight: 700;
    color: #e8f4ec;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.npc-v2-choice-concept {
    font-size: 10px;
    color: rgba(255,255,255,.35);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón de drive revelado (Shop) */
.npc-v2-choice.revealed {
    border-color: #FFD700 !important;
    background: rgba(255,215,0,.12) !important;
    animation: npc-reveal-pulse 1.2s ease infinite;
}
@keyframes npc-reveal-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,215,0,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(255,215,0,0); }
}

/* ── Sin artefactos ──────────────────────────────────────── */
.npc-no-drives {
    text-align: center;
    color: #00FF88;
    font-size: 13px;
    padding: 20px 0;
    line-height: 1.65;
}

/* ── Pantalla de bloqueo ─────────────────────────────────── */
.npc-blocked-box {
    background: rgba(255,215,0,.06);
    border: 1px solid rgba(255,215,0,.2);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: rgba(200,184,112,.85);
    line-height: 1.7;
    margin-bottom: 14px;
    text-align: left;
}
.npc-blocked-progress {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(0,255,136,.06);
    border: 1px solid rgba(0,255,136,.18);
    border-radius: 24px;
    padding: 7px 18px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(0,255,136,.75);
    margin-bottom: 12px;
}
.npc-blocked-hint {
    font-size: 11px;
    color: rgba(255,255,255,.28);
    font-style: italic;
    margin-top: 4px;
}

/* ── Footer con botones ──────────────────────────────────── */
#npc-v2-footer {
    padding: 12px 18px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,.05);
    flex-shrink: 0;
    align-items: center;
}
.npc-v2-btn {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    border: none;
    border-radius: 9px;
    padding: 10px 18px;
    cursor: pointer;
    transition: transform .13s, filter .13s;
    letter-spacing: .3px;
    min-height: 40px;
}
.npc-v2-btn:hover  { filter: brightness(1.14); }
.npc-v2-btn:active { transform: scale(.95); }
.npc-v2-btn-primary {
    background: linear-gradient(135deg, #1a6b3a, #00cc66);
    color: #fff;
    flex: 1;
}
.npc-v2-btn-secondary {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.45);
    border: 1px solid rgba(255,255,255,.1);
}

/* ── Animación de transición del cuerpo ──────────────────── */
#npc-v2-body {
    transition: opacity .16s ease, transform .16s ease;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
    #npc-v2-card     { border-radius: 14px; }
    #npc-v2-body     { padding: 14px 14px; }
    #npc-v2-footer   { padding: 10px 14px 14px; }
    #npc-v2-choices  { grid-template-columns: 1fr; }
    .npc-phase-step  { font-size: 9px; padding: 8px 2px; }
    .npc-v2-btn      { font-size: 12px; padding: 9px 14px; }
    .npc-speech-bubble { font-size: 13px; }
}
@media (max-width: 380px) {
    .npc-phase-step  {
        font-size: 8px;
        letter-spacing: 0;
    }
}

/* ── Ajuste al design system ─────────────────────────────── */
#npc-v2-card, .npc-v2-btn { font-family: var(--font, 'Inter', sans-serif); }
