@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-dark: #0a0a0c;
    --card-dark: #121216;
    --accent-red: #dc2626;
    --accent-crimson: #991b1b;
}

/* Dark Mode (Default Noir) */
html.dark body {
    background-color: #0a0a0c;
    color: #e5e5e5;
}

/* Light Mode (Classic Forensic Dossier Paper) */
html:not(.dark) {
    color-scheme: light;
}

html:not(.dark) body {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

/* Containers, Panels & Admin Sidebar in Light Mode */
html:not(.dark) aside,
html:not(.dark) .bg-\[\#0A0A0C\],
html:not(.dark) .bg-\[\#08080A\],
html:not(.dark) .bg-\[\#0D0D10\],
html:not(.dark) .bg-\[\#09090B\],
html:not(.dark) .bg-\[\#101014\],
html:not(.dark) .bg-\[\#121216\],
html:not(.dark) .bg-\[\#111115\],
html:not(.dark) .bg-neutral-900,
html:not(.dark) .bg-neutral-950 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html:not(.dark) .bg-black {
    background-color: #f8fafc !important;
}

html:not(.dark) header.bg-\[\#0A0A0C\]\/90 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e2e8f0 !important;
}

html:not(.dark) .case-card {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Native Ads & Recommended Archive Gradients in Light Mode */
html:not(.dark) .from-red-950\/30,
html:not(.dark) .from-red-950\/20,
html:not(.dark) [class*="from-red-950"],
html:not(.dark) .bg-gradient-to-r,
html:not(.dark) .bg-gradient-to-br {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%) !important;
    border-color: #fecaca !important;
    color: #1e293b !important;
}

html:not(.dark) [class*="from-red-950"] h2,
html:not(.dark) [class*="from-red-950"] h3,
html:not(.dark) [class*="from-red-950"] h4,
html:not(.dark) [class*="from-red-950"] p,
html:not(.dark) [class*="from-red-950"] span:not(.text-red-500):not(.text-red-600) {
    color: #1e293b !important;
}

/* Table Headers & Utility Surfaces in Light Mode */
html:not(.dark) thead,
html:not(.dark) thead.bg-neutral-950,
html:not(.dark) .bg-neutral-950\/80,
html:not(.dark) .bg-neutral-950\/70,
html:not(.dark) .bg-neutral-950\/40 {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* Borders in Light Mode */
html:not(.dark) .border-neutral-800,
html:not(.dark) .border-neutral-850,
html:not(.dark) .border-neutral-900,
html:not(.dark) .border-neutral-700,
html:not(.dark) .divide-neutral-850 > :not([hidden]) ~ :not([hidden]) {
    border-color: #e2e8f0 !important;
}

/* Interactive Hover in Light Mode */
html:not(.dark) .hover\:bg-neutral-900:hover,
html:not(.dark) .hover\:bg-neutral-900\/50:hover,
html:not(.dark) .hover\:bg-neutral-800:hover,
html:not(.dark) .hover\:bg-neutral-850:hover {
    background-color: #f8fafc !important;
}

/* Typography Visibility in Light Mode */
html:not(.dark) .text-neutral-100,
html:not(.dark) .text-neutral-200 {
    color: #0f172a !important;
}

html:not(.dark) .text-neutral-300,
html:not(.dark) .text-neutral-400 {
    color: #334155 !important;
}

html:not(.dark) .text-neutral-500 {
    color: #64748b !important;
}

/* Form Inputs in Light Mode */
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #94a3b8 !important;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.font-serif {
    font-family: 'Cinzel', Georgia, serif;
}

.font-body {
    font-family: 'Crimson Pro', Georgia, serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
html.dark ::-webkit-scrollbar-track {
    background: #09090b;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 3px;
}
html:not(.dark) ::-webkit-scrollbar-track {
    background: #f1f5f9;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #dc2626 !important;
}

/* Noise overlay effect */
html.dark .bg-noise {
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
}
html:not(.dark) .bg-noise {
    background-image: radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
}

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Editorial Story Typography */
.prose-editorial {
    font-family: 'Crimson Pro', serif;
    font-size: 1.18rem;
    line-height: 1.85;
}

html.dark .prose-editorial {
    color: #d4d4d8;
}

html:not(.dark) .prose-editorial {
    color: #1e293b;
}

.prose-editorial h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
    border-left: 3px solid #dc2626;
    padding-left: 1rem;
}

html.dark .prose-editorial h2 {
    color: #f4f4f5;
}
html:not(.dark) .prose-editorial h2 {
    color: #0f172a;
}

.prose-editorial h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

html.dark .prose-editorial h3 {
    color: #e4e4e7;
}
html:not(.dark) .prose-editorial h3 {
    color: #1e293b;
}

.prose-editorial p {
    margin-bottom: 1.4rem;
}

.prose-editorial blockquote {
    font-family: 'Cinzel', serif;
    font-style: italic;
    border-left: 3px solid #dc2626;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

html.dark .prose-editorial blockquote {
    color: #fca5a5;
    background: rgba(220, 38, 38, 0.05);
}

html:not(.dark) .prose-editorial blockquote {
    color: #991b1b;
    background: rgba(220, 38, 38, 0.08);
}

.prose-editorial ul, .prose-editorial ol {
    margin: 1.25rem 0 1.5rem 1.75rem;
}

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

.prose-editorial strong {
    font-weight: 600;
}

html.dark .prose-editorial strong {
    color: #fafafa;
}
html:not(.dark) .prose-editorial strong {
    color: #0f172a;
}

.prose-editorial a {
    color: #dc2626;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.prose-editorial a:hover {
    color: #991b1b;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}
