/* ==========================================================================
   HifzTrack — Guided Tour styles
   Additive, scoped by .ht-tour-* namespace so nothing bleeds into the app.
   ========================================================================== */

/* ---------- Design tokens (mirrors site palette) ---------- */
.ht-tour-root {
  --tour-cream:   #FAF6EE;
  --tour-ink:     #0B3D2E;
  --tour-ink-2:   #14322A;
  --tour-gold:    #B98A2B;
  --tour-gold-2:  #D4AE5C;
  --tour-muted:   #6B7A70;
  --tour-line:    rgba(11,61,46,0.12);
  --tour-shadow:  0 20px 60px rgba(11,61,46,0.28);
  --tour-radius:  14px;

  position: fixed; inset: 0;
  z-index: 999999;
  pointer-events: none;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark themed variant (site has data-theme="dark") */
html[data-theme="dark"] .ht-tour-root {
  --tour-cream: #17231e;
  --tour-ink:   #f4ecd8;
  --tour-ink-2: #ffe9b8;
  --tour-muted: #a9bbb1;
  --tour-line:  rgba(212,174,92,0.2);
}

/* ---------- Spotlight overlay (SVG mask) ---------- */
.ht-tour-spot {
  position: fixed; inset: 0;
  pointer-events: auto;
  transition: opacity .25s ease;
}
.ht-tour-spot rect.hole { transition: all .35s cubic-bezier(.4,.0,.2,1); }

/* ---------- Tooltip card ---------- */
.ht-tour-tip {
  position: fixed;
  pointer-events: auto;
  width: min(360px, calc(100vw - 32px));
  background: var(--tour-cream);
  color: var(--tour-ink);
  border-radius: var(--tour-radius);
  box-shadow: var(--tour-shadow);
  border: 1px solid var(--tour-line);
  overflow: hidden;
  transform: translateZ(0);
  animation: htTipIn .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes htTipIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ht-tour-tip__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
  gap: 12px;
}
.ht-tour-tip__pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tour-gold); background: rgba(185,138,43,0.10);
  padding: 4px 10px; border-radius: 999px; font-weight: 700;
}
.ht-tour-tip__close {
  background: transparent; border: 0; color: var(--tour-muted);
  cursor: pointer; padding: 6px; border-radius: 8px;
  font-size: 18px; line-height: 1;
}
.ht-tour-tip__close:hover { background: rgba(11,61,46,.06); color: var(--tour-ink); }
.ht-tour-tip__body { padding: 4px 16px 12px; }
.ht-tour-tip__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px; line-height: 1.2; font-weight: 700;
  color: var(--tour-ink); margin: 0 0 6px;
}
.ht-tour-tip__title em { color: var(--tour-gold); font-style: italic; }
.ht-tour-tip__text {
  font-size: 14px; line-height: 1.55; color: var(--tour-ink-2);
  margin: 0;
}
.ht-tour-tip__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 14px; gap: 8px;
  border-top: 1px solid var(--tour-line);
  margin-top: 4px;
}
.ht-tour-tip__progress {
  font-size: 12px; color: var(--tour-muted); font-variant-numeric: tabular-nums;
}
.ht-tour-tip__actions { display: flex; gap: 6px; }
.ht-btn {
  border: 1px solid var(--tour-line); background: transparent;
  color: var(--tour-ink); font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
}
.ht-btn:hover { background: rgba(11,61,46,.05); }
.ht-btn:active { transform: translateY(1px); }
.ht-btn--gold {
  background: var(--tour-gold); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(185,138,43,.35);
}
.ht-btn--gold:hover { background: #a67a24; }
.ht-btn--ghost { color: var(--tour-muted); border-color: transparent; }
.ht-btn--ghost:hover { color: var(--tour-ink); background: rgba(11,61,46,.05); }

/* Tooltip arrow */
.ht-tour-tip__arrow {
  position: absolute; width: 14px; height: 14px;
  background: var(--tour-cream);
  border: 1px solid var(--tour-line);
  transform: rotate(45deg);
  pointer-events: none;
}
.ht-tour-tip[data-pos="top"] .ht-tour-tip__arrow {
  bottom: -8px; left: 50%; margin-left: -7px;
  border-top: 0; border-left: 0;
}
.ht-tour-tip[data-pos="bottom"] .ht-tour-tip__arrow {
  top: -8px; left: 50%; margin-left: -7px;
  border-bottom: 0; border-right: 0;
}
.ht-tour-tip[data-pos="left"] .ht-tour-tip__arrow {
  right: -8px; top: 50%; margin-top: -7px;
  border-left: 0; border-bottom: 0;
}
.ht-tour-tip[data-pos="right"] .ht-tour-tip__arrow {
  left: -8px; top: 50%; margin-top: -7px;
  border-right: 0; border-top: 0;
}

/* ---------- Welcome modal (fullscreen intro) ---------- */
.ht-tour-modal {
  position: fixed; inset: 0;
  background: rgba(11,61,46,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: htTipIn .3s ease-out;
}
.ht-tour-modal__card {
  background: var(--tour-cream);
  border-radius: 18px;
  box-shadow: var(--tour-shadow);
  max-width: 640px; width: 100%;
  overflow: hidden;
  animation: htModalIn .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes htModalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.ht-tour-modal__hero {
  background: linear-gradient(135deg, #0B3D2E 0%, #14322A 100%);
  color: #fff;
  padding: 40px 32px 32px;
  position: relative;
  overflow: hidden;
}
.ht-tour-modal__hero::after {
  content: ""; position: absolute; right: -60px; bottom: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,174,92,.35), transparent 70%);
}
.ht-tour-modal__eyebrow {
  display: inline-block; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tour-gold-2);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(212,174,92,.4); background: rgba(212,174,92,.08);
  margin-bottom: 12px; font-weight: 700;
}
.ht-tour-modal__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px; line-height: 1.1; margin: 0 0 6px; font-weight: 700;
}
.ht-tour-modal__title em { color: var(--tour-gold-2); font-style: italic; }
.ht-tour-modal__subtitle {
  font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.8);
  margin: 6px 0 0; max-width: 480px;
}
.ht-tour-modal__body { padding: 24px 32px 28px; color: var(--tour-ink); }
.ht-tour-modal__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
}
.ht-tour-modal__item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px; border-radius: 12px;
  background: rgba(11,61,46,.03);
  border: 1px solid var(--tour-line);
}
.ht-tour-modal__ico {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--tour-gold) 0%, var(--tour-gold-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px;
}
.ht-tour-modal__ico svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; }
.ht-tour-modal__item h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.ht-tour-modal__item p  { margin: 0; font-size: 13px; line-height: 1.45; color: var(--tour-muted); }
.ht-tour-modal__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--tour-line);
  background: rgba(11,61,46,.02);
}
.ht-tour-modal__foot small { color: var(--tour-muted); font-size: 12px; }

/* ---------- Persistent checklist card ---------- */
.ht-tour-checklist {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 999998;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--tour-cream);
  border-radius: 14px;
  box-shadow: var(--tour-shadow);
  border: 1px solid var(--tour-line);
  overflow: hidden;
  pointer-events: auto;
  transition: transform .25s ease, opacity .2s ease;
}
.ht-tour-checklist[data-collapsed="1"] {
  width: 60px; height: 60px; border-radius: 30px;
  cursor: pointer;
}
.ht-tour-checklist[data-collapsed="1"] .ht-tour-checklist__body,
.ht-tour-checklist[data-collapsed="1"] .ht-tour-checklist__head { display: none; }
.ht-tour-checklist[data-collapsed="1"] .ht-tour-checklist__pulse { display: flex; }
.ht-tour-checklist__pulse {
  display: none;
  width: 60px; height: 60px;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tour-gold) 0%, var(--tour-gold-2) 100%);
  color: #fff; font-weight: 700; font-size: 18px;
  cursor: pointer;
  animation: htPulse 2s ease-in-out infinite;
}
@keyframes htPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(185,138,43,.5); }
  50%     { box-shadow: 0 0 0 12px rgba(185,138,43,0); }
}
.ht-tour-checklist__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tour-line);
}
.ht-tour-checklist__head h4 {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px; font-weight: 700; color: var(--tour-ink);
}
.ht-tour-checklist__head small { color: var(--tour-muted); font-size: 12px; }
.ht-tour-checklist__actions { display: flex; gap: 4px; }
.ht-tour-checklist__actions button {
  background: transparent; border: 0; color: var(--tour-muted);
  cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 16px; line-height: 1;
}
.ht-tour-checklist__actions button:hover { background: rgba(11,61,46,.05); color: var(--tour-ink); }
.ht-tour-checklist__bar {
  height: 4px; background: rgba(11,61,46,.08);
}
.ht-tour-checklist__bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--tour-gold) 0%, var(--tour-gold-2) 100%);
  transition: width .4s ease;
}
.ht-tour-checklist__body {
  max-height: 340px; overflow-y: auto;
  padding: 6px 0;
}
.ht-tour-checklist__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer;
  transition: background .15s ease;
  border: 0; width: 100%; background: transparent; text-align: left;
  font: inherit; color: var(--tour-ink);
}
.ht-tour-checklist__item:hover { background: rgba(11,61,46,.04); }
.ht-tour-checklist__check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--tour-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.ht-tour-checklist__item[data-done="1"] .ht-tour-checklist__check {
  background: var(--tour-gold); border-color: var(--tour-gold); color: #fff;
}
.ht-tour-checklist__item[data-done="1"] .ht-tour-checklist__label {
  color: var(--tour-muted); text-decoration: line-through;
}
.ht-tour-checklist__label { font-size: 14px; font-weight: 500; }
.ht-tour-checklist__go {
  margin-left: auto; font-size: 11px; color: var(--tour-gold);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  opacity: 0; transition: opacity .15s ease;
}
.ht-tour-checklist__item:hover .ht-tour-checklist__go { opacity: 1; }

/* ---------- "Take the tour" launcher chip ---------- */
.ht-tour-launcher {
  position: fixed; bottom: 20px; left: 20px;
  z-index: 999997;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--tour-cream);
  color: var(--tour-ink);
  border: 1px solid var(--tour-line);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(11,61,46,.15);
  pointer-events: auto;
  transition: transform .15s ease;
  font-family: inherit;
}
.ht-tour-launcher:hover { transform: translateY(-1px); }
.ht-tour-launcher__dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--tour-gold) 0%, var(--tour-gold-2) 100%);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}

/* ---------- Mobile responsiveness ---------- */
@media (max-width: 640px) {
  .ht-tour-tip { width: calc(100vw - 24px); left: 12px !important; right: 12px !important; }
  .ht-tour-tip[data-pos] { transform: none !important; }
  .ht-tour-tip__arrow { display: none; }
  .ht-tour-modal__hero { padding: 28px 22px 24px; }
  .ht-tour-modal__title { font-size: 26px; }
  .ht-tour-modal__body { padding: 20px 22px; }
  .ht-tour-modal__foot { padding: 14px 22px 20px; }
  .ht-tour-checklist { bottom: 12px; right: 12px; width: calc(100vw - 24px); }
  .ht-tour-launcher { bottom: 12px; left: 12px; font-size: 12px; }
}

/* Optional: hide when the site is in a modal already or on very small nested contexts */
body[data-tour-hidden="1"] .ht-tour-root,
body[data-tour-hidden="1"] .ht-tour-checklist,
body[data-tour-hidden="1"] .ht-tour-launcher { display: none !important; }
