/* ============================================================
   DAP - Digital Adoption Platform (in-app help layer)
   Self-contained plain CSS so it survives the Tailwind purge.
   Namespaced under #dap-* to avoid collisions with app styles.
   Transitions use !important because no-animations.css sets
   * { transition-duration: 0s !important } app-wide.
   ============================================================ */

/* --- Floating help button --- */
#dap-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #2473DA 0%, #6366F1 100%);
  box-shadow: 0 8px 20px rgba(36, 115, 218, 0.35);
  font-family: 'Poppins', Arial, sans-serif;
  transition: width 0.22s ease !important, border-radius 0.22s ease !important, padding 0.22s ease !important, box-shadow 0.22s ease !important;
}
#dap-fab:hover, #dap-fab:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(36, 115, 218, 0.42);
}
#dap-fab:hover, #dap-fab:focus-visible {
  width: auto;
  padding: 0 18px;
  border-radius: 9999px;
}
#dap-fab .dap-fab-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  margin-left: 0;
  transition: all 0.22s ease !important;
}
#dap-fab:hover .dap-fab-label, #dap-fab:focus-visible .dap-fab-label {
  max-width: 120px;
  opacity: 1;
  margin-left: 6px;
}
#dap-fab i { font-size: 20px; }
#dap-fab:focus-visible { outline: 3px solid rgba(99, 102, 241, 0.4); outline-offset: 2px; }

/* --- Help menu panel --- */
#dap-menu {
  position: fixed;
  bottom: 84px;
  right: 20px;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.18);
  z-index: 9995;
  font-family: 'Poppins', Arial, sans-serif;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.16s ease !important, transform 0.16s ease !important, visibility 0.16s ease !important;
}
#dap-menu.dap-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  display: block;
}
#dap-menu .dap-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f5f7ff 0%, #eef0ff 100%);
  border-bottom: 1px solid #e5e7eb;
}
#dap-menu .dap-menu-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: #1e293b; }
#dap-menu .dap-close {
  border: 0; background: transparent; cursor: pointer; color: #64748b;
  font-size: 15px; padding: 6px; border-radius: 8px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
#dap-menu .dap-close:hover { background: #e2e8f0; color: #0f172a; }
#dap-menu .dap-close:focus-visible { outline: 2px solid #6366F1; outline-offset: 1px; }
#dap-menu .dap-menu-body { max-height: 55vh; overflow-y: auto; padding: 10px; -webkit-overflow-scrolling: touch; }
#dap-menu .dap-menu-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  font-family: inherit;
  transition: background 0.12s ease !important;
}
#dap-menu .dap-menu-item:hover { background: #f1f5f9; }
#dap-menu .dap-menu-item:focus-visible { outline: 2px solid #6366F1; outline-offset: -1px; }
#dap-menu .dap-menu-item .dap-mi-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  color: #4338ca;
  margin-right: 10px;
  font-size: 13px;
}
#dap-menu .dap-menu-item .dap-mi-title { display: block; font-size: 13px; font-weight: 600; color: #1e293b; }
#dap-menu .dap-menu-item .dap-mi-sub { display: block; font-size: 11px; color: #64748b; margin-top: 2px; line-height: 1.35; }
#dap-menu .dap-menu-sec {
  padding: 4px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

/* --- Guided tour dim + spotlight --- */
#dap-dim {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: transparent;
  pointer-events: auto;
  display: none;
}
#dap-dim.dap-dim-on { background: rgba(15, 23, 42, 0.62); }
#dap-spotlight {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62);
  border: 2px solid #6366F1;
  box-sizing: border-box;
}
#dap-blocker {
  position: fixed;
  z-index: 10001;
  pointer-events: auto;
  background: transparent;
  border-radius: 10px;
  box-sizing: border-box;
  cursor: pointer;
}
#dap-blocker:hover { border: 2px solid #818CF8; }

/* --- Tour tooltip --- */
@keyframes dap-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
#dap-tip {
  position: fixed;
  z-index: 10002;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 16px 18px 14px;
  font-family: 'Poppins', Arial, sans-serif;
  color: #0f172a;
  box-sizing: border-box;
  text-align: left;
}
#dap-tip.dap-pop { animation: dap-pop 0.18s ease !important; }
#dap-tip .dap-tip-step { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6366F1; margin-bottom: 6px; }
#dap-tip .dap-tip-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: #0f172a; line-height: 1.3; }
#dap-tip .dap-tip-body { font-size: 12px; line-height: 1.55; color: #475569; margin: 0 0 14px; }
#dap-tip .dap-tip-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#dap-tip .dap-tip-nav { display: flex; align-items: center; gap: 8px; }
#dap-tip .dap-tip-dots { display: flex; align-items: center; gap: 5px; margin-left: 6px; }
#dap-tip .dap-dot { width: 6px; height: 6px; border-radius: 9999px; background: #cbd5e1; transition: background 0.12s ease !important; }
#dap-tip .dap-dot.on { background: #6366F1; }
#dap-tip button {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  line-height: 1;
  white-space: nowrap;
}
#dap-tip button:focus-visible { outline: 2px solid #6366F1; outline-offset: 2px; }
#dap-tip .dap-btn-skip { background: transparent; color: #94a3b8; padding-left: 0; }
#dap-tip .dap-btn-skip:hover { color: #475569; }
#dap-tip .dap-btn-prev { background: #e2e8f0; color: #334155; }
#dap-tip .dap-btn-prev:hover { background: #cbd5e1; }
#dap-tip .dap-btn-next { background: linear-gradient(135deg, #2473DA 0%, #6366F1 100%); color: #fff; transition: filter 0.12s ease !important; }
#dap-tip .dap-btn-next:hover { filter: brightness(1.08); }

/* Pointer caret toward the highlighted element (targeted steps only) */
#dap-tip[data-placement="below"]::before,
#dap-tip[data-placement="above"]::before {
  content: '';
  position: absolute;
  left: var(--dap-caret, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
}
#dap-tip[data-placement="below"]::before { top: -11px; border-bottom-color: #fff; }
#dap-tip[data-placement="above"]::before { bottom: -11px; border-top-color: #fff; }

/* --- Responsive tweaks --- */
@media (max-width: 640px) {
  #dap-fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
  #dap-fab:hover, #dap-fab:focus-visible { width: auto; padding: 0 16px; }
  #dap-menu {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(80px, calc(76px + env(safe-area-inset-bottom)));
    width: min(300px, calc(100vw - 24px));
  }
  #dap-menu .dap-menu-body { max-height: 60vh; }
  #dap-tip { width: min(320px, calc(100vw - 20px)); padding: 14px 15px 12px; }
  #dap-tip .dap-tip-actions { flex-wrap: wrap; }
  #dap-tip .dap-btn-skip { padding-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  #dap-fab, #dap-fab .dap-fab-label, #dap-menu, #dap-menu .dap-menu-item,
  #dap-tip, #dap-tip .dap-dot, #dap-tip .dap-btn-next {
    animation-duration: 0.01ms !important;
    transition-duration: 0s !important;
  }
}