:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#0c121a;
  --text:#e7edf6;
  --muted:#aab7c7;
  --border:rgba(255,255,255,.08);
  --accent:#7dd3fc;
  --accent2:#a78bfa;
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --radius:14px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% 0%, rgba(125,211,252,.08), transparent 55%),
              radial-gradient(1000px 500px at 80% 10%, rgba(167,139,250,.07), transparent 60%),
              var(--bg);
  color:var(--text);
}
a{color:inherit}
.app{
  display:grid;
  grid-template-columns: 380px 1fr;
  min-height:100vh;
}
aside{
  position:sticky; top:0; height:100vh;
  padding:18px;
  border-right:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}
main{ padding:22px; }

.brand{
  display:flex; align-items:center; gap:10px;
  padding:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom:14px;
}
.dot{
  width:12px;height:12px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px rgba(125,211,252,.12);
  flex:0 0 auto;
}
.brand h1{ font-size:16px; margin:0; line-height:1.15; }
.brand p{ margin:2px 0 0 0; font-size:12px; color:var(--muted) }

.controls{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: var(--radius);
  padding:12px;
  box-shadow: var(--shadow);
  margin-bottom:14px;
}
.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
input[type="search"], select{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
input[type="search"]::placeholder{color:rgba(231,237,246,.55)}
select{ cursor:pointer; }
.meta{
  display:flex; gap:10px; margin-top:10px; flex-wrap:wrap;
  font-size:12px; color:var(--muted);
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.pill b{color:var(--text); font-weight:600}
button{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  box-shadow: var(--shadow);
  font-weight:600;
  font-size:13px;
}
button:hover{background: rgba(125,211,252,.08)}

nav{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
}
.navhead{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  background: rgba(255,255,255,.02);
  font-size:12px;
  color:var(--muted);
}
.navlist{
  max-height: calc(100vh - 310px);
  overflow:auto;
  padding:6px 0;
}

.catBlock{ border-bottom:1px solid rgba(255,255,255,.05); }
.catTitle{
  padding:10px 12px 6px 12px;
  font-size:12px;
  color: rgba(231,237,246,.75);
  text-transform:uppercase;
  letter-spacing:.08em;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.catTitle a{
  text-decoration:none;
  border:1px solid rgba(255,255,255,.08);
  padding:4px 8px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
  font-size:11px;
  color: rgba(231,237,246,.7);
}
.catTitle a:hover{ background: rgba(167,139,250,.10) }

.tocLink{
  display:block;
  padding:9px 12px;
  text-decoration:none;
  font-size:13px;
  color: rgba(231,237,246,.92);
  border-top:1px solid rgba(255,255,255,.04);
}
.tocLink:hover{background: rgba(125,211,252,.08)}
.tocLink.active{
  background: linear-gradient(90deg, rgba(125,211,252,.18), rgba(167,139,250,.10));
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.topbar{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:14px; flex-wrap:wrap;
  margin-bottom:18px;
}
.topbar .title{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: var(--radius);
  padding:14px 16px;
  box-shadow: var(--shadow);
  flex: 1 1 520px;
}
.topbar h2{ margin:0; font-size:18px; letter-spacing:.2px; }
.topbar p{
  margin:6px 0 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.categorySection{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: var(--radius);
  padding:14px 16px;
  box-shadow: var(--shadow);
  margin-bottom:14px;
  scroll-margin-top: 16px;
}
.categorySection h3{
  margin:0;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.categorySection .sub{
  margin:6px 0 0 0;
  color:var(--muted);
  font-size:13px;
}

.tutorialCard{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  border-radius: var(--radius);
  padding:14px;
  margin-top:12px;
  scroll-margin-top: 16px;
}
.tutorialCard h4{
  margin:0 0 10px 0;
  font-size:15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.anchor{
  font-size:12px;
  color: rgba(231,237,246,.7);
  text-decoration:none;
  border:1px solid rgba(255,255,255,.08);
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
}
.anchor:hover{background: rgba(125,211,252,.10)}

.videoWrap{
  width:100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.02);
}
iframe{
  width:100%;
  height:100%;
  border:0;
}
/* Local video styling */
.videoWrap video{
  width:100%;
  height:100%;
  display:block;
  background:black;
  object-fit:contain;
}
.langToggle{
  display:flex;
  gap:8px;
  margin-top:8px;
}
.langToggle button{
  padding:6px 10px;
  font-size:12px;
}

.rolesTitle{
  margin:12px 0 8px 0;
  font-size:12px;
  color: rgba(231,237,246,.75);
  text-transform: uppercase;
  letter-spacing:.08em;
}
.chips{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  font-size:12px;
  color: rgba(231,237,246,.9);
  white-space:nowrap;
}

details{
  border:1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.14);
  border-radius: 12px;
  padding:10px 12px;
  margin-top:10px;
}
summary{
  cursor:pointer;
  font-weight:700;
  font-size:13px;
  color: rgba(231,237,246,.95);
  list-style:none;
}
summary::-webkit-details-marker{display:none}
.content{
  margin-top:8px;
  color: rgba(231,237,246,.86);
  font-size:13px;
  line-height:1.55;
  white-space:pre-wrap;
}
.content code{
  display:inline-block;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.back{
  margin-top:12px;
  display:inline-block;
  font-size:12px;
  color: rgba(231,237,246,.8);
  text-decoration:none;
  border:1px solid rgba(255,255,255,.08);
  padding:7px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.02);
}
.back:hover{background: rgba(167,139,250,.10)}

@media (max-width: 980px){
  .app{grid-template-columns: 1fr}
  aside{position:relative; height:auto}
  .navlist{max-height: 340px}
}

/* Login overlay */
.login-overlay{
  position: fixed;
  inset: 0;
  display: none; /* shown via JS */
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,.65)),
    url('../img/background.jpg') center center / cover no-repeat;
  z-index: 9999;
}
.login-card{
  width: 100%;
  max-width: 380px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.login-label{
  font-size:12px;
  color: var(--muted);
}
.login-card input[type="text"],
.login-card input[type="password"]{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.40);
  color:var(--text);
  outline:none;
}
.login-btn{ width:100%; }
.login-error{ color:#ff9a9a; font-size:12px; min-height:16px; }
.login-hint{ color: var(--muted); font-size:12px; text-align:center; }

/* Brand logo in sidebar */
.brand-logo{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  /* remove default brand chrome */
  border:none;
  background:transparent;
  box-shadow:none;
  padding:0;
}
.brand-img{
  width:100%;
  height:auto;
  display:block;
}
