:root {
    --bg-color: #0c1018;
    --surface-color: #0f1521;
    --text-normal: #a09eb0;
    --text-dark: #605e6a;
    --text-highlight: #ffffff;
    --primary-color: #2fc17e;
    --border-color: #1e2433;
    --sidebar-width: 320px; /* CSS Variable controlled by JS */
}

/* Custom Branded Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Basic Layout */
body {
    margin: 0; padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-normal);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 18px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-highlight); font-weight: 500; margin-top: 1.5em; }
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border-color); margin: 2em 0; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 25px;
    box-sizing: border-box;
    overflow-y: auto;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 5;
}
.sidebar h2 { margin-top: 0; color: var(--text-highlight); font-weight: 600; letter-spacing: -0.5px; }
.nav-list { list-style: none; padding-left: 0; }
.nav-list .nav-list { padding-left: 15px; margin-top: 5px; margin-bottom: 15px;}
.nav-dir-title { font-weight: 600; color: var(--text-highlight); font-size: 0.85em; letter-spacing: 0.5px; margin-top: 20px; display: block; }
.nav-file { margin: 6px 0; }
.nav-file a { color: var(--text-normal); font-size: 0.95em; transition: color 0.2s; }
.nav-file a:hover { color: var(--text-highlight); text-decoration: none; }
.nav-file a.active { color: var(--primary-color); font-weight: 500; }

/* Resizer Handle */
.resizer {
    width: 6px;
    cursor: col-resize;
    position: fixed;
    left: var(--sidebar-width);
    top: 0;
    height: 100vh;
    background-color: transparent;
    z-index: 10;
    transition: background-color 0.2s;
    margin-left: -3px; /* Center over the sidebar border */
}
.resizer:hover, .resizer.is-resizing {
    background-color: var(--primary-color);
}

/* Content Area */
.content {
    flex-grow: 1;
    padding: 40px 80px;
    margin-left: var(--sidebar-width);
    max-width: 900px;
    box-sizing: border-box;
}

/* Markdown Elements */
code { background-color: #1a2233; padding: 3px 6px; border-radius: 4px; font-family: monospace; font-size: 0.9em; border: 1px solid var(--border-color); color: var(--primary-color); }
pre { background-color: var(--surface-color); padding: 20px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border-color); }
pre code { color: #e2e8f0; background: none; border: none; padding: 0; }
blockquote { border-left: 4px solid var(--primary-color); margin: 0; padding: 10px 20px; color: var(--text-dark); background: #121927; border-radius: 0 8px 8px 0; }
table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95em; }
th, td { border: 1px solid var(--border-color); padding: 12px; text-align: left; }
th { background-color: var(--surface-color); color: var(--text-highlight); font-weight: 600; }
img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; border: 1px solid var(--border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.mermaid { margin: 20px 0; background: var(--surface-color); padding: 20px; border-radius: 8px; border: 1px solid var(--border-color); text-align: center; overflow-x: auto; }

/* Lightbox / Image Zoom Feature */
.content img {
    cursor: zoom-in;
    transition: opacity 0.2s;
}
.content img:hover {
    opacity: 0.85;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000; /* Ensure it stays on top of the sidebar and resizer */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* Slight scale up effect combined with the fade for a premium feel */
.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}