/*
 * PhantomYerra Help Center — Premium Dark Design System
 * © Ravi Yerra. All Rights Reserved.
 */

/* ── Design Tokens — yerra-audit system ──────────────────────── */
:root {
  /* Core yerra-audit palette */
  --midnight:           #001A2C;
  --deep-navy:          #002A45;
  --teal:               #006E8A;
  --teal-mid:           #008BAD;
  --cobalt:             #1A5CFF;
  --cobalt-hover:       #1449CC;
  --frost-bg:           #EBF5FA;
  --frost-card:         #F7FBFD;

  /* Text */
  --text-primary:       #2C3E50;
  --text-muted:         #5A7080;
  --text-subtle:        #8FA3B0;

  /* Borders */
  --border:             #D4E4EE;
  --border-subtle:      #E8F0F5;

  /* Help-specific aliases — dark content theme */
  --help-bg:            #0B1929;
  --help-sidebar-bg:    var(--deep-navy);
  --help-card-bg:       #0F2336;
  --help-card-hover:    #132D45;
  --help-border:        rgba(255,255,255,0.08);
  --help-border-subtle: rgba(255,255,255,0.04);
  --help-border-hover:  var(--cobalt);
  --help-accent:        var(--cobalt);
  --help-accent-light:  #5B8FFF;
  --help-accent-dim:    rgba(26,92,255,0.15);
  --help-success:       #34D399;
  --help-warning:       #FBBF24;
  --help-danger:        #F87171;
  --help-info:          #60A5FA;
  --help-text:          rgba(255,255,255,0.82);
  --help-text-muted:    rgba(255,255,255,0.48);
  --help-text-bright:   #FFFFFF;
  --help-heading:       #FFFFFF;
  --help-code-bg:       #071220;
  --help-code-border:   rgba(26,92,255,0.25);
  --help-kbd-bg:        rgba(255,255,255,0.07);
  --help-kbd-border:    rgba(255,255,255,0.12);

  --sidebar-width:      280px;
  --content-max:        860px;
  --radius-sm:          4px;
  --radius-md:          8px;
  --radius-lg:          12px;
  --radius-xl:          16px;
  --shadow-glow:        0 4px 20px rgba(26,92,255,0.15);
  --shadow-card:        0 1px 3px rgba(0,26,44,0.08), 0 1px 2px rgba(0,26,44,0.06);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--help-bg);
  color: var(--help-text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-hover); text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.help-sidebar {
  background: var(--help-sidebar-bg);  /* deep-navy #002A45 */
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.help-sidebar::-webkit-scrollbar { width: 4px; }
.help-sidebar::-webkit-scrollbar-track { background: transparent; }
.help-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
/* All text inside the dark sidebar must be white-tinted */
.help-sidebar, .help-sidebar * { color: rgba(255,255,255,0.70); }
.help-sidebar a { color: rgba(255,255,255,0.70); }
.help-sidebar a:hover { color: white; text-decoration: none; }

/* Sidebar Header */
.sidebar-header {
  padding: 20px 16px 0;
  border-bottom: 1px solid var(--help-border);
  padding-bottom: 16px;
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  text-align: center;
}
.sidebar-logo img {
  max-width: 130px;
  height: auto;
  display: block;
}
.sidebar-logo-text {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.40);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Search Box */
.search-box {
  position: relative;
}
.search-box::before {
  content: '⌕';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--help-text-muted);
  font-size: 16px;
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.90);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(26,92,255,0.25);
}
#search::placeholder { color: rgba(255,255,255,0.35); }

/* Search Results */
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.search-result {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--help-border);
  transition: background 0.15s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--help-card-hover); }
.result-title {
  font-size: 13px;
  color: var(--help-text-bright);
  font-weight: 500;
}
.result-tags {
  font-size: 11px;
  color: var(--help-text-muted);
  margin-top: 2px;
}
.no-results {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--help-text-muted);
  text-align: center;
}

/* Topic Tree */
.sidebar-nav {
  padding: 12px 0 20px;
  flex: 1;
}
.topic-tree {
  list-style: none;
}
.topic-group {
  margin-bottom: 4px;
}
.topic-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--help-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.topic-group-header:hover { color: var(--help-text); }
.topic-group-header .chevron {
  transition: transform 0.2s;
  font-size: 10px;
}
.topic-group.collapsed .chevron { transform: rotate(-90deg); }
.topic-group.collapsed .topic-items { display: none; }
.topic-items {
  list-style: none;
  padding: 0 0 4px;
}
.topic-items li a {
  display: block;
  padding: 6px 16px 6px 28px;
  font-size: 13px;
  color: rgba(255,255,255,0.60);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.topic-items li a:hover {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.07);
  border-left-color: var(--cobalt);
  text-decoration: none;
}
.topic-items li a.active {
  color: white;
  background: rgba(26,92,255,0.22);
  border-left-color: var(--cobalt);
  font-weight: 600;
}

/* ── Main Content ───────────────────────────────────────────── */
.help-content {
  overflow-y: auto;
  padding: 40px 48px;
  background: var(--help-bg);
}
.help-content::-webkit-scrollbar { width: 6px; }
.help-content::-webkit-scrollbar-track { background: transparent; }
.help-content::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.2); border-radius: 3px; }
.help-content::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.4); }

.help-content-inner {
  max-width: var(--content-max);
}

/* ── Welcome Screen ─────────────────────────────────────────── */
.help-welcome h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--help-heading);
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 30%, var(--help-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.help-welcome p {
  font-size: 16px;
  color: var(--help-text-muted);
  margin-bottom: 36px;
}
.quick-start-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.quick-card {
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  display: block;
}
.quick-card:hover {
  border-color: var(--help-border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.quick-card-icon { font-size: 28px; margin-bottom: 10px; }
.quick-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--help-text-bright);
  margin-bottom: 4px;
}
.quick-card-desc {
  font-size: 13px;
  color: var(--help-text-muted);
  line-height: 1.5;
}

/* ── Help Page Article ──────────────────────────────────────── */
.help-page { max-width: var(--content-max); }

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--help-border);
}
.page-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--help-heading);
  margin-bottom: 6px;
}
.page-header p {
  font-size: 15px;
  color: var(--help-text-muted);
  line-height: 1.6;
}

/* ── Mode Tabs ──────────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: var(--radius-lg);
  padding: 6px;
}
.mode-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--help-text-muted);
  background: transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mode-tab:hover { color: var(--help-text); background: var(--help-card-hover); }
.mode-tab.active {
  background: var(--cobalt);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,92,255,0.35);
}

/* ── Mode Steps ─────────────────────────────────────────────── */
.mode-steps.hidden { display: none; }

/* Prerequisites */
.prereq-box {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.prereq-box h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--help-success);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.prereq-box ul { list-style: none; }
.prereq-box ul li {
  font-size: 13px;
  color: var(--help-text);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.prereq-box ul li::before {
  content: '✓';
  color: var(--help-success);
  font-weight: 700;
  flex-shrink: 0;
}

/* Info / Warning boxes */
.info-box {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--help-text);
}
.info-box strong { color: #60A5FA; }
.warn-box {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--help-text);
}
.warn-box strong { color: var(--help-warning); }
.danger-box {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--help-text);
}
.danger-box strong { color: var(--help-danger); }

/* Steps List */
.steps { list-style: none; padding: 0; }
.step {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
}
.step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  width: 2px;
  height: calc(100% - 8px);
  background: linear-gradient(to bottom, var(--help-accent-dim), transparent);
}
.step:last-child::before { display: none; }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--help-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--help-accent-dim);
}
.step-content { flex: 1; padding-top: 4px; }
.step-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--help-text-bright);
  margin-bottom: 6px;
}
.step-content p {
  font-size: 14px;
  color: var(--help-text);
  line-height: 1.65;
  margin-bottom: 10px;
}
.step-content p:last-child { margin-bottom: 0; }

/* Step Tip */
.step-tip {
  background: var(--help-accent-dim);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--help-text);
  margin-top: 8px;
}

/* Step Code */
.step-code {
  background: var(--help-code-bg);
  border: 1px solid var(--help-code-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #E2E8F0;
  white-space: pre;
  overflow-x: auto;
  margin-top: 10px;
}
.step-code::-webkit-scrollbar { height: 4px; }
.step-code::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 2px; }

/* Code blocks */
pre, code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}
pre {
  background: var(--help-code-bg);
  border: 1px solid var(--help-code-border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: #E2E8F0;
  margin: 12px 0;
}
code {
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 12.5px;
  color: #C4B5FD;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Keyboard shortcut */
kbd {
  background: var(--help-kbd-bg);
  border: 1px solid var(--help-kbd-border);
  border-bottom-width: 3px;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--help-text);
}

/* Expected time / summary */
.expected-time {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--help-text-muted);
}

/* What Claude Does */
.what-claude-does {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
}
.what-claude-does h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--help-accent-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.what-claude-does ul { list-style: none; }
.what-claude-does ul li {
  font-size: 13px;
  color: var(--help-text);
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}
.what-claude-does ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--help-accent);
}

/* ── Common Issues Accordion ────────────────────────────────── */
.issues-section {
  margin-top: 48px;
  border-top: 1px solid var(--help-border);
  padding-top: 32px;
}
.issues-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--help-heading);
  margin-bottom: 16px;
}
.accordion-item {
  border: 1px solid var(--help-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.accordion-item:hover { border-color: var(--help-border-hover); }
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--help-card-bg);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--help-text);
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}
.accordion-header:hover { background: var(--help-card-hover); }
.accordion-chevron { color: var(--help-text-muted); transition: transform 0.2s; font-size: 12px; }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  display: none;
  padding: 16px 18px;
  background: var(--help-bg);
  font-size: 13px;
  color: var(--help-text);
  line-height: 1.65;
  border-top: 1px solid var(--help-border);
}
.accordion-item.open .accordion-body { display: block; }

/* ── Related Topics ─────────────────────────────────────────── */
.related-section {
  margin-top: 40px;
  border-top: 1px solid var(--help-border);
  padding-top: 28px;
}
.related-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--help-heading);
  margin-bottom: 14px;
}
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--help-text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.related-link:hover {
  border-color: var(--help-border-hover);
  color: var(--help-accent-light);
  background: var(--help-accent-dim);
  text-decoration: none;
}

/* ── Section Headings ───────────────────────────────────────── */
h2 { font-size: 22px; font-weight: 600; color: var(--help-heading); margin: 36px 0 16px; }
h3 { font-size: 17px; font-weight: 600; color: var(--help-heading); margin: 24px 0 12px; }
h4 { font-size: 14px; font-weight: 600; color: var(--help-text-bright); margin: 16px 0 8px; }
p  { margin-bottom: 12px; }
ul, ol { padding-left: 24px; margin-bottom: 12px; }
li { margin-bottom: 6px; }

/* ── Copyright Footer ───────────────────────────────────────── */
.help-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--help-border);
  font-size: 12px;
  color: var(--help-text-muted);
  text-align: center;
}

/* ── Inline page load (search result click) ─────────────────── */
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--help-text-muted);
  margin-bottom: 28px;
}
.page-breadcrumb span { color: var(--help-text-muted); }
.page-breadcrumb a { color: var(--help-accent-light); }
.page-breadcrumb a:hover { color: var(--help-text-bright); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar { display: none; }
  .help-content { padding: 24px 20px; }
  .quick-start-cards { grid-template-columns: 1fr; }
  .mode-tabs { flex-direction: column; }
}

/* ── Scrollbar for main content ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.help-page { animation: fadeIn 0.25s ease; }
.help-welcome { animation: fadeIn 0.3s ease; }
