* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
}

.header-gradient {
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b, #10b981, #8b5cf6);
  background-size: 200% 100%;
  animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.line-numbers {
  padding: 1rem 0;
  text-align: right;
  user-select: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5rem;
  min-width: 3rem;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.line-number {
  padding-right: 0.75rem;
  height: 1.5rem;
}

textarea {
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5rem;
}

.prose-container {
  transition: background-color 0.3s ease;
}

.pulse-update {
  animation: pulse 0.3s ease-out;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Prose styling for dark mode */
.prose-dark {
  color: #e5e7eb;
}

.prose-dark h1, .prose-dark h2, .prose-dark h3, .prose-dark h4 {
  color: #f9fafb;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose-dark h1 { font-size: 2rem; }
.prose-dark h2 { font-size: 1.5rem; }
.prose-dark h3 { font-size: 1.25rem; }

.prose-dark p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.prose-dark strong {
  color: #f9fafb;
  font-weight: 700;
}

.prose-dark a {
  color: #a78bfa;
  text-decoration: underline;
}

.prose-dark blockquote {
  border-left: 4px solid #8b5cf6;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #9ca3af;
  font-style: italic;
}

.prose-dark code {
  background: #374151;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  color: #f472b6;
}

.prose-dark pre {
  background: #1f2937;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.prose-dark pre code {
  background: transparent;
  padding: 0;
  color: #e5e7eb;
}

.prose-dark ul, .prose-dark ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prose-dark li {
  margin: 0.5rem 0;
}

.prose-dark table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.prose-dark th {
  background: #374151;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid #4b5563;
  color: #f9fafb;
}

.prose-dark td {
  padding: 0.75rem;
  border: 1px solid #4b5563;
}

.prose-dark tr:nth-child(even) {
  background: #1f2937;
}

.prose-dark hr {
  border: 0;
  height: 1px;
  background: #4b5563;
  margin: 2rem 0;
}

.prose-dark input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Prose styling for light mode */
.prose-light {
  color: #374151;
}

.prose-light h1, .prose-light h2, .prose-light h3, .prose-light h4 {
  color: #111827;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose-light h1 { font-size: 2rem; }
.prose-light h2 { font-size: 1.5rem; }
.prose-light h3 { font-size: 1.25rem; }

.prose-light p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.prose-light strong {
  color: #111827;
  font-weight: 700;
}

.prose-light a {
  color: #7c3aed;
  text-decoration: underline;
}

.prose-light blockquote {
  border-left: 4px solid #8b5cf6;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #6b7280;
  font-style: italic;
}

.prose-light code {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  color: #db2777;
}

.prose-light pre {
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.prose-light pre code {
  background: transparent;
  padding: 0;
  color: #374151;
}

.prose-light ul, .prose-light ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prose-light li {
  margin: 0.5rem 0;
}

.prose-light table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.prose-light th {
  background: #f3f4f6;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  color: #111827;
}

.prose-light td {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
}

.prose-light tr:nth-child(even) {
  background: #f9fafb;
}

.prose-light hr {
  border: 0;
  height: 1px;
  background: #e5e7eb;
  margin: 2rem 0;
}

.prose-light input[type="checkbox"] {
  margin-right: 0.5rem;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .line-numbers {
    display: none;
  }
  
  textarea {
    padding-left: 1rem !important;
  }
}