/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* Header */
.header {
  background: linear-gradient(135deg, #141720 0%, #281a36 100%);
  color: white;
  padding: 20px;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 1.2em;
  margin-bottom: 5px;
}

.header p {
  font-size: 0.9em;
  opacity: 0.9;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  left: 0;
  top: 80px;
  bottom: 0;
  width: 280px;
  background-color: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
  padding: 20px;
  z-index: 900;
}

.sidebar h3 {
  color: #667eea;
  font-size: 1em;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar .part {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar .part:last-child {
  border-bottom: none;
}

.sidebar .part-number {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar .part-title {
  font-weight: bold;
  color: #764ba2;
  margin-bottom: 12px;
  font-size: 0.9em;
  line-height: 1.4;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 8px;
}

.sidebar a {
  text-decoration: none;
  color: #555;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  transition: all 0.3s;
  font-size: 0.85em;
  border: 1px solid transparent;
}

.sidebar a:hover {
  background-color: #f8f9fa;
  border-color: #e0e0e0;
  transform: translateX(3px);
}

.sidebar a.active {
  background-color: #667eea;
  color: white;
  font-weight: 600;
  border-color: #667eea;
}

.sidebar .chapter-badge {
  display: inline-block;
  background-color: #e0e0e0;
  color: #555;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  min-width: 45px;
  text-align: center;
  margin-right: 10px;
}

.sidebar a:hover .chapter-badge {
  background-color: #667eea;
  color: white;
}

.sidebar a.active .chapter-badge {
  background-color: white;
  color: #667eea;
}

.sidebar .chapter-text {
  flex: 1;
  line-height: 1.3;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  margin-top: 80px;
  padding: 40px;
  min-height: calc(100vh - 80px);
}

.content-wrapper {
  max-width: 900px;
  background-color: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Typography */
h1 {
  color: #667eea;
  font-size: 1.2em;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #667eea;
}

h2 {
  color: #764ba2;
  font-size: 1.0em;
  margin-top: 30px;
  margin-bottom: 15px;
}

h3 {
  color: #555;
  font-size: 0.9em;
  margin-top: 20px;
  margin-bottom: 10px;
}

p {
  margin-bottom: 15px;
  text-align: justify;
}

ul, ol {
  margin-left: 30px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 8px;
}

.chapter-number {
  display: inline-block;
  background-color: #667eea;
  color: white;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.9em;
  margin-right: 10px;
}

.highlight {
  background-color: #fff3cd;
  padding: 3px 6px;
  border-radius: 3px;
}

/* Right-Click Context Menu */
.context-menu {
  position: fixed;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 10px 0;
  min-width: 250px;
  z-index: 10000;
  display: none;
}

.context-menu.show {
  display: block;
}

.context-menu-header {
  padding: 10px 15px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: bold;
  color: #667eea;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.context-menu-part {
  border-bottom: 1px solid #f0f0f0;
}

.context-menu-part:last-child {
  border-bottom: none;
}

.context-menu-part-title {
  padding: 8px 15px;
  font-weight: bold;
  color: #764ba2;
  font-size: 0.9em;
  background-color: #f8f9fa;
}

.context-menu-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
  font-size: 0.9em;
  display: flex;
  align-items: center;
}

.context-menu-item:hover {
  background-color: #667eea;
  color: white;
}

.context-menu-item.active {
  background-color: #f0f0f0;
  color: #667eea;
  font-weight: 600;
}

.context-menu-item .chapter-badge {
  background-color: #667eea;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75em;
  margin-right: 10px;
  min-width: 60px;
  text-align: center;
}

.context-menu-item:hover .chapter-badge {
  background-color: white;
  color: #667eea;
}

/* Home Page Styles */
.home-hero {
  text-align: center;
  padding: 60px 20px;
}

.home-hero h1 {
  font-size: 3em;
  border: none;
  margin-bottom: 15px;
}

.home-hero p {
  font-size: 1.3em;
  color: #666;
  text-align: center;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.part-card {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.part-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.part-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.part-card h2 {
  color: #667eea;
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
  font-size: 1.4em;
}

.chapter-count {
  color: #999;
  font-size: 0.85em;
  margin-bottom: 20px;
  font-style: italic;
}

.part-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.part-card li {
  margin-bottom: 10px;
}

.part-card a {
  text-decoration: none;
  color: #555;
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.part-card a:hover {
  background-color: #f8f9fa;
  border-color: #667eea;
  transform: translateX(5px);
}

.chapter-number-badge {
  display: inline-block;
  background-color: #667eea;
  color: white;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
  margin-right: 12px;
}

.part-card a:hover .chapter-number-badge {
  background-color: #764ba2;
}

.chapter-title {
  flex: 1;
  font-weight: 500;
}

/* Navigation Buttons */
.page-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
}

.nav-button {
  padding: 12px 24px;
  background-color: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-button:hover {
  background-color: #764ba2;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.nav-button.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Toggle Sidebar Button */
.toggle-sidebar {
  position: fixed;
  left: 10px;
  top: 90px;
  background-color: #667eea;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1001;
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    left: -280px;
    transition: left 0.3s;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .toggle-sidebar {
    display: block;
  }

  .home-hero h1 {
    font-size: 2em;
  }

  .parts-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .context-menu,
  .page-navigation,
  .toggle-sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    margin-top: 0;
  }
}
.collapsible {
  cursor: pointer;
  user-select: none;
}

.collapsible-content {
  display: none; /* Ẩn mặc định */
  padding-left: 15px;
  margin-bottom: 10px;
  border-left: 3px solid #ccc;
}
