:root{
  --bg:#070a12;
  --panel:#0c1222;
  --text:#e8eefc;
  --muted:#9fb0d0;
  --line:#1a2440;
  --accent:#ff3b3b;
  --good:#19d18a;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(700px 380px at 20% 10%, rgba(255,59,59,.10), transparent 60%),
    radial-gradient(900px 450px at 80% 15%, rgba(25,209,138,.09), transparent 60%),
    radial-gradient(900px 550px at 50% 90%, rgba(110,160,255,.09), transparent 60%);
  pointer-events:none;
}

.hidden{display:none !important;}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:rgba(7,10,18,.75);
  backdrop-filter: blur(10px);
}

.brand{display:flex; align-items:center; gap:12px; cursor:pointer; user-select:none}
.dot{width:12px; height:12px; border-radius:50%; background:var(--accent); box-shadow:0 0 18px rgba(255,59,59,.7)}
.name{font-weight:900; letter-spacing:.4px}
.tag{font-size:12px; color:var(--muted)}

.top-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.searchBox{display:flex; gap:8px; align-items:center}
.searchBox input{
  width:min(420px, 65vw);
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(12,18,34,.7);
  color:var(--text);
  outline:none;
}
.searchBox input::placeholder{color:rgba(159,176,208,.75)}

.layout{display:flex; min-height:calc(100vh - 58px);}
.sidebar{
  width:240px;
  padding:14px;
  border-right:1px solid var(--line);
  background:rgba(7,10,18,.35);
}
.main{
  flex:1;
  padding:16px;
  max-width:1200px;
}

.card{
  background:rgba(12,18,34,.88);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 12px 35px rgba(0,0,0,.35);
}
.card-title{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.8px;
  text-transform:uppercase;
}
.accent{color:var(--accent)}
.muted{color:var(--muted)}
.small{font-size:12px}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(7,10,18,.55);
  color:var(--text);
  cursor:pointer;
  text-decoration:none;
}
.btn:hover{filter:brightness(1.08)}
.btn-primary{
  background:rgba(255,59,59,.16);
  border-color:rgba(255,59,59,.45);
}
.btn-outline{background:transparent}
.btn:disabled{opacity:.5; cursor:not-allowed}

.navbtn{
  width:100%;
  text-align:left;
  margin-bottom:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(12,18,34,.55);
  color:var(--text);
  cursor:pointer;
}
.navbtn.active{
  border-color:rgba(255,59,59,.55);
  box-shadow:0 0 0 3px rgba(255,59,59,.10);
}
.sideCard{margin-top:14px; padding:12px; border-radius:14px; border:1px solid var(--line); background:rgba(12,18,34,.55);}

.hero h1{margin:10px 0 8px; font-size:34px}
.hero p{line-height:1.6}

.grid3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
.mini{box-shadow:none; background:rgba(7,10,18,.35)}

.twoCol{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.list{line-height:1.7; margin:8px 0 0; padding-left:18px}

.lessonsLayout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:14px;
  margin-top:12px;
}
.lessonList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}
.lessonItem{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(7,10,18,.35);
  cursor:pointer;
}
.lessonItem:hover{filter:brightness(1.08)}
.lessonItem.active{
  border-color:rgba(255,59,59,.55);
  box-shadow:0 0 0 3px rgba(255,59,59,.10);
}
.lessonItem .title{font-weight:900}
.lessonItem .desc{margin-top:4px; color:var(--muted); font-size:12px; line-height:1.5}

.lessonHeader h2{margin:0}
.lessonHeader .tabs{
  display:flex; flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.tab{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(7,10,18,.35);
  color:var(--text);
  cursor:pointer;
  font-size:13px;
}
.tab.active{
  border-color:rgba(255,59,59,.55);
  box-shadow:0 0 0 3px rgba(255,59,59,.10);
}
.lessonContent h4{margin:0 0 10px}
.lessonContent ul{margin:0; padding-left:18px; line-height:1.7}
.lessonContent p{line-height:1.7}

.quizActions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.qTitle{font-weight:900; margin:10px 0 6px}
.qMeta{color:var(--muted); font-size:13px}
.answers{display:grid; gap:10px; margin-top:10px}
.answer{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(7,10,18,.35);
  cursor:pointer;
}
.answer.selected{
  border-color:rgba(255,59,59,.55);
  box-shadow:0 0 0 3px rgba(255,59,59,.10);
}
.quizNav{
  margin-top:12px;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; flex-wrap:wrap;
}
.progress{
  width:220px; height:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(7,10,18,.35);
  overflow:hidden;
}
.progress > div{
  height:100%;
  background:rgba(255,59,59,.55);
}
.score{color:var(--muted); font-size:13px}

.term b{display:block; margin-bottom:6px}

@media (max-width: 980px){
  .layout{flex-direction:column}
  .sidebar{width:auto; border-right:none; border-bottom:1px solid var(--line)}
  .main{padding:12px}
  .grid3{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .twoCol{grid-template-columns:1fr}
  .lessonsLayout{grid-template-columns:1fr}
}
