/* /assets/css/learn.css - ไฟล์ CSS สำหรับหน้า learn.html */

/* Learn Page Specific Styles */
.learn-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .learn-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    order: 2;
  }
  
  .main-content {
    order: 1;
  }
}

/* Sidebar Styles */
.sidebar {
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

[data-theme="dark"] .sidebar {
  background-color: #34495e;
}

.sidebar h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

[data-theme="dark"] .sidebar h3 {
  color: var(--text-light);
}

.toc-list {
  list-style: none;
}

.chapter-item {
  margin-bottom: 1rem;
}

.chapter-title {
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="dark"] .chapter-title {
  color: var(--text-light);
}

.chapter-title:hover {
  color: var(--secondary-color);
}

.section-list {
  list-style: none;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

.section-item {
  margin: 0.5rem 0;
}

.section-link {
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  display: block;
  transition: all 0.3s;
}

[data-theme="dark"] .section-link {
  color: var(--text-light);
}

.section-link:hover {
  background-color: var(--secondary-color);
  color: white;
}

.section-link.active {
  background-color: var(--secondary-color);
  color: white;
  font-weight: 600;
}

/* Main Content Styles */
.main-content {
  background-color: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

[data-theme="dark"] .main-content {
  background-color: #34495e;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

.section-title {
  font-size: 2rem;
  color: var(--primary-color);
}

[data-theme="dark"] .section-title {
  color: var(--text-light);
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.copy-link-btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.copy-link-btn:hover {
  background-color: #2980b9;
}

/* Section Content Styles */
.section-content {
  margin-bottom: 2rem;
}

.section-text {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Tag Styles */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-definition {
  background-color: #e3f2fd;
  color: #1976d2;
}

.tag-duty {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.tag-power {
  background-color: #fff3e0;
  color: #ef6c00;
}

.tag-process {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.tag-penalty {
  background-color: #ffebee;
  color: #c62828;
}

[data-theme="dark"] .tag-definition {
  background-color: #1a237e;
  color: #bbdefb;
}

[data-theme="dark"] .tag-duty {
  background-color: #1b5e20;
  color: #c8e6c9;
}

[data-theme="dark"] .tag-power {
  background-color: #bf360c;
  color: #ffcc80;
}

[data-theme="dark"] .tag-process {
  background-color: #4a148c;
  color: #e1bee7;
}

[data-theme="dark"] .tag-penalty {
  background-color: #b71c1c;
  color: #ffcdd2;
}

/* Cross Reference Styles */
.cross-ref-container {
  background-color: #f8f9fa;
  border-left: 4px solid var(--secondary-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 5px 5px 0;
}

[data-theme="dark"] .cross-ref-container {
  background-color: #2c3e50;
}

.cross-ref-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.cross-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cross-ref-link {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.cross-ref-link:hover {
  background-color: #2980b9;
}

/* Related Sections */
.related-sections {
  background-color: #e3f2fd;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 2rem 0;
}

[data-theme="dark"] .related-sections {
  background-color: #1a237e;
}

.related-sections h4 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.related-sections .section-link {
  display: inline-block;
  margin: 0.3rem 0.5rem;
  padding: 0.3rem 0.8rem;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9rem;
}

.related-sections .section-link:hover {
  background-color: #2980b9;
}

/* Key Takeaways */
.key-takeaways {
  background-color: #fff8e1;
  border-left: 4px solid #ffb300;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 5px 5px 0;
}

[data-theme="dark"] .key-takeaways {
  background-color: #3e2723;
}

.key-takeaways h4 {
  color: #ffb300;
  margin-bottom: 1rem;
}

.key-takeaways ul {
  padding-left: 1.5rem;
}

.key-takeaways li {
  margin-bottom: 0.5rem;
}

/* Print Button */
.print-btn {
  background-color: #78909c;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
  margin-top: 1rem;
}

.print-btn:hover {
  background-color: #546e7a;
}

/* Scroll Spy Active State */
.sidebar .section-link.active {
  background-color: var(--secondary-color);
  color: white;
  font-weight: 600;
}

/* Section Number */
.section-number {
  font-weight: 700;
  color: var(--secondary-color);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .learn-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    height: auto;
    position: static;
    margin-bottom: 2rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .section-actions {
    width: 100%;
    justify-content: space-between;
  }
}