:root {
  --python-blue: #3776ab;
  --python-yellow: #ffd43b;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1a2332;
  --text2: #4a5568;
  --border: #e2e8f0;
  --code-bg: #1e2a3a;
  --code-text: #64ffda;
  --correct: #22c55e;
  --wrong: #ef4444;
  --shadow: 0 4px 20px rgba(55,118,171,0.10);
  --radius: 14px;
}
.dark {
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --text2: #8b949e;
  --border: #30363d;
  --code-bg: #010409;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* Bara principală */
.topbar {
  background: var(--python-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(55,118,171,0.3);
}
.topbar-logo {
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.topbar-logo span { color: var(--python-yellow); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.dark-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: background 0.2s;
}
.dark-btn:hover { background: rgba(255,255,255,0.25); }

/* Bara progres */
.progress-wrap { height: 4px; background: var(--border); }
.progress-fill { height: 4px; background: var(--python-yellow); transition: width 0.4s; }
.progress-label { text-align: center; font-size: 11px; color: var(--text2); padding: 3px 0; font-weight: 600; letter-spacing: 0.3px; }

/* Pagini */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Pagina principală */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #3776ab 50%, #4ea1f3 100%);
  color: white;
  text-align: center;
  padding: 60px 24px 50px;
}
.hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.hero h1 em { color: var(--python-yellow); font-style: normal; }
.hero-sub { font-size: 16px; opacity: 0.88; max-width: 560px; margin: 0 auto 20px; line-height: 1.7; }
.author-pill {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border-radius: 30px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.competente {
  background: #dbeafe;
  border-left: 5px solid var(--python-blue);
  border-radius: 12px;
  padding: 18px 22px;
  max-width: 820px;
  margin: 30px auto 0;
  text-align: left;
  color: #1e3a5f;
}
.dark .competente { background: #1a2d4a; color: #93c5fd; border-color: #4ea1f3; }
.competente strong { font-size: 14px; font-weight: 800; display: block; margin-bottom: 8px; }
.competente ul { padding-left: 18px; }
.competente li { font-size: 13px; line-height: 1.8; }

.lessons-section { max-width: 960px; margin: 36px auto; padding: 0 20px; }
.lessons-section h2 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--python-blue);
}
.card.featured::before { background: var(--python-yellow); }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(55,118,171,0.18); }
.card-nr { font-size: 36px; font-weight: 800; color: var(--border); font-family: 'JetBrains Mono', monospace; line-height: 1; margin-bottom: 8px; }
.dark .card-nr { color: #2d3748; }
.card h3 { font-size: 14px; font-weight: 800; color: var(--python-blue); margin-bottom: 4px; }
.dark .card h3 { color: #4ea1f3; }
.card p { font-size: 13px; color: var(--text2); margin-bottom: 14px; }
.card-btn {
  background: var(--python-blue);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.card-btn:hover { background: #255f8f; }

/* Pagina lecției */
.lesson-wrap {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px 40px;
}
@media (max-width: 860px) { .lesson-wrap { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 76px;
}
.sidebar h3 { font-size: 13px; font-weight: 800; color: var(--python-blue); margin-bottom: 12px; letter-spacing: 0.5px; text-transform: uppercase; }
.dark .sidebar h3 { color: #4ea1f3; }
.sidebar ul { list-style: none; }
.sidebar li {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text2);
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.sidebar li:hover { background: #f0f4f8; color: var(--python-blue); }
.dark .sidebar li:hover { background: #1f2937; color: #4ea1f3; }
.sidebar li.active { background: #dbeafe; color: var(--python-blue); font-weight: 800; }
.dark .sidebar li.active { background: #1a2d4a; color: #4ea1f3; }
.sidebar-comp {
  background: #f0f7ff;
  border-radius: 8px;
  padding: 10px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text2);
  line-height: 1.6;
}
.dark .sidebar-comp { background: #1a2333; }
.sidebar-comp strong { color: var(--python-blue); font-size: 11px; display: block; margin-bottom: 3px; }
.dark .sidebar-comp strong { color: #4ea1f3; }

.content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
@media (max-width: 600px) { .content { padding: 18px; } }

.content h2 { font-size: 19px; font-weight: 800; color: var(--python-blue); margin: 28px 0 10px; }
.dark .content h2 { color: #4ea1f3; }
.content h2:first-child { margin-top: 0; }
.content p { font-size: 14px; line-height: 1.8; color: var(--text2); margin-bottom: 10px; }
.dark .content p { color: #c9d1d9; }
.content ul { padding-left: 20px; margin-bottom: 12px; }
.content li { font-size: 14px; line-height: 1.9; color: var(--text2); }
.dark .content li { color: #c9d1d9; }

/* Casetă sfat */
.tip {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 13px;
  color: #78350f;
  margin-bottom: 24px;
  font-weight: 600;
  line-height: 1.6;
}
.dark .tip { background: #2d2008; color: #fbbf24; border-color: #f59e0b; }

/* Casetă informații */
.info {
  background: #eff6ff;
  border-left: 4px solid var(--python-blue);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1e40af;
  margin: 14px 0;
  line-height: 1.7;
}
.dark .info { background: #1a2d4a; color: #93c5fd; border-color: #4ea1f3; }

/* Zone de cod */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px 20px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid #2d4a6a;
}
code {
  background: var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #c0392b;
  font-weight: 700;
}
.dark code { background: #2d3748; color: #f87171; }

/* Rezultate afișate */
.output {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #166534;
  margin: 10px 0 16px;
  line-height: 1.8;
}
.dark .output { background: #052e16; color: #86efac; border-color: #16a34a; }

/* Quizuri */
.quiz {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}
.dark .quiz { background: #0d1117; }
.quiz h3 { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.quiz-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qbtn {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.qbtn:hover { border-color: var(--python-blue); color: var(--python-blue); background: #eff6ff; }
.dark .qbtn:hover { background: #1a2d4a; color: #4ea1f3; }

.feedback {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  display: none;
}
.feedback.ok { background: #dcfce7; color: #166534; display: block; }
.feedback.err { background: #fee2e2; color: #991b1b; display: block; }
.dark .feedback.ok { background: #052e16; color: #86efac; }
.dark .feedback.err { background: #450a0a; color: #fca5a5; }

/* Câmpuri interactive */
.sim-input {
  padding: 9px 12px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  background: var(--card);
  color: var(--text);
  margin-top: 8px;
  margin-right: 6px;
  transition: border 0.2s;
}
.sim-input:focus { border-color: var(--python-blue); outline: none; }
.run-btn {
  background: #22c55e;
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.run-btn:hover { background: #16a34a; }
.reset-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  margin-left: 6px;
  transition: background 0.2s;
}
.reset-btn:hover { background: #4b5563; }

/* Butoane navigare */
.nav-btns { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.nav-btn {
  background: var(--python-blue);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.nav-btn:hover { background: #255f8f; transform: translateY(-1px); }
.nav-btn.home { background: #64748b; }
.nav-btn.home:hover { background: #475569; }

/* Diplomă finală */
.diploma {
  display: none;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 3px solid #f59e0b;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-top: 24px;
  box-shadow: 0 8px 32px rgba(245,158,11,0.2);
}
.dark .diploma { background: linear-gradient(135deg, #2d2008, #3d2a0a); border-color: #f59e0b; }
.diploma h2 { font-size: 28px; color: #b45309; margin-bottom: 8px; }
.dark .diploma h2 { color: #fbbf24; }
.diploma .d-name { font-size: 26px; font-weight: 800; color: #92400e; margin: 12px 0; }
.dark .diploma .d-name { color: #fcd34d; }
.diploma p { font-size: 15px; color: #78350f; margin: 4px 0; }
.dark .diploma p { color: #fde68a; }
.diploma .d-meta { font-size: 12px; color: #a16207; margin-top: 12px; }
.dark .diploma .d-meta { color: #fbbf24; opacity: 0.7; }

/* Subsol */
footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 24px;
  font-size: 13px;
  line-height: 1.8;
}

/* Antet lecție */
.lesson-header {
  background: linear-gradient(135deg, #1e3a5f, #3776ab);
  color: white;
  text-align: center;
  padding: 36px 20px 28px;
}
.lesson-header h1 { font-size: clamp(22px, 4vw, 34px); font-weight: 800; margin-bottom: 6px; }
.lesson-header p { font-size: 15px; opacity: 0.88; }
.lesson-header .pill {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

/* Inline code in pre */
pre input.inline-input {
  background: #2d4a6a;
  border: 1px solid #4ea1f3;
  color: #64ffda;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 4px;
  width: 160px;
}

/* QUIZ score */
.score-display {
  background: linear-gradient(135deg, var(--python-blue), #4ea1f3);
  color: white;
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  margin-top: 20px;
  font-weight: 800;
  font-size: 16px;
}

/* ═══════════════════════════════════════════════
   SECȚIUNI DE DIFERENȚIERE — NOU
   🐢 Remedial + 🚀 Avansat
   ═══════════════════════════════════════════════ */

.diferentiat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
@media (max-width: 680px) {
  .diferentiat { grid-template-columns: 1fr; }
}

.dif-remedial {
  background: #fef9ee;
  border: 1.5px solid #f59e0b;
  border-left: 5px solid #f59e0b;
  border-radius: 12px;
  padding: 18px 20px;
}
.dark .dif-remedial {
  background: #2a1f08;
  border-color: #b45309;
  border-left-color: #f59e0b;
}

.dif-avansat {
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  border-left: 5px solid #22c55e;
  border-radius: 12px;
  padding: 18px 20px;
}
.dark .dif-avansat {
  background: #052e16;
  border-color: #16a34a;
  border-left-color: #22c55e;
}

.dif-remedial h4 {
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dark .dif-remedial h4 { color: #fbbf24; }

.dif-avansat h4 {
  font-size: 13px;
  font-weight: 800;
  color: #166534;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dark .dif-avansat h4 { color: #86efac; }

.dif-remedial p,
.dif-remedial li,
.dif-avansat p,
.dif-avansat li {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text2);
}
.dark .dif-remedial p,
.dark .dif-remedial li { color: #d97706; }
.dark .dif-avansat p,
.dark .dif-avansat li { color: #86efac; }

.dif-remedial ul,
.dif-avansat ul {
  padding-left: 16px;
  margin-top: 8px;
}

.dif-remedial pre,
.dif-avansat pre {
  font-size: 12px;
  padding: 12px 14px;
  margin: 10px 0 6px;
}

/* ═══════════════════════════════════════════════
   BUTON DESPRE din topbar
   ═══════════════════════════════════════════════ */
.topbar-about-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: background 0.2s;
}
.topbar-about-btn:hover { background: rgba(255,255,255,0.25); }

/* ═══════════════════════════════════════════════
   PAGINA DESPRE
   ═══════════════════════════════════════════════ */
.about-wrap {
  max-width: 860px;
  margin: 36px auto 48px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
@media (max-width: 600px) { .about-card { padding: 18px; } }

.about-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--python-blue);
  margin-bottom: 14px;
}
.dark .about-card h2 { color: #4ea1f3; }

.about-card p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text2);
}
.dark .about-card p { color: #c9d1d9; }

/* Grid cu 4 carduri info */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.about-info-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
}
.about-icon { font-size: 32px; margin-bottom: 10px; }
.about-info-card h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--python-blue);
  margin-bottom: 8px;
}
.dark .about-info-card h3 { color: #4ea1f3; }
.about-info-card p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text2);
}

/* Lista lecțiilor */
.about-lectii {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.about-lectie {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.dark .about-lectie { color: #c9d1d9; }
.about-nr {
  background: var(--python-blue);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 2px;
  min-width: 30px;
  text-align: center;
}
.about-nr-mid { background: #f59e0b; }
.about-nr-final { background: #22c55e; }

/* Autor */
.about-autor {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}
.autor-avatar {
  font-size: 52px;
  background: #dbeafe;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dark .autor-avatar { background: #1a2d4a; }
.about-autor p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text2);
  margin: 0;
}
.about-autor strong { color: var(--text); font-size: 16px; }
.dark .about-autor strong { color: #e6edf3; }

/* Licență */
.about-license {
  margin-top: 14px;
  display: inline-block;
  background: #dbeafe;
  color: var(--python-blue);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
}
.dark .about-license { background: #1a2d4a; color: #4ea1f3; }
