/* ============================================
   ماورا - آموزش CSS
   تم شاد، مدرن و حرفه‌ای
   ============================================ */

:root {
  /* رنگ‌های اصلی شاد */
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --secondary: #EC4899;
  --secondary-light: #F9A8D4;
  --accent: #FBBF24;
  --accent-cyan: #22D3EE;
  --success: #10B981;
  --danger: #EF4444;

  /* پس‌زمینه‌ها */
  --bg-body: #FDF4FF;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1E1B4B;
  --bg-code: #1E1B4B;
  --bg-gradient: linear-gradient(135deg, #7C3AED 0%, #EC4899 50%, #FBBF24 100%);
  --bg-hero: linear-gradient(135deg, #5B21B6 0%, #7C3AED 40%, #EC4899 100%);

  /* متن */
  --text-main: #1E1B4B;
  --text-muted: #6B7280;
  --text-light: #F8FAFC;
  --text-code: #E0E7FF;

  /* سایه‌ها و افکت */
  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.08);
  --shadow-md: 0 8px 24px rgba(124, 58, 237, 0.12);
  --shadow-lg: 0 16px 48px rgba(124, 58, 237, 0.18);
  --shadow-glow: 0 0 30px rgba(236, 72, 153, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

/* ریست و پایه */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

/* پس‌زمینه تزئینی متحرک */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -30%;
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: floatBlob 20s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  bottom: -40%;
  left: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  animation: floatBlob 25s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* تایپوگرافی */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { color: var(--secondary); }

img { max-width: 100%; display: block; }

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-gradient);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  animation: pulseLogo 3s ease-in-out infinite;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-md); }
  50% { transform: scale(1.05); box-shadow: var(--shadow-glow); }
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-desktop a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.95rem;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--bg-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.45);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
  padding: 0.3rem;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}

.hero h1 {
  margin-bottom: 1.2rem;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* ========== LAYOUT ========== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3.5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== LESSON CARDS ========== */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.lesson-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(124, 58, 237, 0.08);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lesson-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: var(--bg-gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}

.lesson-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(124, 58, 237, 0.2);
}

.lesson-card:hover::before {
  transform: scaleX(1);
}

.lesson-num {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.lesson-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.lesson-card p {
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 1.2rem;
}

.lesson-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
}

.lesson-card .card-link:hover {
  gap: 0.7rem;
  color: var(--secondary);
}

/* ========== LESSON PAGE LAYOUT ========== */
.lesson-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  min-height: calc(100vh - 80px);
  width: 100%;
  box-sizing: border-box;
}

.sidebar {
  position: sticky;
  top: 90px;
  height: fit-content;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 10px;
}

.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition);
}

.sidebar-nav a:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav .num {
  width: 24px;
  height: 24px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-nav a.active .num {
  background: var(--primary);
  color: white;
}

/* Content area */
.lesson-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(124, 58, 237, 0.08);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.lesson-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px dashed rgba(124, 58, 237, 0.15);
}

.lesson-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-primary {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
}

.badge-secondary {
  background: rgba(236, 72, 153, 0.12);
  color: var(--secondary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

/* Content blocks */
.content-block {
  margin-bottom: 2.5rem;
}

.content-block h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.content-block h2::before {
  content: '';
  width: 8px;
  height: 28px;
  background: var(--bg-gradient);
  border-radius: 4px;
}

/* Code blocks */
.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  position: relative;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.code-block pre {
  margin: 0;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-code);
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.code-block .code-label {
  position: absolute;
  top: 0.6rem;
  left: 0.8rem;
  font-size: 0.7rem;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #A5B4FC;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Demo boxes */
.demo-box {
  background: linear-gradient(135deg, #FDF4FF, #FCE7F3);
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.demo-box h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Tip / Note boxes */
.note {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(124, 58, 237, 0.08));
  border-right: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.note strong {
  color: var(--primary-dark);
}

.warning {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(236, 72, 153, 0.08));
  border-right: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* Navigation between lessons */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px dashed rgba(124, 58, 237, 0.15);
  flex-wrap: wrap;
}

.lesson-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.3rem;
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.lesson-nav a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--bg-sidebar);
  color: var(--text-light);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: #A5B4FC;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-links h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: #A5B4FC;
  font-size: 0.9rem;
  display: block;
  padding: 0.3rem 0;
}

.footer-links a:hover {
  color: var(--secondary-light);
}

.footer-bottom {
  max-width: 1280px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: #818CF8;
  font-size: 0.85rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .lesson-layout {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem 3rem;
    gap: 1.25rem;
  }

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
    order: 2;
  }

  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .lesson-content {
    padding: 1.5rem 1.15rem;
  }

  .code-block {
    padding: 1rem 1rem 1rem;
  }

  .code-block pre {
    font-size: 0.82rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 3rem 1rem 3.5rem;
  }

  .lesson-content {
    padding: 1.15rem 0.9rem;
    border-radius: 14px;
  }

  .lesson-header h1 {
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .content-block h2 {
    font-size: 1.15rem;
  }

  .lesson-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .lesson-nav a {
    width: 100%;
    text-align: center;
  }

  .code-block {
    padding: 0.9rem 0.8rem;
    margin: 1rem 0;
  }

  .code-block pre {
    font-size: 0.78rem;
    line-height: 1.6;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .badge {
    font-size: 0.75rem;
  }
}

/* Mobile menu */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 75, 0.97);
  z-index: 2000;
  padding: 2rem;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  color: white;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 500;
}

.mobile-nav a:hover {
  background: rgba(255,255,255,0.1);
}

.mobile-close {
  align-self: flex-start;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

/* Utility */
.text-gradient {
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* Interactive demos */
.interactive-demo {
  background: white;
  border: 2px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.demo-controls label {
  font-size: 0.9rem;
  font-weight: 500;
}

.demo-controls input[type="range"] {
  accent-color: var(--primary);
  width: 120px;
}

.demo-preview {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--bg-gradient);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Floating particles (decorative) */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--primary-light);
  border-radius: 50%;
  opacity: 0.4;
  animation: rise 12s linear infinite;
}

@keyframes rise {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Table of contents in content */
.toc {
  background: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc a {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.toc a:hover {
  color: var(--primary);
}

/* Syntax highlight simple */
.token-keyword { color: #F472B6; }
.token-property { color: #67E8F9; }
.token-value { color: #FDE68A; }
.token-comment { color: #9CA3AF; font-style: italic; }
.token-selector { color: #C4B5FD; }

/* ========== VISUAL DEMOS & SHOWCASE ========== */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.demo-item {
  text-align: center;
}

.demo-item span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-weight: 500;
}

/* Border style demos */
.border-demo {
  width: 100%;
  height: 90px;
  background: #FDF4FF;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.85rem;
}

.b-solid { border: 4px solid #7C3AED; }
.b-dashed { border: 4px dashed #EC4899; }
.b-dotted { border: 4px dotted #22D3EE; }
.b-double { border: 6px double #FBBF24; }
.b-groove { border: 6px groove #A78BFA; }
.b-ridge { border: 6px ridge #F472B6; }

/* Radius demos */
.radius-demo {
  width: 90px;
  height: 90px;
  background: var(--bg-gradient);
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

/* Box model visual */
.box-model-visual {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.bm-margin {
  background: rgba(251, 191, 36, 0.25);
  border: 2px dashed #FBBF24;
  padding: 28px;
  border-radius: 12px;
  position: relative;
}

.bm-margin::before {
  content: 'Margin';
  position: absolute;
  top: 4px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #B45309;
}

.bm-border {
  background: rgba(236, 72, 153, 0.2);
  border: 8px solid #EC4899;
  padding: 20px;
  border-radius: 8px;
  position: relative;
}

.bm-border::before {
  content: 'Border';
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #BE185D;
}

.bm-padding {
  background: rgba(34, 211, 238, 0.25);
  padding: 24px;
  border-radius: 4px;
  position: relative;
}

.bm-padding::before {
  content: 'Padding';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0E7490;
}

.bm-content {
  background: #7C3AED;
  color: white;
  padding: 1.2rem 1.8rem;
  border-radius: 4px;
  font-weight: 700;
  text-align: center;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
}

/* Sample cards showcase */
.cards-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.sample-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12);
  transition: var(--transition);
  border: 1px solid rgba(124, 58, 237, 0.08);
}

.sample-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.2);
}

.sample-card-img {
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
}

.sample-card-body {
  padding: 1rem 1.15rem 1.25rem;
}

.sample-card-body h4 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.sample-card-body p {
  font-size: 0.85rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

/* Color swatches */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.swatch {
  height: 70px;
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: var(--shadow-sm);
}

/* Shadow demos */
.shadow-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.shadow-box {
  height: 90px;
  background: white;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* Background demos */
.bg-demo {
  height: 100px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  margin: 0.75rem 0;
}

/* Flex & Grid live demos */
.live-flex {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(124, 58, 237, 0.06);
  border-radius: 12px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.live-flex > div {
  background: var(--bg-gradient);
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  min-width: 70px;
  text-align: center;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(236, 72, 153, 0.06);
  border-radius: 12px;
  margin: 1rem 0;
}

.live-grid > div {
  background: linear-gradient(135deg, #EC4899, #7C3AED);
  color: white;
  padding: 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

/* Padding / Margin visual bars */
.space-visual {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.space-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.space-label {
  width: 70px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.space-bar {
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Decorative illustration */
.illustration {
  max-width: 280px;
  margin: 1.5rem auto;
  display: block;
}

/* Hover scale cards on home */
.lesson-card .lesson-num {
  transition: var(--transition);
}
.lesson-card:hover .lesson-num {
  transform: rotate(-8deg) scale(1.1);
}

/* Code highlight improvements */
.code-block code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Extra badge */
.badge-accent {
  background: rgba(251, 191, 36, 0.18);
  color: #B45309;
}
