/* ============================================================================
   AppeneriX Interactive Help  —  apx-help.css
   Shared, dependency-free styling for the guided tour + help center.
   Everything is namespaced with .apxh- to avoid collisions with host apps
   (DevExtreme, EasyUI, Kendo, DesignHub, ControlPanel).
   Accent is themed per-area via the --apxh-accent custom property.
   ============================================================================ */

:root {
  --apxh-accent: #0f6bdc;
  --apxh-accent-fg: #ffffff;
  --apxh-ink: #16202e;
  --apxh-muted: #5b6b7f;
  --apxh-line: #e4e9f1;
  --apxh-bg: #ffffff;
  --apxh-radius: 14px;
  --apxh-shadow: 0 18px 50px rgba(15, 30, 55, .28);
  --apxh-z: 2147483000;
}

/* ---- Floating launcher ---------------------------------------------------- */
.apxh-launcher {
  position: fixed;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--apxh-accent);
  color: var(--apxh-accent-fg);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(15, 30, 55, .32);
  z-index: var(--apxh-z);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.apxh-launcher:hover { transform: translateY(-2px) scale(1.04); }
.apxh-launcher:active { transform: scale(.96); }
.apxh-launcher.apxh-br { right: 22px; }
.apxh-launcher.apxh-bl { left: 22px; }
.apxh-launcher.apxh-pulse { animation: apxh-pulse 2.2s ease-in-out 3; }
@keyframes apxh-pulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(15, 30, 55, .32); }
  50% { box-shadow: 0 0 0 10px rgba(15, 107, 220, .18), 0 10px 26px rgba(15, 30, 55, .32); }
}

/* ---- Inline launcher (mounted into a host header bar) --------------------- */
.apxh-launcher-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;            /* inherits the header's foreground color */
  cursor: pointer;
  padding: 0 10px;
  border-radius: 8px;
  line-height: 1;
  z-index: var(--apxh-z);
}
.apxh-launcher-inline svg { width: 20px; height: 20px; display: block; }
.apxh-launcher-inline:hover { background: rgba(127, 127, 127, .16); }
.apxh-launcher-inline.apxh-pulse { animation: apxh-pulse-inline 2.2s ease-in-out 3; }
@keyframes apxh-pulse-inline {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px rgba(127, 127, 127, .2); }
}

/* ---- Launcher menu -------------------------------------------------------- */
.apxh-menu {
  position: fixed;
  bottom: 84px;
  width: 248px;
  background: var(--apxh-bg);
  border: 1px solid var(--apxh-line);
  border-radius: var(--apxh-radius);
  box-shadow: var(--apxh-shadow);
  z-index: var(--apxh-z);
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  animation: apxh-pop .14s ease;
}
.apxh-menu.apxh-br { right: 22px; }
.apxh-menu.apxh-bl { left: 22px; }
.apxh-menu.apxh-anchored { bottom: auto; } /* top/left set in JS, anchored below an inline launcher */
@keyframes apxh-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.apxh-menu-head {
  padding: 14px 16px 10px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--apxh-muted);
  border-bottom: 1px solid var(--apxh-line);
}
.apxh-menu-head strong { display: block; color: var(--apxh-ink); font-size: 14px; letter-spacing: 0; text-transform: none; margin-top: 2px; }
.apxh-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: var(--apxh-ink);
  transition: background .12s ease;
}
.apxh-menu-item:hover { background: rgba(15, 107, 220, .07); }
.apxh-menu-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--apxh-accent); }
.apxh-menu-item small { display: block; color: var(--apxh-muted); font-size: 12px; margin-top: 1px; }

/* ---- Tour overlay --------------------------------------------------------- */
.apxh-block {
  position: fixed;
  inset: 0;
  z-index: var(--apxh-z);
  cursor: default;
  background: transparent;
  transition: background .2s ease;
}
.apxh-block.apxh-dim { background: rgba(11, 22, 40, .62); }
.apxh-spot {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(11, 22, 40, .62);
  pointer-events: none;
  z-index: calc(var(--apxh-z) + 1);
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  outline: 2px solid var(--apxh-accent);
  outline-offset: 2px;
}
.apxh-pop {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--apxh-bg);
  border-radius: var(--apxh-radius);
  box-shadow: var(--apxh-shadow);
  z-index: calc(var(--apxh-z) + 2);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  transition: top .25s cubic-bezier(.4, 0, .2, 1), left .25s cubic-bezier(.4, 0, .2, 1);
}
.apxh-pop-bar { height: 4px; background: var(--apxh-accent); }
.apxh-pop-body { padding: 18px 18px 14px; }
.apxh-pop-kicker {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--apxh-accent); font-weight: 700; margin-bottom: 6px;
}
.apxh-pop-title { font-size: 17px; font-weight: 700; color: var(--apxh-ink); margin: 0 0 8px; line-height: 1.3; }
.apxh-pop-text { font-size: 13.5px; line-height: 1.55; color: var(--apxh-muted); margin: 0; }
.apxh-pop-text strong { color: var(--apxh-ink); }
.apxh-pop-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--apxh-line); gap: 10px;
}
.apxh-dots { display: flex; gap: 6px; }
.apxh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--apxh-line); transition: background .2s; }
.apxh-dot.apxh-on { background: var(--apxh-accent); }
.apxh-actions { display: flex; gap: 8px; align-items: center; }
.apxh-btn {
  border: 1px solid var(--apxh-line); background: var(--apxh-bg); color: var(--apxh-ink);
  padding: 7px 14px; border-radius: 9px; font-size: 13px; cursor: pointer; font-weight: 600;
  transition: all .12s ease; font-family: inherit;
}
.apxh-btn:hover { border-color: var(--apxh-accent); }
.apxh-btn-primary { background: var(--apxh-accent); border-color: var(--apxh-accent); color: var(--apxh-accent-fg); }
.apxh-btn-primary:hover { filter: brightness(1.06); }
.apxh-btn-ghost { border-color: transparent; color: var(--apxh-muted); padding-left: 6px; padding-right: 6px; }
.apxh-btn-ghost:hover { color: var(--apxh-ink); border-color: transparent; }
.apxh-pop-close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border: none; background: none; cursor: pointer; color: var(--apxh-muted);
  font-size: 20px; line-height: 1; border-radius: 7px;
}
.apxh-pop-close:hover { background: rgba(0, 0, 0, .06); color: var(--apxh-ink); }
.apxh-pop.apxh-centered { left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ---- Help center panel ---------------------------------------------------- */
.apxh-hc-backdrop {
  position: fixed; inset: 0; background: rgba(11, 22, 40, .42);
  z-index: var(--apxh-z); animation: apxh-fade .15s ease;
}
@keyframes apxh-fade { from { opacity: 0; } to { opacity: 1; } }
.apxh-hc {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 760px; max-width: 100vw;
  background: var(--apxh-bg);
  z-index: calc(var(--apxh-z) + 1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(15, 30, 55, .3);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  animation: apxh-slide .22s cubic-bezier(.4, 0, .2, 1);
}
@keyframes apxh-slide { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.apxh-hc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--apxh-line);
}
.apxh-hc-head .apxh-hc-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: var(--apxh-accent); color: var(--apxh-accent-fg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.apxh-hc-head h2 { margin: 0; font-size: 16px; color: var(--apxh-ink); }
.apxh-hc-head p { margin: 1px 0 0; font-size: 12px; color: var(--apxh-muted); }
.apxh-hc-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--apxh-muted); width: 36px; height: 36px; border-radius: 8px;
}
.apxh-hc-close:hover { background: rgba(0, 0, 0, .06); color: var(--apxh-ink); }
.apxh-hc-search { padding: 14px 20px 6px; }
.apxh-hc-search input {
  width: 100%; box-sizing: border-box; padding: 11px 14px;
  border: 1px solid var(--apxh-line); border-radius: 10px; font-size: 14px; outline: none;
  font-family: inherit; color: var(--apxh-ink);
}
.apxh-hc-search input:focus { border-color: var(--apxh-accent); box-shadow: 0 0 0 3px rgba(15, 107, 220, .12); }
.apxh-hc-cols { display: flex; flex: 1; min-height: 0; }
.apxh-hc-nav {
  width: 240px; flex: 0 0 240px; border-right: 1px solid var(--apxh-line);
  overflow-y: auto; padding: 10px 0;
}
.apxh-hc-group { padding: 12px 20px 4px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--apxh-muted); }
.apxh-hc-link {
  display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: 9px 20px; font-size: 13.5px; color: var(--apxh-ink); border-left: 3px solid transparent;
  font-family: inherit;
}
.apxh-hc-link:hover { background: rgba(15, 107, 220, .06); }
.apxh-hc-link.apxh-active { background: rgba(15, 107, 220, .1); border-left-color: var(--apxh-accent); font-weight: 600; }
.apxh-hc-link.apxh-hidden { display: none; }
.apxh-hc-body { flex: 1; overflow-y: auto; padding: 28px 36px 48px; min-width: 0; }
.apxh-hc-body h1 { font-size: 22px; color: var(--apxh-ink); margin: 0 0 4px; }
.apxh-hc-body h3 { font-size: 15px; color: var(--apxh-ink); margin: 22px 0 8px; }
.apxh-hc-body p { font-size: 14px; line-height: 1.65; color: #36465a; margin: 0 0 12px; }
.apxh-hc-body ul, .apxh-hc-body ol { margin: 0 0 14px; padding-left: 22px; }
.apxh-hc-body li { font-size: 14px; line-height: 1.6; color: #36465a; margin-bottom: 6px; }
.apxh-hc-body code {
  background: #f1f4f9; border: 1px solid var(--apxh-line); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; color: #2a3a52;
}
.apxh-hc-body .apxh-tip {
  background: rgba(15, 107, 220, .07); border-left: 3px solid var(--apxh-accent);
  padding: 12px 16px; border-radius: 0 9px 9px 0; margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; color: #36465a;
}
.apxh-hc-empty { padding: 40px; text-align: center; color: var(--apxh-muted); font-size: 14px; }
.apxh-hc-tourcta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  background: var(--apxh-accent); color: var(--apxh-accent-fg); border: none; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; font-family: inherit;
}
.apxh-hc-tourcta:hover { filter: brightness(1.06); }

@media (max-width: 720px) {
  .apxh-hc-cols { flex-direction: column; }
  .apxh-hc-nav { width: auto; flex: 0 0 auto; max-height: 140px; border-right: none; border-bottom: 1px solid var(--apxh-line); display: flex; flex-wrap: wrap; }
  .apxh-hc-group { width: 100%; }
}
