/* Documentation styling with sidebar navigation */

/* CSS Custom Properties */
:root {
    --sidebar-width: 280px;
    --header-height: 60px;
    --sidebar-bg: #f8f9fa;
    --sidebar-border: #e1e4e8;
    --nav-hover-bg: #e9ecef;
    --nav-active-bg: #e6f3ff;
    --nav-active-border: #0066cc;
    --nav-text: #333;
    --nav-text-muted: #666;
}

/* Base styles */
body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 100%;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-badge {
    background-color: #2196F3;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #333;
    left: 0;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    top: 7px;
}

/* Main layout with sidebar */
.site-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-nav {
    padding: 1rem 0;
}

/* Home link */
.sidebar-home-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin-bottom: 0.5rem;
}

.sidebar-home-link:hover {
    background-color: var(--nav-hover-bg);
}

.sidebar-home-link.active {
    background-color: var(--nav-active-bg);
    border-left-color: var(--nav-active-border);
    color: var(--nav-active-border);
}

.nav-icon {
    flex-shrink: 0;
}

/* Section header */
.nav-section {
    margin-bottom: 0.25rem;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nav-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    transition: background-color 0.15s ease;
}

.nav-section-header:hover {
    background-color: var(--nav-hover-bg);
}

.nav-section-header:focus {
    outline: 2px solid var(--nav-active-border);
    outline-offset: -2px;
}

.nav-section-title {
    flex-grow: 1;
}

.nav-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-section-header[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

/* Section pages */
.nav-section-pages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-section-pages[hidden] {
    display: none;
}

.nav-section-pages li {
    margin: 0;
}

.nav-section-pages a {
    display: block;
    padding: 0.5rem 1.25rem 0.5rem 2.5rem;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-section-pages a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--nav-active-border);
}

.nav-section-pages a.active {
    background-color: var(--nav-active-bg);
    border-left-color: var(--nav-active-border);
    color: var(--nav-active-border);
    font-weight: 500;
}

/* Main content */
.main-content {
    grid-column: 2;
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

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

/* Footer */
.site-footer {
    grid-column: 2;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    padding: 2rem;
    text-align: center;
    color: #666;
}

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

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #333;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-top: 1.5rem; }
h4 { font-size: 1.25rem; margin-top: 1rem; }

p {
    margin-bottom: 1rem;
}

/* Code Blocks */
pre {
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    margin-bottom: 1rem;
    color: #333;
    line-height: 1;
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    background: #fafafa;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #eee;
}

pre code {
    background: transparent;
    padding: 0;
    border: none;
    line-height: 1.2;
}

/* Tables */
table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 20px;
}

thead tr {
    background-color: #f5f5f5;
}

th, td {
    border: 1px solid #ccc;
    padding: 8px;
    vertical-align: top;
    text-align: left;
    word-wrap: break-word;
}

/* Command Output */
#commandOutput, #commandText {
    white-space: pre-wrap;
    background: #fafafa;
    border: 1px solid #ccc;
    padding: 10px;
    min-height: 50px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    border-radius: 4px;
    color: #333;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #333;
    font-family: inherit;
}

.btn:hover {
    background: #e5e5e5;
}

.btn-primary {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.btn-primary:hover {
    background: #0052a3;
}

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: underline;
}

a:hover {
    color: #0052a3;
}

/* Railroad Diagrams */
.railroad-diagram {
    margin: 2rem 0;
    overflow-x: auto;
}

/* Diagram containers */
.diagram-container {
    margin: 2rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.diagram-title {
    background: #f5f5f5;
    padding: 10px 15px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.diagram-description {
    padding: 10px 15px;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 1px solid #eee;
}

.section {
    margin: 3rem 0;
}

/* Schema diagram styling */
.schema-diagram {
    text-align: center;
    margin: 2rem 0;
}

.schema-diagram img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.schema-caption {
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .site-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

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

    .main-content {
        grid-column: 1;
        padding: 1.5rem 1rem;
    }

    .site-footer {
        grid-column: 1;
    }

    .content-container {
        max-width: 100%;
    }

    .logo span {
        display: none;
    }

    .logo-img {
        height: 32px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Responsive - Small mobile */
@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.75rem;
    }

    .version-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}
