/* ===== Layout Container ===== */
.tutorial-container { display: flex; align-items: stretch; min-height: 100vh; }
.content-area { flex: 1; padding: 30px; overflow-x: hidden; background: #ffffff; }
.tutorial-container .content-area .example-box {
  margin-left: 0;
  margin-right: 0;
  width: auto;
  box-sizing: border-box;
}

.tutorial-container .content-area .note-section,
.tutorial-container .content-area .warning-section,
.tutorial-container .content-area .lesson-note {
  margin-left: -30px;
  margin-right: -30px;
  width: calc(100% + 60px);
  box-sizing: border-box;
}

/* Style for inline code snippets from markdown */
.content-area code:not(pre code) {
  color: maroon;
  background-color: #f1f1f1;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 90%;
}

.content-area .note-section code:not(pre code),
.content-area .warning-section code:not(pre code),
.content-area .lesson-note code:not(pre code),
.content-area .lesson-note-success code:not(pre code) {
  color: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* ===== Sidebar Navigation ===== */
.sidebar { width: 230px; min-width: 230px; background: #E5E7EB; border-right: 1px solid #ddd; padding: 16px 0; flex-shrink: 0; position: sticky; top: 75px; height: calc(100vh - 75px); overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #aaa; }
.sidebar-title,
.sidebar h3 { padding: 8px 8px 10px; font-size: 18px; font-weight: 550; color: #555; text-transform: uppercase; letter-spacing: 0.2px; white-space: nowrap; line-height: 1.05; }
.sidebar-group { margin-bottom: 12px; }
.sidebar-group:last-child { margin-bottom: 0; }
.sidebar-section-title { margin: 0; padding: 8px 8px 4px; display: block; font-size: 20px; font-weight: 500; line-height: 1.05; color: #333; white-space: nowrap; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul li a { display: block; width: 100%; padding: 8px 12px; margin: 0; box-sizing: border-box; color: #333; font-size: 15px; line-height: 1.05; border-left: 3px solid transparent; border-radius: 0; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.sidebar ul li a:hover { background: #ffffff; border-left-color: #3B82F6; color: #3B82F6; text-decoration: none; }
.sidebar ul li a.active { background: #3B82F6; border-left-color: #3B82F6; color: #ffffff; text-decoration: none; }

/* ===== Right Sidebar ===== */
.right-sidebar {
  width: 260px;
  min-width: 260px;
  padding: 20px 16px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.right-sidebar-inner {
  position: sticky;
  top: 95px;
  display: grid;
  gap: 16px;
}

.tutorial-container .right-sidebar-inner {
  position: static;
  top: auto;
}

.right-sidebar-card {
  padding: 18px 16px;
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.06);
}

.right-sidebar-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.15;
  color: #1e3a5f;
}

.right-sidebar-card p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.right-sidebar-card p:last-child {
  margin-bottom: 0;
}

.right-sidebar-links {
  display: grid;
  gap: 8px;
}

.right-sidebar-topic-group + .right-sidebar-topic-group {
  margin-top: 14px;
}

.right-sidebar-section-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.right-sidebar-links a {
  display: block;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.right-sidebar-links a:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  text-decoration: none;
  transform: translateY(-1px);
}

.right-sidebar-list {
  padding-left: 18px;
  margin: 0;
  color: #475569;
}

.right-sidebar-list li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.right-sidebar-list li:last-child {
  margin-bottom: 0;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
  .tutorial-container { flex-direction: column; }
  .tutorial-container .content-area .note-section,
  .tutorial-container .content-area .warning-section,
  .tutorial-container .content-area .lesson-note {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    max-width: 270px;
    min-width: 0;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    background: #E5E7EB;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    border-right: 1px solid #ddd;
    padding-top: 110px;
  }
  .sidebar-section-title {
    font-size: 20px;
  }
  .sidebar.open {
    left: 0;
  }
  .right-sidebar {
    display: none;
  }
}
