/* ============================================================
   Tours CSS — Shepherd.js theme override + modal Panduan
   Sage palette: #84A98C primary, #6B8C73 hover, #344E41 dark
   ============================================================ */

/* Shepherd theme overrides */
.shepherd-element.perluasan-shepherd {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  max-width: 360px;
}

.shepherd-element.perluasan-shepherd .shepherd-header {
  background: #84A98C;
  color: white;
  padding: 12px 16px;
  border-radius: 6px 6px 0 0;
}

.shepherd-element.perluasan-shepherd .shepherd-title {
  color: white;
  font-weight: 600;
  font-size: 15px;
}

/* Audit fix: warna default vendor (abu-abu medium, hsla(0,0%,50%,.75))
   kontrasnya jauh lebih rendah dari title putih tegas di atas header
   yang sama -- padahal ini satu-satunya cara keluar tur yang selalu
   terlihat. Putih semi-transparan senada title, lebih pekat saat hover. */
.shepherd-element.perluasan-shepherd .shepherd-cancel-icon {
  color: rgba(255, 255, 255, 0.85);
}
.shepherd-element.perluasan-shepherd .shepherd-cancel-icon:hover {
  color: #ffffff;
}

.shepherd-element.perluasan-shepherd .shepherd-text {
  color: #1f2933;
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.shepherd-element.perluasan-shepherd .shepherd-footer {
  padding: 0 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.shepherd-element.perluasan-shepherd .shepherd-button {
  background: #84A98C;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.shepherd-element.perluasan-shepherd .shepherd-button:hover {
  background: #6B8C73;
}

.shepherd-element.perluasan-shepherd .shepherd-button.shepherd-button-secondary {
  background: transparent;
  color: #6B8C73;
  border: 1px solid #6B8C73;
}

.shepherd-element.perluasan-shepherd .shepherd-button.shepherd-button-secondary:hover {
  background: #f4f7f3;
  color: #344E41;
}

/* Audit fix: selector 1-class kalah spesifisitas dari vendor
   shepherd.css (.shepherd-modal-overlay-container.shepherd-modal-is-visible
   { opacity:.5 }) -- override sebelumnya tidak pernah benar-benar aktif.
   Samakan spesifisitas dgn menambah .shepherd-modal-is-visible juga. */
.shepherd-modal-overlay-container.shepherd-modal-is-visible {
  opacity: 0.65; /* sligtly darker untuk fokus spotlight lebih jelas */
}

/* Dark mode Shepherd */
html.dark .shepherd-element.perluasan-shepherd {
  background: #1f2933;
}
/* Audit fix: arrow (segitiga penunjuk) sebelumnya tetap warna vendor
   terang (putih/abu) di dark mode -- sambungan arrow-body terlihat
   pecah. Samakan ke background tooltip dark di atas. */
html.dark .shepherd-element.perluasan-shepherd > .shepherd-arrow:before,
html.dark .shepherd-element.perluasan-shepherd.shepherd-has-title[data-popper-placement^=bottom] > .shepherd-arrow:before {
  background-color: #1f2933;
}
/* Audit fix Tours #2: badge "Langkah X dari Y" -- jumlah step per tur
   tidak konstan (difilter dinamis per role), user sebelumnya tak pernah
   tahu sedang di step berapa dari berapa total. */
.perluasan-tour-step-counter {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #84A98C;
  margin-bottom: 4px;
  display: block;
}
html.dark .perluasan-tour-step-counter { color: #9DA89E; }

html.dark .shepherd-element.perluasan-shepherd .shepherd-text {
  color: #e5e7eb;
}

/* ============================================================
   Modal "Panduan"
   ============================================================ */
dialog.panduan-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: 480px;
  width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  background: white;
  color: #1f2933;
}

dialog.panduan-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

dialog.panduan-modal .panduan-header {
  background: #84A98C;
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dialog.panduan-modal .panduan-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

dialog.panduan-modal .panduan-header button {
  background: transparent;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

dialog.panduan-modal .panduan-header button:hover {
  opacity: 0.8;
}

dialog.panduan-modal .panduan-body {
  padding: 12px 18px 18px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

dialog.panduan-modal .panduan-shortcut {
  border-bottom: 1px solid #e4e7e4;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

dialog.panduan-modal .panduan-shortcut a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f4f7f3;
  border-radius: 6px;
  color: #344E41;
  font-weight: 600;
  text-decoration: none;
}

dialog.panduan-modal .panduan-shortcut a:hover {
  background: #e0e9dc;
}

dialog.panduan-modal section {
  margin-top: 12px;
}

dialog.panduan-modal h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: #6B8C73;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
  font-weight: 700;
}

dialog.panduan-modal ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

dialog.panduan-modal li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 4px;
  color: #1f2933;
  text-decoration: none;
  font-size: 14px;
}

dialog.panduan-modal li a:hover {
  background: #f4f7f3;
  color: #344E41;
}

dialog.panduan-modal li a.tour-completed::after {
  content: '✓';
  color: #84A98C;
  font-weight: bold;
  font-size: 15px;
}

/* Dark mode modal */
html.dark dialog.panduan-modal {
  background: #1f2933;
  color: #e5e7eb;
}
html.dark dialog.panduan-modal .panduan-shortcut a {
  background: #2d3848;
  color: #d1d5db;
}
html.dark dialog.panduan-modal .panduan-shortcut a:hover {
  background: #3d4858;
}
html.dark dialog.panduan-modal li a {
  color: #e5e7eb;
}
html.dark dialog.panduan-modal li a:hover {
  background: #2d3848;
  color: white;
}

/* ============================================================
   Mobile (<640px): touch targets ≥44px, fullscreen-ish modal,
   tooltip narrow viewport friendly.
   ============================================================ */
@media (max-width: 640px) {
  .shepherd-element.perluasan-shepherd {
    max-width: calc(100vw - 24px);
  }
  .shepherd-element.perluasan-shepherd .shepherd-title { font-size: 16px; }
  .shepherd-element.perluasan-shepherd .shepherd-text {
    font-size: 15px;
    padding: 14px;
    line-height: 1.55;
  }
  .shepherd-element.perluasan-shepherd .shepherd-button {
    padding: 12px 18px;
    font-size: 15px;
    min-height: 44px;
    min-width: 88px;
  }
  .shepherd-element.perluasan-shepherd .shepherd-cancel-icon {
    padding: 10px;
    font-size: 22px;
    min-width: 44px;
    min-height: 44px;
  }

  /* Modal Panduan: near-fullscreen, dvh untuk handle browser chrome */
  dialog.panduan-modal {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: 90dvh;
  }
  dialog.panduan-modal .panduan-body {
    max-height: calc(90dvh - 60px);
  }
  dialog.panduan-modal li a {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 44px;
  }
  dialog.panduan-modal .panduan-shortcut a {
    padding: 14px 14px;
    min-height: 44px;
    font-size: 15px;
  }
  dialog.panduan-modal .panduan-header button {
    padding: 10px 12px;
    min-width: 44px;
    min-height: 44px;
    font-size: 26px;
  }
}

/* Tablet portrait — slight constraint, tooltip narrower */
@media (min-width: 641px) and (max-width: 1023px) {
  .shepherd-element.perluasan-shepherd {
    max-width: 420px;
  }
}

/* ── Dark-mode contrast patch (UI review 2026-06-08) ─────────────────────── */
html.dark dialog.panduan-modal .panduan-shortcut { border-bottom-color: #374151; }
html.dark dialog.panduan-modal h4 { color: #84A98C; }
html.dark .shepherd-element.perluasan-shepherd .shepherd-button.shepherd-button-secondary {
  color: #84A98C; border-color: #84A98C;
}
html.dark .shepherd-element.perluasan-shepherd .shepherd-button.shepherd-button-secondary:hover {
  background: #2A322C; color: #DCE3D8;
}
