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

:root {
    --bg: #000000;
    --border: rgba(255, 255, 255, 0.08);
    --text-dim: rgba(255, 255, 255, 0.4);
    --accent: #ffffff;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* CodeMirror Redesign */
.CodeMirror {
    height: 100% !important;
    background: #000 !important;
    color: #fff !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 13px !important;
    padding: 10px !important;
}
.CodeMirror-gutters {
    background: transparent !important;
    border-right: 1px solid var(--border) !important;
}

/* THE SCROLL FIX: Table Container */
.table-wrapper {
    display: block;
    width: max-content;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0a0a0a;
    box-shadow: 0 1px 0 var(--border);
}

td {
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

tr:last-child td {
    border-bottom: 0;
}

/* UI Transitions */
.sidebar-link-active {
    background: rgba(255, 255, 255, 0.05);
    color: white !important;
    border-left: 2px solid white !important;
}

/* Mobile Sidebar Overlay */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#sidebar.open {
    transform: translateX(0);
}

#sidebar.open + #sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Smooth scaling for interactive elements */
button, label {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#db-output table {
    animation: fadeIn 0.4s ease-out forwards;
}