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

:root {
    --bg-color: #0d1117;
    --bg-secondary: #161b22;
    --text-main: #c9d1d9;
    --text-heading: #f0f6fc;
    --text-muted: #8b949e;
    --primary-color: #2f81f7;
    --primary-hover: #1f6feb;
    --accent-color: #238636;
    --border-color: #30363d;
    --sidebar-width: 280px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.docs-lang-btn:hover {
    border-color: var(--primary-color) !important;
    color: var(--text-heading) !important;
    background: var(--bg-secondary) !important;
}

/* Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.docs-logo {
    padding: 2rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.docs-logo span {
    color: var(--primary-color);
}

.docs-logo img {
    height: 1.2em;
    width: auto;
}

.docs-nav {
    padding: 1.5rem 0;
}

.docs-nav-group {
    margin-bottom: 1.5rem;
}

.docs-nav-group-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.docs-nav-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    text-decoration: none;
}

.docs-nav-link:hover, .docs-nav-link.active {
    background-color: rgba(47, 129, 247, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.5rem - 3px);
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem 4rem 6rem;
    max-width: 1000px;
}

.docs-section {
    margin-bottom: 5rem;
}

/* Typography in Content */
h1, h2, h3, h4 {
    color: var(--text-heading);
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    margin-bottom: 1.2rem;
}

ul, ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Code & Tables */
code {
    font-family: var(--font-code);
    background-color: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-size: 0.85em;
}

pre {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    table {
        min-width: 700px; /* Force minimum width to trigger scroll on parent and prevent squashing */
    }
}

th, td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-heading);
}

/* Alerts / Callouts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    background-color: rgba(47, 129, 247, 0.1);
}

.alert-info {
    border-color: var(--primary-color);
}

.alert-warning {
    border-color: #d29922;
    background-color: rgba(210, 153, 34, 0.1);
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Mobile Toggle */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Prism Overrides */
code[class*="language-"], pre[class*="language-"] {
    font-family: var(--font-code) !important;
    text-shadow: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    .docs-mobile-toggle {
        display: block;
    }
    
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
    }
    
    .docs-main {
        margin-left: 0;
        padding: 4rem 1.5rem;
        width: 100%;
        overflow-x: auto; /* Ensure any wide content like tables can scroll */
    }
}

@media (max-width: 480px) {
    .docs-main {
        padding: 4rem 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Utility to prevent long words from breaking layout in general text, 
   but we're more careful with tables to allow them to expand */
p, li {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

td, th {
    word-wrap: normal;
    word-break: normal;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}
