/* ============================================================================
   BLEUM HELP CENTER - Shared Styles
   Matches the BLEUM admin design system (green brand, clean cards)
   ============================================================================ */

:root {
  --brand-50: #f0fdf4;
  --brand-100: #dcfce7;
  --brand-200: #bbf7d0;
  --brand-300: #86efac;
  --brand-400: #4ade80;
  --brand-500: #3e8e3e;
  --brand-600: #2d7a4e;
  --brand-700: #236b3e;
  --brand-800: #1a5c30;
  --brand-900: #0f4020;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8faf9;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e40af;
  --tip-bg: #f0fdf4;
  --tip-border: #bbf7d0;
  --tip-text: #166534;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }

/* ============================================================================
   LAYOUT
   ============================================================================ */

.help-layout {
  display: flex;
  min-height: 100vh;
}

.help-sidebar {
  width: 280px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 10;
  padding: 24px 0;
}

.help-sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.help-sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.help-sidebar-brand img {
  width: 32px;
  height: 32px;
}

.help-sidebar-brand span {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-600);
  letter-spacing: 0.5px;
}

.help-sidebar-brand .brand-subtitle {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-top: 2px;
}

.help-sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.help-sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}

.help-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.help-sidebar-link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  text-decoration: none;
}

.help-sidebar-link.active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

.help-sidebar-link .link-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* Main Content */
.help-main {
  flex: 1;
  margin-left: 280px;
  padding: 40px 48px 80px;
  max-width: 900px;
}

/* ============================================================================
   ARTICLE METADATA (hidden, for RAG indexing)
   ============================================================================ */

.help-meta {
  display: none;
}

/* ============================================================================
   BREADCRUMB
   ============================================================================ */

.help-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.help-breadcrumb a {
  color: var(--text-muted);
}

.help-breadcrumb a:hover {
  color: var(--brand-600);
}

.help-breadcrumb .sep {
  color: var(--text-light);
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.help-page-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.help-page-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.help-page-header .subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================================
   CONTENT SECTIONS
   ============================================================================ */

.help-section {
  margin-bottom: 40px;
}

.help-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-100);
}

.help-section h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}

.help-section p {
  margin-bottom: 14px;
  color: var(--text);
}

.help-section ul, .help-section ol {
  margin: 12px 0 16px 24px;
}

.help-section li {
  margin-bottom: 8px;
  color: var(--text);
}

/* ============================================================================
   STEP-BY-STEP GUIDES
   ============================================================================ */

.help-steps {
  counter-reset: step;
  margin: 20px 0;
}

.help-step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.help-step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-500);
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.help-step-content {
  flex: 1;
}

.help-step-content strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.help-step-content p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================================================
   CARDS & FEATURE BOXES
   ============================================================================ */

.help-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.help-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.help-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.help-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.help-feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.help-feature-card .feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.help-feature-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.help-feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================================
   CALLOUT BOXES (info, tip, warning)
   ============================================================================ */

.help-callout {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
}

.help-callout.info {
  background: var(--info-bg);
  border-left: 4px solid #3b82f6;
  color: var(--info-text);
}

.help-callout.tip {
  background: var(--tip-bg);
  border-left: 4px solid var(--brand-400);
  color: var(--tip-text);
}

.help-callout.warning {
  background: var(--warn-bg);
  border-left: 4px solid #f59e0b;
  color: var(--warn-text);
}

.help-callout strong {
  display: block;
  margin-bottom: 4px;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.help-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--brand-50);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.help-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text);
}

.help-table tr:nth-child(even) td {
  background: #fafafa;
}

/* ============================================================================
   FAQ SECTION
   ============================================================================ */

.help-faq {
  margin: 20px 0;
}

.help-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.help-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-white);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease;
}

.help-faq-question:hover {
  background: var(--brand-50);
}

.help-faq-question .chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.help-faq-item.open .help-faq-question .chevron {
  transform: rotate(180deg);
}

.help-faq-answer {
  display: none;
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.help-faq-item.open .help-faq-answer {
  display: block;
}

/* ============================================================================
   RELATED ARTICLES
   ============================================================================ */

.help-related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.help-related h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.help-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.help-related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-700);
  text-decoration: none;
  transition: all 0.15s ease;
}

.help-related-link:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
  text-decoration: none;
}

/* ============================================================================
   INDEX PAGE - CATEGORY GRID
   ============================================================================ */

.help-category {
  margin-bottom: 36px;
}

.help-category-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-600);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-100);
}

.help-index-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.help-index-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-1px);
}

.help-index-card .card-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  border-radius: var(--radius-sm);
}

.help-index-card .card-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.help-index-card .card-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ============================================================================
   SEARCH BAR (Index page)
   ============================================================================ */

.help-search {
  position: relative;
  margin-bottom: 32px;
}

.help-search input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s ease;
  outline: none;
}

.help-search input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(62, 142, 62, 0.1);
}

.help-search input::placeholder {
  color: var(--text-light);
}

.help-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Ask button inside search bar */
#help-ask-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand-500);
  color: white;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

#help-ask-btn:hover {
  background: var(--brand-700);
}

.help-search input {
  padding-right: 52px;
}

/* ============================================================================
   AI ANSWER PANEL
   ============================================================================ */

.help-ai-answer {
  background: var(--bg-white);
  border: 2px solid var(--brand-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.help-ai-answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.help-ai-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-600);
  background: var(--brand-50);
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.help-ai-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.help-ai-close:hover {
  background: var(--border-light);
  color: var(--text);
}

.help-ai-answer-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}

.help-ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.help-ai-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-200);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.help-ai-articles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.help-ai-articles-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.help-ai-article-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-700);
  text-decoration: none;
  transition: all 0.15s ease;
}

.help-ai-article-link:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
  text-decoration: none;
}

.help-ai-meta {
  font-size: 11px;
  color: var(--text-light);
}

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 900px) {
  .help-sidebar {
    display: none;
  }

  .help-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .help-card-grid {
    grid-template-columns: 1fr;
  }

  .help-page-header h1 {
    font-size: 26px;
  }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .help-sidebar { display: none; }
  .help-main { margin-left: 0; max-width: none; }
  .help-faq-answer { display: block !important; }
}
