/* help.css — מערכת עזרה: בועיות "?" · תפריט עזרה צף · סיור מודרך.
   תואם-CSP (style-src 'self'). משתמש במשתני-הצבע של style.css. */

/* ============================================================
   1) בועית "?" קונטקסטואלית — CSS בלבד (בלי JS)
   ============================================================ */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-inline-start: 6px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  cursor: help;
  vertical-align: middle;
  flex: 0 0 auto;
  user-select: none;
}
.tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip-q { pointer-events: none; }
.tip-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 200;
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: var(--panel, #fff);
  color: var(--text, #1a2230);
  border: 1px solid var(--line-strong, #d7dbe5);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 28px rgba(20, 30, 70, 0.18);
  font-size: 13px; font-weight: 400; line-height: 1.5;
  text-align: start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.tip-title { display: block; margin-bottom: 3px; font-weight: 700; color: var(--accent); }
.tip-body  { display: block; }
.tip:hover .tip-pop,
.tip:focus .tip-pop,
.tip:focus-within .tip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
/* חץ ממורכז מתחת לאייקון ה-"?" */
.tip-pop::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: calc(50% - 6px);
  border: 6px solid transparent;
  border-bottom-color: var(--line-strong, #d7dbe5);
}

/* ============================================================
   2) כפתור עזרה צף (פינה שמאלית-תחתונה) + תפריט
   ============================================================ */
.help-fab {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 300;
}
.help-fab-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 24px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb, 124 90 223), 0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.help-fab-btn:hover { transform: translateY(-2px) scale(1.04); }
.help-fab-btn:focus { outline: 3px solid rgba(var(--accent-rgb, 124 90 223), 0.4); outline-offset: 2px; }
.help-menu {
  position: absolute;
  bottom: 62px;
  left: 0;
  width: 232px;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e6e9ef);
  border-radius: var(--radius, 12px);
  box-shadow: 0 12px 36px rgba(20, 30, 70, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.help-menu[hidden] { display: none; }
.help-menu-title {
  font-size: 12px; font-weight: 700; color: var(--muted, #8a8fa8);
  padding: 6px 10px 4px;
}
.help-menu a,
.help-menu button {
  display: flex; align-items: center; gap: 8px;
  text-align: start;
  background: none; border: none;
  color: var(--text, #1a2230);
  font: inherit; font-size: 14px;
  padding: 10px 10px;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  cursor: pointer;
}
.help-menu a:hover,
.help-menu button:hover { background: var(--panel-2, #f1f3f6); color: var(--accent); }

/* ============================================================
   3) סיור מודרך ("walk me") — overlay + הדגשת אלמנט + כרטיס
   ============================================================ */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent; /* ההעמעום מגיע מ-box-shadow של .tour-highlight (מונע העמעום כפול) */
}
/* צעד ללא יעד (כרטיס ממורכז): אין highlight → מחזירים העמעום מלא-מסך */
.tour-overlay--dim { background: rgba(15, 18, 38, 0.55); }
.tour-overlay[hidden] { display: none; }
.tour-highlight {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb, 124 90 223), 0.9),
              0 0 0 9999px rgba(15, 18, 38, 0.55);
  transition: all 0.25s ease;
  pointer-events: none;
}
.tour-card {
  position: absolute;
  width: min(340px, calc(100vw - 32px));
  background: var(--panel, #fff);
  color: var(--text, #1a2230);
  border-radius: var(--radius, 12px);
  box-shadow: 0 16px 48px rgba(10, 14, 30, 0.4);
  padding: 18px 18px 14px;
  transition: top 0.25s ease, left 0.25s ease;
}
.tour-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--accent); }
.tour-card p  { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--text, #1a2230); }
.tour-close {
  position: absolute; top: 10px; inset-inline-start: 12px;
  background: none; border: none; font-size: 20px; line-height: 1;
  color: var(--muted, #8a8fa8); cursor: pointer;
}
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-count { font-size: 13px; color: var(--muted, #8a8fa8); margin-inline-end: auto; }
.tour-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-sm, 8px);
  cursor: pointer; border: 1px solid var(--line-strong, #d7dbe5);
  background: var(--panel-2, #f1f3f6); color: var(--text, #1a2230);
}
.tour-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tour-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* כרטיס סקירה/הדרכה בלוח הבקרה */
.help-onboard {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px 22px; padding: 18px 20px; margin: 0 0 24px;
}
.help-onboard-text { flex: 1 1 260px; }
.help-onboard-text strong { font-size: 16px; }
.help-onboard-text p { margin: 4px 0 0; }
.help-onboard .help-cta-row { margin-top: 0; }
.btn-sm.ghost { background: none; border: 1px solid var(--line-strong, #d7dbe5); color: var(--accent); }

/* ============================================================
   4) מרכז העזרה (/app/help)
   ============================================================ */
.help-hero { margin-bottom: 24px; }
.help-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.help-guide { margin-bottom: 14px; border: 1px solid var(--line, #e6e9ef); border-radius: var(--radius, 12px); background: var(--panel, #fff); }
.help-guide > summary {
  list-style: none; cursor: pointer;
  padding: 16px 18px; font-size: 16px; font-weight: 700; color: var(--text, #1a2230);
  display: flex; align-items: center; gap: 10px;
}
.help-guide > summary::-webkit-details-marker { display: none; }
.help-guide > summary::after { content: "▾"; margin-inline-start: auto; opacity: 0.6; transition: transform 0.15s; }
.help-guide[open] > summary::after { transform: rotate(180deg); }
.help-guide-body { padding: 0 18px 18px; font-size: 14px; line-height: 1.65; color: var(--text, #1a2230); }
.help-guide-body ul { margin: 6px 18px 6px; }
.help-guide-body li { margin-bottom: 5px; }
.faq-item { border-bottom: 1px solid var(--line, #e6e9ef); }
.faq-item > summary {
  list-style: none; cursor: pointer;
  padding: 14px 4px; font-size: 15px; font-weight: 600; color: var(--text, #1a2230);
  display: flex; align-items: center; gap: 10px;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: "?"; color: var(--accent); font-weight: 800; }
.faq-item > summary::after { content: "+"; margin-inline-start: auto; color: var(--muted, #8a8fa8); font-size: 18px; }
.faq-item[open] > summary::after { content: "–"; }
.faq-answer { padding: 0 4px 16px 22px; font-size: 14px; line-height: 1.65; color: var(--muted, #6b7185); }

/* style.css קובע במובייל button{width:100%} — מאפסים לכפתורי הסיור/העזרה
   כדי שהם לא ימתחו על כל הרוחב (bleed). */
@media (max-width: 760px) {
  .tour-close, .tour-btn, .help-fab-btn {
    width: auto;
    min-height: 0;
  }
  .help-fab-btn { width: 50px; height: 50px; }
  .tour-foot { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .help-fab { bottom: 16px; left: 16px; }
}
