/* ==========================================================================
   GratisChat Hjælpecenter — help.css
   Wikipedia-style help page: hero, search, category grid, accordion, articles
   ========================================================================== */

/* ── Custom properties ───────────────────────────────────────────────────── */
:root {
  --help-accent:          #3b82f6;
  --help-accent-dark:     #2563eb;
  --help-accent-soft:     rgba(59,130,246,0.09);
  --help-accent-border:   rgba(59,130,246,0.25);
  --help-hero-bg-start:   #1e3a5f;
  --help-hero-bg-end:     #312e81;
  --help-card-bg:         #ffffff;
  --help-card-border:     #e2e8f0;
  --help-card-shadow:     0 2px 12px rgba(0,0,0,0.07);
  --help-card-shadow-hov: 0 8px 28px rgba(59,130,246,0.18);
  --help-body-bg:         #f8fafc;
  --help-text:            #0f172a;
  --help-text-muted:      #64748b;
  --help-text-hero:       #ffffff;
  --help-search-bg:       #ffffff;
  --help-search-border:   rgba(0,0,0,0.12);
  --help-faq-border:      #e2e8f0;
  --help-faq-open-bg:     rgba(59,130,246,0.04);
  --help-mark-bg:         #fef08a;
  --help-mark-text:       #1e293b;
  --help-radius:          14px;
  --help-radius-sm:       9px;
  --help-section-gap:     52px;
}

html.dark,
html.trueblue {
  --help-card-bg:       #1e2029;
  --help-card-border:   rgba(255,255,255,0.08);
  --help-card-shadow:   0 2px 12px rgba(0,0,0,0.30);
  --help-card-shadow-hov: 0 8px 28px rgba(59,130,246,0.28);
  --help-body-bg:       #131417;
  --help-text:          #e2e8f0;
  --help-text-muted:    #94a3b8;
  --help-search-bg:     #25272f;
  --help-search-border: rgba(255,255,255,0.12);
  --help-faq-border:    rgba(255,255,255,0.08);
  --help-faq-open-bg:   rgba(59,130,246,0.08);
  --help-mark-bg:       rgba(253,224,71,0.25);
  --help-mark-text:     #fef08a;
}

/* ── Page wrapper ───────────────────────────────────────────────────────── */
.help-page {
  background: var(--help-body-bg);
  min-height: 100vh;
  font-family: inherit;
  color: var(--help-text);
}

/* ── Hero header ────────────────────────────────────────────────────────── */
.help-hero {
  background: linear-gradient(135deg, var(--help-hero-bg-start) 0%, var(--help-hero-bg-end) 100%);
  padding: 56px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative floating circles */
.help-hero::before,
.help-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.help-hero::before {
  width: 420px; height: 420px;
  top: -160px; left: -100px;
}
.help-hero::after {
  width: 300px; height: 300px;
  bottom: -120px; right: -60px;
}

.help-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}

.help-hero-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
  animation: help-icon-float 3s ease-in-out infinite;
}

@keyframes help-icon-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.help-hero-title {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  color: var(--help-text-hero);
  margin: 0 0 10px;
  line-height: 1.2;
}

.help-hero-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.72);
  margin: 0 0 32px;
  line-height: 1.5;
}

/* ── Search bar ─────────────────────────────────────────────────────────── */
.help-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.help-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--help-text-muted);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

.help-search-input {
  width: 100%;
  padding: 16px 52px 16px 50px;
  font-size: 15px;
  background: var(--help-search-bg);
  border: 2px solid transparent;
  border-radius: 999px;
  outline: none;
  color: var(--help-text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

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

.help-search-input:focus {
  border-color: var(--help-accent);
  box-shadow: 0 4px 24px rgba(59,130,246,0.30);
}

.help-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--help-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  display: none;
}

.help-search-clear:hover {
  color: var(--help-text);
}

.help-search-wrap.has-text .help-search-clear {
  display: flex;
}

/* ── Search results counter ─────────────────────────────────────────────── */
.help-search-count {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  min-height: 20px;
  transition: opacity 0.2s;
}

/* ── Main content ───────────────────────────────────────────────────────── */
.help-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Section title ──────────────────────────────────────────────────────── */
.help-section-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--help-text);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--help-card-border) 0%, transparent 100%);
  border-radius: 99px;
}

/* ── Category card grid ─────────────────────────────────────────────────── */
.help-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: var(--help-section-gap);
}

.help-cat-card {
  background: var(--help-card-bg);
  border: 1px solid var(--help-card-border);
  border-radius: var(--help-radius);
  padding: 22px 20px 18px;
  cursor: pointer;
  text-decoration: none;
  color: var(--help-text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--help-card-shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.help-cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--help-accent-soft);
  opacity: 0;
  transition: opacity 0.18s;
}

.help-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--help-card-shadow-hov);
  border-color: var(--help-accent-border);
  text-decoration: none;
  color: var(--help-text);
}

.help-cat-card:hover::before {
  opacity: 1;
}

.help-cat-icon {
  font-size: 32px;
  line-height: 1;
  position: relative;
}

.help-cat-name {
  font-weight: 700;
  font-size: 14px;
  position: relative;
  line-height: 1.3;
}

.help-cat-count {
  font-size: 12px;
  color: var(--help-text-muted);
  position: relative;
}

/* Active/filtered state */
.help-cat-card.is-active {
  border-color: var(--help-accent);
  background: var(--help-accent-soft);
}

/* ── Quick launch bar ───────────────────────────────────────────────────── */
.help-quickbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--help-section-gap);
}

.help-quickbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--help-card-bg);
  border: 1px solid var(--help-card-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--help-text);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--help-card-shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.help-quickbar-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--help-card-shadow-hov);
  border-color: var(--help-accent-border);
  color: var(--help-accent);
  text-decoration: none;
}

.help-quickbar-btn .hqb-icon {
  font-size: 16px;
}

/* ── FAQ Accordion ──────────────────────────────────────────────────────── */
.help-faq-section {
  margin-bottom: var(--help-section-gap);
}

.help-faq-group {
  border: 1px solid var(--help-faq-border);
  border-radius: var(--help-radius);
  overflow: hidden;
  background: var(--help-card-bg);
  box-shadow: var(--help-card-shadow);
  margin-bottom: 20px;
}

.help-faq-group-header {
  padding: 16px 20px;
  background: var(--help-card-bg);
  border-bottom: 1px solid var(--help-faq-border);
  font-size: 14px;
  font-weight: 700;
  color: var(--help-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-faq-group-icon {
  font-size: 20px;
}

.help-faq-item {
  border-bottom: 1px solid var(--help-faq-border);
}

.help-faq-item:last-child {
  border-bottom: none;
}

/* The button that expands/collapses */
.help-faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--help-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s;
  font-family: inherit;
  line-height: 1.4;
}

.help-faq-q:hover {
  background: var(--help-accent-soft);
}

.help-faq-q[aria-expanded="true"] {
  background: var(--help-faq-open-bg);
  color: var(--help-accent);
}

.help-faq-chevron {
  flex-shrink: 0;
  font-size: 18px;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  opacity: 0.6;
}

.help-faq-q[aria-expanded="true"] .help-faq-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Answer panel */
.help-faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s cubic-bezier(.4,0,.2,1),
              padding 0.25s ease,
              opacity 0.25s ease;
  opacity: 0;
}

.help-faq-a.is-open {
  opacity: 1;
}

.help-faq-a-inner {
  padding: 4px 20px 18px 20px;
  font-size: 13.5px;
  color: var(--help-text-muted);
  line-height: 1.7;
}

.help-faq-a-inner p {
  margin: 0 0 10px;
}

.help-faq-a-inner p:last-child {
  margin: 0;
}

.help-faq-a-inner ul,
.help-faq-a-inner ol {
  padding-left: 20px;
  margin: 6px 0 10px;
}

.help-faq-a-inner li {
  margin-bottom: 5px;
}

/* Tip box inside answer */
.help-faq-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--help-accent-soft);
  border-left: 3px solid var(--help-accent);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--help-text-muted);
  line-height: 1.5;
}

/* ── Search highlight ───────────────────────────────────────────────────── */
mark.help-mark {
  background: var(--help-mark-bg);
  color: var(--help-mark-text);
  border-radius: 3px;
  padding: 0 2px;
}

/* Hidden item (filtered by search/category) */
.help-faq-item.is-hidden,
.help-cat-card.is-hidden {
  display: none;
}

/* ── No results message ─────────────────────────────────────────────────── */
.help-no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--help-text-muted);
  font-size: 15px;
  display: none;
}

.help-no-results.is-visible {
  display: block;
}

.help-no-results-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── CTA strip ──────────────────────────────────────────────────────────── */
.help-cta-strip {
  background: linear-gradient(135deg, var(--help-hero-bg-start) 0%, var(--help-hero-bg-end) 100%);
  border-radius: var(--help-radius);
  padding: 32px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--help-section-gap);
}

.help-cta-text h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px;
}

.help-cta-text p {
  font-size: 13.5px;
  color: rgba(255,255,255,0.68);
  margin: 0;
}

.help-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.help-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.help-cta-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.help-cta-btn--primary {
  background: #fff;
  color: var(--help-hero-bg-end);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.help-cta-btn--primary:hover {
  color: var(--help-hero-bg-end);
}

.help-cta-btn--secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

.help-cta-btn--secondary:hover {
  background: rgba(255,255,255,0.20);
  color: #fff;
}

/* ── Back-to-top button ─────────────────────────────────────────────────── */
.help-back-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--help-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59,130,246,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 900;
}

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

.help-back-top:hover {
  background: var(--help-accent-dark);
}

/* ── Anchor link smooth scroll offset ──────────────────────────────────── */
.help-anchor {
  scroll-margin-top: 80px;
}

/* ── Live search mode overrides ─────────────────────────────────────────── */
body.help-searching .help-cats,
body.help-searching .help-quickbar,
body.help-searching .help-cta-strip {
  display: none;
}

body.help-searching .help-section-title--cats {
  display: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .help-hero {
    padding: 40px 20px 50px;
  }

  .help-cats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .help-cat-card {
    padding: 16px 14px 14px;
  }

  .help-content {
    padding: 32px 16px 60px;
  }

  .help-cta-strip {
    padding: 24px 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 601px) and (max-width: 860px) {
  .help-cats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .help-hero-icon,
  .help-cat-card,
  .help-faq-a,
  .help-search-input,
  .help-back-top {
    animation: none !important;
    transition: none !important;
  }
}
