/* ═══════════════════════════════════════════════════════════════════════════════
   🐍 PYTHON MASTERY - FKTI LIGHT THEME
   Apple-inspired minimalist design
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Google Fonts - aligned with Data Science course */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* ════════════════════════════════════
   CSS Variables (aligned with Data Science course look & feel)
   ════════════════════════════════════ */
:root {
  /* Backgrounds - DS lesson style */
  --bg-primary: #fce7f3;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #1e293b;
  --bg-code-light: #f5f5f7;
  
  /* Course accent (rose/pink like DS) */
  --course-primary: #db2777;
  --course-light: #fce7f3;
  --course-border: #fbcfe8;
  
  /* Python Brand Colors */
  --python-blue: #06c;
  --python-yellow: #FFD43B;
  --python-blue-light: #4584b6;
  
  /* Accent Colors */
  --accent-green: #22c55e;
  --accent-emerald: #059669;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-dark: #f8fafc;
  
  /* Borders & Shadows - DS style */
  --border-color: #fbcfe8;
  --border-focus: #db2777;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 25px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 3px rgba(219, 39, 119, 0.2);
  
  /* Gradients - DS lesson header style */
  --gradient-python: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  --gradient-success: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  --gradient-warm: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  --gradient-cool: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

/* ════════════════════════════════════
   Base Styles
   ════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
  padding: 20px;
}

/* Background Pattern - Subtle */
.bg-pattern {
  display: none;
}

/* ════════════════════════════════════
   Navigation - Polished Glass Design
   ════════════════════════════════════ */
.main-nav, .course-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  margin-bottom: 30px;
  padding: 15px 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid var(--course-border);
}

.nav-content, .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Hub/Home button - DS style (pink accent) */
.nav-hub, .nav-home-link, .nav-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--course-border);
  border-radius: 10px;
  color: var(--course-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-hub:hover, .nav-home-link:hover, .nav-home-btn:hover {
  color: #be185d;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.2);
}

.nav-hub:active, .nav-home-link:active, .nav-home-btn:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 0 #d1d5db,
    0 3px 6px rgba(0, 0, 0, 0.06);
}

/* Session pills container */
.session-nav, .session-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f5f5f7;
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.session-nav::-webkit-scrollbar, .session-pills::-webkit-scrollbar { display: none; }

/* Session number pills */
.nav-link, .pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover, .pill:hover {
  background: rgba(0,0,0,0.06);
  color: #1d1d1f;
}

.nav-link.active, .pill.active {
  background: #fff;
  color: #0071e3;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Assignments button - 3D Green */
.nav-assignments, .nav-assign {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 
    0 3px 0 #15803d,
    0 4px 8px rgba(22, 163, 74, 0.3);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-assignments:hover, .nav-assign:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 5px 0 #15803d,
    0 7px 14px rgba(22, 163, 74, 0.35);
}

.nav-assignments:active, .nav-assign:active {
  transform: translateY(1px);
  box-shadow: 
    0 2px 0 #15803d,
    0 3px 6px rgba(22, 163, 74, 0.25);
}

.logo {
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.logo:hover {
  background: rgba(0,0,0,0.04);
}

/* Session numbers navigation */
.session-nav {
  display: flex;
  gap: 2px;
  align-items: center;
  background: rgba(0,0,0,0.03);
  padding: 4px;
  border-radius: 8px;
}

.nav-link {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #6e6e73;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.15s;
}

.nav-link:hover {
  background: rgba(0,0,0,0.06);
  color: #1d1d1f;
}

.nav-link.active {
  background: white;
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Assignments link */
.nav-assignments {
  font-size: 13px;
  font-weight: 500;
  color: #166534;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  background: #dcfce7;
  transition: all 0.15s;
}

.nav-assignments:hover {
  background: #bbf7d0;
}

/* ════════════════════════════════════
   Progress Bar (Psychological: Shows Achievement)
   ════════════════════════════════════ */
.progress-container {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  z-index: 999;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-success);
  width: 0%;
  transition: width 0.3s ease;
}

/* ════════════════════════════════════
   Main Content
   ════════════════════════════════════ */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* ════════════════════════════════════
   Session Header - Big & Motivating
   ════════════════════════════════════ */
/* Session Header - DS lesson style (gradient banner) */
.session-header {
  text-align: center;
  padding: 50px 40px;
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  border-radius: 25px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(236, 72, 153, 0.3);
  position: relative;
  overflow: hidden;
  color: white;
}

.session-header::before {
  display: none;
}

.session-number {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.session-header h1 {
  font-size: 2.5em;
  font-weight: 800;
  margin-bottom: 15px;
  color: white;
}

.session-subtitle {
  color: rgba(255,255,255,0.95);
  font-size: 1.2em;
  max-width: 700px;
  margin: 0 auto;
}

/* Achievement Badge - DS beginner badge style */
.achievement-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #22c55e;
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9em;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

/* ════════════════════════════════════
   Learning Objectives Card
   ════════════════════════════════════ */
.objectives-card {
  background: var(--bg-secondary);
  border: 3px solid var(--course-border);
  border-radius: 25px;
  padding: 45px;
  margin-bottom: 35px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.08);
}

.objectives-card h2 {
  color: var(--course-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--course-light);
}

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.objective-item {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent-green);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.objective-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.objective-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.objective-item h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.objective-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ════════════════════════════════════
   Content Cards
   ════════════════════════════════════ */
.content-section {
  background: var(--bg-secondary);
  border: 3px solid var(--course-border);
  border-radius: 25px;
  padding: 45px;
  margin-bottom: 35px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.08);
}

.content-section h2 {
  color: var(--course-primary);
  font-size: 1.8em;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--course-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-section h3 {
  color: #be185d;
  font-size: 1.4em;
  margin: 35px 0 20px;
  padding-left: 20px;
  border-left: 5px solid #ec4899;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-section h3::before {
  content: '';
  display: none;
}

.content-section h4 {
  color: var(--accent-purple);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
}

/* ════════════════════════════════════
   Story Box - Engaging Analogies
   ════════════════════════════════════ */
.story-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px dashed #f59e0b;
  border-radius: 20px;
  padding: 30px;
  margin: 25px 0;
  position: relative;
}

.story-box::before {
  content: '📖';
  position: absolute;
  top: -12px;
  left: 20px;
  background: white;
  padding: 0 8px;
  font-size: 1.2rem;
}

.story-title {
  color: #be185d;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.story-box p {
  color: var(--text-secondary);
}

.story-moral {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #f9a8d4;
  color: #be185d;
  font-weight: 600;
}

/* Character Illustration Placeholder */
.character-illustration {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  margin: 1rem 0;
}

.character-illustration .emoji-large {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.character-illustration p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════
   Key Concept Box
   ════════════════════════════════════ */
.key-concept {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.key-concept::before {
  content: '💡';
  position: absolute;
  top: -12px;
  left: 20px;
  background: white;
  padding: 0 8px;
  font-size: 1.2rem;
}

.key-concept h4 {
  color: #b45309;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

/* ════════════════════════════════════
   Code Blocks - SUPER READABLE Light Theme
   ════════════════════════════════════ */
.code-block-wrapper {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid #cbd5e1;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--python-blue);
  color: white;
  font-size: 0.8rem;
  font-family: 'Fira Code', monospace;
}

.code-header .lang-badge {
  background: var(--python-yellow);
  color: #1e293b;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
}

.code-block {
  background: #fefefe;
  padding: 1.25rem;
  overflow-x: auto;
  border-left: 4px solid var(--python-blue);
}

.code-block pre {
  margin: 0;
  background: transparent !important;
}

.code-block code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #1e293b !important;
  font-weight: 500;
  background: transparent !important;
}

/* Make ALL code inside code-block dark and readable */
.code-block code * {
  color: inherit !important;
}

/* Copy button on code blocks (top right) */
.code-block, .terminal-mock, .fkti-pre-wrap { position: relative; }
.fkti-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.12);
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 5;
  transition: background 0.2s, color 0.2s;
}
.fkti-copy-btn:hover { background: rgba(30, 41, 59, 0.2); color: #1e293b; }
.fkti-copy-btn.fkti-copy-done { background: #22c55e; color: #fff; }

/* Syntax Highlighting - High Contrast */
.comment { color: #6b7280 !important; font-style: italic; }
.keyword { color: #7c3aed !important; font-weight: 700; }
.string { color: #059669 !important; }
.number { color: #c2410c !important; }
.function { color: #0369a1 !important; }

/* Output Block */
.output-block {
  background: #f0fdf4;
  border: 2px solid var(--accent-green);
  border-top: none;
  border-radius: 0 0 12px 12px;
}

.output-block pre {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #065f46 !important;
  background: white;
  white-space: pre-wrap;
}

.output-header {
  padding: 0.5rem 1rem;
  background: #dcfce7;
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.output-header::before {
  content: '▶';
}

.output-content {
  padding: 1rem 1.25rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #065f46;
  background: white;
  border-radius: 0 0 10px 10px;
  white-space: pre-wrap;
}

/* Inline Code - Super Visible */
code {
  font-family: 'Fira Code', 'Consolas', monospace;
  background: #fef3c7 !important;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: #92400e !important;
  border: 1px solid #fcd34d;
  font-weight: 600;
}

/* Ensure code in pre tags is dark */
pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #1e293b !important;
}

/* ════════════════════════════════════
   Step-by-Step Explanation
   ════════════════════════════════════ */
.step-by-step {
  margin: 1.5rem 0;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  border-left: 4px solid var(--python-blue);
}

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--gradient-python);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  font-size: 0.9rem;
}

.step-content {
  flex: 1;
}

.step-content strong {
  color: var(--python-blue);
}

.step-content p {
  margin-top: 0.25rem;
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* ════════════════════════════════════
   Visual Memory Diagram
   ════════════════════════════════════ */
.memory-diagram {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.memory-diagram h4 {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.memory-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.memory-box {
  text-align: center;
}

.memory-label {
  background: var(--python-yellow);
  color: var(--text-primary);
  padding: 0.4rem 1rem;
  border-radius: 8px 8px 0 0;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 0.85rem;
}

.memory-value {
  background: white;
  padding: 1rem 1.5rem;
  border: 3px solid var(--python-yellow);
  border-top: none;
  border-radius: 0 0 8px 8px;
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  color: var(--accent-purple);
  font-weight: 600;
}

/* ════════════════════════════════════
   Warning & Tip Boxes
   ════════════════════════════════════ */
.warning-box {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  position: relative;
}

.warning-box::before {
  content: '⚠️';
  position: absolute;
  top: -10px;
  left: 20px;
  background: white;
  padding: 0 6px;
}

.warning-box strong {
  color: #dc2626;
}

.tip-box {
  background: #ecfdf5;
  border: 2px solid #6ee7b7;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  position: relative;
}

.tip-box::before {
  content: '💡';
  position: absolute;
  top: -10px;
  left: 20px;
  background: white;
  padding: 0 6px;
}

.tip-box strong {
  color: var(--accent-emerald);
}

/* ════════════════════════════════════
   Think Box (Curiosity Trigger)
   ════════════════════════════════════ */
.think-box {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border: 2px solid #a78bfa;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  position: relative;
}

.think-box::before {
  content: '🤔';
  position: absolute;
  top: -10px;
  left: 20px;
  background: white;
  padding: 0 6px;
}

.think-box strong {
  color: var(--accent-purple);
}

/* ════════════════════════════════════
   Quiz/Practice Box (Active Learning)
   ════════════════════════════════════ */
.quiz-box {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 2px dashed var(--accent-green);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.quiz-box h4 {
  color: var(--accent-emerald);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-box h4::before {
  content: '✍️';
}

.quiz-list {
  list-style: none;
  padding: 0;
}

.quiz-list li {
  padding: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.quiz-list li:last-child {
  border-bottom: none;
}

.correct { color: var(--accent-emerald); font-weight: 600; font-size: 0.85rem; }
.wrong { color: var(--accent-red); font-weight: 600; font-size: 0.85rem; }

/* ════════════════════════════════════
   Tables
   ════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th {
  background: var(--python-blue);
  color: white;
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 700;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* ════════════════════════════════════
   Summary Section
   ════════════════════════════════════ */
.summary-section {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 2px solid #60a5fa;
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
}

.summary-section h2 {
  color: var(--python-blue);
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.summary-item {
  background: white;
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.summary-item h4 {
  color: var(--python-blue);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.summary-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* ════════════════════════════════════
   Navigation Buttons - Modern & Sleek
   ════════════════════════════════════ */
.page-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 2rem 0;
  margin-top: 3rem;
  gap: 1.5rem;
}

/* Previous/Next Links - Clean Card Style */
.nav-prev,
.nav-next {
  max-width: 280px;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--python-blue);
  box-shadow: 0 4px 12px rgba(48, 105, 152, 0.15);
  transform: translateY(-2px);
}

/* Previous on left */
.nav-prev {
  justify-self: start;
}

/* Next on right, reversed layout */
.nav-next {
  flex-direction: row-reverse;
  text-align: right;
  justify-self: end;
}

.nav-arrow {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--python-blue);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nav-prev:hover .nav-arrow,
.nav-next:hover .nav-arrow {
  background: var(--python-blue);
  color: white;
}

.nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.nav-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* Home Button - Centered */
.nav-home {
  width: 48px;
  height: 48px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  text-decoration: none;
  font-size: 1.3rem;
  transition: all 0.2s ease;
}

.nav-home:hover {
  border-color: var(--python-blue);
  background: #f0f9ff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(48, 105, 152, 0.15);
}

/* Legacy support for old page-nav class */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  margin-top: 3rem;
  gap: 1rem;
}

.page-nav a {
  padding: 0.75rem 1.25rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-nav a:hover {
  border-color: var(--python-blue);
  color: var(--python-blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-disabled {
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 700px) {
  .page-navigation {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.75rem;
  }
  
  .nav-prev,
  .nav-next {
    max-width: 100%;
    width: 100%;
    justify-self: stretch;
  }
  
  .nav-next {
    justify-self: stretch;
  }
  
  .nav-home {
    order: -1;
    justify-self: center;
    margin-bottom: 0.5rem;
  }
}

/* ════════════════════════════════════
   Footer
   ════════════════════════════════════ */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  background: white;
}

footer p {
  color: var(--text-secondary);
}

.footer-mascot {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ════════════════════════════════════
   Responsive Design
   ════════════════════════════════════ */
@media (max-width: 768px) {
  .main-nav, .course-nav {
    padding: 10px 12px;
  }
  
  .nav-content, .nav-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .nav-hub, .nav-home-link, .nav-home-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .nav-assignments, .nav-assign {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .session-nav, .session-pills {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 3px;
  }
  
  .nav-link, .pill {
    min-width: 28px;
    height: 26px;
    font-size: 11px;
    padding: 0 8px;
  }
  
  main {
    padding: 1rem;
  }
  
  .session-header {
    padding: 2rem 1rem;
  }
  
  .session-header h1 {
    font-size: 1.75rem;
  }
  
  .content-section {
    padding: 1.25rem;
  }
  
  .content-section h2 {
    font-size: 1.3rem;
  }
  
  .step {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-nav {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* ════════════════════════════════════
   Animations (Engagement)
   ════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-section {
  animation: fadeInUp 0.4s ease-out;
}

/* Success Checkmark Animation */
@keyframes checkmark {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-check {
  animation: checkmark 0.3s ease-out;
}

/* ════════════════════════════════════
   Engagement Elements
   ════════════════════════════════════ */
.fun-fact {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border: 2px solid #fde047;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  position: relative;
}

.fun-fact::before {
  content: '🎉';
  position: absolute;
  top: -10px;
  left: 20px;
  background: white;
  padding: 0 6px;
}

.milestone-card {
  background: var(--gradient-success);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  margin: 2rem 0;
}

.milestone-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.milestone-card p {
  opacity: 0.9;
}

/* ════════════════════════════════════
   GLOBAL CODE VISIBILITY FIX
   Super readable code everywhere!
   ════════════════════════════════════ */

/* Concept Card Code Blocks */
.concept-card .code-block,
.concept-card pre {
  background: #fffbeb !important;
  border: 2px solid #fcd34d !important;
  border-radius: 10px;
  padding: 1rem !important;
  margin: 1rem 0;
}

.concept-card .code-block code,
.concept-card pre code,
.concept-card code {
  color: #1e293b !important;
  background: transparent !important;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* Force all pre/code combinations to be readable */
pre {
  background: #fefefe !important;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  overflow-x: auto;
}

pre code {
  color: #1e293b !important;
  background: transparent !important;
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 0.9rem !important;
  line-height: 1.8 !important;
  font-weight: 500 !important;
  display: block;
}

/* Ensure visibility in all containers */
.content-section pre code,
.question-card pre code,
.solution-content pre code,
.example-card pre code {
  color: #1e293b !important;
  background: transparent !important;
}

/* Dark text on light background ALWAYS */
.code-block code,
.code-block pre,
.code-block pre code {
  color: #1e293b !important;
  background: #fefefe !important;
}

/* ════════════════════════════════════
   Scrollbar Styling
   ════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ════════════════════════════════════
   EMERGENCY CODE VISIBILITY OVERRIDES
   These ensure no code is ever hidden
   ════════════════════════════════════ */
.code-block,
.code-block * {
  color: #1e293b !important;
}

.code-block code {
  text-shadow: none !important;
  -webkit-text-fill-color: #1e293b !important;
}

/* Python syntax colors - all high contrast on white */
.code-block .comment,
.code-block .cm-comment { color: #6b7280 !important; }
.code-block .keyword,
.code-block .cm-keyword { color: #7c3aed !important; font-weight: bold; }
.code-block .string,
.code-block .cm-string { color: #047857 !important; }
.code-block .number,
.code-block .cm-number { color: #c2410c !important; }
.code-block .function,
.code-block .cm-def { color: #1d4ed8 !important; }
.code-block .builtin,
.code-block .cm-builtin { color: #7c2d12 !important; }
.code-block .operator,
.code-block .cm-operator { color: #0f172a !important; }

/* ════════════════════════════════════
   Back to Top Button
   ════════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, var(--python-blue, #3069a0) 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    box-shadow: 0 4px 0 #1d4ed8, 0 6px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #1d4ed8, 0 10px 20px rgba(37, 99, 235, 0.4);
}

.back-to-top:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1d4ed8, 0 3px 8px rgba(37, 99, 235, 0.3);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}