/* ─────────────────────────────────────────────
   HELP CENTER STYLES
   All brand colors come from JS (config) and
   are injected as CSS variables on <html>.
   ───────────────────────────────────────────── */

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

:root {
  --primary:       #FF1F6E;
  --primary-hover: #E0185F;
  --header-bg:     #FF1F6E;
  --header-text:   #ffffff;
  --card-accent:   #FF1F6E;
  --link:          #FF1F6E;

  --bg:            #f5f6fa;
  --surface:       #ffffff;
  --border:        #e2e4ed;
  --text:          #1e2029;
  --text-muted:    #6b7280;
  --text-light:    #9ca3af;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --font:          'Inter', system-ui, sans-serif;
  --transition:    .18s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; border-radius: var(--radius-sm); display: block; }

/* ── HEADER ──────────────────────────────────── */
.hc-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.hc-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--header-text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.hc-header .logo img { height: 32px; width: auto; border-radius: 6px; }

.hc-header nav { display: flex; align-items: center; gap: 8px; }
.hc-header nav a {
  color: rgba(255,255,255,.85);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.hc-header nav a:hover,
.hc-header nav a.active {
  background: rgba(255,255,255,.2);
  color: #fff;
  text-decoration: none;
}

/* ── HERO / SEARCH ───────────────────────────── */
.hc-hero {
  background: var(--header-bg);
  padding: 60px 24px 80px;
  text-align: center;
  color: var(--header-text);
}
.hc-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 8px;
}
.hc-hero p {
  font-size: 1.1rem;
  opacity: .85;
  margin-bottom: 32px;
}

.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  color: var(--text);
}
.search-wrap input::placeholder { color: var(--text-light); }
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  font-size: 1.1rem;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  border: 1px solid var(--border);
  text-align: left;
}
.search-results.open { display: block; }
.sr-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--bg); }
.sr-item .sr-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.sr-item .sr-cat  { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.sr-item .sr-snippet { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.sr-none { padding: 24px; text-align: center; color: var(--text-muted); font-size: .95rem; }

/* ── MAIN LAYOUT ──────────────────────────────── */
.hc-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── CATEGORIES GRID ─────────────────────────── */
.hc-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: .8rem;
  margin-bottom: 20px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 56px;
}

.cat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  text-decoration: none;
  display: block;
  color: var(--text);
}
.cat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--card-accent);
  text-decoration: none;
}
.cat-card .cat-icon { font-size: 2rem; margin-bottom: 12px; }
.cat-card .cat-label { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.cat-card .cat-count { font-size: .85rem; color: var(--text-muted); }
.cat-card .cat-bar {
  margin-top: 14px;
  height: 3px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.cat-card .cat-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--card-accent);
  border-radius: 2px;
}

/* ── ARTICLES LIST ───────────────────────────── */
.articles-section { margin-bottom: 40px; }
.articles-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.articles-list { display: flex; flex-direction: column; gap: 10px; }

.article-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.article-row:hover {
  box-shadow: var(--shadow);
  border-color: var(--card-accent);
  text-decoration: none;
}
.article-row .ar-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.article-row .ar-body { flex: 1; min-width: 0; }
.article-row .ar-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.article-row .ar-summary { font-size: .85rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-row .ar-arrow { color: var(--text-light); flex-shrink: 0; }

/* ── ARTICLE PAGE ────────────────────────────── */
.article-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}
.article-sidebar h3 {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.sidebar-links { list-style: none; }
.sidebar-links li { margin-bottom: 4px; }
.sidebar-links a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  font-weight: 500;
}
.sidebar-links a:hover,
.sidebar-links a.active {
  background: var(--bg);
  color: var(--link);
  text-decoration: none;
}

.article-content-wrap { flex: 1; min-width: 0; }

.article-breadcrumb {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-breadcrumb a { color: var(--link); }
.article-breadcrumb a:hover { text-decoration: underline; }

.article-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.article-meta .meta-cat {
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--border);
}

.article-body h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: 16px; line-height: 1.3; }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 14px; color: var(--text); }
.article-body h3 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 10px; color: var(--text); }
.article-body p  { margin-bottom: 16px; color: var(--text); line-height: 1.75; }
.article-body ul,
.article-body ol { padding-left: 22px; margin-bottom: 16px; }
.article-body li { margin-bottom: 8px; line-height: 1.7; }
.article-body a  { color: var(--link); }
.article-body a:hover { text-decoration: underline; }
.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }
.article-body kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .85rem;
  font-family: monospace;
}
.article-body .info-box {
  background: #f0eeff;
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
  font-size: .95rem;
  color: var(--text);
}
.article-body img,
.article-hero-img {
  cursor: zoom-in;
}
.article-body img {
  width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid var(--border);
}
.article-body video,
.article-body .hc-article-video {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
  background: #000;
}

/* image lightbox */
.hc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
}
.hc-lightbox[hidden] { display: none; }
.hc-lightbox-img {
  max-width: min(95vw, 1400px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: none;
}
.hc-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}
.hc-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* feedback */
.article-feedback {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.article-feedback p { font-weight: 600; margin-bottom: 14px; color: var(--text-muted); }
.feedback-btns { display: flex; gap: 10px; justify-content: center; }
.feedback-btn {
  padding: 8px 22px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--font);
  transition: background var(--transition), border-color var(--transition);
}
.feedback-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

/* ── ADMIN PAGE ──────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}
.admin-sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .admin-sidebar-title {
  padding: 0 20px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.admin-sidebar-list { list-style: none; flex: 1; overflow-y: auto; }
.admin-sidebar-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: .9rem;
  color: var(--text);
  font-weight: 500;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar-list li a:hover,
.admin-sidebar-list li a.active {
  background: var(--bg);
  border-left-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.admin-sidebar-list .cat-group-label {
  padding: 14px 20px 4px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.btn-new-article {
  margin: 12px 16px 0;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
  text-align: center;
  display: block;
  text-decoration: none;
}
.btn-new-article:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }

.admin-editor {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}
.admin-editor h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 28px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 100px; }

/* Rich text toolbar */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.toolbar-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  font-size: .85rem;
  font-family: var(--font);
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.toolbar-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.toolbar-sep { width: 1px; background: var(--border); margin: 2px 4px; }

.editor-area {
  min-height: 380px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--font);
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.editor-area:focus { border-color: var(--primary); }
.editor-area h2 { font-size: 1.3rem; margin: 20px 0 10px; }
.editor-area h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.editor-area p  { margin-bottom: 12px; }
.editor-area ul,
.editor-area ol { padding-left: 20px; margin-bottom: 12px; }
.editor-area li { margin-bottom: 4px; }
.editor-area .info-box {
  background: #f0eeff;
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 12px 0;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  border: none;
  transition: background var(--transition), opacity var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger  { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }

.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.image-upload-area:hover { border-color: var(--primary); background: var(--bg); }
.image-upload-area p { color: var(--text-muted); font-size: .9rem; margin: 0; }
.image-upload-area input { display: none; }
.uploaded-img-preview {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}
.uploaded-img-preview img { max-height: 180px; border-radius: var(--radius-sm); }
.remove-img-btn {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px; height: 24px;
  cursor: pointer;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
}

/* Config panel */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 40px; height: 36px;
  padding: 2px; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--border);
}
.color-row input[type="text"] { flex: 1; }

.preview-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.preview-box h4 { font-size: .9rem; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #1e2029;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all .25s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #22c55e; }
.toast.error   { background: #ef4444; }

/* ── FOOTER ──────────────────────────────────── */
.hc-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
}
.hc-footer a { color: var(--link); }

/* ── EMPTY / 404 ─────────────────────────────── */
.hc-empty {
  text-align: center;
  padding: 80px 24px;
}
.hc-empty .empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.hc-empty h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.hc-empty p  { color: var(--text-muted); max-width: 380px; margin: 0 auto 24px; }
.hc-empty a  { color: var(--link); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .article-layout { flex-direction: column; padding: 24px 16px 60px; }
  .article-sidebar { width: 100%; position: static; }
  .admin-layout  { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .config-grid   { grid-template-columns: 1fr; }
  .hc-hero { padding: 40px 16px 56px; }
  .hc-main { padding: 32px 16px 60px; }
  .admin-editor { padding: 20px 16px; }
}
