/* PodiumEDI - Help Center */

/* ─── Overlay & Window ─── */
.pa-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
}
.pa-help-overlay.show {
  display: block;
  pointer-events: auto;
}
.pa-help-dimmer {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.pa-help-window {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  max-width: 1400px;
  margin: 0 auto;
  min-width: 480px;
  min-height: 320px;
  background: #0f1116;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.pa-help-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  z-index: 10;
}
.pa-help-resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.25);
  border-bottom: 2px solid rgba(255,255,255,0.25);
  border-radius: 0 0 4px 0;
}

/* ─── Header ─── */
.pa-help-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
  cursor: move;
  user-select: none;
}
.pa-help-header button,
.pa-help-header input,
.pa-help-header select {
  cursor: default;
  user-select: auto;
}
.pa-help-header button { cursor: pointer; }
.pa-help-title {
  font-weight: 700;
  white-space: nowrap;
}
.pa-help-version {
  font-size: 11px;
  opacity: 0.5;
}
.pa-help-search {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: #e8eef6;
  outline: none;
}
.pa-help-search::placeholder {
  color: rgba(232,238,246,0.55);
}
.pa-help-role {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: #e8eef6;
  outline: none;
}
.pa-help-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}
.btn.btn-sm.active {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

/* ─── Body (sidebar + main) ─── */
.pa-help-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.pa-help-left {
  border-right: 1px solid rgba(255,255,255,0.10);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
}
.pa-help-main {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
}

/* ─── Tree Navigation ─── */
.pa-help-tree-nav {}
.pa-help-tree-area {
  margin-bottom: 4px;
}
.pa-help-tree-area-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(232,238,246,0.6);
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
}
.pa-help-tree-area-header:hover {
  background: rgba(255,255,255,0.04);
}
.pa-help-tree-area-header .arrow {
  font-size: 10px;
  transition: transform 0.15s;
  width: 12px;
  text-align: center;
}
.pa-help-tree-area.collapsed .arrow {
  transform: rotate(-90deg);
}
.pa-help-tree-area.collapsed .pa-help-tree-topics {
  display: none;
}
.pa-help-tree-topics {
  padding-left: 6px;
}
.pa-help-tree-topic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  border: 1px solid transparent;
}
.pa-help-tree-topic:hover {
  background: rgba(255,255,255,0.05);
}
.pa-help-tree-topic.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}
.pa-help-tree-topic .chat-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255,160,40,0.25);
  color: #ffb040;
  flex-shrink: 0;
}
.pa-help-tree-topic .vis-toggle-group {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  gap: 2px;
}
.pa-help-tree-topic .vis-toggle {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  cursor: pointer;
}
.vis-toggle-admin { accent-color: #f59e0b; }
.vis-toggle-engineer { accent-color: #3b82f6; }
.vis-toggle-user { accent-color: #22c55e; }

/* ─── Content display ─── */
.pa-help-content {
  line-height: 1.55;
  color: #e8eef6;
}
.pa-help-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pa-help-content h2:first-child {
  margin-top: 0;
}
.pa-help-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px 0;
}
.pa-help-content p {
  margin: 6px 0;
}
.pa-help-content ul, .pa-help-content ol {
  margin: 6px 0 6px 20px;
  padding: 0;
}
.pa-help-content li {
  margin: 3px 0;
}
.pa-help-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 2px 5px;
  border-radius: 4px;
}
.pa-help-topic-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pa-help-topic-meta {
  font-size: 12px;
  opacity: 0.55;
  margin-bottom: 14px;
}

/* ─── Diagrams ─── */
.pa-help-diagram {
  margin: 16px 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,0.15);
}
.pa-help-diagram img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
}
.pa-help-diagram-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: rgba(232,238,246,0.65);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── Notes / Community ─── */
.pa-help-panel.hidden {
  display: none;
}
.pa-help-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.pa-help-notes,
.pa-help-community {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,0.25);
}
.pa-help-notes-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pa-help-notes-title {
  font-weight: 700;
}
.pa-help-note-status {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.8;
}
.pa-help-note-text,
.pa-help-contrib-text {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  color: inherit;
  font-size: 13px;
}
.pa-help-community-list {
  max-height: 240px;
  overflow: auto;
}
.pa-help-community-item,
.pa-help-review-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.18);
}
.pa-help-community-meta {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}
.pa-help-section-title {
  font-weight: 700;
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 8px;
}

/* ─── Chat ─── */
.pa-help-chat-log {
  height: 100%;
  min-height: 300px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0,0,0,0.18);
}
.pa-help-chat-row {
  margin-bottom: 10px;
}
.pa-help-chat-row .who {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}
.pa-help-chat-row .msg {
  white-space: pre-wrap;
  line-height: 1.4;
}
.pa-help-chat-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.pa-help-chat-input {
  flex: 1;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  color: inherit;
}

/* ─── Review / Contrib ─── */
.pa-help-review-actions,
.pa-help-contrib-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 14px;
}
.pa-help-review-item .actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ─── Insights (Admin) ─── */
.pa-help-insights {}
.pa-help-insights-table {
  margin-top: 10px;
}
.pa-help-insights-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pa-help-insights-table th,
.pa-help-insights-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pa-help-insights-table th {
  font-weight: 600;
  opacity: 0.7;
  font-size: 11px;
  text-transform: uppercase;
}
.pa-help-insights-recent {
  margin-top: 10px;
  max-height: 400px;
  overflow: auto;
}
.pa-help-insight-q {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.12);
  font-size: 13px;
}
.pa-help-insight-q .meta {
  font-size: 11px;
  opacity: 0.5;
  margin-bottom: 3px;
}

/* ─── Update History ─── */
.pa-help-updates-list {}
.pa-help-update-entry {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.15);
}
.pa-help-update-entry.major {
  border-left: 3px solid #7aa2f7;
}
.pa-help-update-entry.minor {
  border-left: 3px solid #565f89;
}
.pa-help-update-entry.fix {
  border-left: 3px solid #ff9e64;
}
.pa-help-update-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.pa-help-update-version {
  font-weight: 700;
  font-size: 13px;
}
.pa-help-update-type {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.pa-help-update-type.major { background: rgba(122,162,247,0.15); color: #7aa2f7; }
.pa-help-update-type.minor { background: rgba(86,95,137,0.25); color: #9aa5ce; }
.pa-help-update-type.fix { background: rgba(255,158,100,0.15); color: #ff9e64; }
.pa-help-update-type.beta { background: rgba(224,175,104,0.15); color: #e0af68; }
.pa-help-update-crc {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  opacity: 0.5;
}
.pa-help-update-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.pa-help-update-body {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(232,238,246,0.8);
}

/* ─── Utilities ─── */
.pa-help-hint {
  margin-top: 10px;
  font-size: 12px;
}
.pa-help-empty {
  opacity: 0.6;
  padding: 10px 0;
  font-size: 13px;
}
.muted { opacity: 0.6; }

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .pa-help-body {
    grid-template-columns: 240px 1fr;
  }
}
@media (max-width: 760px) {
  .pa-help-body {
    grid-template-columns: 1fr;
  }
  .pa-help-left {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    max-height: 200px;
  }
  .pa-help-split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .pa-help-window {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-width: unset;
    min-height: unset;
    border-radius: 0;
  }
  .pa-help-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
  }
  .pa-help-bar::-webkit-scrollbar { display: none; }
  .pa-help-bar button {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    min-height: 38px;
  }
  .pa-help-left { max-height: 160px; }
  .pa-help-content { padding: 10px; }
  .pa-help-update-title { font-size: 13px; }
  .pa-help-update-body { font-size: 12px; }
}
