/* assets/css/docs.css - Updated Dark Theme & Layout Fixes */

/* 1. Force the deep dark background on the entire page */
body {
    background-color: #050507; 
    color: #a0aab5;
    margin: 0;
    min-height: 100vh;
}

/* 2. Center the document and fix the right-side gap */
.doc-container {
    max-width: 1000px;
    margin: 0 auto; /* Centers the content block */
    padding: 60px 40px;
    color: #c9d1d9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

/* 3. Make the Sidebar Table of Contents Scrollable */
#toc {
    max-height: calc(100vh - 180px); /* Leaves room for the logo and padding */
    overflow-y: auto;
    padding-right: 10px; /* Space for the scrollbar */
}

/* Custom thin scrollbar for the ToC to keep it looking like liquid glass */
#toc::-webkit-scrollbar {
    width: 6px;
}
#toc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
#toc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
#toc::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 57, 43, 0.5); /* Accent red on hover */
}

/* ---------- Typography & Markdown Elements ---------- */

.doc-container h1 { 
    font-size: 2.8rem; 
    color: #ffffff; 
    margin-bottom: 30px; 
    border-bottom: 2px solid rgba(255,255,255,0.05); 
    padding-bottom: 10px; 
}

.doc-container h2 { 
    font-size: 1.8rem; 
    color: #c0392b; 
    margin-top: 50px; 
    margin-bottom: 20px; 
    border-bottom: 1px dashed rgba(255,255,255,0.05); 
    padding-bottom: 10px; 
}

.doc-container h3 { 
    font-size: 1.3rem; 
    color: #f39c12; /* Golden gate accent for sub-headers */
    margin-top: 30px; 
    margin-bottom: 15px; 
}

.doc-container p { 
    margin-bottom: 20px; 
    font-size: 1.05rem; 
}

/* Lists */
.doc-container ul, .doc-container ol { 
    margin-bottom: 20px; 
    padding-left: 25px; 
}
.doc-container li { margin-bottom: 8px; }

/* Code Blocks */
.doc-container pre {
    background: rgba(12, 14, 18, 0.85); /* Matches the sidebar glass */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 25px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 10px 30px rgba(0,0,0,0.5);
}

.doc-container code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    color: #e6edf3;
}

.doc-container p code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #f39c12;
}

/* Tables (For your BOM) */
.doc-container table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 30px; 
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.15); /* Stronger outer border */
}

.doc-container th, .doc-container td { 
    padding: 12px 15px; 
    text-align: left; 
    border: 1px solid rgba(255,255,255,0.1); /* Visible inner grid lines */
}

.doc-container th { 
    background: rgba(192, 57, 43, 0.15); 
    color: #c0392b; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-size: 0.9rem; 
}

.doc-container tr:hover { 
    background: rgba(255,255,255,0.04); 
}

/* Images */
.doc-container img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.08); 
    margin: 20px 0; 
    background: #000;
}

/* Emphasis styling for Markdown italics used as captions */
.doc-container em {
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .doc-container { padding: 40px 20px; }
}

/* ---------- Persistent Top Bar ---------- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 7, 0.85); /* Deep dark background */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px;
    padding-left: 350px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar-meta {
    font-size: 0.85rem;
    color: #8b949e;
    line-height: 1.6;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.top-bar-meta a {
    color: #c0392b;
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.top-bar-meta a:hover {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

.top-bar-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* YouTube Button Styling */
.yt-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.yt-link:hover {
    background: rgba(192, 57, 43, 0.15);
    border-color: #c0392b;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Responsive adjustment for mobile screens */
@media (max-width: 992px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }
}