/* -------------------------
   BASE & THEME COLORS
------------------------- */
:root{
  --bg: #f5f7fb;
  --panel: #ffffff;
  --muted: #4b5563;
  --accent: #2d6cdf;
  --sidebar-bg: #092042;
  --text-dark: #0f172a;
  --category-bg: #e8f4ff;
  --category-accent: #4a90e2;
  --code-bg: #f1f4f8;
  --card-radius: 10px;
  --font-sans: "Segoe UI", Roboto, Arial, sans-serif;
}

/* DARK THEME (applied to body.dark) */
body.dark {
  --bg: #0b1220;
  --panel: #071226;
  --muted: #9aa6b2;
  --accent: #6ea8ff;
  --sidebar-bg: #07142a;
  --text-dark: #e6eef8;
  --category-bg: #092542;
  --category-accent: #2d6cdf;
  --code-bg: #071a2a;
}

/* GLOBAL */
* { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-dark);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-size: 16px;
   overflow: hidden;  
}

/* APP LAYOUT */
.app {
  /* display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh; */
  
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
}





/* SIDEBAR */
/* .sidebar {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 20px;
  overflow-y:auto;
  position: relative;
} */

.sidebar {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 20px;
  overflow-y: auto;           
  overflow-x: hidden;
}

.brand {
  display:flex; align-items:center; gap:12px; margin-bottom:14px;
}
.brand-box {
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight:700;
}
.brand-text {
  font-size: 18px;
  font-weight: 600;
}

/* controls */
.controls { display:flex; gap:8px; align-items:center; margin-bottom:14px; }
.search {
  flex:1; padding:10px 12px; border-radius:8px; border: none; font-size:14px;
}
.btn { background:none; border:1px solid rgba(255,255,255,0.08); color:#fff; padding:8px 10px; border-radius:8px; cursor:pointer; }
.btn.small { padding:6px 8px; font-size:14px; }
.mobile-only { display:none; }

/* category headings */
.category-title {
  font-size: 20px;
  font-weight: 700;
  background: var(--category-bg);
  padding: 5px 12px;
  border-left: 6px solid var(--category-accent);
  border-radius: 8px;
  margin: 20px 0 10px;
  color: var(--text-dark);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* links */
.question-list { list-style:none; padding-left:0; margin:0 0 6px 0; }
.question-list li { margin:8px 0; }
.question-list a {
  color: #dbe9ff; text-decoration:none; display:block; padding:6px 8px; border-radius:6px; font-size:15px;
}
.question-list a:hover { background: rgba(255,255,255,0.04); }
.question-list a.active { background: rgba(255,255,255,0.08); color:#fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }

/* TOPBAR (mobile) */
.topbar {
  display:none;
  background: var(--panel);
  align-items:center; gap:12px; padding:10px 14px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.topbar .btn { background: none; border: none; color: var(--text-dark); }

/* MAIN CONTENT */
/* .main {
  background: var(--bg);
  padding: 28px 40px;
  overflow-y:auto;
} */

.main {
  background: var(--bg);
  padding: 28px 40px;
  overflow-y: auto;
  height: 100%;
}

/* QA card */
.qa { background: var(--panel); border-radius: var(--card-radius); padding:18px; margin-bottom:18px; box-shadow: 0 4px 12px rgba(16,24,40,0.04); }
.qa-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.qa-head h2 { margin:0; font-size:20px; }
.toggle-answer { background:none; border:1px solid rgba(0,0,0,0.06); padding:4px 8px; border-radius:6px; cursor:pointer; }

/* Answer text larger */
.answer { font-size: 18px; color: var(--muted); line-height:1.7; margin-top:10px; }


/* Code box */
.code-wrap { margin-top:12px; position:relative; }
pre[class*="language-"] {
  padding: 18px 16px 18px 52px;
  background: var(--code-bg);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  overflow:auto;
  position: relative;
  font-size:14px;
  margin:0;
}

/* copy button inside pre */
.copy-code {
  position:absolute;
  right:10px;
  top:10px;
  background: var(--accent);
  color:#fff;
  border:none;
  padding:6px 8px;
  border-radius:6px;
  cursor:pointer;
  font-size:13px;
}

/* footer */
.foot { margin-top:26px; color:var(--muted); }

/* RESPONSIVE */
@media(max-width:920px){
  .app { grid-template-columns: 1fr; }
  .sidebar { position:fixed; left:-100%; top:0; width:78%; max-width:360px; height:100vh; z-index:40; transition: left .25s ease; }
  .sidebar.open { left:0; }
  /* .main { padding: 16px; margin-left:0; } */
   .main { padding: 16px; margin-left:0; overflow-y: auto; }
  .topbar { display:flex; position:sticky; top:0; z-index:30; }
  .mobile-only { display:inline-block; }
  .category-title { font-size:18px; }
}

/* small tweaks for dark theme on code */
body.dark pre[class*="language-"] {
  background: var(--code-bg);
  border-left-color: var(--accent);
}


/* ===== goto Top button ===== */
.go-top {
position: fixed;
/* float above everything */
bottom: 30px;
/* distance from bottom */
right: 30px;
/* distance from right */
background-color: #273d6d;
color: white;
padding: 10px 15px;
border-radius: 50%;
text-decoration: none;
font-size: 20px;
font-weight: bold;
opacity: 0.2;
z-index: 9999;
transition: opacity 0.3s;
}

.go-top:hover {
opacity: 0.71;
}