:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-emerald: #059669;
    --accent-emerald-light: rgba(16, 185, 129, 0.10);
    --accent-indigo: #4f46e5;
    --accent-indigo-light: rgba(99, 102, 241, 0.10);
}

html.dark,
[data-theme="dark"] {
    --bg-page: #06090f;
    --bg-card: #0b0f17;
    --bg-sidebar: #0b0f17;
    --bg-header: rgba(11, 15, 23, 0.95);
    --border-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent-emerald: #00f59b;
    --accent-emerald-light: rgba(0, 245, 155, 0.12);
    --accent-indigo: #818cf8;
    --accent-indigo-light: rgba(99, 102, 241, 0.15);
}

/* Base Body Styles */
body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.6);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Prose Markdown Typography */
.prose {
    color: var(--text-secondary);
    max-width: 65ch;
    font-size: 0.875rem;
    line-height: 1.7142857;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #f8fafc;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    scroll-margin-top: 5.5rem;
}

.prose h1 {
    font-size: 1.875rem;
    line-height: 1.25;
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.prose h2 {
    font-size: 1.35rem;
    line-height: 1.35;
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prose h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.prose a {
    color: #38BDF8;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.prose a:hover {
    color: #7DD3FC;
}

.prose code {
    color: #bfdbfe;
    background-color: rgba(0, 102, 255, 0.10);
    border: 1px solid rgba(0, 102, 255, 0.20);
    padding: 0.15rem 0.35rem;
    border-radius: 0.375rem;
    font-size: 0.8em;
    font-family: 'JetBrains Mono', monospace;
}

.prose pre {
    background-color: #0c111c !important;
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.prose pre code {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #e2e8f0;
    font-size: 1em;
}

.prose ul, .prose ol {
    padding-left: 1.25rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.prose blockquote {
    border-left: 3px solid #0066FF;
    padding-left: 1rem;
    font-style: italic;
    color: #94a3b8;
    margin: 1.25rem 0;
}

.prose table {
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.prose th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #334155;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prose td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    color: #cbd5e1;
}

/* Animations */
@keyframes docFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: docFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Light Theme Prose Overrides */
html.light .prose,
[data-theme="light"] .prose {
    color: #334155;
}

html.light .prose h1,
html.light .prose h2,
html.light .prose h3,
html.light .prose h4,
[data-theme="light"] .prose h1,
[data-theme="light"] .prose h2,
[data-theme="light"] .prose h3,
[data-theme="light"] .prose h4 {
    color: #0F172A;
}

html.light .prose h2,
[data-theme="light"] .prose h2 {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html.light .prose code,
[data-theme="light"] .prose code {
    color: #047857;
    background-color: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.20);
}

html.light .prose pre,
[data-theme="light"] .prose pre {
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0;
}

html.light .prose pre code,
[data-theme="light"] .prose pre code {
    color: #0F172A;
}

html.light .prose th,
[data-theme="light"] .prose th {
    border-bottom: 1px solid #CBD5E1;
    color: #475569;
}

html.light .prose td,
[data-theme="light"] .prose td {
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
    color: #334155;
}

html.light .prose blockquote,
[data-theme="light"] .prose blockquote {
    border-left: 3px solid #10B981;
    color: #64748B;
}
