/* Custom styles for ProgMaster */

/* Prose styling for markdown content */
.prose {
  max-width: none;
}

.prose pre {
  margin: 1.5em 0;
  border-radius: 0.5rem;
  background-color: #1e1e1e;
}

.prose code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.875em;
}

.prose :not(pre) > code {
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-weight: 500;
}

.dark .prose :not(pre) > code {
  background-color: #374151;
}

/* Table styling */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.prose th,
.prose td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  text-align: left;
}

.dark .prose th,
.dark .prose td {
  border-color: #374151;
}

.prose th {
  background-color: #f9fafb;
  font-weight: 600;
}

.dark .prose th {
  background-color: #1f2937;
}

/* Heading anchors */
.prose h1 .header-anchor,
.prose h2 .header-anchor,
.prose h3 .header-anchor,
.prose h4 .header-anchor,
.prose h5 .header-anchor,
.prose h6 .header-anchor {
  opacity: 0;
  margin-left: 0.5rem;
  color: #6b7280;
  text-decoration: none;
  transition: opacity 0.2s;
}

.prose h1:hover .header-anchor,
.prose h2:hover .header-anchor,
.prose h3:hover .header-anchor,
.prose h4:hover .header-anchor,
.prose h5:hover .header-anchor,
.prose h6:hover .header-anchor {
  opacity: 1;
}

/* Syntax highlighting (highlight.js github-dark theme adjustments) */
.hljs {
  background: #0d1117 !important;
  color: #c9d1d9;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dark mode background adjustment */
.dark .bg-gray-750 {
  background-color: #1a2332;
}

/* Image zoom effect */
img.cursor-zoom-in {
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

img.max-w-none {
  cursor: zoom-out;
}

/* Smooth scroll for TOC navigation */
html {
  scroll-behavior: smooth;
}

/* Active TOC item */
nav a.active {
  color: #3b82f6;
  font-weight: 500;
}

/* File type badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

/* Loading spinner */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Transition utilities */
.transition-all {
  transition: all 0.2s ease;
}

/* Focus visible styling */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  nav,
  aside,
  footer,
  .no-print {
    display: none !important;
  }

  .prose {
    max-width: 100% !important;
  }

  body {
    background: white !important;
    color: black !important;
  }
}
