/* Main stylesheet for Logcat.ai Blog */

/* Base styles */
:root {
  /* Brand colors matching landing page */
  --color-black: #232526;
  --color-white: #ededed;
  --color-secondary: #1d9a56;
  --color-fatal: rgba(248, 113, 113, 0.8);
  --color-error: rgba(251, 146, 60, 0.8);
  --color-warning: rgba(252, 211, 77, 0.8);
  --color-info: rgba(147, 197, 253, 0.8);
  --color-card-bg: oklch(0.13 0.028 261.692);
  --color-card-bg-light: rgb(17 24 39 / var(--tw-bg-opacity, 1));
  
  /* Logcat.ai brand colors */
  --cursor-dark: #0A0A0A;
  --cursor-purple: #6E56CF;
  --cursor-green: #2ECF71;
  --cursor-blue: #249EE8;
  
  /* Updated primary colors for dark theme */
  --primary-50: #1a4d32;
  --primary-100: #2d6b47;
  --primary-200: #3a8c5f;
  --primary-300: #4ba66f;
  --primary-400: #2ECF71;
  --primary-500: #1d9a56;
  --primary-600: #165d42;
  --primary-700: #134e37;
  --primary-800: #0f3e2c;
  --primary-900: #0b2d20;
}

/* Typography improvements */
.prose h1 {
  font-size: 2.25em;      /* 36px */
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h2 {
  font-size: 1.875em;     /* 30px - clearly larger than h3 */
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: 1.5em;       /* 24px - clearly smaller than h2 */
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose pre {
  background-color: #1a1a1a;
  color: #f8f8f2;
  overflow-x: auto;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(46, 207, 113, 0.3);
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: 0.9em;
  line-height: 1.6;
}

/* Code block with copy button container */
.code-block-container {
  position: relative;
  margin: 1.5rem 0;
}

.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(46, 207, 113, 0.1);
  border: 1px solid rgba(46, 207, 113, 0.3);
  color: var(--cursor-green);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.copy-button:hover {
  background: var(--cursor-green);
  color: black;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(46, 207, 113, 0.2);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button.copied {
  background: var(--cursor-green);
  color: black;
}

.copy-button.copied:after {
  content: "✓ Copied!";
}

/* Ensure no line numbers or strange formatting */
.prose .highlight .lineno,
.prose pre .lineno,
.prose .line-numbers {
  display: none !important;
}

/* Clean code block structure */
.prose pre {
  position: relative;
}

.prose pre code {
  display: block;
  white-space: pre;
}

.prose code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875em;
}

/* Inline code styling */
.prose :not(pre) > code {
  background-color: var(--color-card-bg-light) !important;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  color: var(--cursor-green) !important;
  font-weight: 500;
  border: 1px solid rgba(46, 207, 113, 0.3);
  font-size: 0.9em;
}

/* Force dark theme for systems that don't respect class-based dark mode */
@media (prefers-color-scheme: light) {
  .prose :not(pre) > code {
    background-color: rgb(17, 24, 39) !important;
    color: #2ECF71 !important;
  }
}

/* Ensure inline code doesn't get copy buttons */
.prose p code, .prose li code {
  position: static;
}

/* Better spacing for prose elements */
.prose > * + * {
  margin-top: 1.25rem;
}

.prose h2 + *, .prose h3 + *, .prose h4 + * {
  margin-top: 0.75rem;
}

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

.prose th {
  background-color: var(--color-card-bg);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  border: 1px solid rgba(46, 207, 113, 0.3);
  color: var(--color-white);
}

.prose td {
  padding: 0.75rem;
  border: 1px solid rgba(46, 207, 113, 0.2);
  color: var(--color-white);
}

/* Blockquote styling */
.prose blockquote {
  border-left: 4px solid var(--cursor-green);
  padding-left: 1rem;
  font-style: italic;
  color: #9ca3af;
  margin: 1.5rem 0;
  background-color: rgba(46, 207, 113, 0.1);
  padding: 1rem;
  border-radius: 0.25rem;
}

/* Image styling */
.prose img {
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  margin: 2rem auto;
  max-width: 100%;
  height: auto;
}

/* Video styling - tighter margins than images */
.prose video {
  margin: 0.5rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Even tighter spacing between stacked videos */
.prose video + video {
  margin-top: 0.25rem;
}

/* Post meta styling */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.post-meta svg {
  width: 1rem;
  height: 1rem;
}

/* Tag and category pills */
.tag-pill, .category-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.category-pill {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.category-pill:hover {
  background-color: var(--primary-200);
}

.tag-pill {
  background-color: #f1f5f9;
  color: #475569;
}

.tag-pill:hover {
  background-color: #e2e8f0;
}

/* Card hover effects */
.post-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Newsletter form */
.newsletter-form input[type="email"] {
  min-width: 250px;
}

.newsletter-form button {
  white-space: nowrap;
}

/* Mobile menu animation */
#mobile-menu {
  transition: max-height 0.3s ease-out;
  max-height: 0;
  overflow: hidden;
}

#mobile-menu:not(.hidden) {
  max-height: 500px;
}

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

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-600);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Print styles */
@media print {
  .no-print {
    display: none;
  }
  
  .prose {
    max-width: 100%;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,0,0,.1);
  border-radius: 50%;
  border-top-color: var(--primary-600);
  animation: spin 1s ease-in-out infinite;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(46, 207, 113, 0.3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 207, 113, 0.5);
}

/* Add modern animations matching landing page */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  animation: gradientShift 5s ease infinite;
}

/* Modern card styling */
.blog-card {
  background: var(--color-card-bg);
  border: 1px solid rgba(46, 207, 113, 0.2);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--cursor-green);
  box-shadow: 0 10px 25px -3px rgba(46, 207, 113, 0.1);
}

/* Update prose styling for dark theme */
.prose {
  color: var(--color-white);
  max-width: none;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--color-white);
}

.prose p {
  color: #d1d5db;
}

.prose a {
  color: var(--cursor-green);
  text-decoration: underline;
  transition: color 0.2s;
}

.prose a:hover {
  color: var(--cursor-blue);
}

/* Fix list styling and indentation */
.prose ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.prose ol {
  list-style-type: decimal;
  margin-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--cursor-green);
}

.prose li p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}