/* ==========================================================================
   SUPPORT.CSS — Hệ thống tài liệu Hướng dẫn & Download
   Tổng Kho Mã Vạch Việt Nam · tongkhomavach.com
   Phong cách: Modern minimal docs · 1 file dùng chung cho mọi trang
   ========================================================================== */

/* -------- Google Font (Be Vietnam Pro — tối ưu tiếng Việt) -------- */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

/* -------------------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------------------- */
:root {
    /* Brand (đồng bộ nhẹ với web chính nhưng tông docs trung tính) */
    --c-primary:      #0154A0;
    --c-accent:       #FF6702;
    --c-accent-soft:  #FFF3E8;
    --c-link:         #1797d2;
    --c-link-hover:   #0154A0;
    --c-success:      #1e8449;
    --c-success-soft: #e8f8ef;
    --c-warn:         #b9770e;
    --c-warn-soft:    #fff7e6;

    /* Neutrals — 1 gam xám lạnh nhẹ */
    --c-bg:           #f6f8fa;
    --c-surface:      #ffffff;
    --c-surface-2:    #f0f3f6;
    --c-border:       #e3e8ee;
    --c-border-strong:#cfd8e0;
    --c-text:         #1f2933;
    --c-text-soft:    #52606d;
    --c-text-muted:   #7b8794;

    /* Spacing */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

    /* Radius */
    --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-full: 999px;

    /* Shadow — tinted, nhẹ */
    --sh-sm: 0 1px 2px rgba(16, 42, 67, 0.06);
    --sh-md: 0 4px 12px rgba(16, 42, 67, 0.08);
    --sh-lg: 0 12px 32px rgba(16, 42, 67, 0.12);

    /* Layout */
    --maxw: 1120px;
    --nav-h: 60px;

    --t-fast: 0.18s ease;
    --t-mid:  0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* -------------------------------------------------------------------------
   2. RESET / BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    margin: 0;
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--c-text); font-weight: 700; letter-spacing: -0.01em; }

code, kbd {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.9em;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 1px 6px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4); }

/* -------------------------------------------------------------------------
   3. TOP NAV (sticky)
   ------------------------------------------------------------------------- */
.site-nav {
    position: sticky; top: 0; z-index: 100;
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--c-border);
}
.site-nav .container {
    height: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.site-nav .brand {
    display: flex; align-items: center; gap: var(--sp-2);
    font-weight: 700; color: var(--c-primary); font-size: 0.95rem;
    white-space: nowrap;
}
.site-nav .brand:hover { text-decoration: none; }
.site-nav .brand .dot {
    width: 26px; height: 26px; border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--c-primary), var(--c-link));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.nav-links a {
    color: var(--c-text-soft); font-size: 0.875rem; font-weight: 500;
    padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm);
}
.nav-links a:hover { color: var(--c-primary); background: var(--c-surface-2); text-decoration: none; }
.nav-cta {
    background: var(--c-accent) !important; color: #fff !important;
    font-weight: 600 !important;
}
.nav-cta:hover { background: #e65c00 !important; }
.nav-toggle { display: none; background: none; border: 0; font-size: 24px; color: var(--c-text); cursor: pointer; }

/* -------------------------------------------------------------------------
   4. HERO
   ------------------------------------------------------------------------- */
.hero {
    background:
        radial-gradient(1200px 400px at 70% -10%, rgba(23,151,210,0.10), transparent 60%),
        linear-gradient(180deg, #ffffff, var(--c-bg));
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-8) 0 var(--sp-7);
}
.hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin: 0 0 var(--sp-3);
}
.hero .lead {
    font-size: 1.05rem; color: var(--c-text-soft); max-width: 62ch; margin: 0 0 var(--sp-5);
}
.hero .eyebrow {
    display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--c-accent);
    background: var(--c-accent-soft); padding: 4px 12px; border-radius: var(--r-full);
    margin-bottom: var(--sp-4);
}

/* -------------------------------------------------------------------------
   5. SEARCH BOX (index + category)
   ------------------------------------------------------------------------- */
.search-wrap { position: relative; max-width: 520px; }
.search-wrap svg, .search-wrap .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-text-muted); }
#supportSearch, .support-search {
    width: 100%;
    font: inherit; font-size: 1rem;
    padding: 12px 16px 12px 42px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
#supportSearch:focus, .support-search:focus {
    outline: none; border-color: var(--c-link);
    box-shadow: 0 0 0 4px rgba(23,151,210,0.12);
}
.search-empty { display: none; color: var(--c-text-muted); padding: var(--sp-5) 0; text-align: center; }

/* -------------------------------------------------------------------------
   6. SECTION
   ------------------------------------------------------------------------- */
.section { padding: var(--sp-7) 0; }
.section-head { margin-bottom: var(--sp-5); }
.section-head h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0 0 var(--sp-2); }
.section-head p { color: var(--c-text-soft); margin: 0; }

/* -------------------------------------------------------------------------
   7. CARD GRID (category / hub)
   ------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--sp-4);
}
.doc-card {
    display: flex; flex-direction: column; gap: var(--sp-2);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--sh-sm);
    transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
    color: inherit;
}
.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
    border-color: var(--c-link);
    text-decoration: none;
}
.doc-card .ic-box {
    width: 44px; height: 44px; border-radius: var(--r-md);
    background: var(--c-surface-2); color: var(--c-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: var(--sp-2);
}
.doc-card h3 { font-size: 1.05rem; margin: 0; }
.doc-card p { font-size: 0.9rem; color: var(--c-text-soft); margin: 0; }
.doc-card .tag {
    margin-top: auto; font-size: 0.78rem; font-weight: 600; color: var(--c-link);
    display: inline-flex; align-items: center; gap: 4px;
}
.doc-card[hidden] { display: none; }

/* -------------------------------------------------------------------------
   8. ARTICLE LAYOUT (detail + TOC sidebar)
   ------------------------------------------------------------------------- */
.article-wrap {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--sp-6);
    align-items: start;
    padding: var(--sp-6) 0 var(--sp-8);
}
.toc {
    position: sticky; top: calc(var(--nav-h) + 16px);
    align-self: start;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    max-height: calc(100vh - var(--nav-h) - 40px);
    overflow-y: auto;
}
.toc h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-muted); margin: 0 0 var(--sp-3); }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a {
    display: block; font-size: 0.875rem; color: var(--c-text-soft);
    padding: 6px 10px; border-radius: var(--r-sm); border-left: 2px solid transparent;
}
.toc a:hover { background: var(--c-surface-2); color: var(--c-primary); text-decoration: none; }
.toc a.active { color: var(--c-primary); font-weight: 600; border-left-color: var(--c-accent); background: var(--c-surface-2); }

.article { min-width: 0; }
.article > h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    margin: 0 0 var(--sp-2);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--c-border);
}
.article .article-meta { color: var(--c-text-muted); font-size: 0.875rem; margin-bottom: var(--sp-5); }

/* -------------------------------------------------------------------------
   9. ACCORDION (.topic / .question / .answer) — giữ tên class tương thích cũ
   ------------------------------------------------------------------------- */
.topic {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-3);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}
.topic .open, .topic > .q-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    cursor: pointer; user-select: none;
    padding: var(--sp-4) var(--sp-5);
    transition: background var(--t-fast);
}
.topic .open:hover, .topic > .q-head:hover { background: var(--c-surface-2); }
.question {
    margin: 0; font-size: 1.02rem; font-weight: 600; color: var(--c-text);
    display: flex; align-items: center; gap: var(--sp-2);
}
h2.question, h3.question { font-size: 1.02rem; }
/* mũi tên */
.faq-t, .topic .chev {
    flex: 0 0 auto; width: 20px; height: 20px; position: relative; transition: transform var(--t-mid);
}
.faq-t::before, .faq-t::after {
    content: ""; position: absolute; top: 9px; width: 10px; height: 2px; background: var(--c-text-muted); border-radius: 2px;
}
.faq-t::before { left: 2px; transform: rotate(45deg); }
.faq-t::after  { right: 2px; transform: rotate(-45deg); }
.topic.is-open .faq-t { transform: rotate(180deg); }

.answer {
    margin: 0;
    padding: 0 var(--sp-5);
    max-height: 0; overflow: hidden;
    color: var(--c-text-soft);
    transition: max-height var(--t-mid), padding var(--t-mid);
}
.topic.is-open .answer { padding: 0 var(--sp-5) var(--sp-5); max-height: 8000px; }
.answer a { color: var(--c-link); font-weight: 500; }
.answer img {
    border-radius: var(--r-md); border: 1px solid var(--c-border);
    margin: var(--sp-3) 0; box-shadow: var(--sh-sm);
}
.answer strong, .answer b { color: var(--c-text); }

/* Bullet kiểu chevron cũ (lni-chevron-right) → dot */
.answer .lni-chevron-right { color: var(--c-accent); font-weight: 700; }

/* nút copy link mục */
.q-copy {
    flex: 0 0 auto; background: none; border: 0; cursor: pointer;
    color: var(--c-text-muted); font-size: 14px; padding: 4px; border-radius: var(--r-sm);
    opacity: 0; transition: opacity var(--t-fast), color var(--t-fast);
}
.topic .open:hover .q-copy { opacity: 1; }
.q-copy:hover { color: var(--c-primary); background: var(--c-surface-2); }

/* -------------------------------------------------------------------------
   10. CALLOUT (chú ý / cảnh báo / mẹo)
   ------------------------------------------------------------------------- */
.callout {
    border-left: 4px solid var(--c-link);
    background: var(--c-surface-2);
    border-radius: var(--r-sm);
    padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-4) 0;
    font-size: 0.95rem;
}
.callout.warn   { border-color: var(--c-warn);    background: var(--c-warn-soft); }
.callout.success{ border-color: var(--c-success); background: var(--c-success-soft); }
.callout .callout-title { font-weight: 700; display: block; margin-bottom: 2px; }

/* -------------------------------------------------------------------------
   11. DOWNLOAD BUTTON / LIST
   ------------------------------------------------------------------------- */
.dl-btn, a.dl-btn {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    background: var(--c-primary); color: #fff; font-weight: 600; font-size: 0.9rem;
    padding: 10px 18px; border-radius: var(--r-md);
    box-shadow: var(--sh-sm); transition: background var(--t-fast), transform var(--t-fast);
}
.dl-btn:hover { background: #013f78; color: #fff; text-decoration: none; transform: translateY(-1px); }
.dl-btn.accent { background: var(--c-accent); }
.dl-btn.accent:hover { background: #e65c00; }

.dl-list { list-style: none; margin: var(--sp-3) 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.dl-list li {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
}
.dl-list .meta { color: var(--c-text-muted); font-size: 0.82rem; }

/* -------------------------------------------------------------------------
   12. SPEC TABLE
   ------------------------------------------------------------------------- */
.spec-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: var(--sp-4) 0; font-size: 0.95rem; }
.spec-table th, .spec-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.spec-table tr td:first-child, .spec-table tr th:first-child { font-weight: 600; color: var(--c-primary); width: 34%; background: var(--c-surface-2); }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table { border: 1px solid var(--c-border); border-radius: var(--r-md); overflow: hidden; }

/* -------------------------------------------------------------------------
   13. BREADCRUMB
   ------------------------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: 0.85rem; color: var(--c-text-muted); padding: var(--sp-4) 0 0; }
.breadcrumb a { color: var(--c-text-soft); }
.breadcrumb .sep { color: var(--c-border-strong); }

/* -------------------------------------------------------------------------
   14. FOOTER
   ------------------------------------------------------------------------- */
.site-footer {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: var(--sp-7) 0 var(--sp-5);
    margin-top: var(--sp-8);
    color: var(--c-text-soft); font-size: 0.9rem;
}
.site-footer .foot-grid { display: flex; flex-wrap: wrap; gap: var(--sp-6); justify-content: space-between; }
.site-footer h4 { color: var(--c-text); font-size: 0.95rem; margin: 0 0 var(--sp-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer .copyright { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); color: var(--c-text-muted); font-size: 0.82rem; }

/* -------------------------------------------------------------------------
   15. BACK TO TOP
   ------------------------------------------------------------------------- */
.back-to-top {
    position: fixed; right: 22px; bottom: 22px; z-index: 90;
    width: 44px; height: 44px; border-radius: var(--r-full);
    background: var(--c-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    box-shadow: var(--sh-md); border: 0; cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: #013f78; }

/* -------------------------------------------------------------------------
   16. RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .article-wrap { grid-template-columns: 1fr; }
    .toc { position: static; max-height: none; order: -1; }
}
@media (max-width: 680px) {
    .nav-links {
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--c-surface); border-bottom: 1px solid var(--c-border);
        padding: var(--sp-2); box-shadow: var(--sh-md);
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: var(--sp-3); border-radius: var(--r-sm); }
    .nav-toggle { display: block; }
}

/* -------------------------------------------------------------------------
   17. MOTION SAFETY
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------------------
   18. UTILITIES
   ------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--c-text-muted); }
.divider { height: 1px; background: var(--c-border); border: 0; margin: var(--sp-5) 0; }
