/* ============================================
   BOOK STYLES - EXTENDING BLOG DESIGN
   ============================================ */

/* Book Container Layout */
.book-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 0;
  min-height: calc(100vh - 60px);
}

/* ============================================
   LEFT SIDEBAR - BOOK NAVIGATION
   ============================================ */

.book-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 30px 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.book-sidebar::-webkit-scrollbar {
  width: 6px;
}

.book-sidebar::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

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

.book-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent1);
}

.book-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.book-brand i {
  color: var(--accent1);
  font-size: 1.5rem;
}

/* Progress Section */
.progress-section {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 25px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.progress-percentage {
  color: var(--accent1);
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: rgba(235, 111, 146, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Book Navigation */
.book-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section {
  margin-bottom: 5px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  background: var(--bg-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.section-header:hover {
  background: rgba(235, 111, 146, 0.1);
  border-color: var(--accent1);
}

.section-icon {
  font-size: 8px;
  color: var(--accent1);
}

.section-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-icon {
  font-size: 0.75rem;
  color: var(--text-gray);
  transition: transform 0.3s;
}

.nav-section.active .toggle-icon {
  transform: rotate(180deg);
}

.section-items {
  list-style: none;
  padding-left: 28px;
  margin-top: 8px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-section.active .section-items {
  max-height: 1000px;
}

.section-items li {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text-gray);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  margin-bottom: 3px;
}

.section-items li:hover {
  color: var(--text-light);
  background: rgba(235, 111, 146, 0.05);
  border-left-color: var(--accent1);
  transform: translateX(3px);
}

.section-items li.active {
  color: var(--accent1);
  background: rgba(235, 111, 146, 0.1);
  border-left-color: var(--accent1);
  font-weight: 600;
}

.section-items li.completed {
  color: var(--accent2);
}

.section-items li.completed::before {
  content: "✓ ";
  color: var(--accent2);
  font-weight: bold;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.book-content {
  background: var(--bg-dark);
  padding: 60px 80px;
  overflow-y: auto;
}

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

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

.chapter-label {
  display: inline-block;
  background: rgba(235, 111, 146, 0.1);
  color: var(--accent1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.chapter-header h1 {
  font-size: 2.8rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.2;
}

.chapter-meta {
  display: flex;
  gap: 25px;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.chapter-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-meta i {
  color: var(--accent2);
}

/* Chapter Intro */
.chapter-intro {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent1);
  padding: 25px 30px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 40px;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-light);
  margin: 0;
}

/* Content Sections */
.content-section {
  color: var(--text-light);
}

.content-section h2 {
  font-size: 1.8rem;
  color: var(--text-light);
  margin-top: 50px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.content-section h3 {
  font-size: 1.4rem;
  color: var(--text-light);
  margin-top: 30px;
  margin-bottom: 15px;
}

.content-section h4 {
  font-size: 1.1rem;
  color: var(--accent2);
  margin-top: 20px;
  margin-bottom: 10px;
}

.content-section p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-gray);
  margin-bottom: 20px;
}

.content-section ul,
.content-section ol {
  margin-left: 25px;
  margin-bottom: 20px;
  color: var(--text-gray);
}

.content-section li {
  margin-bottom: 10px;
  line-height: 1.7;
}

/* Key Point Box */
.key-point {
  display: flex;
  gap: 15px;
  background: rgba(156, 207, 216, 0.1);
  border: 1px solid rgba(156, 207, 216, 0.3);
  border-left: 4px solid var(--accent2);
  padding: 20px;
  border-radius: 8px;
  margin: 30px 0;
}

.key-point i {
  color: var(--accent2);
  font-size: 1.5rem;
  margin-top: 3px;
}

.key-point strong {
  color: var(--accent2);
}

/* Pillar Grid */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s;
}

.pillar-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent1);
  box-shadow: 0 10px 30px rgba(235, 111, 146, 0.2);
}

.pillar-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.pillar-icon i {
  font-size: 1.8rem;
  color: var(--accent1);
}

.pillar-card h3 {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 0.95rem;
  color: var(--text-gray);
  line-height: 1.6;
  margin: 0;
}

/* Workflow Steps */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.workflow-step {
  display: flex;
  gap: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.3s;
}

.workflow-step:hover {
  border-color: var(--accent1);
  transform: translateX(5px);
}

.step-number {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: var(--bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h4 {
  color: var(--text-light);
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.step-content p {
  color: var(--text-gray);
  margin: 0;
  font-size: 0.95rem;
}

/* Quote Block */
.chapter-quote {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent3);
  padding: 25px 30px;
  margin: 40px 0;
  border-radius: 0 10px 10px 0;
  position: relative;
}

.chapter-quote i {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 2rem;
  color: var(--accent3);
  opacity: 0.3;
}

.chapter-quote p {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-light);
  margin: 0 0 15px 0;
  padding-left: 30px;
}

.chapter-quote cite {
  display: block;
  color: var(--text-gray);
  font-size: 0.9rem;
  text-align: right;
  font-style: normal;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.skill-category {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 25px;
}

.skill-category h4 {
  color: var(--text-light);
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-category i {
  color: var(--accent1);
}

.skill-category ul {
  margin: 0;
  padding-left: 20px;
}

.skill-category li {
  color: var(--text-gray);
  margin-bottom: 8px;
}

/* Chapter Navigation */
.chapter-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--border-color);
}

.nav-button {
  flex: 1;
  max-width: 200px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
}

.nav-button:hover:not(:disabled) {
  background: var(--accent1);
  border-color: var(--accent1);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-button.prev {
  justify-content: flex-start;
}

.nav-button.next {
  justify-content: flex-end;
  margin-left: auto;
}

/* ============================================
   RIGHT SIDEBAR - TABLE OF CONTENTS
   ============================================ */

.book-right-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  padding: 30px 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.book-right-panel::-webkit-scrollbar {
  width: 6px;
}

.book-right-panel::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.book-right-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.panel-block {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

.panel-block:last-child {
  border-bottom: none;
}

.panel-block h4 {
  font-size: 0.85rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
}

/* Page TOC */
.page-toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-toc li {
  margin-bottom: 10px;
}

.page-toc a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: block;
  padding: 5px 10px;
  border-radius: 5px;
  border-left: 2px solid transparent;
}

.page-toc a:hover,
.page-toc a.active {
  color: var(--accent1);
  background: rgba(235, 111, 146, 0.1);
  border-left-color: var(--accent1);
  transform: translateX(3px);
}

/* Chapter Info */
.chapter-info {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.chapter-info i {
  color: var(--accent2);
  width: 16px;
}

/* Resources */
.resources .resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.resources .resource-link:hover {
  background: rgba(235, 111, 146, 0.1);
  border-color: var(--accent1);
  color: var(--accent1);
  transform: translateX(3px);
}

.resources .resource-link i {
  color: var(--accent1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
  .book-container {
    grid-template-columns: 260px 1fr 260px;
  }

  .book-content {
    padding: 50px 60px;
  }
}

@media (max-width: 1200px) {
  .book-container {
    grid-template-columns: 240px 1fr;
  }

  .book-right-panel {
    display: none;
  }

  .book-content {
    padding: 40px 50px;
  }
}

@media (max-width: 900px) {
  .book-container {
    grid-template-columns: 1fr;
  }

  .book-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .book-content {
    padding: 40px 30px;
  }

  .chapter-header h1 {
    font-size: 2.2rem;
  }

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

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

@media (max-width: 600px) {
  .book-content {
    padding: 30px 20px;
  }

  .chapter-header h1 {
    font-size: 1.8rem;
  }

  .chapter-navigation {
    flex-direction: column;
  }

  .nav-button {
    max-width: none;
  }

  .book-brand {
    font-size: 1rem;
  }

  .content-section h2 {
    font-size: 1.5rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chapter-content {
  animation: fadeInUp 0.6s ease-out;
}
