/* General styles */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  color: #333;
  line-height: 1.6;
}

/* Active navigation item */
.nav-item.active {
  background-color: #f0f9ff;
  border-left: 3px solid #3b82f6;
  color: #1e40af;
  font-weight: 500;
}

/* Markdown content styles */
.markdown-content h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #2563eb;
}

.markdown-content h4 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: #374151;
}

.markdown-content h5 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #4b5563;
}

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

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

.markdown-content ul {
  list-style-type: disc;
}

.markdown-content ol {
  list-style-type: decimal;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

.markdown-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  font-style: italic;
  margin: 1rem 0;
  color: #4b5563;
}

.markdown-content code {
  font-family: monospace;
  background-color: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.markdown-content pre {
  background-color: #f1f5f9;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  display: block;
}

.markdown-content table thead {
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.markdown-content table th,
.markdown-content table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #e2e8f0;
}

.markdown-content table tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Practice problems styling */
.problem-step {
  margin-bottom: 1.5rem;
}

.practice-part {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Print styles */
@media print {
  header, 
  #sidebar, 
  #menuBtn, 
  #closeMenu, 
  #printBtn, 
  .print-section-btn,
  footer {
    display: none !important;
  }
  
  body, main {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .content-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
  
  h2 {
    break-after: avoid;
    page-break-after: avoid;
  }
  
  .hidden-print {
    display: none !important;
  }
}

/* Custom component styles */
.formula {
  background-color: #f8f9fa;
  padding: 1rem;
  border-left: 4px solid #3b82f6;
  margin: 1rem 0;
  border-radius: 0.25rem;
}

.intext-formula {
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: monospace;
  white-space: nowrap;
}

.definition-box {
  background-color: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
}

.definition-box h4 {
  color: #1e40af;
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.key-takeaway {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
}

.key-takeaway h4 {
  color: #064e3b;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Collapsible sections */
.collapsible-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.collapsible-header:hover {
  background-color: #f1f5f9;
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0 1rem;
}

.collapsible-content.open {
  max-height: 2000px;
  padding: 1rem;
}
