:root {
    --sidebar-width: 350px;
    --header-height: 80px;
}

/* Light Theme (for documentation pages) */
body.theme--light {
    background-color: #fafbfc;
    color: #1f2937;
}

/* Fix navigation text colors for light theme */
body.theme--light .navbar-dark .wsmenu > .wsmenu-list > li > a.h-link,
body.theme--light .navbar-light .wsmenu > .wsmenu-list > li > a.h-link {
    color: #fff; !important;
}

body.theme--light .navbar-dark .wsmenu > .wsmenu-list > li > a.h-link:hover,
body.theme--light .navbar-light .wsmenu > .wsmenu-list > li > a.h-link:hover {
    color: #1f2937 !important;
}

/* Fix button colors in light theme */
body.theme--light .wsmenu > .wsmenu-list > li a.btn {
    color: #fff !important;
}

/* Fix navigation text colors for light theme */
body.theme--light .navbar-dark .wsmenu > .wsmenu-list > li > a.h-link,
body.theme--light .navbar-light .wsmenu > .wsmenu-list > li > a.h-link {
    color: #fff !important;
}

body.theme--light .navbar-dark .wsmenu > .wsmenu-list > li > a.h-link:hover,
body.theme--light .navbar-light .wsmenu > .wsmenu-list > li > a.h-link:hover {
    color: #1f2937 !important;
}

/* Fix submenu colors for light theme */
body.theme--light .wsmenu > .wsmenu-list > li > ul.sub-menu,
body.theme--light .wsmenu > .wsmenu-list > li > .wsmegamenu,
body.theme--light .wsmenu > .wsmenu-list > li > .wsmegamenu.halfmenu {
    background-color: #ffffff !important;
    border: solid 1px #e1e8ed !important;
    box-shadow: 0 2px 3px rgba(96, 96, 96, .1);
}

/* Documentation Layout Styles */
/* Documentation Layout Styles */

.docs-container {
    display: flex;
    min-height: calc(100vh - 80px); /* Adjust based on your header height */
    margin-top: 80px; /* Adjust based on your header height */
}

.docs-sidebar {
    width: var(--sidebar-width);
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    position: fixed;
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Search Styles */
.docs-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    position: relative;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

#search-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.search-result-excerpt {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

.search-result-excerpt mark {
    background: #fff3cd;
    padding: 0 0.2rem;
    border-radius: 0.2rem;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Navigation Styles */
.docs-nav {
    padding: 2rem 1.5rem;
}

.docs-nav h6 {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2rem 0 0.75rem 0;
}

.docs-nav h6:first-child {
    margin-top: 0;
}

.docs-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.docs-nav li {
    margin-bottom: 0.25rem;
}

.docs-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.docs-nav a:hover {
    background-color: #e9ecef;
    color: #212529;
}

.docs-nav a.active {
    background-color: #007bff;
    color: white;
}

/* Content Area Styles */
.docs-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    max-width: calc(100% - var(--sidebar-width));
}

/* Breadcrumb Styles */
.docs-breadcrumb {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #dee2e6;
    margin: 0 0.5rem;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* Section Content Styles */
.docs-section {
    max-width: 1200px;
}

.docs-section h1 {
    color: #212529;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.75rem;
}

.docs-section h3 {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.docs-section h4 {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.docs-section p {
    line-height: 1.7;
    margin-bottom: 1.25rem;
    color: #6c757d;
}

.docs-section .lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: #495057;
    margin-bottom: 2rem;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Explicitly 3 columns */
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-card h4 {
    color: #212529;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.highlight-box h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.highlight-box p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

/* Code Blocks */
pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #e83e8c;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

pre code {
    background: transparent;
    padding: 0;
    color: #495057;
    font-size: 0.875rem;
}

/* Lists */
.docs-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.docs-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #6c757d;
}

.docs-section li strong {
    color: #495057;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid #f5c6cb;
    margin: 2rem 0;
}

.error h3 {
    color: #721c24;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.error p {
    color: #721c24;
    margin-bottom: 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 100px;
    left: 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background-color 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 320px;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1.5rem;
    }

    .docs-section h1 {
        font-size: 2rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    pre {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .docs-search {
        padding: 0.75rem 1rem;
    }

    .docs-nav {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .docs-content {
        padding: 1rem;
    }

    .docs-section h1 {
        font-size: 1.75rem;
    }

    .highlight-box {
        padding: 1.5rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .docs-container {
        margin-top: 70px;
    }

    .docs-sidebar {
        height: calc(100vh - 70px);
    }
}

/* Print Styles */
@media print {
    .docs-sidebar,
    .mobile-menu-btn,
    .docs-search,
    .docs-breadcrumb,
    header,
    .btn,
    .nav,
    .navbar {
        display: none !important;
    }

    .docs-container {
        display: block;
        margin-top: 0;
    }

    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 0;
    }

    .docs-section {
        max-width: 100%;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: white;
    }

    .docs-section h1 {
        font-size: 18pt;
        color: #000;
        border-bottom: 2pt solid #000;
        page-break-after: avoid;
    }

    .docs-section h3 {
        font-size: 14pt;
        color: #000;
        page-break-after: avoid;
        margin-top: 16pt;
    }

    .docs-section h4 {
        font-size: 12pt;
        font-weight: bold;
        page-break-after: avoid;
    }

    pre {
        background: #f5f5f5;
        border: 1pt solid #ccc;
        padding: 8pt;
        font-size: 9pt;
        white-space: pre-wrap;
        word-wrap: break-word;
        page-break-inside: avoid;
    }

    code {
        background: #f5f5f5;
        padding: 1pt 2pt;
        font-size: 9pt;
    }

    .feature-grid {
        display: block;
    }

    .feature-card {
        break-inside: avoid;
        margin-bottom: 12pt;
        border: 1pt solid #ccc;
        padding: 8pt;
    }

    .highlight-box {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1pt solid #000;
        padding: 12pt;
        page-break-inside: avoid;
    }

    .highlight-box h3 {
        color: #000 !important;
    }

    ul, ol {
        padding-left: 18pt;
    }

    li {
        margin-bottom: 4pt;
    }

    a {
        color: #000;
        text-decoration: none;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    .docs-section {
        page-break-after: always;
    }

    .docs-section:last-child {
        page-break-after: auto;
    }

    .feature-card,
    .highlight-box,
    pre,
    .docs-section h1,
    .docs-section h3,
    .docs-section h4 {
        page-break-inside: avoid;
    }
}

/* Additional utility classes */
.docs-section .text-muted {
    color: #6c757d !important;
}

.docs-section .text-primary {
    color: #007bff !important;
}

.docs-section .bg-light {
    background-color: #f8f9fa !important;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.docs-section .alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.docs-section .alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.docs-section .alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.docs-section .alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Copy button for code blocks */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: #495057;
}

.copy-code-btn.copied {
    background: #28a745;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Focus styles for accessibility */
.nav-link:focus,
#search-input:focus,
.search-result-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    body.theme--dark .docs-sidebar {
        background: #1a1a1a;
        border-right-color: #333;
    }

    body.theme--dark .docs-nav h6 {
        color: #aaa;
    }

    body.theme--dark .docs-nav a {
        color: #ccc;
    }

    body.theme--dark .docs-nav a:hover {
        background-color: #333;
        color: #fff;
    }

    body.theme--dark .docs-content {
        background: #121212;
        color: #e0e0e0;
    }

    body.theme--dark .docs-section h1,
    body.theme--dark .docs-section h3,
    body.theme--dark .docs-section h4 {
        color: #fff;
    }

    body.theme--dark pre {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }

    body.theme--dark code {
        background: #2d2d2d;
        color: #ff6b6b;
    }
}

/* Add these styles to your docs.css file */

/* Related Sections */
.related-sections {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #007bff;
}

.related-sections h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.related-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.related-link:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading::after {
    content: 'Loading...';
    display: block;
    font-style: italic;
}

/* Enhanced Error State */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #f5c6cb;
    margin: 2rem 0;
    text-align: center;
}

.error h3 {
    color: #721c24;
    margin-top: 0;
    margin-bottom: 1rem;
}

.error p {
    color: #721c24;
    margin-bottom: 1.5rem;
}

.error .btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.error .btn:hover {
    background: #c82333;
}

/* Enhanced Search Results */
.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.search-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.search-result-item:hover::before,
.search-result-item.active::before {
    background: #007bff;
}

/* Smooth Transitions */
#content-area {
    transition: opacity 0.2s ease;
}

#content-area.loading {
    opacity: 0.7;
}

/* Navigation Feedback */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link.loading::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .related-links {
        flex-direction: column;
    }

    .related-link {
        text-align: center;
    }

    .loading {
        padding: 2rem 1rem;
    }

    .error {
        padding: 1.5rem;
        margin: 1rem 0;
    }
}

/* Accessibility Improvements */
.nav-link:focus,
.related-link:focus,
.search-result-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Performance: Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .loading::before,
    .nav-link.loading::after,
    .related-link,
    .search-result-item {
        animation: none;
        transition: none;
    }

    .related-link:hover {
        transform: none;
    }
}