* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f8fc;
  color: #222;
}

.lesson-page {
  display: flex;
  min-height: 100vh;
}

.lesson-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 24px;
}

.lesson-sidebar h2 {
  margin-top: 0;
  margin-bottom: 24px;
}


.sidebar-back {
  margin-bottom: 18px;
}

.sidebar-back-link {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #5f6b7a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-back-link:hover {
  color: #1f3f8f;
}

/* Layout */
.lesson-page {
  display: flex;
}

/* Sidebar */
.lesson-sidebar {
  position: relative;
  width: 300px;
  min-width: 300px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  transition: width 0.28s ease, min-width 0.28s ease;
  overflow: visible;
}

/* Inner content */
.sidebar-inner {
  padding: 28px 24px;
  transition: opacity 0.2s ease;
}

/* Toggle button */
.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #4b5563;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.sidebar-toggle:hover {
  background: #f9fafb;
}

/* Collapsed state */
.lesson-sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}

.lesson-sidebar.collapsed .sidebar-inner {
  opacity: 0;
  pointer-events: none;
}

/* Main content */
.lesson-main {
  flex: 1;
  padding: 40px;
}

/*------------------------------ side bar ends here */

.unit-block {
  margin-bottom: 24px;
}

.unit-block h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #444;
}

.unit-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.unit-block li {
  margin-bottom: 8px;
}

.unit-block a {
  text-decoration: none;
  color: #333;
}

.unit-block a:hover {
  color: #2563eb;
}

.selected-lesson {
  color: #2563eb !important;
  font-weight: 700;
}

.lesson-main {
  flex: 1;
  padding: 40px;
}

.lesson-template-main {
  max-width: 900px;
  margin: 0 auto;
}

.lesson-header {
  margin-bottom: 24px;
}

.lesson-header h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.lesson-header p {
  margin: 0 0 10px;
  line-height: 1.6;
  color: #555;
}

.start-container {
  margin-top: 32px;
  text-align: right;
}

#start-btn {
  padding: 12px 24px;
  background-color: #2d6cdf;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 1rem;
  cursor: pointer;
}

#start-btn:hover {
  background-color: #1f4fbf;
}

.mode-switch {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: #e5e7eb;
  cursor: pointer;
}

.mode-btn.active {
  background: #2563eb;
  color: white;
}

.mode-section {
  display: none;
}

.active-section {
  display: block;
}

.content-card {
  background: white;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.content-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.content-card p,
.content-card li {
  line-height: 1.7;
  color: #444;
}

#course-title {
  cursor: pointer;
}

#course-title:hover {
  color: #2563eb;
}

@media (max-width: 900px) {
  .lesson-page {
    flex-direction: column;
  }

  .lesson-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .lesson-main {
    padding: 24px;
  }

  .start-container {
    text-align: left;
  }
}

/* -------------------------------------------mindmap_template */
.mindmap-container {
  position: relative;
  width: 100%;
  min-height: 800px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
}

.mindmap-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 160px;
  max-width: 240px;
  padding: 16px 20px;
  border: 2px solid #111;
  background: white;
  text-align: center;
}

.mindmap-node.oval {
  border-radius: 999px;
}

.mindmap-node.main {
  border-radius: 999px;
  font-weight: 600;
}

.mindmap-node.dashed {
  border-style: dashed;
  border-radius: 24px;
}

#mindmap-svg {
  z-index: 0;
}

#mindmap-nodes-layer {
  z-index: 1;
}

.mindmap-container {
  overflow: hidden;
}

.mindmap-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.mindmap-svg line{
  pointer-events: none;
}

.mindmap-nodes-layer {
  position: relative;
  width: 100%;
  height: 800px;
  z-index: 1;
}

.mindmap-edge {
  stroke: #222;
  stroke-width: 2;
  fill: none;
}

.mindmap-page {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.mindmap-header {
  margin-bottom: 32px;
}

.mindmap-stage {
  position: relative;
  width: 100%;
  height: 700px;
  background: #f7f7f7;
  border-radius: 24px;
  overflow: hidden;
}

.mindmap-root {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.mindmap-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}


.mindmap-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 170px;
  padding: 16px 24px;
  border: 3px solid #222;
  border-radius: 999px;
  background: white;
  text-align: center;
  cursor: pointer;
}

.mindmap-node.active-node {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.edge-dot {
  cursor: pointer;
  pointer-events: auto;
}

.mindmap-info-panel {
  margin-top: 24px;
  padding: 24px;
  background: white;
  border-radius: 20px;
}