/* Custom CSS for NEO Documentation */

/* Enhanced Left Sidebar Design */
.sidebar {
    padding: 2rem 0 2rem 1rem !important; /* Added left padding */
}

.sidebar > h1 {
    margin: 0 0 2rem 0 !important;
    padding: 0 1.5rem !important;
}

.sidebar ul {
    margin: 0 !important;
    padding: 0 !important;
}

.sidebar ul li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Section headers in sidebar */
.sidebar ul li strong {
    display: block;
    color: #9ca3af !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600 !important;
    margin: 2rem 1rem 0.75rem 1rem !important; /* Added left margin */
    padding: 0 0 0.5rem 0.5rem !important; /* Added left padding */
    border-bottom: 1px solid #374151;
}

/* First section header (no top margin) */
.sidebar ul li:first-child strong {
    margin-top: 1rem !important;
}

/* Navigation links */
.sidebar ul li a {
    color: #d1d5db !important;
    text-decoration: none !important;
    display: block !important;
    padding: 0.6rem 1rem 0.6rem 1rem !important; /* Better left padding */
    margin: 0 0.5rem !important; /* Added left margin */
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    border-left: 2px solid transparent !important;
    transition: all 0.15s ease !important;
}

.sidebar ul li a:hover {
    color: #ffffff !important;
    border-left-color: #6b7280 !important;
    background: rgba(107, 114, 128, 0.1) !important;
}

.sidebar ul li a.active {
    color: #ffffff !important;
    border-left-color: #0066cc !important;
    background: rgba(0, 102, 204, 0.1) !important;
    font-weight: 500 !important;
}

/* Right sidebar table of contents - Subtle, professional design */
.right-toc {
    position: fixed;
    top: 80px;
    right: 30px;
    width: 220px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: transparent;
    border: none;
    padding: 1rem 0;
    z-index: 1000;
    font-size: 13px;
}

.right-toc h4 {
    margin: 0 0 1rem 0;
    font-size: 14px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.5rem;
}

.right-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.right-toc li {
    margin: 0;
}

.right-toc a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    padding: 0.4rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: all 0.15s ease;
    font-weight: 400;
    line-height: 1.4;
}

.right-toc a:hover {
    color: #ffffff;
    border-left-color: #6b7280;
}

.right-toc a.active {
    color: #ffffff;
    border-left-color: #0066cc;
    font-weight: 500;
}

/* Enhanced Main Content Section Design */
.markdown-section {
    max-width: calc(100% - 300px);
    margin-right: 300px;
    padding: 2rem 3rem !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
}

/* Typography enhancements */
.markdown-section h1 {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin: 0 0 1.5rem 0 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

.markdown-section h2 {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    margin: 3rem 0 1.25rem 0 !important;
    line-height: 1.3 !important;
    color: #f3f4f6 !important;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.75rem;
}

.markdown-section h3 {
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    margin: 2.5rem 0 1rem 0 !important;
    line-height: 1.4 !important;
    color: #e5e7eb !important;
}

.markdown-section h4 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 2rem 0 0.75rem 0 !important;
    color: #d1d5db !important;
}

/* Paragraph and text spacing */
.markdown-section p {
    margin: 0.25rem  1.5rem !important;
    color: #d1d5db !important;
    font-weight: 400 !important;
}

.markdown-section blockquote {
    margin: 2rem 0 !important;
    padding: 1.5rem 2rem !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border-left: 4px solid #3b82f6 !important;
    border-radius: 0 8px 8px 0 !important;
    font-style: italic;
}

.markdown-section blockquote p {
    margin: 0 !important;
    color: #e5e7eb !important;
    font-size: 1.1rem !important;
}

/* List improvements */
.markdown-section ul,
.markdown-section ol {
    margin: 1.5rem 0 !important;
    padding-left: 1.5rem !important;
}

.markdown-section li {
    margin: 0.5rem 0 !important;
    color: #d1d5db !important;
}

/* Code blocks */
.markdown-section pre {
    margin: 2rem 0 !important;
    padding: 1.5rem !important;
    background: #1f2937 !important;
    border-radius: 8px !important;
    border: 1px solid #374151 !important;
}

.markdown-section code {
    background: #374151 !important;
    color: #fbbf24 !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 4px !important;
    font-size: 0.9rem !important;
}

/* Tables */
.markdown-section table {
    margin: 2rem 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
    background: transparent !important;
}

.markdown-section th {
    background: #374151 !important;
    color: #ffffff !important;
    padding: 1rem !important;
    text-align: left !important;
    font-weight: 600 !important;
    border: 1px solid #4b5563 !important;
}

.markdown-section td {
    padding: 0.75rem 1rem !important;
    border: 1px solid #4b5563 !important;
    color: #d1d5db !important;
}

.markdown-section tr:nth-child(even) {
    background: rgba(55, 65, 81, 0.3) !important;
}

/* Links */
.markdown-section a {
    color: #60a5fa !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.15s ease !important;
}

.markdown-section a:hover {
    color: #93c5fd !important;
    text-decoration: underline !important;
}

/* Details/Summary (expandable sections) */
.markdown-section details {
    margin: 1.5rem 0 !important;
    border: 1px solid #374151 !important;
    border-radius: 8px !important;
    background: rgba(31, 41, 55, 0.5) !important;
}

.markdown-section summary {
    padding: 1rem 1.5rem !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    color: #f3f4f6 !important;
    border-bottom: 1px solid #374151 !important;
    transition: background 0.15s ease !important;
}

.markdown-section summary:hover {
    background: rgba(55, 65, 81, 0.5) !important;
}

.markdown-section details[open] summary {
    border-bottom: 1px solid #374151 !important;
}

.markdown-section details div,
.markdown-section details p {
    padding: 0.25rem 1.5rem !important;
    margin: 0 !important;
}

/* Fix spacing for lists inside details */
.markdown-section details ul,
.markdown-section details ol {
    padding: 0 1.5rem 0.75rem 1.5rem !important;
    margin: 0.5rem 0 0 0 !important;
}

.markdown-section details li {
    margin: 0.1rem 0 !important;
    color: #d1d5db !important;
}

/* Reduce spacing between paragraphs in details */
.markdown-section details p {
    margin: 0.5rem 0 !important;
}

.markdown-section details p + p {
    margin-top: 0.5rem !important;
}

.markdown-section details p + ul,
.markdown-section details p + ol {
    margin-top: 0.25rem !important;
}

.markdown-section details ul + p,
.markdown-section details ol + p {
    margin-top: 0.5rem !important;
}

/* Reduce spacing for strong elements in details */
.markdown-section details strong {
    display: inline !important;
    margin: 0 !important;
}

/* Horizontal rules */
.markdown-section hr {
    margin: 3rem 0 !important;
    border: none !important;
    height: 1px !important;
    background: #374151 !important;
}

/* Fix button readability issues */
.markdown-section a[style*="background: #0066cc"] {
    background: #0066cc !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
}

.markdown-section a[style*="background: #f5f5f5"] {
    background: #374151 !important;
    color: #ffffff !important;
    border: 1px solid #4b5563 !important;
    font-weight: 500 !important;
}

.markdown-section a[style*="background: #28a745"] {
    background: #059669 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
}

/* Fix white/light background sections for dark theme */
.markdown-section div[style*="background: #f8f9fa"],
.markdown-section div[style*="background: #fff3cd"],
.markdown-section div[style*="background: #e8f4fd"],
.markdown-section div[style*="background: #d4edda"],
.markdown-section div[style*="background: #f8d7da"] {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #e5e7eb !important;
}

/* Specific styling for different alert types */
.markdown-section div[style*="background: #fff3cd"] {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 4px solid #f59e0b !important;
}

.markdown-section div[style*="background: #e8f4fd"] {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left: 4px solid #3b82f6 !important;
}

.markdown-section div[style*="background: #d4edda"] {
    background: rgba(34, 197, 94, 0.1) !important;
    border-left: 4px solid #22c55e !important;
}

.markdown-section div[style*="background: #f8d7da"] {
    background: rgba(239, 68, 68, 0.1) !important;
    border-left: 4px solid #ef4444 !important;
}

/* Fix text color in these sections */
.markdown-section div[style*="background: #f8f9fa"] h3,
.markdown-section div[style*="background: #fff3cd"] h3,
.markdown-section div[style*="background: #e8f4fd"] h3,
.markdown-section div[style*="background: #d4edda"] h3,
.markdown-section div[style*="background: #f8d7da"] h3 {
    color: #ffffff !important;
    margin-top: 0 !important;
}

.markdown-section div[style*="background: #f8f9fa"] p,
.markdown-section div[style*="background: #fff3cd"] p,
.markdown-section div[style*="background: #e8f4fd"] p,
.markdown-section div[style*="background: #d4edda"] p,
.markdown-section div[style*="background: #f8d7da"] p {
    color: #e5e7eb !important;
}

.markdown-section div[style*="background: #f8f9fa"] ul,
.markdown-section div[style*="background: #fff3cd"] ul,
.markdown-section div[style*="background: #e8f4fd"] ul,
.markdown-section div[style*="background: #d4edda"] ul,
.markdown-section div[style*="background: #f8d7da"] ul {
    color: #e5e7eb !important;
}

.markdown-section div[style*="background: #f8f9fa"] li,
.markdown-section div[style*="background: #fff3cd"] li,
.markdown-section div[style*="background: #e8f4fd"] li,
.markdown-section div[style*="background: #d4edda"] li,
.markdown-section div[style*="background: #f8d7da"] li {
    color: #e5e7eb !important;
}

/* Grid and card improvements */
.markdown-section div[style*="display: grid"] {
    gap: 1.5rem !important;
}

.markdown-section div[style*="border: 1px solid #ddd"] {
    border: 1px solid #374151 !important;
    background: rgba(31, 41, 55, 0.5) !important;
}

.markdown-section div[style*="border: 2px solid #0066cc"] {
    border: 2px solid #0066cc !important;
    background: rgba(0, 102, 204, 0.05) !important;
}

.markdown-section div[style*="border: 2px solid #28a745"] {
    border: 2px solid #059669 !important;
    background: rgba(5, 150, 105, 0.05) !important;
}

/* Good and Bad Example Boxes - Professional styling */
.markdown-section div[style*="background: #d4edda"] {
    background: rgba(34, 197, 94, 0.08) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    border-left: 4px solid #22c55e !important;
}

.markdown-section div[style*="background: #f8d7da"] {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-left: 4px solid #ef4444 !important;
}

/* Fix text in Good/Bad example boxes */
.markdown-section div[style*="background: #d4edda"] h3 {
    color: #22c55e !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
}

.markdown-section div[style*="background: #f8d7da"] h3 {
    color: #ef4444 !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
}

/* Inner example boxes within Good/Bad sections */
.markdown-section div[style*="background: #d4edda"] div[style*="background: white"],
.markdown-section div[style*="background: #f8d7da"] div[style*="background: white"] {
    background: rgba(31, 41, 55, 0.8) !important;
    border: 1px solid #4b5563 !important;
    border-radius: 6px !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
}

.markdown-section div[style*="background: #d4edda"] div[style*="background: white"] strong,
.markdown-section div[style*="background: #f8d7da"] div[style*="background: white"] strong {
    color: #ffffff !important;
    font-weight: 600 !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
}

.markdown-section div[style*="background: #d4edda"] div[style*="background: white"] p,
.markdown-section div[style*="background: #f8d7da"] div[style*="background: white"] p {
    color: #d1d5db !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Hide right TOC on mobile */
@media (max-width: 1200px) {
    .right-toc {
        display: none;
    }
    
    .markdown-section {
        max-width: 100%;
        margin-right: 0;
        padding: 2rem 1.5rem !important;
    }
}

/* Fix copy button and feedback message styling */
.docsify-copy-code-button {
    background: #374151 !important;
    color: #ffffff !important;
    border: 1px solid #4b5563 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.5rem !important;
    transition: all 0.15s ease !important;
}

.docsify-copy-code-button:hover {
    background: #4b5563 !important;
    color: #ffffff !important;
    border-color: #6b7280 !important;
}

/* Copy feedback message */
.docsify-copy-code-button:focus,
.docsify-copy-code-button.success {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
}

.docsify-copy-code-button.error {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

/* Ensure copy button is visible on code blocks */
.markdown-section pre {
    position: relative !important;
}

.markdown-section pre .docsify-copy-code-button {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 10 !important;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}
