/* =========================================================
   NDT DBF — Global Styles
   - Dark, clean, minimal aesthetic
   - Consistent with index.php + docs.php
   - Includes: header/nav, hero, cards, docs layout, buttons,
     badges, footer, animations, and Prism tweaks
   ========================================================= */

/* -------------------------
   Base / Reset
------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
  min-height: 100%;
}

:root{
  --bg: #0b1324;
  --bg-2: #0b172b;
  --panel: #0d1a2b;
  --panel-2: #0e1522;
  --border: rgba(255,255,255,.08);
  --text: #e6f0ff;
  --text-dim: #b6c6dd;
  --muted: #93a4b7;
  --brand: #60a5fa;         /* sky-400 */
  --brand-2: #38bdf8;       /* sky-300 */
  --brand-3: #2563eb;       /* blue-600 */
  --accent: #f59e0b;        /* amber-500 */
  --success: #22c55e;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

body{
  background: radial-gradient(1200px 1200px at 20% -10%, rgba(37,99,235,.15), transparent 60%),
              radial-gradient(1200px 1200px at 90% 0%, rgba(56,189,248,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Links */
a { color: #cfe8ff; text-decoration: none; }
a:hover { color: #ffffff; text-decoration: none; }

/* Utility */
.hidden { display: none !important; }
.center { text-align: center; }

/* Lists */
ul.check{
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}
ul.check li{
  position: relative;
  padding-left: 22px;
  margin: 6px 0;
  color: var(--text);
}
ul.check li::before{
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-size: 12px;
  line-height: 1.8;
}

/* -------------------------
   Header / Nav
------------------------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(7, 12, 24, .55);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand{
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.brand-mark{
  font-size: 18px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(56,189,248,.35);
}
.brand-suffix{
  font-size: 18px;
  color: #fff;
}

.nav{
  display: inline-flex;
  gap: 8px;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.btn:hover{
  background: #0c1b2e;
  border-color: rgba(255,255,255,.13);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }

.btn-primary{
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
  border-color: rgba(255,255,255,.18);
  color: #fff;
}
.btn-primary:hover{
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(37,99,235,.35);
}
.btn-ghost{
  background: transparent;
  border-color: var(--border);
}
.btn-cta{
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: rgba(255,255,255,.2);
}
.btn-cta:hover{
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(22,163,74,.35);
}

/* -------------------------
   Hero (index.php)
------------------------- */
/* Hero */
.hero{padding:56px 0 24px}
.hero-inner{display:flex;flex-direction:column;align-items:center;text-align:center}
.hero-title{
  font-size: clamp(40px,6.5vw,72px);
  font-weight: 900;
  margin:0 0 8px;
  line-height:1.05;
  letter-spacing:.4px;
  position: relative;
  background: linear-gradient(90deg,#fff, #dbeafe);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.glow-anim{
  text-shadow:
    0 0 22px rgba(96,165,250,.35),
    0 0 48px rgba(167,139,250,.25);
}
.glow-anim::after{
  content:"";
  position:absolute; inset:-8px -22px;
  background: radial-gradient(50% 40% at 50% 40%, rgba(96,165,250,.18), transparent 70%),
              radial-gradient(45% 35% at 60% 60%, rgba(192,132,252,.16), transparent 70%);
  filter: blur(18px);
  z-index:-1;
  animation: glowPulse 3.2s ease-in-out infinite;
}
@keyframes glowPulse{
  0%,100%{opacity:.7; transform:scale(1)}
  50%    {opacity:1;  transform:scale(1.03)}
}

.hero-sub{margin:0 0 12px;color:var(--muted);font-weight:600}
.badges{
  display:flex;flex-wrap:wrap;gap:10px;justify-content:center;
  margin:12px 0 18px
}
.badges img{height:20px;display:inline-block;filter:drop-shadow(0 2px 8px rgba(0,0,0,.25))}
.hero-cta{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:10px 0 6px}
.hero-note{text-align:center;color:var(--muted)}

/* Features */
.features{padding:28px 0 8px}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.card{background:var(--panel);border:1px solid rgba(255,255,255,.06);border-radius:18px;padding:18px;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.card h3{margin:0 0 6px}

/* Sections */
.section{padding:16px 0}
.section h2{margin:8px 0 10px}

/* Checklist */
.check{list-style:none;padding:0;margin:8px 0 20px}
.check li{margin:6px 0;padding-left:22px;position:relative}
.check li::before{content:"✔";position:absolute;left:0;top:0;color:var(--success)}

/* Panel */
.panel{
  background:var(--panel);
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px;
  padding:16px;
  margin:14px 0;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.panel h2{margin:4px 0 12px}
.panel h3{margin:12px 0 8px}


/* Code card */
.code-card{background:var(--panel);border:1px solid rgba(255,255,255,.06);border-radius:16px;overflow:hidden;margin-top:8px;position:relative}
.code-card-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.06);background:linear-gradient(90deg,rgba(96,165,250,.15),transparent)}
.code-card-head span{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
pre[class*="language-"]{margin:0;border-radius:0;background:#0d1117}
pre[class*="language-"] code{font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:.93rem}

/* Prism toolbar: Copy button */
div.code-toolbar>.toolbar{opacity:1;position:absolute;top:10px;right:10px;transition:none}
div.code-toolbar>.toolbar .toolbar-item>button,
div.code-toolbar>.toolbar .toolbar-item>a{
  background:#111827;border:1px solid rgba(255,255,255,.18);
  color:#e5eef9;border-radius:8px;padding:6px 10px;font-size:.8rem
}
div.code-toolbar>.toolbar .toolbar-item>button:hover{filter:brightness(1.1)}
div.code-toolbar>.toolbar .toolbar-item{margin-left:8px}

/* Line numbers */
pre.line-numbers{padding-left:3.4em}
.line-numbers .line-numbers-rows{border-right:1px solid rgba(255,255,255,.06)}
.line-numbers-rows>span:before{color:#6b7280}
/* -------------------------
   Cards / Sections
------------------------- */
.section{
  padding: 8px 0 40px;
}
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

h1,h2,h3{
  margin: 8px 0 12px;
}
h2{
  font-size: 20px;
  border-bottom: 1px dashed rgba(255,255,255,.08);
  padding-bottom: 6px;
}
h3{ font-size: 16px; color: #eaf3ff; }

p{ color: var(--text); margin: 6px 0 10px; }
small, .muted { color: var(--muted); }

/* -------------------------
   Docs Layout (docs.php)
------------------------- */
.docs-shell{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.docs-sidebar{
  position: sticky;
  top: 72px;
  align-self: start;
}
.docs-sidebar details{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 8px 0;
  overflow: hidden; /* ensure rounded corners for inner content */
}
.docs-sidebar summary{
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color .2s ease, opacity .2s ease;
}
.docs-sidebar summary::-webkit-details-marker { display: none; }
.docs-sidebar summary::before{
  content: "▸";
  font-size: 12px;
  color: #cfe8ff;
  transition: transform .2s ease;
}
.docs-sidebar details[open] > summary::before{
  transform: rotate(90deg);
}
.docs-sidebar .collapsible-body{
  /* height is controlled via JS for animation */
}
.docs-sidebar nav a{
  display: block;
  padding: 8px 12px;
  color: #cfe8ff;
  border-top: 1px dashed rgba(255,255,255,.06);
  text-decoration: none;
  transition: background .18s ease, padding-left .18s ease, color .18s ease;
}
.docs-sidebar nav a:hover{
  background: var(--panel-2);
  color: #fff;
}
.docs-sidebar nav a.active{
  background: linear-gradient(90deg, rgba(96,165,250,.22), transparent);
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  border-radius: 8px;
  color: #fff;
}

.docs-content{ min-width: 0; }
.docs-content .card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 40px; /* EXTRA space so scrollspy is stable */
}
.docs-content h2{ margin: 4px 0 10px; }
.docs-content h3{ margin: 10px 0 8px; }
.pre-note{ font-size: 12px; color: var(--muted); margin: -2px 0 8px; }

@media (max-width: 900px){
  .docs-shell{ grid-template-columns: 1fr; }
  .docs-sidebar{ position: relative; top: 0; }
}

/* Links */
a{text-decoration:none}
a:hover{text-decoration:none}

/* Responsive */
@media (max-width:900px){
  .grid{grid-template-columns:1fr}
  .install-grid{grid-template-columns:1fr}
  .hero-title{font-size:44px}
}


/* -------------------------
   Footer
------------------------- */
.site-footer{
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  margin-top: 22px;
  text-align: center;
}
.site-footer .wrap p{
  margin: 0;
  color: var(--text-dim);
}
.heart{
  display: inline-block;
  color: #ff6b8b;
  transform-origin: center;
  animation: heart-beat 1.1s ease-in-out infinite;
  text-shadow: 0 0 16px rgba(255,107,139,.35);
}
@keyframes heart-beat{
  0%, 20%, 40%, 60%, 80%, 100% { transform: scale(1); }
  10%, 50%, 90% { transform: scale(1.18); }
}

/* -------------------------
   Badges (centered)
------------------------- */
.badge-list{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.badge-list img{
  height: 20px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}

/* -------------------------
   Prism tweaks
------------------------- */
pre[class*="language-"]{
  background: #0b1627 !important;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
code[class*="language-"]{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata{
  color: #7aa2c1 !important;
  opacity: .85;
}
/* Prism toolbar: copy button nicer */
.prism-toolbar{
  opacity: 1 !important;
}
.prism-toolbar .toolbar-item > button{
  background: rgba(255,255,255,.06);
  color: #eaf3ff;
  border: 1px solid rgba(255,255,255,.08);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease;
}
.prism-toolbar .toolbar-item > button:hover{
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* Line numbers readability */
.line-numbers .line-numbers-rows > span:before{
  color: rgba(202,218,240,.6) !important;
}

/* Inline code */
code:not([class]){
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

/* -------------------------
   Tables (if used in docs)
------------------------- */
.table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table th, .table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.table th{
  background: #0c1b2e;
  text-align: left;
  font-weight: 700;
}
.table tr:hover td{
  background: #0e1f36;
}

/* -------------------------
   CTA Links (no underline, subtle hover)
------------------------- */
.link{
  color: #cfe8ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,.18);
  transition: color .2s ease, border-color .2s ease;
}
.link:hover{
  color: #fff;
  border-color: rgba(255,255,255,.36);
}

/* -------------------------
   Hero CTA button group emphasis
------------------------- */
.hero .btn{
  height: 42px;
  padding: 0 16px;
  border-radius: 14px;
}
.hero .btn-primary{
  box-shadow: 0 10px 28px rgba(37,99,235,.35);
}
.hero .btn-ghost{
  border-color: rgba(255,255,255,.18);
}

/* -------------------------
   Maintenance page (includes/maintenance.php)
------------------------- */
.maint{
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.maint .box{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  max-width: 680px;
  box-shadow: var(--shadow);
}
.maint h1{ margin: 0 0 8px; }

/* Dùng JS để smooth scroll → tắt CSS smooth khi JS đã load */
html.js-smooth { scroll-behavior: auto; }

/* Tăng khoảng cách section để scrollspy ổn định hơn */
.docs-content .card{ margin: 0 0 44px; }

/* Anchor offset khi dùng hash (backup) */
.docs-content [id]{ scroll-margin-top: 98px; }

/* Sidebar tools (expand/collapse all) */
.sidebar-tools{
  display: flex;
  gap: 8px;
  padding: 6px 0 8px;
  position: sticky;       /* luôn hiện khi sidebar dài */
  top: -2px;              /* dính sát phần trên của aside */
  background: transparent;
  z-index: 2;
}

.btn-xs{
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 30px;
}

/* ===== Pretty scrollbar for docs sidebar ===== */
.docs-sidebar{
  /* đảm bảo sidebar luôn scroll được và không giật layout */
  overflow: auto;
  max-height: calc(100vh - 86px);
  scrollbar-gutter: stable both-edges;

  /* custom vars cho tiện chỉnh */
  --sb-track: transparent;
  --sb-thumb: rgba(96,165,250,.55);      /* sky-400 */
  --sb-thumb-hover: rgba(99,179,237,.85);
  --sb-thumb-active: rgba(56,189,248,1); /* sky-400 brighter */
}

/* Firefox */
.docs-sidebar{
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) var(--sb-track);
}
.docs-sidebar:hover{
  scrollbar-color: var(--sb-thumb-hover) var(--sb-track);
}

/* WebKit / Chromium */
.docs-sidebar::-webkit-scrollbar{
  width: 10px;
}
.docs-sidebar:hover::-webkit-scrollbar{
  width: 12px; /* hơi lớn hơn khi hover cho dễ kéo */
}
.docs-sidebar::-webkit-scrollbar-track{
  background: var(--sb-track);
  border-left: 1px solid var(--border);
}
.docs-sidebar::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(96,165,250,.55), rgba(37,99,235,.6));
  border-radius: 12px;
  border: 2px solid transparent;          /* tạo rãnh trong suốt */
  background-clip: padding-box;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 2px 8px rgba(37,99,235,.25);
}
.docs-sidebar::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, var(--sb-thumb-hover), rgba(37,99,235,.95));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.12),
    0 4px 10px rgba(37,99,235,.35);
}
.docs-sidebar::-webkit-scrollbar-thumb:active{
  background: linear-gradient(180deg, var(--sb-thumb-active), rgba(37,99,235,1));
}
.docs-sidebar::-webkit-scrollbar-corner{
  background: transparent;
}

/* -------------------------
   Responsive tweaks
------------------------- */
@media (max-width: 720px){
  .site-header .wrap{ min-height: 60px; }
  .hero-cta{ justify-content: center; }
  .hero .title{ text-align: center; }
  .hero .subtitle{ text-align: center; margin-left: auto; margin-right: auto; }
}

