/* Lesson Content Styling */
:root {
  --bg-dark: #0a0a0c;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-color: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

.lesson-container {
  max-width: 800px;
  margin: 80px auto;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

.lesson-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 2rem;
}

.lesson-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lesson-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  color: var(--accent-color);
}

h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  color: #fff;
}

p, li {
  color: var(--text-main);
  opacity: 0.9;
}

code {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-color);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
}

pre {
  background: #111;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
}

pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
}

blockquote {
  border-left: 4px solid var(--accent-color);
  margin: 2rem 0;
  padding: 1rem 2rem;
  background: rgba(56, 189, 248, 0.05);
  border-radius: 4px 12px 12px 4px;
}

hr {
  border: 0;
  height: 1px;
  background: var(--glass-border);
  margin: 3rem 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.back-link:hover {
  transform: translateX(-5px);
  color: #fff;
}

/* Sticky Chapter Bar (Dark Mode) */
.sticky-chapter-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.85); /* Matches --primary-bg with transparency */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
  margin: -2rem -2rem 2rem -2rem; /* Negative margin to stretch full width of container padding */
  border-radius: 20px 20px 0 0; /* Rounded top corners if inside a container, but usually top-level */
}

.nav-container {
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-chapter-num {
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--accent-color);
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Tool Toggles */
.tool-toggle-container {
  display: flex;
  gap: 0.5rem;
  background: rgba(0,0,0,0.2);
  padding: 0.4rem;
  border-radius: 12px;
  margin: 1.5rem 0;
  width: fit-content;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.tool-btn.active {
  background: var(--accent-color);
  color: #000;
}

.tool-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tool-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Research Highlights & Success Criteria */
.research-highlight {
  background: rgba(129, 140, 248, 0.05);
  border-left: 4px solid #818cf8;
  padding: 1.5rem;
  border-radius: 4px 16px 16px 4px;
  margin: 2rem 0;
}

.research-highlight h3 {
  margin-top: 0;
  color: #818cf8;
}

.success-criteria {
  background: rgba(52, 211, 153, 0.05);
  border: 1px solid #34d399;
  padding: 2rem;
  border-radius: 20px;
  margin: 3rem 0;
}

.success-criteria h2 {
  margin-top: 0;
  color: #34d399;
}

/* Nav Progress Bar */
.nav-progress-bar {
  height: 4px;
  background: var(--accent-color);
  width: 0%;
  position: absolute;
  bottom: -2px;
  left: 0;
  transition: width 0.1s;
}

.nav-right {
  display: flex;
  gap: 0.75rem;
}

.nav-right a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.nav-right a:hover {
  color: #001;
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* Inline Float Images & Lightbox */
img.inline-right {
  float: right;
  max-width: 45%;
  height: auto;
  margin: 0.5rem 0 1.5rem 2rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
  img.inline-right {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }
}

.clickable-img {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-img:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 40px var(--accent-glow);
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
  opacity: 1;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(255,255,255,0.1);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}
