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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --background: #020617;
    --surface: #0f172a;
    --surface-light: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #06b6d4;
    --danger: #f43f5e;
    --border: rgba(255, 255, 255, 0.08);
    --grid: rgba(255, 255, 255, 0.03);
}

body {
    background-color: var(--background);
    background-image: 
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text);
    line-height: 1.6;
    padding: 1rem; /* Reduced base padding for mobile */
}

@media (min-width: 640px) {
    body { padding: 2rem; }
}

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

.container {
    max-width: 1300px;
    margin: 0 auto;
}

/* Header Responsiveness */
header {
    text-align: left;
    margin-bottom: 2rem;
    padding: 2rem; /* Reduced for smaller screens */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

@media (min-width: 768px) {
    header { padding: 4rem; margin-bottom: 4rem; }
}

h1 {
    font-size: 1.5rem; /* Base size */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: white;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    h1 { font-size: 2.2rem; padding-left: 1.5rem; }
}

@media (min-width: 1024px) {
    h1 { font-size: 2.5rem; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    max-width: 800px;
    margin-top: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

@media (min-width: 768px) {
    .subtitle { font-size: 0.9rem; }
}

/* Document Grid Responsiveness */
.doc-content {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .doc-content {
        flex-direction: row;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        margin-bottom: 4rem;
    }
}

.doc-section {
    background: var(--surface);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 100%;
}

@media (min-width: 768px) {
    .doc-section { padding: 2.5rem; }
}

.doc-section h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin-bottom: 1rem;
}

.doc-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Stats Responsiveness */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2x2 on mobile */
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .stats-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 1.5rem; 
        margin-bottom: 3rem; 
    }
}

.stat-card {
    background: var(--surface);
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

@media (min-width: 768px) {
    .stat-card { padding: 1.5rem; }
    .stat-label { font-size: 0.75rem; }
    .stat-value { font-size: 2.5rem; }
}

/* Charts Responsiveness */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        margin-bottom: 4rem;
    }
}

.chart-container {
    background: var(--surface);
    padding: 1.5rem; /* Increased padding */
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 420px; /* Increased height for mobile */
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 300px; /* Limit max height of canvas itself to leave space for titles/axes */
}

@media (min-width: 768px) {
    .chart-container { padding: 2.5rem; height: 500px;}
    .chart-container canvas { max-height: none; }
}

/* Data Table Scrolling */
.data-table-container {
    background: var(--surface);
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .data-table-container { padding: 3rem; margin-top: 4rem;}
}

.table-scroll {
    width: 100%;
    overflow-x: auto; /* Force horizontal scroll for wide tables on small screens */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.table-scroll::-webkit-scrollbar {
    height: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

table {
    min-width: 800px; /* Ensures the table doesn't collapse too much */
}

@media (max-width: 768px) {
    .data-table-container h3 {
        font-size: 0.8rem;
    }
}

footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    footer { font-size: 0.8rem; }
}
