/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: #212529;
  background: #ffffff;
  line-height: 1.6;
}

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #DEE2E6;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.sidebar-logo {
  padding: 12px 16px;
  background: #F8F9FA;
  border-bottom: 1px solid #DEE2E6;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 80px;
  width: 100%;
  padding: 12px 16px;
  text-decoration: none;
  color: #212529;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.nav-item:hover {
  background: #F8F9FA;
}

.nav-item.active {
  background: #F8F9FA;
}

.nav-active-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
}

.nav-item.active .nav-active-bar {
  background: #0D6EFD;
}

.nav-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-text {
  font-size: 0.9rem;
  line-height: 1.3;
  color: #212529;
}

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

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

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

.hero-tag {
  display: inline-block;
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

.hero h1 {
  color: #ffffff !important;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: #ffffff;
  color: #0D6EFD;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 28px;
  border-radius: 6px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary:hover {
  background: #f0f0f0;
  transform: scale(1.02);
}

.btn-secondary {
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 28px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.7);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2.5rem; font-weight: 700; color: #0D6EFD; }
h2 { font-size: 2rem; font-weight: 700; color: #0D6EFD; margin: 2rem 0 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; color: #0D6EFD; margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1.25rem; font-weight: 600; color: #0D6EFD; margin: 1.25rem 0 0.5rem; }

p { margin-bottom: 1.5rem; color: #212529; line-height: 1.6; }

/* ===== PAGE TITLE ===== */
.page-title-area {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #DEE2E6;
}

.page-title-area h1 {
  color: #0D6EFD;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-title-area .subtitle {
  color: #6C757D;
  font-size: 0.875rem;
}

/* ===== CARDS ===== */
.card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #DEE2E6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ===== CHAPTER CARD GRID ===== */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: #F4F7F6;
  padding: 24px;
  border-radius: 8px;
  margin: 2rem 0;
}

.chapter-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #DEE2E6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.075);
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  text-decoration: none;
  color: #333333;
  transition: box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
}

.chapter-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.chapter-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter-card-text {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  color: #333333;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chapter-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #0D6EFD;
  color: #ffffff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #DEE2E6;
  font-size: 0.9rem;
}

thead th {
  background: #F8F9FA;
  color: #212529;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 12px 16px;
  border-bottom: 1px solid #DEE2E6;
  text-align: left;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #DEE2E6;
  min-height: 40px;
  color: #212529;
}

tbody tr:nth-child(even) { background: #F8F9FA; }

/* ===== IMAGES ===== */
.figure-container {
  margin: 1.5rem 0;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  overflow: hidden;
  background: #E7F1FF;
  padding: 16px;
}

.figure-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

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

/* ===== LISTS ===== */
ul.bullet-list, ol.number-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

ul.bullet-list li, ol.number-list li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: #212529;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  border: none;
  border-top: 1px solid #DEE2E6;
  margin: 2rem 0;
}

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
  background: #E7F1FF;
  border-left: 4px solid #0D6EFD;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

.highlight-box p { margin-bottom: 0; }

/* ===== WARNING BOX ===== */
.warning-box {
  background: #FFF3CD;
  border-left: 4px solid #FFC107;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

/* ===== LINKS ===== */
a { color: #0D6EFD; text-decoration: none; }
a:hover { text-decoration: underline; color: #0a58ca; }

/* ===== SCROLLBAR ===== */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #DEE2E6; border-radius: 2px; }
