/* WECOYA Sanctions Screening — Help Drawer & Tooltips */

/* ── Backdrop ───────────────────────────────────────────────────── */
.help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 36, 54, 0.35);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}
.help-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Drawer ─────────────────────────────────────────────────────── */
#helpDrawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 100vw;
  background: #fff;
  border-left: 3px solid var(--wecoya-light-blue);
  box-shadow: -6px 0 24px rgba(7, 36, 54, 0.15);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 250ms ease;
}
#helpDrawer.is-open {
  transform: translateX(0);
}

/* ── Drawer Header ──────────────────────────────────────────────── */
.help-drawer-header {
  background: var(--wecoya-dark-blue);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.drawer-brand-wrap img {
  height: 32px;
  width: auto;
  display: block;
}
.help-drawer-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  transition: color 150ms, background 150ms;
}
.help-drawer-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.help-drawer-subtitle {
  background: #041722;
  padding: 0.3rem 1rem;
  color: var(--wecoya-light-blue);
  font-size: 0.77rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Search ─────────────────────────────────────────────────────── */
.help-drawer-search {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--wecoya-border);
  flex-shrink: 0;
}
.help-drawer-search input {
  width: 100%;
  border: 1px solid var(--wecoya-border);
  border-radius: 5px;
  padding: 0.32rem 0.6rem;
  font-size: 0.82rem;
  background: #f5f7f8;
  color: var(--wecoya-text);
  transition: border-color 150ms;
}
.help-drawer-search input:focus {
  outline: none;
  border-color: var(--wecoya-light-blue);
  box-shadow: 0 0 0 2px rgba(0, 180, 213, 0.2);
}

/* ── TOC ────────────────────────────────────────────────────────── */
.help-drawer-toc {
  overflow-y: auto;
  flex: 1;
  padding: 0.4rem 0.7rem;
  font-size: 0.83rem;
}
.help-toc-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  padding: 0.5rem 0.5rem 0.2rem;
}
.help-toc-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.3rem 0.5rem;
  color: #555;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.83rem;
  transition: background 130ms, color 130ms;
  line-height: 1.35;
}
.help-toc-item:hover {
  background: #f0fbfd;
  color: #006e82;
}
.help-toc-item.is-active {
  background: #e0f7fb;
  color: #006e82;
  font-weight: 600;
  border-left: 3px solid var(--wecoya-light-blue);
  padding-left: calc(0.5rem - 1px);
}
.help-toc-sub {
  padding-left: 1.4rem;
  font-size: 0.77rem;
  color: #777;
}
.help-toc-sub.is-active {
  padding-left: calc(1.4rem - 2px);
}
.help-toc-item.is-hidden { display: none; }

/* ── Search Results ─────────────────────────────────────────────── */
.help-search-results {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0.7rem;
}
.help-sri {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.25rem;
  border: 1px solid var(--wecoya-border);
  border-radius: 5px;
  background: #f9fbfc;
  cursor: pointer;
  transition: background 130ms, border-color 130ms;
}
.help-sri:hover {
  background: #e8f8fc;
  border-color: var(--wecoya-light-blue);
}
.help-sri-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wecoya-dark-blue);
  margin-bottom: 0.15rem;
}
.help-sri-snippet {
  display: block;
  font-size: 0.77rem;
  color: #555;
  line-height: 1.45;
  white-space: pre-wrap;
}
.help-sri mark,
.help-sri-title mark {
  background: #fff176;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.help-sri-empty {
  font-size: 0.82rem;
  color: #999;
  padding: 0.5rem;
  margin: 0;
}

/* ── Content Panel ──────────────────────────────────────────────── */
.help-drawer-content {
  overflow-y: auto;
  flex: 1;
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  line-height: 1.65;
  display: none;
}
.help-drawer-content.is-visible { display: block; }

.help-drawer-content h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--wecoya-dark-blue);
  margin: 0.75rem 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--wecoya-border);
}
.help-drawer-content h2:first-child { margin-top: 0; }

.help-drawer-content h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--wecoya-dark-blue);
  margin: 0.75rem 0 0.25rem;
}

.help-drawer-content p  { margin-bottom: 0.6rem; }
.help-drawer-content ul,
.help-drawer-content ol { margin: 0.3rem 0 0.7rem 1.3rem; }
.help-drawer-content li { margin-bottom: 0.25rem; }

.help-drawer-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 0.5rem 0 0.9rem;
}
.help-drawer-content th {
  background: var(--wecoya-dark-blue);
  color: #fff;
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-weight: 600;
}
.help-drawer-content td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--wecoya-border);
}
.help-drawer-content tr:nth-child(even) td { background: #f5f7f8; }

.help-chapter { display: none; }
.help-chapter.is-visible { display: block; }

.help-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--wecoya-light-blue);
  font-size: 0.8rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0;
  margin-bottom: 0.75rem;
}
.help-back-btn:hover { color: #008ba6; }

/* ── Drawer Footer ──────────────────────────────────────────────── */
.help-drawer-footer {
  border-top: 1px solid var(--wecoya-border);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.help-manual-link {
  color: var(--wecoya-light-blue);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.help-manual-link:hover { text-decoration: underline; }
.help-footer-sep { color: #ccc; }

/* ── ?-Button in Navbar ─────────────────────────────────────────── */
.btn-help-toggle {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 150ms, color 150ms;
  flex-shrink: 0;
}
.btn-help-toggle:hover,
.btn-help-toggle[aria-expanded="true"] {
  border-color: var(--wecoya-light-blue);
  color: var(--wecoya-light-blue);
}

/* ── ℹ Tooltip Trigger ──────────────────────────────────────────── */
.help-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #e0f7fb;
  color: #006e82;
  border: 1px solid var(--wecoya-light-blue);
  border-radius: 50%;
  font-size: 0.62rem;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
  margin-left: 0.3rem;
  line-height: 1;
  transition: background 150ms;
  user-select: none;
}
.help-tooltip-trigger:hover { background: #c5f0f8; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  #helpDrawer {
    width: 100vw;
    border-left: none;
    border-top: 3px solid var(--wecoya-light-blue);
  }
  .help-drawer-close {
    font-size: 1.4rem;
    padding: 0.3rem 0.6rem;
  }
}
