/* =============================================================
   BraceCoder — Design System (bracecoder.in style)
   ============================================================= */

/* -------------------------------------------------------------
   1. CSS Variables
   ------------------------------------------------------------- */
:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #818cf8;
  --primary-bg:    #eef2ff;
  --accent:        #f59e0b;
  --accent-dark:   #d97706;
  --success:       #10b981;
  --danger:        #ef4444;
  --text:          #1e293b;
  --text-light:    #64748b;
  --text-muted:    #94a3b8;
  --bg:            #f8fafc;
  --bg-white:      #ffffff;
  --bg-dark:       #0f172a;
  --bg-card:       #ffffff;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --header-height: 70px;

  /* Backwards-compat aliases so existing Blade templates keep working */
  --bg-base:            var(--bg);
  --bg-elevated:        #f1f5f9;
  --bg-overlay:         #e8edf4;
  --border-hover:       #cbd5e1;
  --text-primary:       var(--text);
  --text-secondary:     var(--text-light);
  --text-inverse:       #ffffff;
  --accent-course:      var(--primary-dark);
  --accent-course-light: var(--primary);
  --accent-course-glow: var(--primary-bg);
  --accent-tutorial:    #7c3aed;
  --accent-tutorial-light: #8b5cf6;
  --accent-tutorial-glow: rgba(139,92,246,.12);
  --accent-blog:        #059669;
  --accent-blog-light:  var(--success);
  --accent-blog-glow:   rgba(16,185,129,.12);
  --error:   var(--danger);
  --warning: var(--accent);
  --info:    #2563eb;
  --nav-height:      var(--header-height);
  --transition:      .2s ease;
  --transition-slow: .3s ease;
  --shadow-xl: 0 24px 48px rgba(0,0,0,.12);
  --radius-xl: 20px;
  --level-beginner:     #16a34a;
  --level-intermediate: #d97706;
  --level-advanced:     #dc2626;
}

/* -------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
code, pre { font-family: var(--font-mono); }

/* -------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.35rem); }
h4 { font-size: 1.05rem; }
p  { color: var(--text-light); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------
   4. Layout
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.main-content { min-height: calc(100vh - var(--header-height) - 300px); }
.section    { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }

/* -------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-green  { background: var(--success); color: #fff; }
.btn-green:hover { background: #059669; color: #fff; }
.btn-sm { padding: .4rem 1rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* -------------------------------------------------------------
   6. Top Bar
   ------------------------------------------------------------- */
.top-bar {
  background: var(--bg-dark);
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  padding: .4rem 0;
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; }
.top-bar-left span { display: flex; align-items: center; gap: .4rem; color: rgba(255,255,255,.7); }
.top-bar-right { display: flex; gap: 1rem; }
.top-bar-right a { color: rgba(255,255,255,.6); font-size: .9rem; transition: color .2s; }
.top-bar-right a:hover { color: #fff; }

/* -------------------------------------------------------------
   7. Navbar
   ------------------------------------------------------------- */
.navbar {
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-height);
  display: flex; align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow .2s;
}
.navbar.scrolled { box-shadow: var(--shadow); }
.nav-content { display: flex; align-items: center; gap: 1.5rem; width: 100%; }

.logo, .footer-logo {
  display: flex; align-items: center; gap: 1px;
  font-size: 1.35rem; font-weight: 800;
  color: var(--text); white-space: nowrap;
}
.logo:hover, .footer-logo:hover { color: var(--text); }
.logo-brace { color: var(--primary); font-family: var(--font-mono); font-weight: 700; }
.logo-text  { letter-spacing: -.5px; }

.nav-search {
  flex: 1; max-width: 400px;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .4rem .5rem .4rem 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.nav-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.nav-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: .875rem;
}
.nav-search input::placeholder { color: var(--text-muted); }
.nav-search button { color: var(--text-muted); font-size: .875rem; padding: .25rem .5rem; transition: color .2s; }
.nav-search button:hover { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav-link {
  color: var(--text); font-size: .9rem; font-weight: 500;
  padding: .5rem .75rem; border-radius: var(--radius-sm);
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { background: var(--primary-bg); color: var(--primary); }
.nav-link-course   { color: var(--primary) !important; }
.nav-link-tutorial { color: var(--accent-tutorial-light) !important; }
.nav-link-blog     { color: var(--success) !important; }
.nav-link-course:hover   { background: var(--primary-bg) !important; }
.nav-link-tutorial:hover { background: var(--accent-tutorial-glow) !important; }
.nav-link-blog:hover     { background: var(--accent-blog-glow) !important; }

.btn-login {
  background: var(--primary) !important; color: #fff !important;
  border-radius: 100px !important; padding: .5rem 1.25rem !important;
}
.btn-login:hover { background: var(--primary-dark) !important; color: #fff !important; }

.nav-user { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); font-size: .875rem; font-weight: 500;
}
.nav-user-btn:hover { border-color: var(--primary); }
.user-avatar-small {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .5rem;
  display: none; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: var(--radius-sm);
  font-size: .875rem; color: var(--text-light); transition: all .2s;
}
.user-dropdown a:hover { background: var(--primary-bg); color: var(--primary); }
.user-dropdown a i { width: 16px; color: var(--text-muted); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: .4rem; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.mobile-search { display: none; background: var(--bg-white); padding: .75rem 0; border-bottom: 1px solid var(--border); }
.mobile-search form { display: flex; gap: .5rem; }
.mobile-search input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: .5rem 1rem; border-radius: var(--radius); font-size: .875rem; outline: none; }
.mobile-search button { padding: .5rem 1rem; color: var(--text-muted); }

/* -------------------------------------------------------------
   8. Section Headers
   ------------------------------------------------------------- */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; gap: 1rem; }
.section-label {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  display: flex; align-items: center; gap: .35rem;
  margin-bottom: .4rem;
}
.section-label-course   { color: var(--primary); }
.section-label-tutorial { color: var(--accent-tutorial-light); }
.section-label-blog     { color: var(--success); }
.section-title    { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.section-subtitle { font-size: .9rem; color: var(--text-muted); margin-top: .3rem; }

/* -------------------------------------------------------------
   9. Home Hero
   ------------------------------------------------------------- */
.hero {
  padding: 5rem 0 3.5rem;
  position: relative; overflow: hidden;
  text-align: center;
  background: var(--bg);
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .6; pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--primary-bg); color: var(--primary);
  padding: .35rem .9rem; border-radius: 100px;
  font-size: .8rem; font-weight: 600;
  border: 1px solid rgba(99,102,241,.3);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.hero-accent { color: var(--primary); }
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-light);
  max-width: 560px; margin: 0 auto 2rem;
}
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 2.5rem; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}
.hero-stat { text-align: center; }
.hero-stat-num   { font-size: 1.6rem; font-weight: 800; color: var(--text); display: block; }
.hero-stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* -------------------------------------------------------------
   10. Post Hero (dark header for article pages)
   ------------------------------------------------------------- */
.post-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 3.5rem 0 2.5rem;
  position: relative; overflow: hidden;
}
.post-hero::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.post-hero::after {
  content: '';
  position: absolute; bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,.1) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.post-hero-inner { position: relative; z-index: 1; max-width: 800px; }
.post-hero-cat {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--primary-light);
  margin-bottom: .85rem;
}
.post-title {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 800; line-height: 1.25;
  color: #fff; margin-bottom: 1.25rem;
}
.post-meta-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1.25rem; margin-bottom: 1.25rem;
  font-size: .85rem; color: rgba(255,255,255,.55);
}
.post-meta-row span { display: flex; align-items: center; gap: .4rem; }
.post-meta-row i { color: var(--primary-light); }
.post-author-row {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1rem;
}
.post-author-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: .9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.post-author-name { font-size: .9rem; font-weight: 600; color: #fff; }
.post-author-date { font-size: .78rem; color: rgba(255,255,255,.5); }
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.post-tag {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .25rem .7rem;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 100px; font-size: .78rem; font-weight: 500;
  transition: all .2s;
}
.post-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.post-hero-image {
  width: 100%; border-radius: var(--radius-lg);
  margin-top: 2rem; border: 1px solid rgba(255,255,255,.1);
  box-shadow: var(--shadow-lg);
}

/* -------------------------------------------------------------
   11. Blog / Article Layout
   ------------------------------------------------------------- */
.breadcrumb-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
}
.breadcrumb {
  display: flex; align-items: center;
  gap: .5rem; font-size: .82rem; color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); transition: color .2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i.fa-chevron-right { font-size: .6rem; opacity: .5; }

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.blog-main { min-width: 0; }
.post-layout {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Article body */
.post-body-wrap { padding: 2rem; }
.post-body {
  font-size: 1.05rem; line-height: 1.85; color: #334155;
}
.post-body h1 {
  font-size: 2rem; font-weight: 800;
  margin: 2.25rem 0 1.25rem; color: var(--text);
  padding-bottom: .6rem; border-bottom: 3px solid var(--primary-bg);
}
.post-body h2 {
  font-size: 1.45rem; font-weight: 700;
  margin: 2rem 0 1rem; color: var(--text);
  padding-bottom: .5rem; border-bottom: 2px solid var(--primary-bg);
}
.post-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 .75rem; color: var(--text); }
.post-body h4 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 .5rem; color: var(--text); }
.post-body h5 { font-size: .9rem; font-weight: 600; margin: 1rem 0 .4rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.post-body p  { margin-bottom: 1.25rem; color: #334155; }
.post-body ul,
.post-body ol  { margin-bottom: 1.25rem; padding-left: 2rem; }
.post-body ul  { list-style: disc !important; }
.post-body ul ul { list-style: circle !important; padding-left: 1.5rem; }
.post-body ul ul ul { list-style: square !important; }
.post-body ol  { list-style: decimal !important; }
.post-body ol ol { list-style: lower-alpha !important; padding-left: 1.5rem; }
.post-body li  { display: list-item !important; margin-bottom: .5rem; line-height: 1.7; color: #334155; }
.post-body a   { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--primary-dark); }
.post-body strong { color: var(--text); }
.post-body pre {
  background: #1e293b; color: #e2e8f0;
  padding: 1.25rem 1.5rem; border-radius: var(--radius-sm);
  overflow-x: auto; margin-bottom: 1.5rem;
  font-size: .88rem; line-height: 1.75;
  border: 1px solid #334155;
}
.post-body pre code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }
.post-body code {
  font-family: var(--font-mono);
  background: #1e293b; border: 1px solid #334155;
  color: #e8b4b8; padding: 2px 7px; border-radius: 5px;
  font-size: .85em;
}
.post-body blockquote {
  border-left: 4px solid var(--primary); background: var(--primary-bg);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--text-light);
}
.post-body img { border-radius: var(--radius-sm); margin: 1.5rem 0; }
.post-body table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0;
  font-size: .95rem; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.post-body table th {
  background: var(--bg); color: var(--text); font-weight: 600;
  text-align: left; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .4px;
}
.post-body table th:last-child { border-right: none; }
.post-body table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  vertical-align: top; color: var(--text-light);
}
.post-body table td:last-child { border-right: none; }
.post-body table tr:last-child td { border-bottom: none; }
.post-body table tbody tr:nth-child(even) { background: var(--bg); }
.post-body table tbody tr:hover { background: var(--primary-bg); transition: background .15s; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Diagram blocks */
.post-body pre.diagram,
.lesson-body pre.diagram {
  background: #f8fafc;
  color: #334155;
  border: 2px solid var(--border);
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.7;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.5rem 0;
  white-space: pre;
}
html.dark .post-body pre.diagram,
html.dark .lesson-body pre.diagram {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

/* Callout / Highlight blocks */
.post-body .callout,
.lesson-body .callout {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  border-left: 4px solid;
  line-height: 1.65;
}
.post-body .callout-icon,
.lesson-body .callout-icon { font-size: 1rem; margin-top: .2rem; flex-shrink: 0; }
.post-body .callout-body,
.lesson-body .callout-body { flex: 1; font-size: .95rem; }
.post-body .callout-body p,
.lesson-body .callout-body p { margin: .2rem 0 0; }
.post-body .callout-label,
.lesson-body .callout-label {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  display: block; margin-bottom: .3rem;
}

.post-body .callout-info,   .lesson-body .callout-info    { background:#eff6ff; border-color:#3b82f6; color:#1e40af; }
.post-body .callout-info .callout-icon,
.lesson-body .callout-info .callout-icon { color:#3b82f6; }

.post-body .callout-warning, .lesson-body .callout-warning { background:#fffbeb; border-color:#f59e0b; color:#92400e; }
.post-body .callout-warning .callout-icon,
.lesson-body .callout-warning .callout-icon { color:#f59e0b; }

.post-body .callout-error,  .lesson-body .callout-error   { background:#fef2f2; border-color:#ef4444; color:#991b1b; }
.post-body .callout-error .callout-icon,
.lesson-body .callout-error .callout-icon { color:#ef4444; }

.post-body .callout-success, .lesson-body .callout-success { background:#f0fdf4; border-color:#10b981; color:#065f46; }
.post-body .callout-success .callout-icon,
.lesson-body .callout-success .callout-icon { color:#10b981; }

.post-body .callout-alert,  .lesson-body .callout-alert   { background:#fff7ed; border-color:#f97316; color:#9a3412; }
.post-body .callout-alert .callout-icon,
.lesson-body .callout-alert .callout-icon { color:#f97316; }

.post-body .callout-critical, .lesson-body .callout-critical { background:#fff1f2; border-color:#dc2626; color:#7f1d1d; }
.post-body .callout-critical .callout-icon,
.lesson-body .callout-critical .callout-icon { color:#dc2626; }

.post-body .callout-deprecated, .lesson-body .callout-deprecated { background:#f8fafc; border-color:#6b7280; color:#374151; }
.post-body .callout-deprecated .callout-icon,
.lesson-body .callout-deprecated .callout-icon { color:#6b7280; }

.post-body .callout-debug,  .lesson-body .callout-debug   { background:#faf5ff; border-color:#8b5cf6; color:#4c1d95; }
.post-body .callout-debug .callout-icon,
.lesson-body .callout-debug .callout-icon { color:#8b5cf6; }

.post-body .callout-notice, .lesson-body .callout-notice  { background:#ecfeff; border-color:#06b6d4; color:#164e63; }
.post-body .callout-notice .callout-icon,
.lesson-body .callout-notice .callout-icon { color:#06b6d4; }

/* Dark mode callouts */
html.dark .post-body .callout-info,   html.dark .lesson-body .callout-info    { background:rgba(59,130,246,.12); color:#93c5fd; }
html.dark .post-body .callout-warning, html.dark .lesson-body .callout-warning { background:rgba(245,158,11,.1);  color:#fcd34d; }
html.dark .post-body .callout-error,  html.dark .lesson-body .callout-error   { background:rgba(239,68,68,.1);   color:#fca5a5; }
html.dark .post-body .callout-success, html.dark .lesson-body .callout-success { background:rgba(16,185,129,.1);  color:#6ee7b7; }
html.dark .post-body .callout-alert,  html.dark .lesson-body .callout-alert   { background:rgba(249,115,22,.1);  color:#fdba74; }
html.dark .post-body .callout-critical, html.dark .lesson-body .callout-critical { background:rgba(220,38,38,.12); color:#fca5a5; }
html.dark .post-body .callout-deprecated, html.dark .lesson-body .callout-deprecated { background:rgba(107,114,128,.12); color:#9ca3af; }
html.dark .post-body .callout-debug,  html.dark .lesson-body .callout-debug   { background:rgba(139,92,246,.12); color:#c4b5fd; }
html.dark .post-body .callout-notice, html.dark .lesson-body .callout-notice  { background:rgba(6,182,212,.1);   color:#67e8f9; }

/* Share row */
.post-share {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}
.post-share-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-white); border: 1px solid var(--border);
  color: var(--text-light); font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.share-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Post navigation (prev/next) */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-light);
}
.post-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white); transition: all .2s;
  color: var(--text);
}
.post-nav-link:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.post-nav-link.next { justify-content: flex-end; text-align: right; }
.post-nav-link i { color: var(--text-muted); flex-shrink: 0; }
.post-nav-link:hover i { color: var(--primary); }
.post-nav-info { display: flex; flex-direction: column; gap: .2rem; }
.post-nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.post-nav-title { font-size: .88rem; font-weight: 600; line-height: 1.35; }

/* Related */
.related-section { padding: 1.5rem 2rem; border-top: 1px solid var(--border-light); }
.related-section > h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.related-card {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  transition: all .2s;
}
.related-card:hover { border-color: var(--primary); background: var(--primary-bg); }
.related-cat  { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--primary); }
.related-title { font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.related-views { font-size: .78rem; color: var(--text-muted); }

/* Comments */
.comments-section {
  padding: 2rem;
  border-top: 1px solid var(--border-light);
}
.comments-header {
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem;
}
.comments-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.comments-count {
  background: var(--primary-bg); color: var(--primary);
  padding: .15rem .6rem; border-radius: 100px;
  font-size: .75rem; font-weight: 700;
}
.comment-form {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem;
}
.comment-form textarea {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
  font-size: .9rem; resize: vertical; outline: none;
  background: var(--bg-white); transition: border-color .2s;
  color: var(--text);
}
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.comment-list { display: flex; flex-direction: column; gap: 1.25rem; }
.comment-item { display: flex; gap: .85rem; }
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff; font-size: .9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comment-body {
  flex: 1; background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 1rem;
}
.comment-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.comment-author { font-size: .875rem; font-weight: 600; color: var(--text); }
.comment-time   { font-size: .78rem; color: var(--text-muted); }
.comment-text   { font-size: .9rem; color: var(--text-light); line-height: 1.65; }
.comment-login-prompt {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem; border-radius: var(--radius);
  border: 1px dashed var(--border); color: var(--text-muted);
  font-size: .9rem; margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------
   12. Sidebar
   ------------------------------------------------------------- */
.sidebar {
  display: flex; flex-direction: column; gap: 1.5rem;
  position: sticky; top: calc(var(--header-height) + 1.5rem);
}
.sidebar-widget, .widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.widget-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: 1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-light);
}
.widget-post { display: flex; flex-direction: column; gap: .85rem; }
.widget-post-item {
  display: flex; gap: .75rem;
  padding-bottom: .85rem; border-bottom: 1px solid var(--border-light);
}
.widget-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.widget-post-title {
  font-size: .85rem; font-weight: 600; color: var(--text);
  line-height: 1.4; display: block; transition: color .2s;
}
.widget-post-title:hover { color: var(--primary); }
.widget-post-meta { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.widget-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.widget-tag {
  display: inline-flex; align-items: center;
  padding: .25rem .65rem;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-light); border-radius: 100px;
  font-size: .78rem; font-weight: 500; transition: all .2s;
}
.widget-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* -------------------------------------------------------------
   13. Course Cards
   ------------------------------------------------------------- */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .3s; display: flex; flex-direction: column;
  color: var(--text);
}
.course-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-3px); }

.course-thumb {
  position: relative; aspect-ratio: 16/9;
  background: var(--bg-elevated); overflow: hidden;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.course-card:hover .course-thumb img { transform: scale(1.05); }
.course-thumb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3); opacity: 0; transition: opacity .3s;
}
.course-thumb-overlay i { font-size: 2.5rem; color: #fff; }
.course-card:hover .course-thumb-overlay { opacity: 1; }

.course-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.course-category {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--primary); margin-bottom: .6rem;
}
.course-title {
  font-size: 1rem; font-weight: 700; line-height: 1.4;
  color: var(--text); margin-bottom: .75rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-desc {
  font-size: .85rem; color: var(--text-light); line-height: 1.6;
  margin-bottom: 1rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-meta { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); margin-top: auto; }
.course-meta span { display: flex; align-items: center; gap: .3rem; }
.course-card-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg-elevated); overflow: hidden; }
.course-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.course-card:hover .course-card-thumb img { transform: scale(1.05); }
.course-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--primary); opacity: .3;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-overlay));
}
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3); opacity: 0; transition: opacity .3s;
}
.play-overlay i { font-size: 2.5rem; color: #fff; }
.course-card:hover .play-overlay { opacity: 1; }
.course-card-body { padding: 1.25rem; flex: 1; }
.course-card-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: .5rem; }
.course-level-badge { position: absolute; top: .75rem; left: .75rem; padding: .2rem .6rem; border-radius: 100px; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.level-beginner     { background: rgba(22,163,74,.15);  color: var(--level-beginner); }
.level-intermediate { background: rgba(217,119,6,.15);  color: var(--level-intermediate); }
.level-advanced     { background: rgba(220,38,38,.15);  color: var(--level-advanced); }

/* -------------------------------------------------------------
   14. Tutorial / Series Cards
   ------------------------------------------------------------- */
.tutorials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.series-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; gap: 1rem; transition: all .3s;
  color: var(--text);
}
.series-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.series-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  background: var(--primary-bg); color: var(--primary);
}
.series-body { flex: 1; min-width: 0; }
.series-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: .4rem; }
.series-desc  { font-size: .85rem; color: var(--text-light); line-height: 1.55; margin-bottom: .6rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.series-meta  { font-size: .78rem; color: var(--text-muted); display: flex; gap: .75rem; }
.series-meta span { display: flex; align-items: center; gap: .3rem; }

/* -------------------------------------------------------------
   15. Blog / Post Cards
   ------------------------------------------------------------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }

.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .3s; display: flex; flex-direction: column;
  color: var(--text);
}
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-img { aspect-ratio: 16/9; overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
  display: inline-block; background: var(--primary-bg); color: var(--primary);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  padding: .2rem .6rem; border-radius: 100px; margin-bottom: .65rem;
}
.post-card-title {
  font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.4;
  margin-bottom: .5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title:hover { color: var(--primary); }
.post-card-excerpt {
  font-size: .875rem; color: var(--text-light); line-height: 1.65; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 1rem;
}
.post-card-meta {
  display: flex; flex-wrap: wrap; gap: .75rem;
  font-size: .78rem; color: var(--text-muted); margin-top: auto;
  padding-top: .75rem; border-top: 1px solid var(--border-light);
}
.post-card-meta span { display: flex; align-items: center; gap: .3rem; }

/* Legacy .post-card-body classes */
.post-category {
  display: inline-block; background: var(--primary-bg); color: var(--primary);
  font-size: .7rem; font-weight: 700; padding: .2rem .6rem; border-radius: 100px;
  text-transform: uppercase; letter-spacing: .3px;
}
.post-date { font-size: .78rem; color: var(--text-muted); }
.post-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: .75rem; border-top: 1px solid var(--border-light); margin-top: auto; }
.post-author { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-light); }
.author-avatar-tiny {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.post-stats { display: flex; gap: .75rem; font-size: .78rem; color: var(--text-muted); }
.post-stats span { display: flex; align-items: center; gap: .3rem; }

/* -------------------------------------------------------------
   16. Tag / Badge
   ------------------------------------------------------------- */
.tag-badge, .badge {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .25rem .7rem;
  background: var(--primary-bg); color: var(--primary);
  border: 1px solid transparent; border-radius: 100px;
  font-size: .78rem; font-weight: 500; transition: all .2s;
}
.tag-badge:hover { background: var(--primary); color: #fff; }
.badge-success  { background: rgba(16,185,129,.12); color: var(--success); }
.badge-muted    { background: var(--bg-elevated); color: var(--text-muted); }
.badge-course   { background: var(--primary-bg); color: var(--primary); }
.badge-tutorial { background: var(--accent-tutorial-glow); color: var(--accent-tutorial-light); }

/* -------------------------------------------------------------
   17. Watch / Video Page
   ------------------------------------------------------------- */
.watch-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.video-player-wrap {
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 16/9;
}
.video-player-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.video-info { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.25rem; }
.video-title { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: .75rem; }
.video-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.video-meta span { display: flex; align-items: center; gap: .4rem; }
.video-desc { font-size: .9rem; color: var(--text-light); line-height: 1.7; }

.rating-stars { display: flex; gap: .25rem; }
.rating-stars .star { font-size: 1.25rem; color: var(--border); cursor: pointer; transition: color .15s; }
.rating-stars .star.active, .rating-stars .star:hover { color: var(--accent); }

.playlist-sidebar { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.playlist-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.playlist-sidebar-header h3 { font-size: .95rem; font-weight: 700; color: var(--text); }
.playlist-video-item {
  display: flex; gap: .75rem; padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border-light); transition: background .2s; cursor: pointer;
}
.playlist-video-item:last-child { border-bottom: none; }
.playlist-video-item:hover, .playlist-video-item.active { background: var(--primary-bg); }
.playlist-video-item.active .playlist-video-title { color: var(--primary); }
.playlist-video-num { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.playlist-video-item.active .playlist-video-num { background: var(--primary); color: #fff; border-color: var(--primary); }
.playlist-video-title { font-size: .85rem; font-weight: 500; color: var(--text); line-height: 1.35; }
.playlist-video-dur   { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* Watch page — blade class aliases */
.video-info-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.video-info-title  { font-size: 1.2rem; font-weight: 700; color: var(--text); line-height: 1.4; flex: 1; }
.video-info-meta   { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .82rem; color: var(--text-muted); flex-shrink: 0; }
.video-info-meta span { display: flex; align-items: center; gap: .35rem; }
.video-description { font-size: .9rem; color: var(--text-light); line-height: 1.7; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-light); }
.video-rating { display: flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border-light); flex-wrap: wrap; }
.rating-label { font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.rating-star  { background: none; border: none; font-size: 1.3rem; color: var(--border); cursor: pointer; transition: color .15s; padding: 0; line-height: 1; }
.rating-star.active, .rating-star:hover { color: var(--accent); }
.rating-avg   { font-size: .82rem; color: var(--text-muted); margin-left: .25rem; }
.watch-sidebar { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: calc(var(--header-height) + 1rem); }
.watch-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.watch-sidebar-title  { font-size: .9rem; font-weight: 700; color: var(--text); }
.watch-video-list { max-height: 65vh; overflow-y: auto; }
.watch-video-item {
  display: flex; gap: .75rem; padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border-light); transition: background .2s; color: var(--text);
}
.watch-video-item:last-child { border-bottom: none; }
.watch-video-item:hover, .watch-video-item.active { background: var(--primary-bg); }
.watch-video-item.active .watch-video-title { color: var(--primary); font-weight: 600; }
.watch-video-num { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.watch-video-item.active .watch-video-num { background: var(--primary); color: #fff; border-color: var(--primary); }
.watch-video-info  { flex: 1; min-width: 0; }
.watch-video-title { font-size: .85rem; font-weight: 500; color: var(--text); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-video-dur   { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* Course detail page */
.course-layout { max-width: 800px; }
.course-main   {}
.course-page-title { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.3; margin-bottom: .75rem; }
.course-page-desc  { font-size: .95rem; color: var(--text-light); line-height: 1.7; margin-bottom: 1rem; }
.course-page-meta  { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; font-size: .85rem; color: var(--text-muted); margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.course-page-meta span { display: flex; align-items: center; gap: .35rem; }

/* Course video list (blade uses video-list-item) */
.video-list-item {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all .2s; color: var(--text); text-decoration: none;
}
.video-list-item:hover { border-color: var(--primary); background: var(--primary-bg); color: var(--text); }
.video-list-num   { font-size: .72rem; font-weight: 700; color: var(--text-muted); width: 22px; flex-shrink: 0; text-align: center; }
.video-list-info  { flex: 1; min-width: 0; }
.video-list-title { font-size: .9rem; font-weight: 500; color: var(--text); }
.video-list-meta  { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.video-list-play  { color: var(--primary); font-size: 1.1rem; flex-shrink: 0; opacity: .7; transition: opacity .2s; }
.video-list-item:hover .video-list-play { opacity: 1; }

/* -------------------------------------------------------------
   18. Tutorial / Lesson Page
   ------------------------------------------------------------- */
.lesson-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
.lesson-sidebar {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: sticky; top: calc(var(--header-height) + 1.5rem);
}
.lesson-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.lesson-sidebar-header h3 { font-size: .9rem; font-weight: 700; color: var(--text); }
.lesson-chapter { border-bottom: 1px solid var(--border-light); }
.lesson-chapter-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--text);
  transition: background .2s;
}
.lesson-chapter-title:hover { background: var(--bg); }
.lesson-item {
  display: block; padding: .6rem 1.25rem .6rem 2rem;
  font-size: .82rem; color: var(--text-light); transition: all .2s;
  border-left: 3px solid transparent;
}
.lesson-item:hover { color: var(--primary); background: var(--primary-bg); border-color: var(--primary); }
.lesson-item.active { color: var(--primary); background: var(--primary-bg); border-color: var(--primary); font-weight: 600; }
.lesson-content { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.lesson-header { padding: 2rem 2rem 1.5rem; border-bottom: 1px solid var(--border-light); }
.lesson-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.lesson-meta  { display: flex; gap: 1.25rem; font-size: .82rem; color: var(--text-muted); margin-top: .75rem; }
.lesson-body  { padding: 2rem; font-size: 1.05rem; line-height: 1.85; color: #334155; }
.lesson-body h1 { font-size: 2rem; font-weight: 800; margin: 2.25rem 0 1.25rem; color: var(--text); padding-bottom: .6rem; border-bottom: 3px solid var(--primary-bg); }
.lesson-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--text); padding-bottom: .5rem; border-bottom: 2px solid var(--primary-bg); }
.lesson-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 .75rem; color: var(--text); }
.lesson-body h4 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 .5rem; color: var(--text); }
.lesson-body h5 { font-size: .9rem; font-weight: 600; margin: 1rem 0 .4rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.lesson-body p  { margin-bottom: 1.25rem; }
.lesson-body table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0;
  font-size: .95rem; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.lesson-body table th {
  background: var(--bg); color: var(--text); font-weight: 600;
  text-align: left; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .4px;
}
.lesson-body table th:last-child { border-right: none; }
.lesson-body table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  vertical-align: top; color: var(--text-light);
}
.lesson-body table td:last-child { border-right: none; }
.lesson-body table tr:last-child td { border-bottom: none; }
.lesson-body table tbody tr:nth-child(even) { background: var(--bg); }
.lesson-body table tbody tr:hover { background: var(--primary-bg); transition: background .15s; }
.lesson-body ul,
.lesson-body ol  { margin-bottom: 1.25rem; padding-left: 2rem; }
.lesson-body ul  { list-style: disc !important; }
.lesson-body ul ul { list-style: circle !important; padding-left: 1.5rem; }
.lesson-body ul ul ul { list-style: square !important; }
.lesson-body ol  { list-style: decimal !important; }
.lesson-body ol ol { list-style: lower-alpha !important; padding-left: 1.5rem; }
.lesson-body li  { display: list-item !important; margin-bottom: .5rem; line-height: 1.7; }
.lesson-body pre { background: #1e293b; color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1.5rem; font-size: .88rem; line-height: 1.75; border: 1px solid #334155; }
.lesson-body code { font-family: var(--font-mono); background: #1e293b; border: 1px solid #334155; color: #e8b4b8; padding: 2px 7px; border-radius: 4px; font-size: .85em; }
.lesson-body pre code { background: none; border: none; padding: 0; color: inherit; }
.lesson-progress { height: 4px; background: var(--border); }
.lesson-progress-bar { height: 100%; background: var(--primary); transition: width .4s; }
.lesson-nav {
  display: flex; justify-content: space-between;
  padding: 1.25rem 2rem; border-top: 1px solid var(--border-light);
  gap: 1rem;
}
.lesson-nav-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.1rem; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text);
  transition: all .2s; max-width: 45%;
}
.lesson-nav-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.lesson-nav-next { justify-content: flex-end; }
.lesson-breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); margin-bottom: 1.25rem; flex-wrap: wrap; }
.lesson-breadcrumb a { color: var(--text-muted); transition: color .2s; }
.lesson-breadcrumb a:hover { color: var(--primary); }
.lesson-breadcrumb i { font-size: .6rem; opacity: .5; }
.lesson-content-wrap { max-width: 820px; padding: 2rem; }

/* Tutorial full-page layout (lesson.blade.php standalone) */
.tutorial-layout {
  display: block;
  min-height: 100vh; padding-top: 52px;
}
.tutorial-layout > main {
  margin-left: 280px; min-height: calc(100vh - 52px);
  background: var(--bg);
}
.tutorial-sidebar {
  background: var(--bg-white); border-right: 1px solid var(--border);
  position: fixed; top: 52px; left: 0; bottom: 0; width: 280px;
  overflow-y: auto; z-index: 100;
  display: flex; flex-direction: column;
}
.sidebar-logo { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-series-name { display: flex; align-items: center; gap: .65rem; font-size: .9rem; font-weight: 700; color: var(--text); }
.sidebar-series-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.sidebar-progress { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border-light); }
.progress-bar-wrap { height: 5px; background: var(--border); border-radius: 100px; overflow: hidden; margin-bottom: .4rem; }
.progress-bar-fill { height: 100%; border-radius: 100px; transition: width .4s; }
.progress-text { font-size: .72rem; color: var(--text-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.sidebar-chapter { }
.sidebar-chapter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1.25rem; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--text);
  transition: background .2s;
}
.sidebar-chapter-header:hover { background: var(--bg); }
.sidebar-chapter-header .fa-chevron-right { font-size: .65rem; transition: transform .2s; color: var(--text-muted); }
.sidebar-chapter.open .sidebar-chapter-header .fa-chevron-right { transform: rotate(90deg); }
.sidebar-lessons { display: none; }
.sidebar-chapter.open .sidebar-lessons { display: block; }
.sidebar-lesson {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.25rem .55rem 2rem; font-size: .82rem;
  color: var(--text-light); transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-lesson:hover { color: var(--primary); background: var(--primary-bg); }
.sidebar-lesson.active { color: var(--primary); background: var(--primary-bg); border-left-color: var(--primary); font-weight: 600; }
.sidebar-lesson-icon { font-size: .6rem; flex-shrink: 0; color: var(--primary); }
.sidebar-toggle-btn {
  display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 1rem;
  box-shadow: 0 4px 12px rgba(99,102,241,.4); cursor: pointer;
  align-items: center; justify-content: center;
}

/* Shared utilities */
.btn-purple { background: var(--primary); color: #fff; border: none; }
.btn-purple:hover { background: var(--primary-dark); color: #fff; }

/* -------------------------------------------------------------
   19. Course / Playlist Page
   ------------------------------------------------------------- */
.course-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 3rem 0; position: relative; overflow: hidden;
}
.course-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(99,102,241,.15) 0%, transparent 60%);
}
.course-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.course-hero-title { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.course-hero-desc  { font-size: 1rem; color: rgba(255,255,255,.7); line-height: 1.65; }
.course-hero-meta  { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1rem; font-size: .85rem; color: rgba(255,255,255,.55); }
.course-hero-meta span { display: flex; align-items: center; gap: .4rem; }
.course-hero-meta i { color: var(--primary-light); }

.chapter-section { margin-bottom: 2rem; }
.chapter-title { font-size: 1rem; font-weight: 700; color: var(--text); padding: 1rem 1.25rem; background: var(--bg-elevated); border-radius: var(--radius-sm); margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.chapter-title i { color: var(--primary); }
.video-list { display: flex; flex-direction: column; gap: .5rem; }
.video-item {
  display: flex; gap: 1rem; padding: .85rem 1.25rem;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all .2s;
  color: var(--text);
}
.video-item:hover { border-color: var(--primary); background: var(--primary-bg); }
.video-item-num { font-size: .72rem; font-weight: 700; color: var(--text-muted); width: 20px; }
.video-item-title { flex: 1; font-size: .9rem; font-weight: 500; color: var(--text); }
.video-item-dur   { font-size: .78rem; color: var(--text-muted); flex-shrink: 0; }

/* -------------------------------------------------------------
   20. Search Page
   ------------------------------------------------------------- */
.search-hero {
  background: var(--bg-white); border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}
.search-hero h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.search-form {
  display: flex; background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 100px; overflow: hidden;
  max-width: 600px; transition: border-color .2s;
}
.search-form:focus-within { border-color: var(--primary); }
.search-form input { flex: 1; padding: .85rem 1.25rem; background: none; border: none; outline: none; font-size: 1rem; color: var(--text); }
.search-form button { padding: .85rem 1.5rem; background: var(--primary); color: #fff; font-weight: 600; }
.search-tabs { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.search-tab { padding: .45rem 1rem; border-radius: 100px; font-size: .85rem; font-weight: 500; color: var(--text-light); border: 1px solid var(--border); transition: all .2s; }
.search-tab:hover, .search-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* -------------------------------------------------------------
   21. Auth Pages
   ------------------------------------------------------------- */
.auth-page, .auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 60%, #eef2ff 100%);
}
.auth-card {
  background: #fff; border: 1px solid rgba(99,102,241,.12);
  border-radius: 18px; width: 100%; max-width: 440px;
  box-shadow: 0 8px 40px rgba(99,102,241,.12), 0 2px 8px rgba(0,0,0,.06);
  padding: 2.5rem 2.25rem;
  position: relative;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--primary), #818cf8);
}
/* template alias classes */
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: .25rem; margin-bottom: 1.5rem; font-size: 1.35rem; font-weight: 800;
}
.auth-logo .logo-brace { color: var(--primary); }
.auth-logo .logo-text  { color: var(--text); }
.auth-title {
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: .3rem;
}
.auth-subtitle {
  font-size: .9rem; color: var(--text-muted);
  text-align: center; margin-bottom: 1.75rem;
}
.auth-link {
  text-align: center; font-size: .875rem; color: var(--text-muted);
  margin-top: 1.25rem;
}
.auth-link a { color: var(--primary); font-weight: 600; }
.auth-card-body { padding: 0; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header .logo { justify-content: center; margin-bottom: 1.25rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 800; }
.auth-header p  { font-size: .9rem; color: var(--text-muted); margin-top: .3rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-size: .85rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: .35rem;
}
.form-input {
  width: 100%; padding: .7rem 1rem; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem; outline: none; background: var(--bg);
  color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; }
select.form-input { appearance: none; cursor: pointer; }
.auth-divider { text-align: center; position: relative; margin: 1rem 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { position: relative; background: #fff; padding: 0 .75rem; font-size: .8rem; color: var(--text-muted); }
.auth-footer { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: .75rem; }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* OTP digit inputs */
.otp-inputs { display: flex; gap: .6rem; justify-content: center; margin: .5rem 0 1rem; }
.otp-digit {
  width: 52px; height: 60px; text-align: center; font-size: 1.6rem;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  border: 2px solid var(--border); border-radius: 10px;
  outline: none; color: var(--text); background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.otp-digit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.otp-digit.filled { border-color: var(--primary); background: var(--primary-bg); }

/* Tutorial lesson list */
.lesson-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .4rem .75rem;
}
.lesson-list-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; border-radius: 8px;
  color: var(--text); font-size: .9rem;
  transition: background .15s, color .15s;
  border: 1px solid transparent;
}
.lesson-list-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: rgba(99,102,241,.15);
}
.lesson-list-item i { flex-shrink: 0; font-size: .4rem; margin-top: 1px; }
.chapter-section {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.chapter-title {
  font-size: 1rem !important; font-weight: 700 !important;
  color: var(--text-secondary) !important;
  margin-bottom: .9rem !important; padding-bottom: .6rem !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex; align-items: center; gap: .5rem;
}
.chapter-title::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--primary); border-radius: 2px;
}

/* -------------------------------------------------------------
   22. Alerts
   ------------------------------------------------------------- */
.alert {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* -------------------------------------------------------------
   23. Pagination
   ------------------------------------------------------------- */
.pagination, .pagination-wrap {
  display: flex; justify-content: center; align-items: center;
  gap: .5rem; margin: 2.5rem 0 1rem; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 .75rem;
  border-radius: var(--radius-sm); background: var(--bg-white);
  color: var(--text); font-weight: 500; font-size: .875rem;
  border: 1px solid var(--border); transition: all .2s;
}
.page-btn:hover      { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.page-btn-active, .page-btn.active { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.page-btn-disabled   { opacity: .4; pointer-events: none; }
.page-btn-dots       { border: none; background: none; color: var(--text-muted); min-width: auto; }

/* -------------------------------------------------------------
   24. Empty States
   ------------------------------------------------------------- */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state i    { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; display: block; }
.empty-state h3   { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.empty-state p    { font-size: .9rem; }

/* -------------------------------------------------------------
   25. Footer
   ------------------------------------------------------------- */
.footer {
  background: var(--bg-dark); color: rgba(255,255,255,.7);
  padding: 3.5rem 0 0; margin-top: 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 2.5rem; padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo .logo-text { color: #fff; }
.footer-logo .logo-brace { color: var(--primary-light); }
.footer-about p { font-size: .875rem; line-height: 1.7; margin: 1rem 0 1.25rem; color: rgba(255,255,255,.6); }
.footer-social { display: flex; gap: .75rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; transition: all .2s;
}
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-links h4, .footer-newsletter h4 {
  color: #fff; font-size: .95rem; font-weight: 600; margin-bottom: 1.25rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: .6rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .875rem; transition: all .2s; display: flex; align-items: center; gap: .4rem; }
.footer-links a:hover { color: #fff; padding-left: .25rem; }
.footer-newsletter p { font-size: .875rem; margin-bottom: 1rem; color: rgba(255,255,255,.6); }
.newsletter-form {
  display: flex; background: rgba(255,255,255,.08);
  border-radius: var(--radius-sm); overflow: hidden;
}
.newsletter-form input {
  flex: 1; padding: .7rem 1rem; background: transparent; border: none;
  color: #fff; outline: none; font-size: .85rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.4); }
.newsletter-form button {
  background: var(--primary); color: #fff; border: none;
  padding: .7rem 1.25rem; font-size: .85rem; font-weight: 600;
  transition: background .2s;
}
.newsletter-form button:hover { background: var(--primary-dark); }
.newsletter-msg { font-size: .82rem; margin-top: .5rem; }
.footer-bottom {
  padding: 1.25rem 0; text-align: center;
  font-size: .82rem; color: rgba(255,255,255,.4);
}

/* -------------------------------------------------------------
   26. Admin Styles
   ------------------------------------------------------------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-dark); color: rgba(255,255,255,.8);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.admin-logo {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.1rem; font-weight: 800; color: #fff;
}
.admin-logo .logo-brace { color: var(--primary-light); }
.admin-nav { padding: 1rem 0; flex: 1; overflow-y: auto; }
.admin-nav-section { padding: .25rem .75rem; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.3); margin-top: 1rem; margin-bottom: .25rem; }
.admin-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.5rem; font-size: .875rem; font-weight: 500;
  color: rgba(255,255,255,.65); transition: all .2s;
  border-left: 3px solid transparent;
}
.admin-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav-link.active { background: rgba(99,102,241,.2); color: #fff; border-left-color: var(--primary-light); }
.admin-nav-link i { width: 18px; text-align: center; opacity: .75; }
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--bg-white); border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.admin-content { padding: 2rem; flex: 1; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.admin-stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.admin-stat-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.admin-stat-num  { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.admin-stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-table-wrap { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.admin-table-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: .75rem; }
.admin-table-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { background: var(--bg); text-align: left; padding: .75rem 1.25rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.admin-table td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; color: var(--text-light); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.admin-form-wrap { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }
.admin-form-section { margin-bottom: 1.75rem; }
.admin-form-label { font-size: .85rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: .35rem; margin-bottom: .4rem; }

/* -------------------------------------------------------------
   27. Utility / Misc
   ------------------------------------------------------------- */
.text-primary   { color: var(--primary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }

/* Code language labels on pre blocks */
.code-block-wrap { position: relative; display: block; }
.code-block-wrap pre { padding-top: 2.25rem !important; }
.code-lang {
  position: absolute; top: .55rem; right: .75rem;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: rgba(255,255,255,.45);
  font-family: var(--font-mono);
  background: rgba(255,255,255,.07); padding: .15rem .45rem;
  border-radius: 3px; pointer-events: none; line-height: 1.4;
}

/* 404 */
.error-page { text-align: center; padding: 6rem 2rem; }
.error-page h1 { font-size: 6rem; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 1rem; }
.error-page h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.error-page p  { color: var(--text-light); margin-bottom: 2rem; }

/* Flash success/error */
.flash-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; padding: .85rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.flash-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; padding: .85rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; display: flex; align-items: center; gap: .5rem; }

/* -------------------------------------------------------------
   28. Responsive
   ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .blog-layout      { grid-template-columns: 1fr; }
  .watch-layout     { grid-template-columns: 1fr; }
  .lesson-layout    { grid-template-columns: 1fr; }
  .sidebar          { position: static; }
  .lesson-sidebar   { position: static; }
  .footer-grid      { grid-template-columns: 1fr 1fr; }
  .course-hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-search { display: none; }
  .nav-links  { display: none; flex-direction: column; gap: .25rem; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-white); padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .mobile-search { display: block; }
  .courses-grid, .tutorials-grid, .blog-grid, .posts-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .section { padding: 2.5rem 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-nav  { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .watch-layout { grid-template-columns: 1fr; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-main    { margin-left: 0; }
  .post-hero { padding: 2rem 0; }
  .post-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 0 2rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card-body { padding: 1.5rem; }
  .post-meta-row { gap: .75rem; }
  .post-share { flex-wrap: wrap; }
}

/* -------------------------------------------------------------
   29. Theme Toggle Button
   ------------------------------------------------------------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-light);
  font-size: .95rem;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: rotate(20deg);
}

/* -------------------------------------------------------------
   30. Dark Mode
   ------------------------------------------------------------- */
html.dark {
  --text:          #e2e8f0;
  --text-light:    #94a3b8;
  --text-muted:    #64748b;
  --bg:            #0f172a;
  --bg-white:      #1e293b;
  --bg-dark:       #020617;
  --bg-card:       #1e293b;
  --border:        #334155;
  --border-light:  #293548;
  --primary-bg:    rgba(99,102,241,.15);
  --bg-base:       #0f172a;
  --bg-elevated:   #1e293b;
  --bg-overlay:    #273549;
  --border-hover:  #475569;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.3);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.4), 0 8px 10px -6px rgba(0,0,0,.3);
}

/* Navbar */
html.dark .navbar {
  background: rgba(30,41,59,.97);
  border-bottom-color: var(--border);
}
html.dark .navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
html.dark .nav-links {
  background: #1e293b;
}
html.dark .nav-search {
  background: #0f172a;
  border-color: var(--border);
}
html.dark .nav-search input {
  background: transparent;
  color: var(--text);
}
html.dark .nav-search input::placeholder { color: var(--text-muted); }
html.dark .nav-search button { color: var(--text-muted); }

/* Top Bar */
html.dark .top-bar {
  background: #020617;
}
html.dark .mobile-search {
  background: #1e293b;
  border-bottom-color: var(--border);
}
html.dark .mobile-search input {
  background: #0f172a;
  color: var(--text);
  border-color: var(--border);
}

/* User dropdown */
html.dark .user-dropdown {
  background: #1e293b;
  border-color: var(--border);
}
html.dark .user-dropdown a { color: var(--text); }
html.dark .user-dropdown a:hover { background: var(--bg); }

/* Nav user button */
html.dark .nav-user-btn { color: var(--text); }

/* Cards & surfaces */
html.dark .card,
html.dark .course-card,
html.dark .blog-card,
html.dark .tutorial-card,
html.dark .sidebar-widget,
html.dark .post-body,
html.dark .chapter-section,
html.dark .lesson-card,
html.dark .watch-info,
html.dark .lesson-info,
html.dark .comment-form,
html.dark .comment-item {
  background: var(--bg-white);
  border-color: var(--border);
}
html.dark .card-tag,
html.dark .badge {
  background: var(--bg);
  color: var(--text-muted);
}

/* Hero */
html.dark .hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
}
html.dark .hero-stat { color: var(--text); }

/* Buttons */
html.dark .btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
html.dark .btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
html.dark .btn-outline { color: var(--primary); border-color: var(--primary); }

/* Forms */
html.dark input,
html.dark textarea,
html.dark select {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
html.dark input::placeholder,
html.dark textarea::placeholder { color: var(--text-muted); }
html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: var(--primary);
  background: var(--bg-white);
}

/* Auth card */
html.dark .auth-card {
  background: #1e293b;
  border-color: var(--border);
}
html.dark .auth-title { color: var(--text); }
html.dark .otp-digit {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
html.dark .otp-digit:focus { border-color: var(--primary); background: var(--bg-white); }

/* Footer */
html.dark footer {
  background: #020617;
  border-top-color: #1e293b;
}
html.dark .footer-bottom {
  border-top-color: #1e293b;
  color: var(--text-muted);
}

/* Sidebar */
html.dark .sidebar-widget { background: var(--bg-white); }
html.dark .sidebar-tag { background: var(--bg); color: var(--text-light); border-color: var(--border); }
html.dark .sidebar-tag:hover { background: var(--primary-bg); color: var(--primary); }

/* Code blocks */
html.dark pre,
html.dark .post-body pre {
  background: #020617;
  border-color: var(--border);
}
html.dark code { background: rgba(99,102,241,.15); color: #a5b4fc; }
html.dark pre code { background: transparent; color: #e2e8f0; }

/* Post / blog content */
html.dark .post-hero { background: linear-gradient(135deg, #0f172a, #1e293b); }
html.dark .post-body blockquote {
  border-left-color: var(--primary);
  background: var(--primary-bg);
  color: var(--text-light);
}
html.dark .post-body table th { background: var(--bg); }
html.dark .post-body table td,
html.dark .post-body table th { border-color: var(--border); }

/* Section backgrounds */
html.dark .section-gray,
html.dark .bg-gray { background: #1e293b; }

/* Pagination */
html.dark .pagination a,
html.dark .pagination span {
  background: var(--bg-white);
  border-color: var(--border);
  color: var(--text);
}
html.dark .pagination a:hover { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
html.dark .pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Flash messages */
html.dark .flash-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); }
html.dark .flash-error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.3); }

/* Theme toggle in dark mode shows sun */
html.dark .theme-toggle {
  background: #1e293b;
  border-color: var(--border);
  color: #fbbf24;
}
html.dark .theme-toggle:hover {
  background: rgba(251,191,36,.1);
  border-color: #fbbf24;
  color: #f59e0b;
}

/* Smooth transition for theme switch */
body, .navbar, .top-bar, .card, .sidebar-widget, footer, input, textarea, select, .auth-card {
  transition: background-color .25s ease, border-color .25s ease, color .15s ease;
}

/* =============================================================
   Donation Page
   ============================================================= */
.donate-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.donate-preset-btn {
  padding: .5rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s, transform .12s;
}

.donate-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
}

.donate-preset-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}

/* Navbar donate link */
.nav-link-donate {
  color: #ff6b6b !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.nav-link-donate:hover {
  color: #ff4d4d !important;
}

/* Dark mode */
html.dark .donate-preset-btn {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}
html.dark .donate-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,.1);
}
