/* ===== GLOBAL RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f9fa;
  color: #212529;
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.sidebar-logo img {
  max-width: 180px;
  height: auto;
  display: block;
}

.sidebar-logo a {
  display: block;
  margin-top: 8px;
  color: #0D6EFD;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-logo a:hover { text-decoration: underline; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  height: 80px;
  padding: 0 20px;
  text-decoration: none;
  color: #212529;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  gap: 12px;
  line-height: 1.3;
}

.nav-item:hover {
  background: #f0f4ff;
  color: #0D6EFD;
  border-left-color: #0D6EFD;
}

.nav-item.active {
  background: #e8f0fe;
  color: #0D6EFD;
  border-left-color: #0D6EFD;
  font-weight: 600;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #0D6EFD;
}

.nav-item span { flex: 1; }

/* ===== MAIN CONTENT AREA ===== */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  background: #ffffff;
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #0D6EFD 0%, #0a58ca 50%, #084298 100%);
  border-radius: 16px;
  padding: 48px 40px;
  color: white;
  margin-bottom: 48px;
  max-width: 1000px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 700px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

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

.hero-stat .number {
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
}

.hero-stat .label {
  font-size: 0.78rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== CHAPTER NAVIGATION CARDS ===== */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.chapter-card {
  background: #0D6EFD;
  border-radius: 12px;
  padding: 20px 16px;
  color: white;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 130px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13,110,253,0.35);
}

.chapter-card svg {
  width: 28px;
  height: 28px;
  color: white;
  opacity: 0.9;
}

.chapter-card .card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.chapter-card .card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #198754;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ===== SECTION HEADINGS ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0D6EFD;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

.section-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 28px 0 12px;
}

.subsection-title {
  font-size: 1rem;
  font-weight: 600;
  color: #343a40;
  margin: 20px 0 8px;
}

/* ===== PARAGRAPHS ===== */
p {
  margin-bottom: 16px;
  color: #343a40;
  line-height: 1.75;
}

/* ===== FIGURES ===== */
.figure-container {
  margin: 28px 0;
  text-align: center;
}

.figure-container img {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
}

.figure-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6c757d;
  font-style: italic;
  text-align: center;
}

/* ===== TABLES ===== */
.table-container {
  margin: 24px 0;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead tr {
  background: #0D6EFD;
  color: white;
}

thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #f8f9fa; }
tbody tr:hover { background: #e8f0fe; }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
  line-height: 1.5;
}

/* ===== LISTS ===== */
ul.content-list, ol.content-list {
  padding-left: 24px;
  margin-bottom: 16px;
}

ul.content-list li, ol.content-list li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: #343a40;
}

/* ===== INFO CARDS ===== */
.info-card {
  background: #f0f4ff;
  border-left: 4px solid #0D6EFD;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.info-card h4 {
  color: #0D6EFD;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.warning-card {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.page-header .chapter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0D6EFD;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
  margin-bottom: 12px;
}

.page-header .lead {
  font-size: 1.05rem;
  color: #6c757d;
  line-height: 1.7;
}

/* ===== FOOTER ===== */
.page-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-footer a {
  color: #0D6EFD;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}

.page-footer a:hover { text-decoration: underline; }

.page-footer .footer-nav {
  display: flex;
  gap: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-280px); }
  .main-content { margin-left: 0; }
  .content-wrapper { padding: 24px 20px 60px; }
  .chapter-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.4rem; }
}

/* ===== UTILITY ===== */
.text-blue { color: #0D6EFD; }
.text-muted { color: #6c757d; }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: 24px; }
.badge-green {
  display: inline-block;
  background: #198754;
  color: white;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue {
  display: inline-block;
  background: #0D6EFD;
  color: white;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-orange {
  display: inline-block;
  background: #fd7e14;
  color: white;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
