/* Admin Help Guide Styles */

/* ─── Sticky jump-to bar ─── */
.help-jump-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px;
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.help-jump-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  margin-right: 4px;
}

.help-jump-link {
  display: inline-block;
  padding: 8px 16px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.help-jump-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Section-specific jump link colors */
.help-jump-link--run-day {
  background: #fef3c7;
  color: #92400e;
}

.help-jump-link--new-run {
  background: #dbeafe;
  color: #1e40af;
}

.help-jump-link--change-run {
  background: #e0e7ff;
  color: #3730a3;
}

.help-jump-link--new-member {
  background: #fce7f3;
  color: #9d174d;
}

.help-jump-link--members {
  background: #d1fae5;
  color: #065f46;
}

.help-jump-link--challenges {
  background: #fef9c3;
  color: #854d0e;
}

/* ─── Search bar ─── */
.help-search {
  margin-bottom: 36px;
}

.help-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  padding: 0 18px;
  transition: border-color 0.2s ease;
}

.help-search-wrapper:focus-within {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-search-icon {
  flex-shrink: 0;
  color: var(--color-text-secondary, #6b7280);
}

.help-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 18px 14px;
  font-size: 19px;
  background: transparent;
  color: var(--color-text, #111827);
}

.help-search-input::placeholder {
  color: var(--color-text-secondary, #9ca3af);
}

.help-search-clear {
  flex-shrink: 0;
  background: var(--color-bg-alt, #f3f4f6);
  border: none;
  color: var(--color-text, #374151);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm, 8px);
  transition: background-color 0.15s ease;
}

.help-search-clear:hover {
  background-color: #e5e7eb;
}

/* ─── Scenario sections ─── */
.help-scenario {
  margin-bottom: 52px;
  scroll-margin-top: 80px;
}

.help-scenario-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--color-border, #e5e7eb);
}

/* Section-specific colored borders */
.help-scenario--run-day .help-scenario-header {
  border-bottom-color: #f59e0b;
}

.help-scenario--new-run .help-scenario-header {
  border-bottom-color: #3b82f6;
}

.help-scenario--change-run .help-scenario-header {
  border-bottom-color: #6366f1;
}

.help-scenario--new-member .help-scenario-header {
  border-bottom-color: #ec4899;
}

.help-scenario--members .help-scenario-header {
  border-bottom-color: #10b981;
}

.help-scenario--challenges .help-scenario-header {
  border-bottom-color: #eab308;
}

.help-scenario-icon {
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.help-scenario-header h2 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--color-text, #111827);
}

.help-scenario-header p {
  font-size: 18px;
  color: var(--color-text-secondary, #6b7280);
  margin: 0;
}

/* ─── Individual help items (collapsible) ─── */
.help-item {
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.help-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.help-item[open] {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.help-item-question {
  display: flex;
  align-items: center;
  padding: 22px 24px;
  font-size: 19px;
  font-weight: 600;
  color: var(--color-text, #111827);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease;
}

.help-item-question:hover {
  background-color: var(--color-bg-alt, #f9fafb);
}

.help-item-question::-webkit-details-marker {
  display: none;
}

.help-item-question::before {
  content: "▸";
  display: inline-block;
  margin-right: 14px;
  font-size: 18px;
  color: var(--color-text-secondary, #6b7280);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.help-item[open] > .help-item-question::before {
  transform: rotate(90deg);
}

/* ─── Answer area ─── */
.help-item-answer {
  padding: 0 24px 24px 24px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--color-text, #374151);
  border-top: 1px solid var(--color-border, #f3f4f6);
  padding-top: 20px;
}

.help-item-answer p {
  margin: 0 0 16px 0;
}

.help-item-answer ul,
.help-item-answer ol {
  margin: 0 0 18px 0;
  padding-left: 0;
}

.help-item-answer > ul,
.help-item-answer > ol {
  padding-left: 4px;
}

.help-item-answer ul ul,
.help-item-answer ol ul {
  margin-top: 8px;
  margin-bottom: 8px;
  padding-left: 24px;
}

/* ─── Numbered steps ─── */
.help-steps {
  counter-reset: help-step;
  list-style: none;
  padding-left: 0;
}

.help-steps > li {
  counter-increment: help-step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
}

.help-steps > li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  background: var(--color-primary, #2563eb);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-steps > li ul {
  list-style: disc;
  padding-left: 24px;
  margin-top: 8px;
}

/* ─── Callout boxes ─── */
.help-result {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  margin: 20px 0 16px 0;
  font-size: 17px;
  line-height: 1.65;
}

.help-tip {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  margin: 20px 0 16px 0;
  font-size: 17px;
  line-height: 1.65;
}

.help-warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  margin: 20px 0 16px 0;
  font-size: 17px;
  line-height: 1.65;
}

/* ─── Tables ─── */
.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px 0;
  font-size: 17px;
}

.help-table th {
  text-align: left;
  padding: 14px 18px;
  background: var(--color-bg-alt, #f9fafb);
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary, #6b7280);
}

.help-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border, #f3f4f6);
  vertical-align: top;
  line-height: 1.55;
}

.help-table tr:last-child td {
  border-bottom: none;
}

/* ─── No results ─── */
.help-no-results {
  margin-bottom: 40px;
}

/* ─── Inline code ─── */
.help-item-answer code {
  background: var(--color-bg-alt, #f3f4f6);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 17px;
  font-family: monospace;
}

/* ─── Back to top button ─── */
.help-back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.15s ease;
  z-index: 20;
}

.help-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.help-back-to-top:hover {
  background: #1d4ed8;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .help-jump-bar {
    gap: 8px;
    padding: 14px 16px;
    position: static;
    box-shadow: none;
  }

  .help-jump-label {
    width: 100%;
    margin-bottom: 4px;
    font-size: 16px;
  }

  .help-jump-link {
    font-size: 15px;
    padding: 6px 14px;
  }

  .help-scenario-icon {
    font-size: 32px;
  }

  .help-scenario-header h2 {
    font-size: 24px;
  }

  .help-scenario-header p {
    font-size: 16px;
  }

  .help-item-question {
    padding: 18px 18px;
    font-size: 17px;
  }

  .help-item-answer {
    padding: 0 18px 20px 18px;
    padding-top: 16px;
    font-size: 17px;
  }

  .help-steps > li {
    padding-left: 40px;
  }

  .help-result,
  .help-tip,
  .help-warning {
    font-size: 16px;
  }

  .help-table {
    font-size: 16px;
  }

  .help-table th {
    font-size: 15px;
  }

  .help-table th,
  .help-table td {
    padding: 12px 14px;
  }

  .help-back-to-top {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}
