/* Markdown Content Styling */
.markdown-content h1 {
  font-size: 1.15rem; /* text-xl */
  font-weight: 700;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  color: #111827;
}

.markdown-content h2 {
  font-size: 1rem; /* text-lg */
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
  color: #111827;
}

.markdown-content h3 {
  font-size: 0.95rem; /* text-base */
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #111827;
}

.markdown-content h4 {
  font-size: 0.9rem; /* text-sm */
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #111827;
}

.markdown-content h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #111827;
}

.markdown-content h6 {
  font-size: 0.8rem; /* text-sm */
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  color: #111827;
}

/* Remove top margin from first heading */
.markdown-content > :first-child {
  margin-top: 0;
}

.markdown-content p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.markdown-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-content li {
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

.markdown-content strong,
.markdown-content b {
  font-weight: 600;
}

.markdown-content em,
.markdown-content i {
  font-style: italic;
}

.markdown-content code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: monospace;
}

.markdown-content pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
}

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

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

.markdown-content a {
  color: #2563eb;
  text-decoration: underline;
}

.markdown-content a:hover {
  color: #1d4ed8;
}

.markdown-content hr {
  border: 0;
  height: 1px;
  background-color: #e5e7eb;
  margin: 1.5rem 0;
}

/* Remove bottom margin from last element */
.markdown-content > :last-child {
  margin-bottom: 0;
}

/* Table Styling - Flexible for any number of columns */
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  table-layout: auto; /* Let table adapt to content */
}

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

.markdown-content table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  white-space: normal; /* Allow text wrapping */
}

.markdown-content table td {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  color: #374151;
  vertical-align: top;
  word-wrap: break-word;
  white-space: normal; /* Allow text wrapping */
}

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

.markdown-content table tbody tr:hover {
  background-color: #f3f4f6;
}

/* Responsive table wrapper */
.markdown-content > table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

/* Ensure minimum width for readability */
.markdown-content table th,
.markdown-content table td {
  min-width: 100px; /* Minimum width for any column */
}

/* For very long content, set a max-width */
.markdown-content table th,
.markdown-content table td {
  max-width: 500px; /* Prevent extremely wide columns */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .markdown-content table {
    font-size: 0.75rem;
  }

  .markdown-content table th,
  .markdown-content table td {
    padding: 0.5rem;
    min-width: 80px;
  }
}
