/* JustZix — onboarding / samouczek (coach-marks). Wszystkie klasy prefiks jz-ob-.
   3 warianty wizualne na .jz-ob-root: jz-ob-v-spotlight / jz-ob-v-glow / jz-ob-v-card. */

.jz-ob-root {
  position: fixed; inset: 0; z-index: 2147483600;
  pointer-events: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.jz-ob-root[hidden] { display: none; }

/* --- Podświetlenie celu --------------------------------------------------- */
/* Spotlight: ciemne tło z "dziurą" zrobioną gigantycznym box-shadow. */
.jz-ob-spot {
  position: fixed; border-radius: 7px; pointer-events: none;
  transition: top .28s cubic-bezier(.4,0,.2,1), left .28s cubic-bezier(.4,0,.2,1),
              width .28s cubic-bezier(.4,0,.2,1), height .28s cubic-bezier(.4,0,.2,1);
}
.jz-ob-v-spotlight .jz-ob-spot { box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.66); }

/* Pierścień wokół celu. */
.jz-ob-ring {
  position: fixed; border-radius: 8px; pointer-events: none;
  transition: top .28s cubic-bezier(.4,0,.2,1), left .28s cubic-bezier(.4,0,.2,1),
              width .28s cubic-bezier(.4,0,.2,1), height .28s cubic-bezier(.4,0,.2,1);
}
.jz-ob-v-spotlight .jz-ob-ring { box-shadow: 0 0 0 2px #10B981, 0 0 0 5px rgba(16,185,129,.35); }
.jz-ob-v-glow .jz-ob-ring {
  box-shadow: 0 0 0 3px #10B981, 0 0 0 7px rgba(16,185,129,.30), 0 0 22px 5px rgba(16,185,129,.6);
  animation: jz-ob-pulse 1.7s ease-in-out infinite;
}
.jz-ob-v-card .jz-ob-ring {
  box-shadow: 0 0 0 2px #6366F1;
  outline: 2px dashed rgba(99,102,241,.55); outline-offset: 4px;
}
@keyframes jz-ob-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #10B981, 0 0 0 7px rgba(16,185,129,.30), 0 0 16px 3px rgba(16,185,129,.45); }
  50%      { box-shadow: 0 0 0 3px #10B981, 0 0 0 9px rgba(16,185,129,.18), 0 0 30px 9px rgba(16,185,129,.72); }
}

/* --- Dymek ---------------------------------------------------------------- */
.jz-ob-bubble {
  position: fixed; width: 340px; max-width: calc(100vw - 32px);
  background: #FFFFFF; color: #1F2937;
  border-radius: 12px; padding: 16px 18px 14px;
  box-shadow: 0 14px 48px rgba(0,0,0,.32); pointer-events: auto;
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
}
.jz-ob-bubble.jz-ob-in { opacity: 1; transform: translateY(0); }
.jz-ob-v-card .jz-ob-bubble { width: 380px; border-top: 4px solid #6366F1; }

.jz-ob-arrow {
  position: absolute; width: 14px; height: 14px; background: inherit;
  transform: rotate(45deg); box-shadow: 0 14px 48px rgba(0,0,0,.32);
}

.jz-ob-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 7px; }
.jz-ob-badge {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: #10B981; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.jz-ob-v-card .jz-ob-badge { background: #6366F1; }
.jz-ob-title { flex: 1 1 auto; font-size: 14px; font-weight: 700; line-height: 1.35; padding-top: 2px; }
.jz-ob-x {
  flex: 0 0 auto; width: 22px; height: 22px; border: none; background: transparent;
  color: #9CA3AF; font-size: 18px; line-height: 1; cursor: pointer; border-radius: 5px;
}
.jz-ob-x:hover { background: rgba(0,0,0,.07); color: #1F2937; }

.jz-ob-body { font-size: 12.5px; line-height: 1.6; color: #374151; }
.jz-ob-body code {
  background: #F1F5F9; color: #0F766E; padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
}
.jz-ob-hint {
  margin-top: 9px; font-size: 11px; color: #10B981; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.jz-ob-v-card .jz-ob-hint { color: #6366F1; }
.jz-ob-hint svg { width: 13px; height: 13px; flex: 0 0 auto; }

/* Kopiowalny fragment kodu w dymku. */
.jz-ob-code { position: relative; margin: 11px 0 2px; }
.jz-ob-code pre {
  margin: 0; background: #0F172A; color: #93C5FD;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; line-height: 1.55;
  padding: 10px 12px; padding-right: 66px; border-radius: 8px;
  white-space: pre-wrap; word-break: break-word;
}
.jz-ob-copy {
  position: absolute; top: 7px; right: 7px; font: inherit; font-size: 10.5px; font-weight: 600;
  cursor: pointer; padding: 4px 9px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); color: #E5E7EB;
}
.jz-ob-copy:hover { background: rgba(255,255,255,.17); }
.jz-ob-copy.jz-ob-copied { background: #10B981; border-color: #10B981; color: #fff; }

.jz-ob-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; gap: 10px;
}
.jz-ob-progress { display: flex; align-items: center; gap: 8px; }
.jz-ob-progress-txt { font-size: 11px; color: #9CA3AF; white-space: nowrap; }
.jz-ob-bar { width: 64px; height: 4px; border-radius: 2px; background: #E5E7EB; overflow: hidden; }
.jz-ob-bar-fill { height: 100%; background: #10B981; border-radius: 2px; transition: width .25s ease; }
.jz-ob-v-card .jz-ob-bar-fill { background: #6366F1; }

.jz-ob-btns { display: flex; gap: 7px; }
.jz-ob-btns button {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 7px 13px; border-radius: 7px; border: 1px solid transparent;
}
.jz-ob-back { background: transparent; border-color: #D1D5DB !important; color: #6B7280; }
.jz-ob-back:hover { background: rgba(0,0,0,.04); }
.jz-ob-next { background: #10B981; color: #fff; }
.jz-ob-next:hover { background: #0E9F6E; }
.jz-ob-v-card .jz-ob-next { background: #6366F1; }
.jz-ob-v-card .jz-ob-next:hover { background: #4F46E5; }

/* --- Launcher (centrum samouczków) --------------------------------------- */
.jz-ob-launcher {
  position: fixed; inset: 0; z-index: 2147483601;
  background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', system-ui, sans-serif; padding: 24px;
}
.jz-ob-launcher[hidden] { display: none; }
.jz-ob-card {
  background: #fff; color: #1F2937; border-radius: 14px; width: 620px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 26px 28px;
}
.jz-ob-card h2 { margin: 0 0 4px; font-size: 19px; }
.jz-ob-lead { margin: 0 0 18px; font-size: 13px; color: #6B7280; line-height: 1.55; }
.jz-ob-sect-t {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #9CA3AF; margin: 18px 0 9px;
}
.jz-ob-sect-t:first-of-type { margin-top: 0; }

/* wybór wariantu */
.jz-ob-variants { display: flex; gap: 10px; }
.jz-ob-variant {
  flex: 1; cursor: pointer; border: 2px solid #E5E7EB; border-radius: 10px;
  padding: 12px 10px; text-align: center; background: #FBFBFB; transition: border-color .15s, background .15s;
}
.jz-ob-variant:hover { border-color: #CBD5E1; }
.jz-ob-variant.jz-ob-sel { border-color: #10B981; background: #ECFDF5; }
.jz-ob-variant-prev {
  height: 46px; border-radius: 7px; margin-bottom: 8px; position: relative;
  background: #1F2937; overflow: hidden;
}
.jz-ob-variant-dot {
  position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; border-radius: 5px; background: #475569;
}
.jz-ob-vp-spotlight { box-shadow: inset 0 0 0 999px rgba(0,0,0,.45); }
.jz-ob-vp-spotlight .jz-ob-variant-dot { box-shadow: 0 0 0 999px rgba(0,0,0,.5), 0 0 0 2px #10B981; }
.jz-ob-vp-glow .jz-ob-variant-dot { box-shadow: 0 0 0 3px #10B981, 0 0 14px 4px rgba(16,185,129,.7); }
.jz-ob-vp-card .jz-ob-variant-dot { box-shadow: 0 0 0 2px #6366F1; outline: 2px dashed rgba(99,102,241,.6); outline-offset: 3px; }
.jz-ob-variant-name { font-size: 12px; font-weight: 700; }
.jz-ob-variant-desc { font-size: 10.5px; color: #9CA3AF; margin-top: 2px; line-height: 1.4; }

/* lista scenariuszy */
.jz-ob-scen {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #E5E7EB; border-radius: 10px; margin-bottom: 9px;
}
.jz-ob-scen-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; background: #ECFDF5;
  color: #10B981; display: flex; align-items: center; justify-content: center;
}
.jz-ob-scen-ico svg { width: 20px; height: 20px; }
.jz-ob-scen-txt { flex: 1 1 auto; min-width: 0; }
.jz-ob-scen-name { font-size: 13px; font-weight: 700; }
.jz-ob-scen-desc { font-size: 11.5px; color: #6B7280; margin-top: 1px; line-height: 1.45; }
.jz-ob-scen-meta { font-size: 10.5px; color: #9CA3AF; margin-top: 3px; }
.jz-ob-scen button {
  flex: 0 0 auto; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; border: none; background: #10B981; color: #fff;
}
.jz-ob-scen button:hover { background: #0E9F6E; }

.jz-ob-launcher-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #EEF0F3;
}
.jz-ob-skip {
  font: inherit; font-size: 12px; cursor: pointer; background: transparent;
  border: 1px solid #D1D5DB; color: #6B7280; padding: 7px 14px; border-radius: 8px;
}
.jz-ob-skip:hover { background: rgba(0,0,0,.04); }
.jz-ob-launcher-foot label { font-size: 11.5px; color: #9CA3AF; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* --- Tryb ciemny ---------------------------------------------------------- */
body.theme-dark .jz-ob-bubble,
body.theme-dark .jz-ob-card { background: #1F2937; color: #E5E7EB; }
body.theme-dark .jz-ob-arrow { background: #1F2937; }
body.theme-dark .jz-ob-body { color: #CBD5E1; }
body.theme-dark .jz-ob-body code { background: #0F172A; color: #5EEAD4; }
body.theme-dark .jz-ob-x:hover { background: rgba(255,255,255,.1); color: #fff; }
body.theme-dark .jz-ob-bar { background: #374151; }
body.theme-dark .jz-ob-back { border-color: #4B5563 !important; color: #9CA3AF; }
body.theme-dark .jz-ob-back:hover { background: rgba(255,255,255,.06); }
body.theme-dark .jz-ob-lead,
body.theme-dark .jz-ob-scen-desc { color: #9CA3AF; }
body.theme-dark .jz-ob-variant { background: #111827; border-color: #374151; }
body.theme-dark .jz-ob-variant.jz-ob-sel { background: #064E3B; border-color: #10B981; }
body.theme-dark .jz-ob-scen { border-color: #374151; }
body.theme-dark .jz-ob-scen-ico { background: #064E3B; }
body.theme-dark .jz-ob-launcher-foot { border-color: #374151; }
body.theme-dark .jz-ob-skip { border-color: #4B5563; color: #9CA3AF; }
