/* =============================================================================
 * help.css — in-app help & guidance layer (Help panel, first-run tour, tooltips)
 * Added 2026-06-23 to make the app approachable for users wary of complexity.
 * House palette: wine #621224, muted #595959, warm neutrals. Additive only —
 * everything is namespaced under .dh-help* so it can't collide with app styles.
 * ========================================================================== */

:root {
  --dh-help-wine: #621224;
  --dh-help-ink: #2a2a2a;
  --dh-help-muted: #595959;
  --dh-help-bg: #ffffff;
  --dh-help-soft: #faf6f2;
  --dh-help-border: #e6ddd6;
  --dh-help-shadow: 0 12px 40px rgba(40, 12, 20, 0.22);
}

/* ---- Floating Help button (FAB) ---- */
.dh-help-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  display: none;                 /* revealed once the user is signed in */
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--dh-help-wine);
  color: #fff;
  font: 600 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(98, 18, 36, 0.4);
}
.dh-help-fab.is-visible { display: inline-flex; }
.dh-help-fab:hover { background: #4d0e1c; }
.dh-help-fab:focus-visible { outline: 3px solid #f0c5cf; outline-offset: 2px; }
.dh-help-fab .dh-help-fab-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.2); font-weight: 700;
}

/* ---- Help slide-in panel ---- */
.dh-help-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  z-index: 9100;
  background: var(--dh-help-bg);
  box-shadow: var(--dh-help-shadow);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex; flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--dh-help-ink);
}
.dh-help-panel.is-open { transform: translateX(0); }
.dh-help-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; background: var(--dh-help-soft);
  border-bottom: 1px solid var(--dh-help-border);
}
.dh-help-panel__header h2 { margin: 0; font-size: 18px; color: var(--dh-help-wine); }
.dh-help-panel__close {
  border: none; background: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--dh-help-muted); padding: 4px 8px;
}
.dh-help-panel__close:focus-visible { outline: 2px solid var(--dh-help-wine); border-radius: 4px; }
.dh-help-panel__intro { margin: 0; padding: 16px 20px 4px; color: var(--dh-help-muted); font-size: 14px; }
.dh-help-panel__body { overflow-y: auto; padding: 8px 20px 20px; flex: 1; }

.dh-help-topic { border-bottom: 1px solid var(--dh-help-border); }
.dh-help-topic__q {
  width: 100%; text-align: left; border: none; background: none;
  padding: 14px 0; font-size: 15px; font-weight: 600; color: var(--dh-help-ink);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.dh-help-topic__q:focus-visible { outline: 2px solid var(--dh-help-wine); border-radius: 4px; }
.dh-help-topic__q::after { content: "+"; color: var(--dh-help-wine); font-size: 20px; }
.dh-help-topic.is-open .dh-help-topic__q::after { content: "\2013"; }
.dh-help-topic__a { display: none; padding: 0 0 14px; color: var(--dh-help-muted); font-size: 14px; line-height: 1.55; }
.dh-help-topic.is-open .dh-help-topic__a { display: block; }

.dh-help-panel__footer { padding: 16px 20px; border-top: 1px solid var(--dh-help-border); background: var(--dh-help-soft); }
.dh-help-action {
  display: block; width: 100%; margin-top: 8px; padding: 10px 14px;
  border-radius: 8px; border: 1px solid var(--dh-help-wine);
  background: #fff; color: var(--dh-help-wine); font-weight: 600; font-size: 14px;
  cursor: pointer; text-align: center; text-decoration: none;
}
.dh-help-action--primary { background: var(--dh-help-wine); color: #fff; }
.dh-help-action:focus-visible { outline: 3px solid #f0c5cf; outline-offset: 2px; }

/* ---- Inline tooltip ("what is this?") ---- */
.dh-help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; border: 1px solid var(--dh-help-wine);
  background: #fff; color: var(--dh-help-wine);
  font: 700 11px/1 system-ui, sans-serif; cursor: help; padding: 0;
}
.dh-help-tip:focus-visible { outline: 2px solid var(--dh-help-wine); outline-offset: 1px; }
.dh-help-bubble {
  position: fixed; z-index: 9300; max-width: 260px;
  background: var(--dh-help-ink); color: #fff; padding: 9px 12px;
  border-radius: 8px; font: 400 13px/1.45 system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3); pointer-events: none;
}

/* ---- First-run guided tour ---- */
.dh-tour-backdrop {
  position: fixed; inset: 0; z-index: 9400;
  background: rgba(20, 6, 10, 0.55);
}
.dh-tour-highlight {
  position: fixed; z-index: 9410; border-radius: 10px;
  box-shadow: 0 0 0 4px #f0c5cf, 0 0 0 9999px rgba(20, 6, 10, 0.55);
  pointer-events: none; transition: all 0.2s ease;
}
.dh-tour-card {
  position: fixed; z-index: 9420; width: min(340px, 90vw);
  background: #fff; border-radius: 12px; box-shadow: var(--dh-help-shadow);
  padding: 20px; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.dh-tour-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--dh-help-wine); }
.dh-tour-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--dh-help-ink); }
.dh-tour-card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dh-tour-card__count { font-size: 12px; color: var(--dh-help-muted); }
.dh-tour-card__btns { display: flex; gap: 8px; }
.dh-tour-btn {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--dh-help-border);
  background: #fff; color: var(--dh-help-muted); font-weight: 600; font-size: 13px; cursor: pointer;
}
.dh-tour-btn--primary { background: var(--dh-help-wine); color: #fff; border-color: var(--dh-help-wine); }
.dh-tour-btn:focus-visible { outline: 3px solid #f0c5cf; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .dh-help-panel, .dh-tour-highlight { transition: none; }
}
