/* ==============================
   TOPBAR
============================== */
.topbar{
  position:sticky;
  top:0;
  z-index:200;
  background:var(--nav-bg);
  border-bottom:2px solid var(--card-border);
  padding:1rem 1.5rem;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
}

.topbar-left{
  display:flex;
  flex-direction:column;
  gap:0.35rem;
}

.topbar-left h1{
  font-family:'Paytone One', sans-serif;
  font-size:1.4rem;
  color:var(--text);
}

.back-home{
  font-size:0.85rem;
  font-weight:900;
  color:var(--btn-bg);
}

.topbar-right{
  display:flex;
  gap:0.6rem;
  flex-wrap:wrap;
}

/* ==============================
   LAYOUT
============================== */
.lms-layout{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:1.5rem;
  padding:1.5rem;
  max-width:1400px;
  margin:0 auto;
}

/* ==============================
   SIDEBAR
============================== */
.sidebar{
  background:var(--card-bg);
  border:2px solid var(--card-border);
  border-radius:var(--radius);
  padding:1.5rem;
  box-shadow:var(--shadow);
  height:calc(100vh - 130px);
  overflow:auto;
}

.sidebar-title{
  font-family:'Paytone One', sans-serif;
  font-size:1.2rem;
  margin-bottom:1rem;
}

.menu{
  display:flex;
  flex-direction:column;
  gap:0.5rem;
}

.menu button{
  width:100%;
  text-align:left;
  border:none;
  background:rgba(0,0,0,0.05);
  color:var(--text);
  font-weight:900;
  padding:0.75rem 0.85rem;
  border-radius:14px;
  cursor:pointer;
  transition:0.2s;
}

body.dark-mode .menu button{
  background:rgba(255,255,255,0.06);
}

.menu button:hover{
  transform:translateX(3px);
}

.menu button.active{
  background:var(--btn-bg);
  color:var(--btn-text);
}

.menu .module-title{
  font-size:0.9rem;
  font-weight:900;
  opacity:0.8;
  margin-top:1rem;
  margin-bottom:0.25rem;
}

.sidebar-footer{
  margin-top:1.5rem;
}

/* ==============================
   CONTENT AREA
============================== */
.content-area{
  background:var(--card-bg);
  border:2px solid var(--card-border);
  border-radius:var(--radius);
  padding:2rem;
  box-shadow:var(--shadow);
  min-height:calc(100vh - 130px);
}

.content-header h2{
  font-family:'Paytone One', sans-serif;
  font-size:1.6rem;
  margin-bottom:0.4rem;
}

.content-header p{
  color:var(--text-muted);
  font-weight:700;
  margin-bottom:1.5rem;
}

/* ==============================
   PROGRESS
============================== */
.progress-box{
  border:2px solid var(--card-border);
  border-radius:var(--radius-sm);
  padding:1rem;
  margin-bottom:1.5rem;
  background:rgba(255,255,255,0.65);
}

body.dark-mode .progress-box{
  background:rgba(255,255,255,0.05);
}

.progress-label{
  display:flex;
  justify-content:space-between;
  font-weight:900;
  margin-bottom:0.75rem;
}

.progress-bar{
  width:100%;
  height:12px;
  border-radius:999px;
  background:rgba(0,0,0,0.12);
  overflow:hidden;
}

body.dark-mode .progress-bar{
  background:rgba(255,255,255,0.12);
}

.progress-fill{
  height:100%;
  width:0%;
  background:var(--btn-bg);
  transition:0.3s;
}

/* ==============================
   TOPIC CONTENT
============================== */
.topic-content{
  font-size:1rem;
}

.topic-content h3{
  font-family:'Paytone One', sans-serif;
  margin-top:1.5rem;
  margin-bottom:0.6rem;
}

.topic-content p{
  margin-bottom:1rem;
  color:var(--text);
  font-weight:600;
}

.topic-content ul{
  margin:1rem 0;
  padding-left:1.4rem;
  font-weight:700;
  color:var(--text-muted);
}

.topic-content .example-box{
  border-left:6px solid var(--btn-bg);
  padding:1rem 1.2rem;
  border-radius:14px;
  background:rgba(255,255,255,0.65);
  margin:1.2rem 0;
  border:2px solid var(--card-border);
}

body.dark-mode .topic-content .example-box{
  background:rgba(255,255,255,0.06);
}

.topic-content .exercise-box{
  margin:1.2rem 0;
  padding:1.2rem;
  border-radius:14px;
  border:2px dashed var(--card-border);
  background:rgba(255,255,255,0.5);
}

body.dark-mode .topic-content .exercise-box{
  background:rgba(255,255,255,0.05);
}

/* ==============================
   ACTION BUTTONS
============================== */
.topic-actions{
  display:flex;
  gap:1rem;
  margin-top:2rem;
  flex-wrap:wrap;
}

/* ==============================
   WELCOME CARD
============================== */
.welcome-card{
  padding:1.5rem;
  border-radius:16px;
  border:2px solid var(--card-border);
  background:rgba(255,255,255,0.7);
}

body.dark-mode .welcome-card{
  background:rgba(255,255,255,0.05);
}

.welcome-actions{
  margin-top:1.5rem;
}

/* ==============================
   FOOTER
============================== */
.footer{
  text-align:center;
  padding:2rem;
  font-weight:800;
  color:var(--text-muted);
}

/* ==============================
   RESPONSIVE
============================== */
@media(max-width:1000px){
  .lms-layout{
    grid-template-columns:1fr;
  }

  .sidebar{
    height:auto;
  }

  .content-area{
    min-height:auto;
  }
}
