/* ═══════════════════════════════════════════════════════
   BDC Mastery — Module Sidebar
   Sticky right panel: slide viewer, downloads, progress,
   get help, community placeholder.
   ═══════════════════════════════════════════════════════ */

/* Layout wrapper — wraps main-wrap + sidebar */
.module-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 0;
}

/* Main content shrinks to make room */
.module-layout .main-wrap {
  flex: 1;
  min-width: 0;
  max-width: 860px;
  padding-left: 32px;
  padding-right: 32px;
}

/* ─── SIDEBAR ─── */
.mod-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  border-left: 1px solid rgba(24,22,20,0.10);
  background: #f7f4ef;
  padding-bottom: 80px;
  scrollbar-width: thin;
}

/* ─── SLIDE PANEL ─── */
.sb-slide-panel {
  background: #181614;
  padding: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.sb-slide-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.sb-slide-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(247,244,239,0.35);
  font-family: Inter, sans-serif;
}
.sb-slide-counter {
  font-size: 9px;
  color: rgba(247,244,239,0.25);
  font-family: Inter, sans-serif;
}
.sb-slide-frame {
  aspect-ratio: 16/9;
  background: #252220;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-slide-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sb-slide-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  width: 100%;
  height: 100%;
}
.sb-slide-placeholder-num {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(247,244,239,0.25);
  margin-bottom: 6px;
  font-family: Inter, sans-serif;
}
.sb-slide-placeholder-title {
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  color: #f7f4ef;
  line-height: 1.3;
  margin-bottom: 4px;
}
.sb-slide-placeholder-sub {
  font-size: 8px;
  color: rgba(247,244,239,0.35);
  line-height: 1.4;
  font-family: Inter, sans-serif;
}
.sb-slide-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: #c0392b;
}
.sb-slide-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}
.sb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(247,244,239,0.12);
  transition: all .2s;
  cursor: pointer;
  flex-shrink: 0;
}
.sb-dot.active {
  width: 14px;
  border-radius: 3px;
  background: #c0392b;
}
.sb-dot.visited {
  background: rgba(26,102,84,0.6);
}

/* ─── SIDEBAR SECTIONS ─── */
.sb-section {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(24,22,20,0.08);
}
.sb-section:last-child {
  border-bottom: none;
}
.sb-section-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(24,22,20,0.35);
  margin-bottom: 10px;
  font-family: Inter, sans-serif;
}

/* ─── DOWNLOAD LINKS ─── */
.sb-download {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid rgba(24,22,20,0.10);
  border-radius: 7px;
  text-decoration: none;
  margin-bottom: 6px;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.sb-download:last-child { margin-bottom: 0; }
.sb-download:hover {
  border-color: rgba(24,22,20,0.25);
  background: #f0ebe2;
}
.sb-dl-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.sb-dl-text { flex: 1; }
.sb-dl-name {
  font-size: 12px;
  font-weight: 600;
  color: #181614;
  display: block;
  font-family: Inter, sans-serif;
}
.sb-dl-type {
  font-size: 10px;
  color: rgba(24,22,20,0.4);
  font-family: Inter, sans-serif;
}
.sb-dl-arrow {
  font-size: 12px;
  color: rgba(24,22,20,0.3);
}

/* ─── PROGRESS ─── */
.sb-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 11px;
  font-family: Inter, sans-serif;
}
.sb-pi-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(24,22,20,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}
.sb-pi-dot.done {
  background: #1a6654;
  border-color: #1a6654;
  color: #fff;
}
.sb-pi-dot.active {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}
.sb-pi-label { color: #3e3a36; }
.sb-pi-label.done { color: #1a6654; }
.sb-pi-label.active { color: #c0392b; font-weight: 600; }
.sb-pi-label.future { color: rgba(24,22,20,0.35); }
.sb-progress-bar-track {
  background: rgba(24,22,20,0.08);
  border-radius: 4px;
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
}
.sb-progress-bar-fill {
  height: 100%;
  background: #1a6654;
  border-radius: 4px;
  transition: width .4s ease;
}
.sb-progress-label {
  font-size: 10px;
  color: rgba(24,22,20,0.4);
  margin-top: 5px;
  font-family: Inter, sans-serif;
}

/* ─── GET HELP ─── */
.sb-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid rgba(24,22,20,0.10);
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  font-family: Inter, sans-serif;
  transition: border-color .15s, background .15s;
}
.sb-btn:last-child { margin-bottom: 0; }
.sb-btn:hover { border-color: rgba(24,22,20,0.25); background: #f0ebe2; }
.sb-btn-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.sb-btn-text { font-size: 12px; font-weight: 600; color: #181614; }

/* ─── COMMUNITY PLACEHOLDER ─── */
.sb-community-card {
  background: #fff;
  border: 1.5px dashed rgba(24,22,20,0.12);
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
}
.sb-community-icon { font-size: 24px; margin-bottom: 8px; }
.sb-community-title {
  font-size: 12px;
  font-weight: 600;
  color: #181614;
  margin-bottom: 4px;
  font-family: Inter, sans-serif;
}
.sb-community-sub {
  font-size: 11px;
  color: rgba(24,22,20,0.4);
  line-height: 1.5;
  font-family: Inter, sans-serif;
}

/* ─── TITLE SLIDE CARD ─── */
.sb-slide-title-card {
  padding: 20px 16px;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}
.sb-slide-title-eyebrow {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(247,244,239,0.3);
  font-family: Inter, sans-serif;
  margin-bottom: 10px;
}
.sb-slide-title-module {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(192,57,43,0.8);
  font-family: Inter, sans-serif;
  margin-bottom: 8px;
}
.sb-slide-title-name {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #f7f4ef;
  line-height: 1.3;
  margin-bottom: 12px;
}
.sb-slide-title-divider {
  width: 32px;
  height: 2px;
  background: #c0392b;
  border-radius: 1px;
  margin-bottom: 10px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .module-layout { flex-direction: column; padding: 0; }
  .module-layout .main-wrap { max-width: 100%; padding: 0 24px 60px; }
  .mod-sidebar { width: 100%; position: static; max-height: none; border-left: none; border-top: 1px solid rgba(24,22,20,0.10); }
  .sb-slide-panel { position: static; }
}

/* ── Slide navigation (prev / dots / next) ───────────────────────── */
.sb-slide-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.sb-slide-nav .sb-slide-dots { flex: 1; }
.sb-slide-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(247,244,239,0.55);
  font-size: 14px;
  font-family: Inter, sans-serif;
  cursor: pointer;
  transition: all .15s;
}
.sb-slide-arrow:hover:not(.disabled) {
  background: rgba(255,255,255,0.10);
  color: #f7f4ef;
  border-color: rgba(255,255,255,0.25);
}
.sb-slide-arrow.disabled {
  opacity: .25;
  cursor: default;
}
.sb-slide-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

/* Facilitator-only sidebar items (e.g. facilitator guide download) —
   CSS fallback in case sidebar.js renders after guard.js's initial
   fac-only sweep. Belt-and-suspenders with guard.js's own JS toggle. */
.student-view .sb-download.fac-only {
  display: none !important;
}
