
/* Shiki dual theme support */
.shiki {
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  position: relative;
}

.shiki code {
  display: block;
}

/* Icon colors and positioning */
.text-brand-blue {
  color: #00C9FF; 
}

.text-red-500 {
  color: #ef4444; /* Red for unfixed findings */
}

.inline-flex {
  display: inline-flex;
}

.items-center {
  align-items: center;
}

.align-middle {
  vertical-align: middle;
}

.mr-2 {
  margin-right: 0.5rem;
}

/* Finding identifier badges */
.finding-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15em 0.7em;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9em;
  line-height: 1.5;
  color: white;
  margin-right: 0.75rem;
  white-space: nowrap;
}

.finding-badge-high {
  background-color: #ef4444; /* Red for HIGH severity */
}

.finding-badge-medium {
  background-color: #FF8C42; /* Amber for MEDIUM severity */
}

.finding-badge-low {
  background-color: #6D72F1; /* Blue for LOW severity */
}

.finding-badge-info {
  background-color: #9F9FA8; /* Gray for INFO severity */
}

/* Screen reader only - hide visually but keep accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Findings table styles */
.finding-summary-container {
  display: block;
  width: max-content;
  margin: 2rem auto;
}

.findings-table {
  display: table;
  width: auto;
  border-collapse: collapse;
  font-size: 1.2rem;
}

.findings-table caption {
  caption-side: bottom;
  margin-top: 1rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--foreground);
  text-align: center;
}

.findings-status-header {
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.findings-severity-header {
  padding: 1rem;
  text-align: center;
  border-bottom: 2px solid var(--border);
  font-size: 1.3rem;
}

.findings-status-cell {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.findings-count-cell {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.fixed-icon {
  height: 2rem;
  width: 2rem;
  color: #00C9FF;
}

.unfixed-icon {
  height: 2rem;
  width: 2rem;
  color: #ef4444;
}

/* Finding heading responsive layout */
.finding-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  overflow-wrap: break-word;
}

.finding-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.finding-status {
  margin-left: 1rem;
}

.finding-summary-heading {
  font-size: 1.10rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.finding-description {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Mobile screen adjustments */
@media (max-width: 640px) {
  .finding-heading {
    flex-wrap: wrap;
  }
  
  .finding-heading > span:first-child {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Navigation back to audits index */
.nav-back {
  margin-bottom: 2rem;
}

.nav-back a {
  color: #00C9FF;
  text-decoration: none;
  font-weight: 500;
}

.nav-back a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Inline code styling for headings */
h1 code.inline-code, h2 code.inline-code, h3 code.inline-code, h4 code.inline-code {
  font-family: monospace;
  padding: 0.1em 0.3em;
  border-radius: 0.25em;
  background: rgba(0,0,0,0.05);
  font-size: 0.9em;
  margin: 0 0.2em;
  vertical-align: middle;
  display: inline;
}

/* Inline code styles for all elements */
.inline-code {
  font-family: monospace;
  padding: 0.1em 0.3em;
  border-radius: 0.25em;
  background: rgba(0,0,0,0.05);
  font-size: 0.9em;
  vertical-align: middle;
  display: inline;
}

html.dark h1 code.inline-code, 
html.dark h2 code.inline-code, 
html.dark h3 code.inline-code, 
html.dark h4 code.inline-code,
html.dark .inline-code {
  background: rgba(255,255,255,0.1);
}

/* Light theme (default) */
html:not(.dark) .shiki,
.shiki {
  background-color: var(--shiki-light-bg, #ffffff) !important;
  color: var(--shiki-light, #24292e) !important;
}

/* Respect inline styles for syntax highlighting in light theme */
html:not(.dark) .shiki span,
.shiki span {
  /* Remove !important to let the inline styles take precedence */
  font-style: var(--shiki-light-font-style, normal);
  font-weight: var(--shiki-light-font-weight, normal);
  text-decoration: var(--shiki-light-text-decoration, none);
}

.shiki .line {
  display: inline-block;
  padding: 0 0.5rem;
  min-height: 1.5rem;
  line-height: 1.5rem;
}

.shiki .line:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Dark mode */
html.dark .shiki {
  background-color: var(--shiki-dark-bg, #0d1117) !important;
  color: var(--shiki-dark, #c9d1d9) !important;
}

/* Respect dark theme inline styles for syntax tokens */
html.dark .shiki span {
  /* Use --shiki-dark property from inline styles */
  color: var(--shiki-dark, inherit) !important;
  font-style: var(--shiki-dark-font-style, normal);
  font-weight: var(--shiki-dark-font-weight, normal);
  text-decoration: var(--shiki-dark-text-decoration, none);
}

html.dark .shiki .line:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Media query fallback for dark mode if CSS classes are not available */
@media (prefers-color-scheme: dark) {
  :root:not(.light) .shiki {
    background-color: var(--shiki-dark-bg, #0d1117) !important;
    color: var(--shiki-dark, #c9d1d9) !important;
  }
  
  :root:not(.light) .shiki span {
    color: var(--shiki-dark, inherit) !important;
    font-style: var(--shiki-dark-font-style, normal);
    font-weight: var(--shiki-dark-font-weight, normal);
    text-decoration: var(--shiki-dark-text-decoration, none);
  }
  
  :root:not(.light) .shiki .line:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }
}

/* Audit report specific styling */
.markdown-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.markdown-content h2 {
  font-size: 1.5rem;
  font-weight: 650;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

.markdown-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.markdown-content p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  text-align: justify;
}

.markdown-content a {
  color: #00C9FF;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

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

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

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

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

.markdown-content blockquote {
  padding-left: 1rem;
  border-left: 4px solid #00C9FF;
  font-style: italic;
  margin: 1.5rem 0;
}

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

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

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

.markdown-content table tr:nth-child(even) {
  background-color: var(--secondary-light);
}

/* Severity badges */
.severity-high {
  color: #ef4444;
}

.severity-medium {
  color: #f59e0b;
}

.severity-low {
  color: #3b82f6;
}

.severity-info {
  color: #6b7280;
}

/* Responsive styles for mobile */
@media (max-width: 640px) {
  .markdown-content h1 {
    font-size: 1.75rem;
  }
  
  .markdown-content h2 {
    font-size: 1.35rem;
  }
  
  .markdown-content h3 {
    font-size: 1.15rem;
  }
  
  .markdown-content table {
    font-size: 0.9rem;
  }
  
  .markdown-content table th,
  .markdown-content table td {
    padding: 0.5rem;
  }
  
  .shiki {
    font-size: 0.8rem;
    padding: 1rem;
  }
  
  .finding-badge {
    font-size: 0.8em;
  }
}

/* Print styles */
@media print {
  body {
    background-color: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  
  .shiki, 
  html.dark .shiki {
    background-color: #f8f8f8 !important;
    color: #000000 !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .shiki span,
  html.dark .shiki span {
    color: inherit !important;
    background-color: transparent !important;
  }
  
  a {
    color: #000000;
    text-decoration: underline;
  }
  
  .finding-badge {
    border: 1px solid #ccc;
    color: #000000;
    background-color: #ffffff;
  }
  
  .finding-summary-container,
  .nav-back,
  .finding-status,
  .findings-table caption {
    display: none; /* Hide non-essential elements for print */
  }
  
  h1, h2, h3, h4 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  pre, blockquote, table {
    page-break-inside: avoid;
  }
}
