/**
 * Filename: public/stylesheets/help.css
 * Revision: 2026-09-11 – Initial: ? button, armed cursor and help popup, light and dark.
 * Description: Context help styles. Loaded site-wide by layout.pug, after dark-mode.css.
 *              Paired with public/javascripts/help.js.
 */

/* ===== ? BUTTON (header, left of the theme toggle) ===== */
/* Matches .theme-toggle in layout.css so the pair reads as one control group. */
.help-toggle {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-toggle:hover {
  background: #f1f5f9;
}

.help-toggle.armed {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

[data-theme="dark"] .help-toggle {
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .help-toggle:hover {
  background: #1e293b;
}

[data-theme="dark"] .help-toggle.armed {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

/* ===== ARMED CURSOR ===== */
/* Arrow with a question mark, as close to the original as a web cursor gets.
   The `help` keyword is the fallback for anything that rejects the data URI. */
body.help-armed,
body.help-armed * {
  cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 2 L5 23 L10.5 18.2 L14 26 L17.5 24.4 L14 17 L21 17 Z' fill='%23ffffff' stroke='%23000000' stroke-width='1.4' stroke-linejoin='round'/%3E%3Ctext x='20' y='14' font-family='Arial,Helvetica,sans-serif' font-size='15' font-weight='bold' fill='%23000000' stroke='%23ffffff' stroke-width='2.5' paint-order='stroke'%3E%3F%3C/text%3E%3C/svg%3E") 4 2, help !important;
}

/* ===== POPUP ===== */
/* 9998 clears .modal-overlay (500) and the header (200); #activity-popup (9999)
   stays on top, which is correct — it is a modal the admin opened deliberately. */
.help-popup {
  position: fixed;
  z-index: 9998;
  width: max-content;
  max-width: 360px;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  line-height: 1.5;
}

.help-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.help-popup-title {
  font-weight: 700;
  font-size: 13px;
}

.help-popup-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.help-popup-close:hover {
  color: #1e293b;
}

.help-popup-body {
  padding: 10px 12px 12px;
}

.help-popup-body p {
  margin: 0 0 8px;
}

.help-popup-body p:last-child {
  margin-bottom: 0;
}

.help-popup-body ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.help-popup-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f5f9;
  border-radius: 3px;
  padding: 1px 4px;
}

[data-theme="dark"] .help-popup {
  background: #162231;
  color: #e2e8f0;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .help-popup-head {
  border-bottom-color: #334155;
}

[data-theme="dark"] .help-popup-close {
  color: #94a3b8;
}

[data-theme="dark"] .help-popup-close:hover {
  color: #e2e8f0;
}

[data-theme="dark"] .help-popup-body code {
  background: #0f172a;
}
