/* ============================================================
 * VIPs Tutorial drawer + mockups
 * Uses portal tokens (variables.css). Light mode safe via vars.
 * ============================================================ */

/* Header trigger button (lives in /#vips and /#vips-tracker headers) */
.vips-tut-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--hair-strong);
  color: var(--t2);
  padding: 0 12px;
  height: 32px;
  font-size: 11px;
  font-family: 'Geist', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--r-s);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.vips-tut-trigger:hover {
  background: var(--gg);
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.vips-tut-trigger .vips-tut-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--bg);
  font-size: 10px;
  font-weight: 800;
  font-family: 'Noto Sans Mono', monospace;
}
.vips-tut-trigger.has-new::after {
  content: '';
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  background: var(--color-brand);
  border-radius: 50%;
  border: 2px solid var(--bg);
  animation: vt-pulse-new 1.6s ease-in-out infinite;
}
@keyframes vt-pulse-new {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.7; }
}

/* ============================================================
 * Drawer chrome
 * ============================================================ */
.vips-tut-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.vips-tut-backdrop.is-open { opacity: 1; pointer-events: auto; }

.vips-tut-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 480px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-elev);
  border-left: 1px solid var(--hair-strong);
  box-shadow: -16px 0 60px rgba(0,0,0,0.5);
  z-index: 9001;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.vips-tut-drawer.is-open { transform: translateX(0); }

/* Header inside drawer */
.vips-tut-head {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.vips-tut-head-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vips-tut-kicker {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--color-brand);
  text-transform: uppercase;
  font-weight: 500;
}
.vips-tut-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.vips-tut-close {
  background: transparent;
  border: 1px solid var(--hair-strong);
  color: var(--t3);
  width: 32px; height: 32px;
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--r-s);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vips-tut-close:hover { background: var(--s2); color: var(--t1); }

/* Section navigator (scrollspy index, only on multi-section views) */
.vips-tut-nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--hair);
  background: var(--bg-deep);
  overflow-x: auto;
  scrollbar-width: thin;
  flex-shrink: 0;
}
.vips-tut-nav::-webkit-scrollbar { height: 4px; }
.vips-tut-nav::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 2px; }
.vips-tut-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--t3);
  padding: 6px 10px;
  font-size: 11px;
  font-family: 'Noto Sans Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: var(--r-s);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.vips-tut-nav-btn:hover { color: var(--t1); background: var(--s2); }
.vips-tut-nav-btn.is-active {
  color: var(--color-brand);
  background: var(--gg);
  border-color: var(--color-brand);
}

/* Body scroll area */
.vips-tut-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
}
.vips-tut-body::-webkit-scrollbar { width: 6px; }
.vips-tut-body::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 3px; }

/* Section heading inside body */
.vips-tut-section {
  padding: 24px 24px 8px;
  border-bottom: 1px solid var(--hair);
  scroll-margin-top: 12px;
}
.vips-tut-section:last-of-type { border-bottom: 0; }
.vips-tut-section-head {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--t4);
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 12px;
}

/* Step block */
.vips-tut-step {
  padding: 0 0 22px;
}
.vips-tut-step-num {
  display: inline-block;
  font-family: 'Noto Sans Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--t4);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.vips-tut-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  margin: 0 0 12px;
  letter-spacing: -0.2px;
  line-height: 1.35;
}
.vips-tut-step-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--t2);
  margin: 12px 0 0;
}
.vips-tut-step-text strong { color: var(--t1); font-weight: 600; }
.vips-tut-step-text code {
  background: var(--gg);
  color: var(--color-brand);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Noto Sans Mono', monospace;
  font-size: 11.5px;
}

/* Mockup canvas */
.vips-tut-mock {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--hair);
  border-radius: var(--r-s);
  padding: 16px;
  margin: 4px 0;
  overflow: hidden;
}
.vips-tut-mock.no-pad { padding: 0; }

/* Pulsing target highlight (for buttons, chips, rows) */
.vips-tut-mock .is-target {
  background: var(--gg);
  border-color: var(--color-brand);
  color: var(--color-brand);
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(234,143,215,0.18);
  animation: vt-pulse 1.8s ease-in-out infinite;
}
@keyframes vt-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(234,143,215,0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(234,143,215,0.28); }
}

/* Pointing arrow */
.vips-tut-arrow {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Noto Sans Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--color-brand);
  text-transform: uppercase;
  font-weight: 700;
  animation: vt-bob 1.4s ease-in-out infinite;
  pointer-events: none;
}
.vips-tut-arrow svg { display: block; }
@keyframes vt-bob {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-4px); }
}
.vips-tut-arrow.bob-down { animation-name: vt-bob-down; }
@keyframes vt-bob-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ---------- Mock primitives (used across multiple sections) ---------- */
.vt-mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vt-mock-btn {
  background: transparent;
  border: 1px solid var(--hair-strong);
  color: var(--t2);
  padding: 7px 12px;
  font-size: 11px;
  font-family: 'Geist', 'Inter', sans-serif;
  font-weight: 500;
  border-radius: var(--r-s);
  white-space: nowrap;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vt-mock-btn.full { opacity: 1; }
.vt-mock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  font-size: 10px;
  font-family: 'Noto Sans Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t2);
  background: var(--bg-elev);
  opacity: 0.65;
}
.vt-mock-pill.full { opacity: 1; }
.vt-mock-pill .dot { width: 6px; height: 6px; border-radius: 50%; }

/* Mock form */
.vt-mock-form {
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: var(--r-s);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vt-mock-field { display: flex; flex-direction: column; }
.vt-mock-label {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--t4);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.vt-mock-input {
  background: var(--bg);
  border: 1px solid var(--hair);
  color: var(--t2);
  padding: 7px 10px;
  font-size: 11.5px;
  font-family: 'Noto Sans Mono', monospace;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
}
.vt-mock-input.is-typing { border-color: var(--color-brand); color: var(--color-brand); }
.vt-mock-input .vt-cursor {
  display: inline-block;
  width: 1px; height: 12px;
  background: var(--color-brand);
  animation: vt-blink 1s steps(2) infinite;
}
@keyframes vt-blink { 50% { opacity: 0; } }

.vt-mock-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.vt-mock-save {
  background: var(--color-brand);
  color: var(--bg);
  border: none;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  font-family: 'Geist', 'Inter', sans-serif;
}

/* Mock table row */
.vt-mock-trow {
  display: grid;
  grid-template-columns: 24px 1fr 70px 90px;
  gap: 0;
  font-size: 11px;
  font-family: 'Noto Sans Mono', monospace;
  border-bottom: 1px solid var(--hair);
}
.vt-mock-trow > div { padding: 10px 8px; }
.vt-mock-trow .num { text-align: right; color: var(--t3); }
.vt-mock-trow.green-bg { background: var(--gbg); }
.vt-mock-trow.red-bg   { background: var(--rbg); }
.vt-mock-trow.yellow-bg { background: rgba(251,191,36,0.06); }
.vt-mock-trow .vt-trow-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.vt-mock-trow .vt-trow-name { color: var(--t1); }
.vt-mock-trow .vt-trow-tag { font-weight: 700; text-align: right; }

/* Mock KPI card */
.vt-mock-kpi {
  background: var(--bg-elev);
  border: 1px solid var(--hair);
  border-radius: var(--r-s);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vt-mock-kpi-label {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--t4);
  text-transform: uppercase;
}
.vt-mock-kpi-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -1.2px;
  font-family: 'Geist', 'Inter', sans-serif;
}

/* Mock semaforo */
.vt-mock-sem {
  display: flex;
  gap: 10px;
  justify-content: space-around;
}
.vt-mock-sem-cell {
  text-align: center;
  flex: 1;
}
.vt-mock-sem-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  margin: 0 auto 6px;
  border: 2px solid;
}
.vt-mock-sem-label {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.vt-mock-sem-sub {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
  font-family: 'Noto Sans Mono', monospace;
}

/* Tip callout */
.vips-tut-tip {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(234,143,215,0.06);
  border-left: 2px solid var(--color-brand);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
}
.vips-tut-tip strong { color: var(--color-brand); }
.vips-tut-tip.warn {
  background: rgba(251,191,36,0.06);
  border-left-color: #FBBF24;
}
.vips-tut-tip.warn strong { color: #FBBF24; }

/* End marker */
.vips-tut-end {
  padding: 24px;
  color: var(--t4);
  font-size: 11px;
  font-family: 'Noto Sans Mono', monospace;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* Mobile */
@media (max-width: 640px) {
  .vips-tut-drawer { width: 100vw; max-width: 100vw; }
  .vips-tut-trigger span:not(.vips-tut-q) { display: none; }
  .vips-tut-trigger { padding: 0 8px; }
}
