/* Enhanced markdown styling for professional reports */

/* Import highlight.js theme for code syntax highlighting */
@import "highlight.js/styles/github.css";

/* Dark mode code highlighting */
@media (prefers-color-scheme: dark) {
  @import "highlight.js/styles/github-dark.css";
}

/* Professional markdown content styling */
.markdown-content {
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1;
  line-height: 1.625;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enhanced code block styling */
.markdown-content pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.markdown-content pre code {
  background: none !important;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* Professional table styling */
.markdown-content table {
  margin: 1.5rem 0;
  width: 100%;
  border-collapse: collapse;
  box-shadow:
    0 1px 3px 0 rgb(0 0 0 / 0.1),
    0 1px 2px -1px rgb(0 0 0 / 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

.markdown-content th {
  background: hsl(var(--muted));
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  border-right: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.markdown-content th:last-child {
  border-right: none;
}

.markdown-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  border-right: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.markdown-content td:last-child {
  border-right: none;
}

.markdown-content tbody tr:last-child td {
  border-bottom: none;
}

.markdown-content tbody tr:hover {
  background: hsl(var(--muted) / 0.5);
}

/* Enhanced list styling */
.markdown-content ul,
.markdown-content ol {
  margin: 1rem 0;
  padding-left: 1.75rem;
}

.markdown-content li {
  margin: 0.375rem 0;
  line-height: 1.625;
}

.markdown-content li > p {
  margin: 0.5rem 0;
}

.markdown-content li > p:first-child {
  margin-top: 0;
}

.markdown-content li > p:last-child {
  margin-bottom: 0;
}

/* Professional blockquotes */
.markdown-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid hsl(var(--primary));
  background: hsl(var(--muted) / 0.5);
  border-radius: 0 0.375rem 0.375rem 0;
  font-style: italic;
  color: hsl(var(--muted-foreground));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.markdown-content blockquote p:first-child {
  margin-top: 0;
}

.markdown-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Better heading spacing and typography */
.markdown-content h1 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid hsl(var(--border));
  padding-bottom: 0.5rem;
}

.markdown-content h1:first-child {
  margin-top: 0;
}

.markdown-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.markdown-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-content h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Enhanced inline code styling */
.markdown-content :not(pre) > code {
  background: hsl(var(--muted)) !important;
  color: hsl(var(--foreground)) !important;
  padding: 0.125rem 0.375rem !important;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
}

/* Professional link styling */
.markdown-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: all 0.2s ease-in-out;
}

.markdown-content a:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration-thickness: 2px;
}

/* Better paragraph spacing */
.markdown-content p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.markdown-content p:first-child {
  margin-top: 0;
}

.markdown-content p:last-child {
  margin-bottom: 0;
}

/* Enhanced strong/emphasis styling */
.markdown-content strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.markdown-content em {
  font-style: italic;
  color: hsl(var(--foreground));
}

/* Horizontal rule styling */
.markdown-content hr {
  margin: 2rem 0;
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, hsl(var(--border)), transparent);
}

/* Badge-like styling for certain elements */
.markdown-content kbd {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .markdown-content {
    font-size: 0.9rem;
  }

  .markdown-content h1 {
    font-size: 1.75rem;
  }

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

  .markdown-content h3 {
    font-size: 1.25rem;
  }

  .markdown-content table {
    font-size: 0.875rem;
  }

  .markdown-content th,
  .markdown-content td {
    padding: 0.5rem;
  }
}
