:root {
  --navy: #0d1b2a;
  --royal: #1a3a6b;
  --blue: #1e5fa8;
  --accent: #4fc3f7;
  --gold: #f0b429;
  --white: #f5f7fa;
  --muted: #8aa0bb;
  --surface: #132236;
  --surface2: #1a2f47;
  --border: rgba(79, 195, 247, 0.18);
  --glow: 0 0 32px rgba(79, 195, 247, 0.12);
  --success: #4ade80;
  --warning: #f59e0b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 10%, rgba(30, 95, 168, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(79, 195, 247, 0.12) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Top upgrade banner */
.vb-upgrade-banner {
  position: sticky;
  top: 0;
  z-index: 300;
  background: linear-gradient(90deg, #f0b429, #ffd166);
  color: #0d1b2a;
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(13, 27, 42, 0.12);
}

.vb-upgrade-banner a {
  color: #0b3d91;
  text-decoration: underline;
  font-weight: 800;
}

/* NAV */
nav {
  position: sticky;
  top: 44px;
  z-index: 250;
  background: rgba(13, 27, 42, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 56px;
  flex-wrap: wrap;
}

.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

nav a:hover {
  color: var(--accent);
}

/* Hamburger */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: rgba(79, 195, 247, 0.2);
}

.sidebar-toggle svg {
  display: block;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 199;
}

.sidebar-overlay.active {
  display: block;
}

/* Layout */
.page-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 2rem 0 2rem 2rem;
  position: sticky;
  top: 100px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.sidebar-close:hover {
  background: rgba(79, 195, 247, 0.22);
}

.sidebar h5 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
  margin-top: 1.2rem;
  padding-left: 0.5rem;
}

.sidebar a {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(79, 195, 247, 0.08);
  color: var(--accent);
}

.sidebar .mini-book {
  background: rgba(79, 195, 247, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  margin: 1rem 0 0.8rem;
  text-align: center;
}

.sidebar .mini-book h6 {
  font-size: 0.82rem;
  margin-bottom: 0.7rem;
  color: var(--white);
}

.sidebar .mini-book img {
  width: 120px;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: var(--glow);
}

.main-content {
  flex: 1;
  overflow: hidden;
}

/* Generic sections */
section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h1 span {
  color: var(--accent);
}

h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

.section-intro,
.content-card p,
.content-card li {
  color: var(--muted);
}

.content-card p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.content-card strong {
  color: var(--white);
}

.content-card ul {
  padding-left: 1.2rem;
  margin-top: 0.7rem;
}

/* Ad */
.top-ad {
  padding: 1.6rem 2rem 0;
  text-align: center;
}

/* Hero */
.lesson-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 2rem 2.8rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79, 195, 247, 0.12);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.3rem;
}

.hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-sub {
  font-size: 1.03rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--navy);
}

.btn-primary:hover {
  background: #81d4fa;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 195, 247, 0.35);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: rgba(79, 195, 247, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

.progress-wrap {
  margin-top: 1.2rem;
  max-width: 620px;
}

.progress-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.progress-container {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(to right, var(--accent), #00bcd4);
  height: 100%;
  width: 2%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: var(--glow);
}

.lesson-card h3 {
  font-family: 'DM Serif Display', serif;
  color: var(--accent);
  margin-bottom: 1rem;
}

.lesson-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lesson-meta-item:last-child {
  border-bottom: none;
}

.lesson-meta-item .label {
  color: var(--muted);
  font-size: 0.86rem;
}

.lesson-meta-item .value {
  color: var(--white);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  text-align: right;
}

/* Cards */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--glow);
}

.key-point {
  background: rgba(79, 195, 247, 0.08);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.4rem;
  border-radius: 12px;
  margin-bottom: 1.8rem;
}

.key-point h3 {
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.feature-box,
.summary-points,
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.feature-card,
.summary-point,
.resource-card,
.step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  transition: all 0.2s;
}

.feature-card:hover,
.resource-card:hover,
.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.feature-card i,
.summary-point i {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

.feature-card h4,
.summary-point-content h4,
.resource-card h3,
.step-card h4 {
  color: var(--white);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.summary-point {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.summary-point i {
  margin-bottom: 0;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--navy);
  border-radius: 50%;
  font-weight: 700;
  margin-right: 0.45rem;
}

/* Image preview */
.ide-preview {
  margin: 1.8rem 0;
}

.ide-preview img {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--glow);
}

.ide-preview figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

/* Code blocks */
.code-editor-container {
  background: #101827;
  border: 1px solid rgba(79, 195, 247, 0.16);
  border-radius: 14px;
  overflow: hidden;
  margin: 1.8rem 0;
  box-shadow: var(--glow);
}

.editor-header {
  background: #0b1220;
  color: #dcdcdc;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.editor-buttons {
  display: flex;
  gap: 6px;
}

.editor-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.editor-button.red { background: #ff5f57; }
.editor-button.yellow { background: #ffbd2e; }
.editor-button.green { background: #28c940; }

.editor-content {
  padding: 1.2rem 1.2rem 0.6rem;
  overflow-x: auto;
  font-family: 'DM Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.65;
}

.code-block {
  margin: 0;
  color: #e5e7eb;
  counter-reset: line;
}

.code-line {
  display: block;
  padding: 2px 0;
}

.code-line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2rem;
  padding-right: 0.8rem;
  margin-right: 0.9rem;
  color: #6a9955;
  text-align: right;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.code-keyword { color: #89b4fa; font-weight: 700; }
.code-function { color: #94e2d5; }
.code-string { color: #a6e3a1; }
.code-comment { color: #6a9955; font-style: italic; }
.code-variable { color: #cba6f7; }

.run-button {
  background: linear-gradient(to right, var(--accent), #00bcd4);
  color: var(--navy);
  border: none;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: block;
  margin: 1rem 1.2rem 1rem;
  transition: all 0.2s;
  font-size: 0.92rem;
}

.run-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 195, 247, 0.22);
}

.output-container {
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 1.2rem;
  margin: 0 1.2rem 1.2rem;
  display: none;
  border: 1px solid rgba(255,255,255,0.08);
}

.output-container h4 {
  color: var(--white);
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.output-content {
  background: rgba(0,0,0,0.2);
  color: #d1fae5;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  min-height: 100px;
  border: 1px solid rgba(255,255,255,0.05);
  white-space: pre-line;
  font-size: 0.9rem;
}

/* Resources buttons */
.resource-card .resource-link,
.next-lesson-link {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: rgba(79, 195, 247, 0.12);
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.resource-card .resource-link:hover,
.next-lesson-link:hover {
  background: rgba(79, 195, 247, 0.18);
  text-decoration: none;
}

/* Books */
.featured-books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.6rem;
  margin-top: 2rem;
}

.book-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glow);
}

.book-image {
  padding: 1.5rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.book-image img {
  max-height: 260px;
  border-radius: 8px;
  box-shadow: var(--glow);
}

.book-info {
  padding: 1.4rem;
}

.book-title {
  color: var(--white);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.book-author {
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}

.book-desc {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.94rem;
}

.book-features {
  padding-left: 1.1rem;
  color: var(--muted);
}

.book-features li {
  margin-bottom: 0.45rem;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.book-actions a {
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: rgba(79, 195, 247, 0.12);
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.book-actions a:hover {
  background: rgba(79, 195, 247, 0.18);
  text-decoration: none;
}

/* Modern upgrade box */
.modern-upgrade-box {
  background: linear-gradient(135deg, rgba(238,246,255,0.08), rgba(219,234,254,0.08));
  border-left: 5px solid #2563eb;
  border: 1px solid rgba(79, 195, 247, 0.22);
  padding: 1.2rem;
  margin-top: 2rem;
  border-radius: 12px;
  text-align: center;
}

.modern-upgrade-box h3 {
  color: var(--white);
  margin-bottom: 0.6rem;
}

.modern-upgrade-box p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

/* Footer */
.share-strip {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 1rem;
  position: relative;
  z-index: 1;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: inline-flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 0.8rem 0 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copyright {
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Responsive */
@media (max-width: 900px) {
  .lesson-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  nav {
    top: 44px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-close {
    display: flex;
  }

  .page-layout {
    position: static;
    z-index: auto;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100dvh !important;
    padding: 1rem 0.75rem 2rem 1rem !important;
    background: #0d1b2a !important;
    border-right: 1px solid rgba(79, 195, 247, 0.18) !important;
    z-index: 200 !important;
    overflow-y: auto !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
  }

  .sidebar a {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    font-size: 0.92rem !important;
    padding: 0.6rem 0.5rem !important;
    line-height: 1.4 !important;
  }

  .lesson-hero,
  section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .top-ad,
  .share-strip {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .nav-inner {
    gap: 1rem;
  }

  nav a:not(.nav-brand) {
    display: none;
  }

  .lesson-meta-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-meta-item .value {
    text-align: left;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.6rem;
  }
}
/* ===== NEW HEADER OPTIMIZATION ===== */

.authority-banner {
  background: linear-gradient(135deg, #f0b429, #ffd166);
  color: #000;
  text-align: center;
  padding: 8px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Improve nav spacing */
.nav-links {
  display: flex;
  gap: 10px;
  flex: 1;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.nav-links a:hover {
  background: rgba(79,195,247,0.1);
}

/* Highlight VB.NET 2026 (first item) */
.nav-links a:first-child {
  color: var(--white);
  background: rgba(79,195,247,0.15);
  border: 1px solid rgba(79,195,247,0.2);
}

/* CTA button */
.nav-cta {
  background: linear-gradient(135deg, #f0b429, #ffd166);
  color: #000;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

/* ===== FOOTER IMPROVEMENT ===== */

/* ===== FOOTER IMPROVEMENT ===== */

/* ===== FORCE FOOTER VERSION LINKS INTO COLUMNS ===== */

.footer-versions,
.footer-other {
  margin-top: 1.5rem;
  text-align: center;
}

.footer-versions h4,
.footer-other h4 {
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.footer-version-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  max-width: 720px;
  margin: 0 auto;
}

.footer-other-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
}

.footer-version-links a,
.footer-other-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.footer-version-links a:hover,
.footer-other-links a:hover {
  color: var(--white);
}