/* HIVEPOWERED — AI Like a Pro — TRON dark style */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-sidebar: #0d0d0d;
  --bg-nav: rgba(10,10,10,0.93);
  --bg-card: rgba(255,255,255,0.034);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-active: rgba(62,186,244,0.07);

  --cyan: #3ebaf4;
  --cyan-glow: rgba(62,186,244,0.14);
  --cyan-border: rgba(62,186,244,0.22);
  --purple: #df30ff;
  --purple-glow: rgba(223,48,255,0.14);
  --yellow: #ffd84d;
  --green: #00d49b;
  --red: #ff4757;

  --text-1: rgba(255,255,255,0.93);
  --text-2: rgba(255,255,255,0.62);
  --text-3: rgba(255,255,255,0.36);
  --border: rgba(255,255,255,0.07);
  --border-cyan: rgba(62,186,244,0.22);

  --font-head: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;

  --nav-h: 60px;
  --sidebar-w: 268px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius: 10px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

a { color: var(--cyan); text-decoration: none; transition: color 0.2s; }
a:hover { color: #79d4ff; }

/* ── NAV ─────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0,0,0,0.5);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(62,186,244,0.4));
}
.nav-sep {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-family: var(--font-body);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-links a:hover { color: var(--text-1); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--cyan); }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: none; border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  font-size: 22px;
  line-height: 1;
}

/* ── HERO (homepage) ─────────────────────── */
.hero {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 80px;
  padding-left: 24px;
  padding-right: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse at 50% 0%,
    rgba(62,186,244,0.13) 0%,
    rgba(223,48,255,0.05) 45%,
    transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 400px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(62,186,244,0.3), transparent);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(62,186,244,0.08);
  border: 1px solid rgba(62,186,244,0.18);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: -1px;
  color: var(--text-1);
  line-height: 1.05;
  margin-bottom: 16px;
  position: relative;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.65;
  position: relative;
}
.hero-search {
  max-width: 540px;
  margin: 0 auto 32px;
  position: relative;
}
.hero-search input {
  width: 100%;
  height: 54px;
  background: rgba(255,255,255,0.07);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 0 56px 0 52px;
  outline: none;
  transition: all 0.2s var(--ease);
}
.hero-search input::placeholder { color: var(--text-3); }
.hero-search input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-glow);
}
.hero-search .s-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; font-size: 18px;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  background: #161616;
  border: 1px solid var(--border-cyan);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  overflow: hidden;
  display: none;
  z-index: 300;
  max-height: 380px;
  overflow-y: auto;
}
.search-results.visible { display: block; }
.search-result-item {
  display: block;
  padding: 14px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result-item:hover { background: var(--bg-active); }
.search-result-item:last-child { border-bottom: none; }
.result-module { font-size: 10px; font-weight: 700; color: var(--cyan); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 3px; }
.result-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.result-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.track-pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; position: relative; }
.track-pill {
  font-size: 12px; font-weight: 600;
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid;
}
.track-pill.chat { background: rgba(62,186,244,0.07); border-color: rgba(62,186,244,0.2); color: var(--cyan); }
.track-pill.code { background: rgba(223,48,255,0.06); border-color: rgba(223,48,255,0.2); color: var(--purple); }

/* ── COURSE PROGRESS (homepage) ──────────── */
.course-progress-section {
  max-width: 1080px; margin: 0 auto; padding: 0 32px 48px;
  display: none;
}
.course-progress-card {
  background: rgba(0,212,155,0.04);
  border: 1px solid rgba(0,212,155,0.15);
  border-radius: 12px;
  padding: 24px 28px;
}
.cp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.cp-label { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-1); }
.cp-count { font-size: 14px; color: var(--green); font-weight: 600; }
.cp-bar-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.cp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #00ffb0);
  border-radius: 10px;
  transition: width 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0%;
}
.cp-msg { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* ── SECTION WRAPPERS ────────────────────── */
.section { max-width: 1080px; margin: 0 auto; padding: 64px 32px; }
.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
}
.section-title { font-family: var(--font-head); font-weight: 700; font-size: 28px; color: var(--text-1); margin-bottom: 6px; }
.section-sub { font-size: 14px; color: var(--text-3); margin-bottom: 36px; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── SKILL LEVEL BADGES ──────────────────── */
.level-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px; border: 1px solid;
}
.level-starter { color: #00d49b; border-color: rgba(0,212,155,0.3); background: rgba(0,212,155,0.08); }
.level-intermediate { color: #ffd84d; border-color: rgba(255,216,77,0.3); background: rgba(255,216,77,0.07); }
.level-adv { color: #ff9f45; border-color: rgba(255,159,69,0.3); background: rgba(255,159,69,0.07); }
.level-advanced { color: #df30ff; border-color: rgba(223,48,255,0.3); background: rgba(223,48,255,0.08); }

/* ── MODULE CARDS ────────────────────────── */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s var(--ease);
  opacity: 0;
  animation: fadeUp 0.4s var(--ease) forwards;
}
.module-card:hover { border-color: var(--border-cyan); box-shadow: 0 6px 24px rgba(62,186,244,0.1); transform: translateY(-2px); background: var(--bg-card-hover); }

.mc-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.mc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mc-top-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 4px;
  border: 1px solid;
}
.mc-track { font-size: 11px; color: var(--text-3); font-weight: 500; }
.mc-header h3 { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text-1); letter-spacing: 0.2px; }

.mc-lessons { padding: 12px 0 4px; }
.mc-lesson-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.mc-lesson-link:hover { color: var(--text-1); background: rgba(255,255,255,0.03); border-left-color: var(--border-cyan); }
.mc-lnum {
  min-width: 20px; height: 20px;
  border-radius: 5px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
  transition: all 0.2s;
}
.mc-lnum.done {
  background: rgba(0,212,155,0.12) !important;
  border-color: rgba(0,212,155,0.35) !important;
  color: var(--green) !important;
}

/* ── REFERENCE CARDS ─────────────────────── */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ref-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none; color: inherit;
  display: block;
  transition: all 0.2s var(--ease);
}
.ref-card:hover { border-color: var(--border-cyan); box-shadow: 0 4px 16px rgba(62,186,244,0.1); transform: translateY(-2px); background: var(--bg-card-hover); }
.ref-icon { font-size: 26px; margin-bottom: 14px; }
.ref-card h4 { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.ref-card p { font-size: 13px; color: var(--text-3); line-height: 1.55; }

/* ── DOWNLOAD GRID ───────────────────────── */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: border-color 0.15s;
}
.dl-card:hover { border-color: var(--border-cyan); }
.dl-icon {
  width: 38px; height: 38px;
  background: rgba(62,186,244,0.08);
  border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--cyan);
}
.dl-info h4 { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.dl-info p { font-size: 12px; color: var(--text-3); line-height: 1.45; margin-bottom: 10px; }
.dl-btn {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(62,186,244,0.1);
  border: 1px solid rgba(62,186,244,0.2);
  color: var(--cyan);
  border-radius: 6px; font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.dl-btn:hover { background: rgba(62,186,244,0.18); color: var(--cyan); }

/* ── FOOTER ──────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}
.site-footer strong { color: var(--text-2); }

/* ── LESSON LAYOUT ───────────────────────── */
.lesson-wrap {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* Left sidebar */
.lesson-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0 32px;
  z-index: 100;
}
.lesson-sidebar::-webkit-scrollbar { width: 4px; }
.sb-section-title {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3); padding: 12px 20px 6px;
}
.sb-module { margin-bottom: 4px; }
.sb-module-name {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 20px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: default;
  flex-wrap: wrap;
}
.sb-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-3);
}
.sb-lesson-link {
  display: flex; align-items: center;
  padding: 5px 16px 5px 36px;
  font-size: 12px; color: var(--text-3);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  overflow: hidden;
}
.sb-lesson-link .sb-link-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.sb-lesson-link .sb-check {
  font-size: 10px; color: var(--green); font-weight: 700;
  opacity: 0; transition: opacity 0.2s; flex-shrink: 0; margin-left: 4px;
}
.sb-lesson-link:hover { color: var(--text-1); background: rgba(255,255,255,0.03); }
.sb-lesson-link.active { color: var(--cyan); border-left-color: var(--cyan); font-weight: 600; background: var(--bg-active); }
.sb-lesson-link.done { color: var(--text-2); }
.sb-lesson-link.done .sb-check { opacity: 1; }
.sb-divider { border: none; border-top: 1px solid var(--border); margin: 12px 20px; }
.sb-ref-link {
  display: block;
  padding: 5px 20px;
  font-size: 12px; color: var(--text-3);
  text-decoration: none;
  transition: all 0.15s;
}
.sb-ref-link:hover { color: var(--cyan); background: rgba(255,255,255,0.03); }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 140;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* Main content with sidebar offset */
.lesson-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* Progress strip */
.progress-strip {
  position: sticky;
  top: var(--nav-h);
  z-index: 99;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.progress-bar-track { height: 2px; background: rgba(255,255,255,0.06); }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--purple)); transition: width 0.4s; }
.progress-label-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 40px;
  font-size: 11px; color: var(--text-3);
}
.progress-label-row .pct { color: var(--cyan); font-weight: 600; }

/* Lesson article */
.lesson-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* Lesson header */
.lesson-header-block {
  padding: 52px 40px 44px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.lesson-header-inner { max-width: 760px; margin: 0 auto; position: relative; }
.lesson-module-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 14px;
}
.lesson-header-block h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; color: var(--text-1);
  line-height: 1.15; letter-spacing: -0.3px;
  margin-bottom: 14px;
}
.lesson-desc { font-size: 15px; color: var(--text-2); line-height: 1.65; max-width: 600px; }

/* Article content typography */
.lesson-article { padding-top: 44px; }
.lesson-article h2 {
  font-family: var(--font-head);
  font-size: 26px; font-weight: 700;
  color: var(--text-1);
  margin: 48px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.2px;
}
.lesson-article h3 {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 700;
  color: var(--text-1);
  margin: 32px 0 10px;
}
.lesson-article p { color: var(--text-2); margin-bottom: 14px; }
.lesson-article ul, .lesson-article ol { color: var(--text-2); margin: 0 0 16px 24px; }
.lesson-article li { margin-bottom: 6px; }
.lesson-article strong { color: var(--text-1); font-weight: 600; }
.lesson-article code {
  background: rgba(62,186,244,0.08);
  border: 1px solid rgba(62,186,244,0.15);
  color: var(--cyan);
  padding: 2px 7px; border-radius: 4px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 13px;
}
.lesson-article pre {
  background: #111;
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.85);
  padding: 20px 24px; border-radius: 8px;
  overflow-x: auto; margin: 20px 0; font-size: 13px; line-height: 1.7;
}
.lesson-article pre code { background: none; border: none; color: inherit; padding: 0; font-size: inherit; }
.lesson-article blockquote {
  background: rgba(62,186,244,0.05);
  border-left: 3px solid var(--cyan);
  margin: 24px 0; padding: 14px 20px;
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
}
.lesson-article blockquote p { margin: 0; }
.lesson-article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.lesson-article th { background: rgba(255,255,255,0.05); color: var(--text-2); font-weight: 600; text-align: left; padding: 10px 14px; border: 1px solid var(--border); font-size: 12px; letter-spacing: 0.3px; }
.lesson-article td { padding: 10px 14px; border: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.lesson-article tr:hover td { background: rgba(255,255,255,0.02); }
.lesson-article hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* Callouts */
.lesson-article .callout { border-radius: 8px; padding: 14px 18px; margin: 24px 0; border-left: 3px solid; }
.lesson-article .callout-tip { background: rgba(0,212,155,0.07); border-color: var(--green); color: rgba(0,212,155,0.9); }
.lesson-article .callout-note { background: rgba(62,186,244,0.06); border-color: var(--cyan); color: var(--text-2); }
.lesson-article .callout-warn { background: rgba(255,216,77,0.06); border-color: var(--yellow); color: rgba(255,216,77,0.9); }

/* ── SECURITY WARNING BLOCK ──────────────── */
.security-warning {
  background: rgba(255, 59, 48, 0.08);
  border: 2px solid rgba(255, 59, 48, 0.6);
  border-left: 5px solid #ff3b30;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 32px 0;
}
.security-warning .sw-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head);
  font-size: 17px; font-weight: 700;
  color: #ff6b6b;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.security-warning .sw-title::before {
  content: '⚠';
  font-size: 20px;
}
.security-warning p, .security-warning li {
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 6px;
}
.security-warning ul { padding-left: 20px; margin: 8px 0; }
.security-warning strong { color: #ff8a80; }

/* Downloads section in lesson */
.lesson-downloads {
  background: rgba(62,186,244,0.04);
  border: 1px solid rgba(62,186,244,0.15);
  border-radius: 10px; padding: 24px; margin: 40px 0;
}
.lesson-downloads h3 { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.lesson-downloads p { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.lesson-dl-list { display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(62,186,244,0.08);
  border: 1px solid rgba(62,186,244,0.2);
  border-radius: 7px;
  text-decoration: none; color: var(--cyan);
  font-size: 13px; font-weight: 600;
  transition: all 0.15s;
}
.lesson-dl-btn:hover { background: rgba(62,186,244,0.16); color: var(--cyan); }

/* Mark Complete button */
.mark-complete-wrap {
  display: flex; justify-content: center;
  margin: 40px 0 8px;
}
.mark-complete-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px;
  background: rgba(0,212,155,0.07);
  border: 1px solid rgba(0,212,155,0.25);
  border-radius: 10px;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.mark-complete-btn:hover:not(.done) { background: rgba(0,212,155,0.14); border-color: rgba(0,212,155,0.4); }
.mark-complete-btn.done {
  background: rgba(0,212,155,0.12);
  border-color: rgba(0,212,155,0.35);
  cursor: default;
  color: rgba(0,212,155,0.8);
}

/* Prev/Next navigation */
.lesson-nav {
  display: flex; justify-content: space-between; align-items: stretch;
  gap: 12px; margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.lesson-nav-btn {
  flex: 1; max-width: 46%;
  display: flex; flex-direction: column;
  text-decoration: none;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all 0.15s var(--ease);
}
.lesson-nav-btn:hover { border-color: var(--border-cyan); box-shadow: 0 4px 16px rgba(62,186,244,0.1); background: var(--bg-card-hover); }
.lesson-nav-btn.next { text-align: right; }
.nav-dir { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 6px; }
.nav-title { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.35; }
.lesson-nav-spacer { flex: 1; max-width: 46%; }

/* ── REFERENCE PAGE ──────────────────────── */
.ref-page { max-width: 860px; margin: 0 auto; padding: calc(var(--nav-h) + 48px) 40px 80px; }
.ref-page-header {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px; margin-bottom: 48px;
  position: relative; overflow: hidden;
}
.ref-page-header::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(62,186,244,0.12), transparent 70%);
  pointer-events: none;
}
.ref-page-badge { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.ref-page-header h1 { font-family: var(--font-head); font-size: 38px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; letter-spacing: -0.3px; }
.ref-page-header p { font-size: 15px; color: var(--text-2); }

.cmd-section { margin-bottom: 40px; }
.cmd-section-title {
  font-family: var(--font-head); font-size: 20px; font-weight: 700;
  color: var(--text-1); margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table th {
  background: rgba(255,255,255,0.04);
  color: var(--text-3); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.cmd-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; vertical-align: top; }
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: rgba(255,255,255,0.02); }
.cmd-table code { background: rgba(62,186,244,0.08); border: 1px solid rgba(62,186,244,0.15); color: var(--cyan); padding: 2px 7px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.cmd-table .desc { color: var(--text-3); }
.cmd-wrap { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }

/* Formula cards */
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 40px; }
.formula-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s; }
.formula-card:hover { border-color: var(--border-cyan); }
.formula-head { padding: 16px 20px 14px; }
.formula-part { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.7; margin-bottom: 4px; }
.formula-head h3 { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.formula-body { padding: 14px 20px 18px; }
.formula-body p { font-size: 13px; color: var(--text-2); margin-bottom: 10px; line-height: 1.55; }
.formula-eg { background: rgba(255,255,255,0.04); border-radius: 6px; padding: 10px 14px; font-size: 12.5px; color: var(--text-3); font-style: italic; line-height: 1.55; border-left: 2px solid var(--border-cyan); }

/* Code block for reference pages */
.dark-code {
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px; line-height: 1.9;
  margin: 20px 0 40px;
  overflow-x: auto;
}
.dark-code .kw { color: var(--cyan); }
.dark-code .val { color: rgba(255,255,255,0.75); }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── IDENTITY MODAL ─────────────────────────────────── */
.identity-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.96);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.identity-overlay.hidden { display: none; }
.identity-box {
  max-width: 520px; width: 90%; text-align: center;
  padding: 48px 32px;
}
.identity-scan {
  width: 60px; height: 2px; background: var(--cyan);
  margin: 0 auto 32px;
  box-shadow: 0 0 20px var(--cyan);
  animation: scanPulse 2s ease-in-out infinite;
}
@keyframes scanPulse {
  0%,100% { opacity: 1; width: 60px; }
  50% { opacity: 0.4; width: 120px; }
}
.identity-title {
  font-family: var(--font-head); font-size: 28px; font-weight: 700;
  color: var(--text-1); margin-bottom: 8px; letter-spacing: 0.5px;
}
.identity-sub { font-size: 14px; color: var(--text-3); margin-bottom: 20px; }
.identity-warning {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,160,0,0.08); border: 1px solid rgba(255,160,0,0.35);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 28px; text-align: left;
}
.identity-warning-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.identity-warning-text { font-size: 13px; color: #ffb347; line-height: 1.5; }
.identity-warning-text strong { color: #ffd080; font-weight: 700; }
.identity-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-bottom: 24px;
}
.identity-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; width: calc(33.333% - 8px); min-width: 120px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer; color: var(--text-2);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  transition: all 0.2s var(--ease);
  text-align: center;
}
.identity-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(62,186,244,0.07);
  box-shadow: 0 0 16px rgba(62,186,244,0.15);
  transform: translateY(-2px);
}
.identity-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 18px; font-weight: 700;
  background: rgba(62,186,244,0.1);
  border: 1px solid rgba(62,186,244,0.2);
  color: var(--cyan);
}

/* ── RANK CARD ──────────────────────────────────────── */
.rank-card {
  margin: 0 40px 0;
  padding: 20px 28px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(223,48,255,0.2);
  border-radius: 14px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 20px;
}
.rank-card::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg,
    transparent 30%,
    rgba(223,48,255,0.03) 50%,
    transparent 70%);
  animation: holographicShimmer 4s linear infinite;
  pointer-events: none;
}
@keyframes holographicShimmer {
  from { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
  to   { transform: translateX(100%) translateY(100%) rotate(0deg); }
}
.rank-scan-line {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(223,48,255,0.4), transparent);
  animation: scanLine 3s linear infinite;
}
@keyframes scanLine {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(80px); opacity: 0; }
}
.rank-avatar-large {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  background: rgba(223,48,255,0.12);
  border: 2px solid rgba(223,48,255,0.3);
  color: var(--purple);
}
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-1); }
.rank-title-text {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--purple); margin: 2px 0 8px;
}
.rank-progress-track {
  height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden;
}
.rank-progress-fill {
  height: 100%; border-radius: 2px; background: var(--purple);
  box-shadow: 0 0 8px rgba(223,48,255,0.5);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}

/* ── RANK-UP ANIMATION OVERLAY ─────────────────────── */
@keyframes rankup-in  { from { opacity:0; transform: scale(0.7) translateY(40px); } to { opacity:1; transform: scale(1) translateY(0); } }
@keyframes rankup-out { from { opacity:1; transform: scale(1); } to { opacity:0; transform: scale(1.05); } }
@keyframes confetti-fall { 0% { transform: translateY(-10px) rotate(0deg); opacity:1; } 100% { transform: translateY(220px) rotate(720deg); opacity:0; } }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 20px rgba(62,186,244,0.4); } 50% { box-shadow: 0 0 40px rgba(62,186,244,0.8), 0 0 80px rgba(223,48,255,0.4); } }

#rankup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#rankup-overlay.visible { opacity: 1; pointer-events: all; }
#rankup-card {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border: 1px solid rgba(62,186,244,0.4);
  border-radius: 20px; padding: 48px 56px; text-align: center;
  max-width: 440px; width: 90%; position: relative; overflow: hidden;
  animation: rankup-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-play-state: paused;
}
#rankup-overlay.visible #rankup-card { animation-play-state: running; }
#rankup-card.leaving { animation: rankup-out 0.35s ease-in forwards; }
#rankup-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(62,186,244,0.06) 0%, rgba(223,48,255,0.06) 100%);
}
.rankup-label { font-size: 11px; letter-spacing: 3px; color: var(--cyan); font-weight: 700; text-transform: uppercase; margin-bottom: 12px; }
.rankup-icon  { font-size: 64px; line-height: 1; margin-bottom: 12px; animation: pulse-glow 1.5s ease-in-out infinite; display: inline-block; border-radius: 50%; }
.rankup-title { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.rankup-name  { font-size: 15px; color: var(--text-3); margin-bottom: 24px; }
.rankup-msg   { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 28px; }
.rankup-close { background: rgba(62,186,244,0.1); border: 1px solid rgba(62,186,244,0.3); color: var(--cyan); padding: 10px 28px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; transition: background 0.15s; }
.rankup-close:hover { background: rgba(62,186,244,0.2); }
.confetti-piece { position: absolute; width: 8px; height: 8px; border-radius: 2px; animation: confetti-fall 1.2s ease-in forwards; }

.rank-tier-badge {
  text-align: right; flex-shrink: 0;
}
.rank-icon { font-size: 28px; display: block; margin-bottom: 4px; }
.rank-change-name { font-size: 10px; color: var(--text-3); }

/* ── QUIZ SECTION ───────────────────────────────────── */
.quiz-section {
  background: rgba(62,186,244,0.03);
  border: 1px solid rgba(62,186,244,0.15);
  border-radius: 14px; padding: 32px; margin: 40px 0;
}
.quiz-header { margin-bottom: 28px; }
.quiz-title-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.quiz-icon { font-size: 20px; }
.quiz-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-1); }
.quiz-subtitle { font-size: 13px; color: var(--text-3); }
.quiz-question { margin-bottom: 24px; }
.quiz-q-num { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.quiz-q-text { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; color: var(--text-2);
  font-family: var(--font-body); font-size: 14px; line-height: 1.4;
  transition: all 0.15s; text-align: left; width: 100%;
}
.quiz-option:hover:not(.locked) { border-color: var(--border-cyan); color: var(--text-1); background: rgba(62,186,244,0.05); }
.quiz-option.selected { border-color: var(--cyan); background: rgba(62,186,244,0.08); color: var(--text-1); }
.quiz-option.correct { border-color: var(--green); background: rgba(0,212,155,0.08); color: rgba(0,212,155,0.9); }
.quiz-option.wrong  { border-color: rgba(255,80,80,0.4); background: rgba(255,80,80,0.05); color: rgba(255,80,80,0.7); }
.quiz-option.locked { cursor: default; }
.quiz-opt-bullet {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-top: 1px;
  transition: all 0.15s;
}
.quiz-option.selected .quiz-opt-bullet { border-color: var(--cyan); background: var(--cyan); color: #000; }
.quiz-option.correct .quiz-opt-bullet  { border-color: var(--green); background: var(--green); color: #000; }
.quiz-option.wrong .quiz-opt-bullet   { border-color: rgba(255,80,80,0.5); background: rgba(255,80,80,0.1); }
.quiz-footer { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.quiz-submit-btn {
  padding: 12px 40px;
  background: rgba(62,186,244,0.07); border: 1px solid rgba(62,186,244,0.25);
  border-radius: 10px; color: var(--cyan);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.quiz-submit-btn:hover:not(:disabled) { background: rgba(62,186,244,0.14); border-color: rgba(62,186,244,0.4); }
.quiz-submit-btn:disabled { opacity: 0.35; cursor: default; }
.quiz-result { width: 100%; padding: 14px 20px; border-radius: 10px; text-align: center; font-weight: 600; font-size: 15px; }
.quiz-result.pass { background: rgba(0,212,155,0.08); border: 1px solid rgba(0,212,155,0.2); color: rgba(0,212,155,0.95); }
.quiz-result.fail { background: rgba(255,80,80,0.06); border: 1px solid rgba(255,80,80,0.2); color: rgba(255,80,80,0.8); }
.quiz-retry-btn {
  padding: 8px 24px;
  background: none; border: 1px solid rgba(255,80,80,0.3);
  border-radius: 7px; color: rgba(255,80,80,0.7);
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.quiz-retry-btn:hover { background: rgba(255,80,80,0.06); }

/* ── COMPLETION TOAST ───────────────────────────────── */
.completion-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); border: 1px solid rgba(0,212,155,0.3);
  border-radius: 14px; padding: 14px 22px;
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; font-weight: 600; color: var(--text-1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 20px rgba(0,212,155,0.1);
  transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.3s;
  opacity: 0; z-index: 998; pointer-events: none;
  white-space: nowrap;
}
.completion-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: all; }
.toast-check { font-size: 20px; color: var(--green); flex-shrink: 0; }
.toast-next-btn {
  display: inline-block; background: var(--cyan); color: #000;
  font-weight: 700; font-size: 12px; padding: 5px 14px;
  border-radius: 7px; text-decoration: none; transition: opacity 0.15s;
}
.toast-next-btn:hover { opacity: 0.85; color: #000; }

/* ── BOOKMARK ───────────────────────────────────────── */
.bookmark-btn {
  position: absolute; top: 18px; right: 20px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-3); cursor: pointer; font-size: 16px; padding: 5px 9px;
  line-height: 1; transition: all 0.2s var(--ease);
}
.bookmark-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.bookmark-btn.saved { background: rgba(255,216,77,0.1); border-color: rgba(255,216,77,0.4); color: var(--yellow); }
.sb-bookmark-star { opacity: 0; font-size: 10px; margin-left: auto; color: var(--yellow); flex-shrink: 0; transition: opacity 0.2s; }
.sb-lesson-link.bookmarked .sb-bookmark-star { opacity: 1; }
.bookmarks-section { display: none; padding: 0 40px 40px; }
.bookmarks-section.visible { display: block; }
.bm-section-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--yellow); margin-bottom: 12px; }
.bm-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: rgba(255,216,77,0.06); border: 1px solid rgba(255,216,77,0.2);
  border-radius: 20px; font-size: 12px; font-weight: 600;
  color: var(--text-2); text-decoration: none; transition: all 0.15s;
}
.bm-chip:hover { border-color: rgba(255,216,77,0.4); color: var(--yellow); }

/* ── BONUS CARD ─────────────────────────────────────── */
.bonus-card { border-color: rgba(255,216,77,0.2) !important; }
.bonus-card:hover { border-color: rgba(255,216,77,0.45) !important; box-shadow: 0 4px 24px rgba(255,216,77,0.07) !important; }
.mc-bonus-tag {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--yellow); padding: 2px 8px;
  background: rgba(255,216,77,0.1); border: 1px solid rgba(255,216,77,0.25);
  border-radius: 4px; margin-bottom: 8px;
}
.level-bonus { background: rgba(255,216,77,0.1); border-color: rgba(255,216,77,0.3); color: var(--yellow); }

/* ── MODULE COMPLETE BANNER ─────────────────────────── */
.module-complete-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 997;
  background: linear-gradient(90deg, var(--bg-1), rgba(0,212,155,0.08), var(--bg-1));
  border-bottom: 1px solid rgba(0,212,155,0.3);
  padding: 14px; text-align: center;
  font-family: var(--font-head); font-size: 18px; font-weight: 700;
  color: var(--green); letter-spacing: 1px;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
.module-complete-banner.show { transform: translateY(0); }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; align-items: center; }
  .nav-links { display: none; }
  .lesson-sidebar { display: none; }
  .lesson-sidebar.mobile-open {
    display: block;
    position: fixed;
    z-index: 150;
    box-shadow: 4px 0 40px rgba(0,0,0,0.8);
  }
  .lesson-main { margin-left: 0; }
  .lesson-header-block { padding: 32px 24px 28px; }
  .lesson-article { padding: 32px 24px 60px; }
  .progress-label-row { padding: 8px 24px; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav-btn, .lesson-nav-spacer { max-width: 100%; }
  .lesson-nav-btn.next { text-align: left; }
  .ref-page { padding: calc(var(--nav-h) + 24px) 24px 60px; }
  .ref-page-header { padding: 28px; }
  .course-progress-section { padding: 0 24px 40px; }
  .rank-card { margin: 0 24px 0; flex-wrap: wrap; }
  .bookmarks-section { padding: 0 24px 40px; }
  .identity-grid { grid-template-columns: repeat(2, 1fr); }
  .completion-toast { white-space: normal; max-width: calc(100vw - 40px); }
}
