/* ══════════════════════════════════════════════════
   TEAM HUB — HELP PANEL STYLES
   Slide-in panel for contextual help & documentation
   ══════════════════════════════════════════════════ */

/* ── Overlay ── */
.help-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1050;
}
.help-panel-overlay.active {
  display: block;
}

/* ── Panel Shell ── */
.help-panel {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  z-index: 1051;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.help-panel.active {
  display: flex;
  transform: translateX(0);
}

/* ── Header ── */
.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.help-panel-title {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  padding-right: 12px;
  color: var(--text);
}

/* ── Close Button ── */
.help-panel-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s;
}
.help-panel-close:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.help-panel-close:active {
  transform: scale(0.9);
}
.help-panel-close:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ── Content Area ── */
.help-panel-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

/* ── Loading State ── */
.help-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 12px;
}
.help-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Empty State ── */
.help-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.help-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

/* ── Breadcrumb / Back Link ── */
.help-breadcrumb {
  margin-bottom: 16px;
}
.help-back-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.help-back-link:hover {
  color: var(--text);
}

/* ── Document Meta ── */
.help-doc-meta {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}


/* ══════════════════════════════════════════════════
   MARKDOWN RENDERED CONTENT
   Styles for parsed markdown inside the help panel
   ══════════════════════════════════════════════════ */

.help-md h1 {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
.help-md h2 {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.help-md h3 {
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--navy);
}
.help-md h4, .help-md h5, .help-md h6 {
  font-size: 14px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--text);
}
.help-md p {
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px;
  color: var(--text);
}
.help-md ul, .help-md ol {
  padding-left: 20px;
  margin: 8px 0;
}
.help-md li {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.6;
}
.help-md a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.help-md a:hover {
  color: var(--navy);
}
.help-md strong {
  font-weight: 700;
  color: var(--text);
}

/* Inline code */
.help-md code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono-font);
  font-size: 13px;
}

/* Code blocks */
.help-md pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0;
  overflow-x: auto;
}
.help-md pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* Blockquotes */
.help-md blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  background: var(--accent-blue-pale);
  border-left: 3px solid var(--accent-blue);
  font-size: 14px;
  color: var(--text);
}
.help-md blockquote p {
  margin: 0 0 6px;
  font-size: 14px;
}
.help-md blockquote p:last-child {
  margin-bottom: 0;
}

/* Callout variants */
.help-md blockquote.callout-warning {
  background: #fff3cd;
  border-left-color: var(--orange);
}
.help-md blockquote.callout-tip {
  background: #e8f5e9;
  border-left-color: var(--green);
}

/* Tables */
.help-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.help-md th, .help-md td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.help-md th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

/* Horizontal rules */
.help-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Images */
.help-md img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}


/* ══════════════════════════════════════════════════
   HELP TRIGGER BUTTON
   Small ? button placed next to elements for
   context-sensitive help. Available for future use.
   ══════════════════════════════════════════════════ */

/* ── Context Help Trigger ── */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1.5px solid var(--border);
  margin-left: 6px;
  flex-shrink: 0;
  vertical-align: middle;
  transition: all 0.15s;
}
.help-trigger:hover {
  background: var(--navy);
  color: var(--surface);
  border-color: var(--navy);
}
.help-trigger:active {
  transform: scale(0.9);
}


/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

/* Mobile: full width (default — panel is already width:100%) */

/* Tablet and above: capped at 400px */
@media (min-width: 600px) {
  .help-panel {
    max-width: 400px;
  }
}

/* Small phones: slightly smaller padding */
@media (max-width: 360px) {
  .help-panel-header {
    padding: 14px 16px;
  }
  .help-panel-content {
    padding: 16px;
  }
  .help-md h2 {
    font-size: 16px;
  }
  .help-md p, .help-md li {
    font-size: 14px;
  }
}
