/* Chapter Page Styles */

/* Progress Bar */
.progress-bar-container {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-secondary);
  z-index: 999;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  width: 0%;
  transition: width 0.3s ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

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

.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-section-header:hover {
  background: var(--bg-tertiary);
}

.nav-icon {
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
}

.nav-section-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.nav-arrow {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.nav-section.expanded .nav-arrow {
  transform: rotate(180deg);
}

.nav-chapters {
  display: none;
  padding-left: 1rem;
}

.nav-section.expanded .nav-chapters {
  display: block;
}

.nav-chapter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  border-left: 2px solid transparent;
}

.nav-chapter:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-chapter.active {
  background: var(--bg-tertiary);
  color: var(--neon-cyan);
  border-left-color: var(--neon-cyan);
}

.nav-chapter.completed {
  color: var(--neon-green);
}

.chapter-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 20px;
}

.chapter-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.chapter-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.check-icon {
  color: var(--neon-green);
  font-size: 0.875rem;
}

.sidebar-progress {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.progress-ring {
  position: relative;
  width: 50px;
  height: 50px;
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--neon-cyan);
}

/* Main Content */
.chapter-main {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.3s ease;
}

.sidebar-active .chapter-main {
  margin-left: 0;
}

.chapter {
  max-width: 900px;
  margin: 0 auto;
}

/* Chapter Header */
.chapter-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--neon-cyan);
}

.separator {
  color: var(--text-muted);
}

.current {
  color: var(--text-primary);
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chapter-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--neon-cyan);
  opacity: 0.3;
  line-height: 1;
}

.chapter-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.chapter-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.chapter-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.chapter-actions {
  display: flex;
  gap: 0.75rem;
}

.chapter-actions .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

/* Chapter Content */
.chapter-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.chapter-content .section {
  margin-bottom: 3rem;
}

.chapter-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.chapter-content h3 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.chapter-content p {
  margin-bottom: 1rem;
}

.chapter-content ul,
.chapter-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.chapter-content li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-box:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.feature-box .feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-box h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Comparison Table */
.comparison-table {
  margin: 2rem 0;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-table td {
  color: var(--text-secondary);
}

.comparison-table .check {
  color: var(--neon-green);
  font-weight: 500;
}

.comparison-table .cross {
  color: var(--text-muted);
}

/* Advantage List */
.advantage-list {
  margin: 2rem 0;
}

.advantage-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.advantage-item:hover {
  border-color: var(--neon-cyan);
}

.advantage-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  opacity: 0.5;
  line-height: 1;
}

.advantage-content h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.advantage-content p {
  margin: 0;
  font-size: 0.95rem;
}

/* Scenario Grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.scenario-card h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--neon-cyan);
}

.scenario-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.scenario-card li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

/* Steps */
.steps {
  margin: 2rem 0;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.step:hover {
  border-color: var(--neon-purple);
}

.step-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neon-purple);
  min-width: 50px;
}

.step-content h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.step-content p {
  margin: 0;
  font-size: 0.95rem;
}

/* Chapter Footer */
.chapter-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-prev,
.nav-next {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-prev:hover,
.nav-next:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.nav-prev {
  align-items: flex-start;
}

.nav-next {
  align-items: flex-end;
  text-align: right;
}

.nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.nav-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-next .nav-title {
  color: var(--neon-cyan);
}

/* Code Block Enhancements */
.chapter-content pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.chapter-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
  z-index: 1;
}

.chapter-content pre code {
  position: relative;
  z-index: 2;
  display: block;
  padding-top: 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--neon-cyan);
}

.chapter-content pre .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  font-family: 'Noto Sans SC', sans-serif;
}

.chapter-content pre .copy-btn:hover {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  border-color: var(--neon-cyan);
}

/* Note Box */
.note-box {
  background: rgba(6, 182, 212, 0.1);
  border-left: 3px solid var(--neon-cyan);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.note-box.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: var(--neon-orange);
}

.note-box.tip {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: var(--neon-green);
}

.note-box-title {
  font-weight: 600;
  color: var(--neon-cyan);
  margin-bottom: 0.5rem;
}

.note-box.warning .note-box-title {
  color: var(--neon-orange);
}

.note-box.tip .note-box-title {
  color: var(--neon-green);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .chapter-main {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .chapter-header h1 {
    font-size: 1.75rem;
  }
  
  .chapter-subtitle {
    font-size: 1rem;
  }
  
  .feature-grid,
  .scenario-grid {
    grid-template-columns: 1fr;
  }
  
  .chapter-nav {
    flex-direction: column;
  }
  
  .chapter-number {
    font-size: 2rem;
  }
}
