/* ==========================================================================
   Azure Developer Handbook — Enterprise Premium Design System v2
   Complete redesign: glassmorphism, animated gradients, refined KPIs,
   polished cards, micro-animations, and professional enterprise feel.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   Design Tokens — Light Theme (Default: Azure Enterprise Clean)
   ========================================================================== */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono', Consolas, monospace;

  /* Azure Signature Palette */
  --primary: #0078d4;
  --primary-hover: #106ebe;
  --primary-glow: rgba(0, 120, 212, 0.25);
  --primary-light: #e0f2fe;
  --primary-dark: #004578;
  --primary-50: #eff6ff;

  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-indigo: #4f46e5;

  /* Silent & Sophisticated Executive Hero Gradient — Understated light aura */
  --hero-gradient: radial-gradient(ellipse 90% 55% at 50% -10%, rgba(0, 120, 212, 0.08) 0%, transparent 70%), linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --card-glow: radial-gradient(ellipse at top right, rgba(0, 120, 212, 0.05), transparent 70%);
  --kpi-glass: #ffffff;
  --shimmer: linear-gradient(90deg, transparent 0%, rgba(0, 120, 212, 0.05) 50%, transparent 100%);

  /* Surfaces - Crisp Modern Light Mode */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f7ff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-hover: #0078d4;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-faint: #cbd5e1;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 28px 56px -12px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 30px rgba(0, 120, 212, 0.22);
  --shadow-card-hover: 0 14px 32px -4px rgba(0, 120, 212, 0.16), 0 0 0 1px rgba(0, 120, 212, 0.2);

  /* Reader Modal Theme - Crisp Light */
  --reader-header-bg: #ffffff;
  --reader-sidebar-bg: #f8fafc;
  --reader-sidebar-border: #e2e8f0;
  --reader-item-bg: #ffffff;
  --reader-item-text: #334155;
  --reader-item-hover: #eff6ff;
  --reader-item-active: #e0f2fe;
  --reader-item-active-text: #0078d4;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.15s ease;
}

/* ==========================================================================
   Dark Theme (Midnight Slate)
   ========================================================================== */
[data-theme="dark"] {
  --hero-gradient: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(56, 189, 248, 0.07) 0%, transparent 70%), linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
  --bg-page: #0b1120;
  --bg-surface: #0f172a;
  --bg-card: #131d33;
  --bg-card-hover: #192744;
  --bg-subtle: #192338;
  --bg-muted: #1e293b;
  --nav-bg: rgba(11, 17, 32, 0.94);
  --border-color: #1e293b;
  --border-light: #162032;
  --border-hover: #38bdf8;

  --text-main: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --text-faint: #334155;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 32px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.25);
  --shadow-card-hover: 0 12px 32px -6px rgba(56, 189, 248, 0.15), 0 0 0 1px rgba(56, 189, 248, 0.15);
  --card-glow: radial-gradient(ellipse at top right, rgba(56, 189, 248, 0.08), transparent 70%);

  --reader-header-bg: #070d18;
  --reader-sidebar-bg: #0b1322;
  --reader-sidebar-border: #1a2744;
  --reader-item-bg: rgba(255, 255, 255, 0.03);
  --reader-item-text: #94a3b8;
  --reader-item-hover: rgba(255, 255, 255, 0.07);
  --reader-item-active: rgba(0, 120, 212, 0.25);
  --reader-item-active-text: #ffffff;
}

/* ==========================================================================
   Global Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes count-up-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* ==========================================================================
   Site Header — Refined Glass Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0078d4 30%, #38bdf8 70%, transparent);
  opacity: 0.7;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.brand-wrapper:hover {
  transform: translateX(2px);
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
  display: block;
  transition: var(--transition);
}

.brand-wrapper:hover .brand-logo-img {
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.5);
  transform: rotate(3deg) scale(1.05);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
}

.brand-text span {
  font-size: 0.68rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #0078d4, #0284c7);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
}

/* ==========================================================================
   Hero Section — Silent & Sophisticated Executive Landing
   ========================================================================== */
.hero {
  background: var(--hero-gradient);
  color: var(--text-main);
  padding: 68px 0 52px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero::before,
.hero::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1050px;
}

/* Subtle Pill Badges */
.hero-badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  animation: fade-in-up 0.6s var(--ease-out) both;
}

.hero-pill {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: var(--transition);
}

.hero-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Silent & Elegant Hero Title */
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 4.2vw, 3.3rem);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-main);
  animation: fade-in-up 0.7s var(--ease-out) 0.1s both;
}

.hero-title .gradient-text {
  background: linear-gradient(120deg, #0078d4 0%, #0284c7 45%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 820px;
  font-weight: 400;
  animation: fade-in-up 0.8s var(--ease-out) 0.2s both;
}

/* ==========================================================================
   Search — Premium Glass Input
   ========================================================================== */
.search-box-wrapper {
  position: relative;
  max-width: 720px;
  margin-bottom: 28px;
  animation: fade-in-up 0.9s var(--ease-out) 0.3s both;
}

.search-input {
  width: 100%;
  padding: 18px 52px 18px 54px;
  font-size: 1rem;
  font-family: var(--font-main);
  font-weight: 500;
  border-radius: 16px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  outline: none;
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow), 0 12px 32px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.search-icon-left {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  font-size: 1.15rem;
  display: none;
  transition: var(--transition-fast);
  border-radius: 50%;
}

.search-clear-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* Quick Topic Chips — Calm, Silent Pill Badges */
.quick-topics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 38px;
  font-size: 0.84rem;
  color: var(--text-muted);
  animation: fade-in-up 1s var(--ease-out) 0.4s both;
}

.quick-topic-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.quick-topic-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.12);
}

/* ==========================================================================
   Executive KPI Dashboard — Calm, Silent & Premium Enterprise Cards
   ========================================================================== */
.hero-kpis-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  max-width: 1050px;
  margin-top: 12px;
  animation: fade-in-up 1.1s var(--ease-out) 0.5s both;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--primary-glow);
}

/* Silent Top Border Indicator */
.kpi-card.kpi-green { border-top: 3px solid var(--accent-emerald); }
.kpi-card.kpi-cyan { border-top: 3px solid var(--accent-cyan); }
.kpi-card.kpi-purple { border-top: 3px solid var(--accent-purple); }
.kpi-card.kpi-amber { border-top: 3px solid var(--accent-amber); }
.kpi-card.kpi-blue { border-top: 3px solid var(--primary); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.kpi-icon {
  font-size: 1.35rem;
}

.kpi-pill {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.kpi-card.kpi-green .kpi-pill { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.kpi-card.kpi-cyan .kpi-pill { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.kpi-card.kpi-purple .kpi-pill { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.kpi-card.kpi-amber .kpi-pill { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.kpi-card.kpi-blue .kpi-pill { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

[data-theme="dark"] .kpi-card.kpi-green .kpi-pill { background: rgba(5, 150, 105, 0.15); color: #6ee7b7; border: 1px solid rgba(5, 150, 105, 0.3); }
[data-theme="dark"] .kpi-card.kpi-cyan .kpi-pill { background: rgba(2, 132, 199, 0.15); color: #7dd3fc; border: 1px solid rgba(2, 132, 199, 0.3); }
[data-theme="dark"] .kpi-card.kpi-purple .kpi-pill { background: rgba(124, 58, 237, 0.15); color: #c4b5fd; border: 1px solid rgba(124, 58, 237, 0.3); }
[data-theme="dark"] .kpi-card.kpi-amber .kpi-pill { background: rgba(217, 119, 6, 0.15); color: #fcd34d; border: 1px solid rgba(217, 119, 6, 0.3); }
[data-theme="dark"] .kpi-card.kpi-blue .kpi-pill { background: rgba(0, 120, 212, 0.15); color: #93c5fd; border: 1px solid rgba(0, 120, 212, 0.3); }

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 850;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Quick Jump Matrix Ribbon
   ========================================================================== */
.quick-matrix-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  position: relative;
  z-index: 85;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.matrix-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.matrix-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.matrix-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.matrix-scroll::-webkit-scrollbar {
  display: none;
}

.matrix-item {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.matrix-item:hover {
  background: linear-gradient(135deg, #0078d4, #0284c7);
  border-color: #0078d4;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.35);
}

.matrix-item.completed-item {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #059669;
}

.matrix-item.master-item {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border-color: transparent;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Controls Bar: Filters & Progress
   ========================================================================== */
.controls-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
  position: sticky;
  top: 68px;
  z-index: 80;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  transition: background 0.3s ease;
}

.controls-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Category Filter Pills */
.categories-scroll {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.categories-scroll::-webkit-scrollbar {
  height: 3px;
}

.categories-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

.category-pill {
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.category-pill.active {
  background: linear-gradient(135deg, #0078d4, #0284c7);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.category-pill .pill-count {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.06);
  min-width: 20px;
  text-align: center;
}

.category-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Progress Banner */
.progress-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  border: 1px solid var(--border-color);
}

.progress-track {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 520px;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #0078d4);
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-out);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Catalog Grid & Chapter Cards — Premium Material Design
   ========================================================================== */
.catalog-section {
  padding: 48px 0 80px;
  flex: 1;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.results-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 22px;
}

/* === Chapter Card === */
.chapter-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: default;
}

/* Top accent gradient stripe — always visible, per-category colored */
.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  opacity: 0.6;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.chapter-card:hover::before {
  opacity: 1;
  height: 4px;
}

.chapter-card .card-inner {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.chapter-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--shadow-card-hover);
}

.chapter-card .card-inner {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.chapter-card.completed {
  border-left: 4px solid var(--accent-emerald);
}

.chapter-card.completed::before {
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
  opacity: 0.6;
}

.chapter-card.bookmarked {
  border-top: 3px solid var(--accent-amber);
}

/* Per-category color accents — each category gets a unique gradient */
.chapter-card[data-category="foundation"]::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}
.chapter-card[data-category="cloud"]::before {
  background: linear-gradient(90deg, #0078d4, #38bdf8);
}
.chapter-card[data-category="security"]::before {
  background: linear-gradient(90deg, #ef4444, #f97316);
}
.chapter-card[data-category="architecture"]::before {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}
.chapter-card[data-category="performance"]::before {
  background: linear-gradient(90deg, #f59e0b, #eab308);
}
.chapter-card[data-category="excellence"]::before {
  background: linear-gradient(90deg, #ec4899, #d946ef);
}

/* Per-category badge color variants */
.chapter-card[data-category="foundation"] .card-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}
.chapter-card[data-category="cloud"] .card-badge {
  background: rgba(0, 120, 212, 0.1);
  color: #0078d4;
  border-color: rgba(0, 120, 212, 0.2);
}
.chapter-card[data-category="security"] .card-badge {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}
.chapter-card[data-category="architecture"] .card-badge {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.2);
}
.chapter-card[data-category="performance"] .card-badge {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}
.chapter-card[data-category="excellence"] .card-badge {
  background: rgba(236, 72, 153, 0.1);
  color: #db2777;
  border-color: rgba(236, 72, 153, 0.2);
}

/* Dark mode badge colors */
[data-theme="dark"] .chapter-card[data-category="foundation"] .card-badge {
  background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border-color: rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .chapter-card[data-category="cloud"] .card-badge {
  background: rgba(56, 189, 248, 0.15); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .chapter-card[data-category="security"] .card-badge {
  background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3);
}
[data-theme="dark"] .chapter-card[data-category="architecture"] .card-badge {
  background: rgba(139, 92, 246, 0.15); color: #ddd6fe; border-color: rgba(139, 92, 246, 0.3);
}
[data-theme="dark"] .chapter-card[data-category="performance"] .card-badge {
  background: rgba(245, 158, 11, 0.15); color: #fde68a; border-color: rgba(245, 158, 11, 0.3);
}
[data-theme="dark"] .chapter-card[data-category="excellence"] .card-badge {
  background: rgba(236, 72, 153, 0.15); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.3);
}

/* Per-category hover glow */
.chapter-card[data-category="foundation"]:hover {
  box-shadow: 0 12px 32px -6px rgba(16, 185, 129, 0.18), 0 0 0 1px rgba(16, 185, 129, 0.12);
}
.chapter-card[data-category="cloud"]:hover {
  box-shadow: 0 12px 32px -6px rgba(0, 120, 212, 0.18), 0 0 0 1px rgba(0, 120, 212, 0.12);
}
.chapter-card[data-category="security"]:hover {
  box-shadow: 0 12px 32px -6px rgba(239, 68, 68, 0.18), 0 0 0 1px rgba(239, 68, 68, 0.12);
}
.chapter-card[data-category="architecture"]:hover {
  box-shadow: 0 12px 32px -6px rgba(139, 92, 246, 0.18), 0 0 0 1px rgba(139, 92, 246, 0.12);
}
.chapter-card[data-category="performance"]:hover {
  box-shadow: 0 12px 32px -6px rgba(245, 158, 11, 0.18), 0 0 0 1px rgba(245, 158, 11, 0.12);
}
.chapter-card[data-category="excellence"]:hover {
  box-shadow: 0 12px 32px -6px rgba(236, 72, 153, 0.18), 0 0 0 1px rgba(236, 72, 153, 0.12);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--primary-50);
  color: var(--primary);
  border: 1px solid rgba(0, 120, 212, 0.15);
  text-transform: uppercase;
}

[data-theme="dark"] .card-badge {
  background: rgba(0, 120, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* Card Icon & Title */
.card-icon-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.card-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.tag-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
  transform: translateY(-1px);
}

[data-theme="dark"] .tag-chip:hover {
  background: rgba(0, 120, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0078d4, #0284c7);
  color: #ffffff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
  position: relative;
  overflow: hidden;
}

.read-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.read-btn:hover::before {
  opacity: 1;
}

.read-btn:hover {
  box-shadow: 0 8px 20px rgba(0, 120, 212, 0.4);
  transform: translateY(-2px);
}

.read-btn:active {
  transform: translateY(0);
}

.action-secondary-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.95rem;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.icon-btn.completed-toggle.checked {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.icon-btn.bookmark-toggle.bookmarked {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .icon-btn.completed-toggle.checked {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .icon-btn.bookmark-toggle.bookmarked {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Master Card — Premium Enterprise Highlight */
.chapter-card.master-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(2, 132, 199, 0.05) 100%), var(--bg-card);
  border: 2px solid var(--accent-indigo);
  grid-column: 1 / -1;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.12);
}

.chapter-card.master-card::before {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #0284c7);
  opacity: 1;
  height: 4px;
}

.chapter-card.master-card:hover {
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .chapter-card.master-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(2, 132, 199, 0.06) 100%), var(--bg-card);
}

/* ==========================================================================
   Book Reader Modal — Premium Dark Overlay
   ========================================================================== */
.reader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 14, 0.96);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.reader-overlay.active {
  display: flex;
  animation: fade-in-up 0.25s var(--ease-out) both;
}

.reader-header {
  height: 56px;
  background: var(--reader-header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--text-main);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: relative;
  z-index: 60;
}

.reader-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Sidebar Toggle in Reader Header */
#reader-toggle-sidebar {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

#reader-toggle-sidebar:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

#reader-toggle-sidebar.active {
  background: #eff6ff;
  color: #0078d4;
  border-color: #0078d4;
  box-shadow: 0 1px 4px rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] #reader-toggle-sidebar.active {
  background: rgba(0, 120, 212, 0.2);
  color: #38bdf8;
  border-color: #0284c7;
}

.reader-title-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .reader-title-badge {
  background: rgba(2, 132, 199, 0.15);
  color: #7dd3fc;
  border-color: rgba(2, 132, 199, 0.3);
}

.reader-title-text {
  font-family: var(--font-heading);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.reader-header-actions .nav-btn {
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.reader-header-actions .nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

#reader-close-btn {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

#reader-close-btn:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
}

[data-theme="dark"] #reader-close-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.reader-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Reader Sidebar — Butter-Smooth Drawer & Fully Scrollable */
.reader-sidebar {
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  background: var(--reader-sidebar-bg);
  border-right: 1px solid var(--reader-sidebar-border);
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              min-width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 50;
}

.reader-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0;
  border-right: none;
  pointer-events: none;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--reader-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar-view-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  color: var(--primary);
}

.sidebar-toggle-btn.active {
  background: #0078d4;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 120, 212, 0.4);
}

.sidebar-search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: var(--font-main);
  outline: none;
  transition: var(--transition);
}

.sidebar-search-input:focus {
  border-color: #0078d4;
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

.sidebar-list {
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px 36px;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-overflow-scrolling: touch;
}

.sidebar-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

.sidebar-category-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  padding: 14px 8px 6px;
  margin-top: 4px;
}

.sidebar-category-header:first-child {
  padding-top: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--reader-item-text);
  cursor: pointer;
  margin-bottom: 2px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: var(--reader-item-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.sidebar-item.active {
  background: var(--reader-item-active);
  color: var(--reader-item-active-text);
  font-weight: 700;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
}

.sidebar-item-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  font-size: 0.84rem;
}

.sidebar-num-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-num-pill.master {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border-color: transparent;
  color: #ffffff;
}

.sidebar-item.active .sidebar-num-pill {
  background: #0078d4;
  border-color: #0078d4;
  color: #ffffff;
}

.sidebar-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover .sidebar-item-sub {
  color: var(--text-secondary);
}

.sidebar-item.active .sidebar-item-sub {
  color: var(--primary);
}

/* Reader Content Frame */
.reader-frame-container {
  flex: 1;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.reader-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   Roadmap Section — Modern Stepped Layout
   ========================================================================== */
.roadmap-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 72px 0;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
  counter-reset: roadmap-counter;
}

.roadmap-card {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  background: var(--bg-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  counter-increment: roadmap-counter;
}

/* Gradient top stripe */
.roadmap-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan), var(--accent-purple));
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.roadmap-card:hover::before {
  opacity: 1;
}

.roadmap-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 120, 212, 0.1);
}

.roadmap-step {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.roadmap-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.roadmap-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Footer — Premium Enterprise
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 52px 0 28px;
  font-size: 0.88rem;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0078d4 30%, #38bdf8 70%, transparent);
  opacity: 0.7;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.footer-bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1100px) {
  .hero-kpis-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .chapters-grid {
    grid-template-columns: 1fr;
  }

  .hero-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reader-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    width: 300px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .reader-title-text {
    max-width: 200px;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-btn span:not(#theme-icon) {
    display: none;
  }

  .hero {
    padding: 56px 0 44px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .progress-banner {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .progress-track {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero-kpis-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 36px;
  }

  .search-input {
    font-size: 0.9rem;
    padding: 14px 44px 14px 44px;
  }

  .kpi-value {
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ==========================================================================
   Focus & Accessibility
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection Color */
::selection {
  background: rgba(0, 120, 212, 0.25);
  color: inherit;
}
