/* Documentation Layout Styles */
.docs-container {
    display: flex;
    min-height: calc(100vh - 120px);
    margin-top: 0;
    background: #fff;
}

/* Documentation Header with Version Selector */
.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    margin: -2rem -2rem 2rem -2rem;
}

.docs-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Version Selector Dropdown */
.versions {
    position: relative;
    display: inline-block;
}

.version-selector-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #24292f;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.version-selector-trigger:hover {
    background: #f6f8fa;
    border-color: #8c959f;
    text-decoration: none;
}

.version-arrow {
    transition: transform 0.15s ease;
    color: #656d76;
}

.versions:hover .version-arrow {
    transform: rotate(180deg);
}

.versions-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
    z-index: 1000;
    min-width: 160px;
}

.versions:hover .versions-dropdown-content {
    display: block;
}

.versions-dropdown-content a {
    display: block;
    padding: 0.5rem 1rem;
    color: #24292f;
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 1px solid #f6f8fa;
    transition: background-color 0.15s ease;
}

.versions-dropdown-content a:last-child {
    border-bottom: none;
}

.versions-dropdown-content a:hover {
    background: #f6f8fa;
    text-decoration: none;
}

.versions-dropdown-content a.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.versions-dropdown-content a.active:hover {
    background: #bfdbfe;
}

.docs-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
}

.docs-nav {
    padding: 2rem 1.5rem;
}

.docs-nav-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.docs-nav-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.docs-nav-header h3 a {
    color: inherit;
    text-decoration: none;
}

.docs-nav-header h3 a:hover {
    color: #3498db;
}

/* Version Selector in Docs Header */
.version-selector {
    position: relative;
    margin-top: 0.5rem;
}

.version-button {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #24292f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    transition: all 0.15s ease;
    font-weight: 500;
}

.version-button:hover {
    background: #f6f8fa;
    border-color: #8c959f;
}

.version-button:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

.version-current {
    font-weight: 500;
}

.version-arrow {
    font-size: 0.75rem;
    color: #656d76;
    transition: transform 0.15s ease;
}

.version-button[aria-expanded="true"] .version-arrow {
    transform: rotate(180deg);
}

.version-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
    z-index: 1000;
    margin-top: 4px;
    overflow: hidden;
    min-width: 160px;
}

.version-dropdown.show {
    display: block;
}

.version-item {
    display: block;
    padding: 10px 16px;
    color: #24292f;
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 1px solid #f6f8fa;
    transition: all 0.15s ease;
    position: relative;
}

.version-item:last-child {
    border-bottom: none;
}

.version-item:hover {
    background: #f6f8fa;
    color: #24292f;
    text-decoration: none;
}

.version-item.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

.version-item.active:hover {
    background: #bfdbfe;
}

.version-badge {
    display: inline-block;
    background: #1f883d;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
    line-height: 1;
}

/* Dynamic Menu Navigation */
.docs-nav-menu {
    margin-top: 1rem;
}

#docs-ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#docs-ul li {
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

#docs-ul li.children {
    position: relative;
}

#docs-ul li a {
    display: block;
    padding: 10px 40px 10px 15px;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#docs-ul li a:hover {
    background: #f6f8fa;
    color: #24292f;
    text-decoration: none;
}

#docs-ul li.current {
    color: #24292f;
    font-weight: 600;
    padding: 10px 40px 10px 15px;
    background: #dbeafe;
    border-radius: 4px;
}

#docs-ul li.childCurrent > a {
    color: #24292f;
    font-weight: 500;
    background: #f6f8fa;
}

#docs-ul li ul {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: 20px;
}

#docs-ul li ul li a {
    padding: 8px 15px;
    font-size: 0.9rem;
    color: #8b949e !important;
    text-decoration: none;
}

#docs-ul li ul li a:hover {
    color: #24292f !important;
    background: #f6f8fa;
    text-decoration: none;
}

#docs-ul li ul li a:visited {
    color: #8b949e !important;
}

#docs-ul li ul li.current {
    padding: 8px 15px;
    background: #f6f8fa;
    color: #24292f;
    font-weight: 500;
}

.arrow {
    position: absolute;
    right: 15px;
    top: 12px;
    color: #8b949e;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: none;
    z-index: 10;
}

.arrow .arrow-icon {
    transition: transform 0.3s ease;
    display: block;
}

li.open .arrow .arrow-icon {
    transform: rotate(180deg);
}

/* Version Selector Styles - GitHub Pages Compatible */
.version-selector-wrapper {
    display: inline-block;
    position: relative;
}

.version-selector {
    position: relative;
    display: inline-block;
}

.version-selector-button {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.version-selector-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.version-selector-current {
    font-weight: 500;
}

.version-selector-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.version-selector:hover .version-selector-arrow,
.version-selector-button[aria-expanded="true"] .version-selector-arrow {
    transform: rotate(180deg);
}

.version-selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 4px;
}

.version-selector:hover .version-selector-dropdown,
.version-selector-button[aria-expanded="true"] + .version-selector-dropdown {
    display: block;
}

.version-selector-item {
    display: block;
    padding: 12px 16px;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.version-selector-item:last-child {
    border-bottom: none;
}

.version-selector-item:hover {
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
}

.version-selector-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.latest-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
}

.version-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-name {
    font-weight: 500;
}

.version-badge {
    background: #10b981;
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.latest-badge {
    background: #28a745;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
}

.version-selector {
    font-size: 0.9rem;
    color: #6c757d;
}

.current-version {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.docs-nav-section {
    margin-bottom: 2rem;
}

.docs-nav-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-nav-section li {
    margin-bottom: 0.5rem;
}

.docs-nav-section a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #6c757d;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.docs-nav-section a:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.docs-nav-section a.active {
    background: #3498db;
    color: white;
}

.docs-content {
    flex: 1;
    max-width: calc(100% - 280px);
    overflow-x: auto;
}

.docs-article {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem;
}

/* Documentation Banner Styles */
.kaniop-banner {
    width: 100%;
    font-size: 0.875rem;
    line-height: 1.5;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.kaniop-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
}

.kaniop-banner__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    flex-wrap: wrap;
}

.kaniop-banner__link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.kaniop-banner__link:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Warning Banner (for unreleased versions) */
.kaniop-banner--warning {
    background: rgba(255, 248, 230, 0.95);
    color: #b45309;
    border-bottom-color: #f59e0b;
}

.kaniop-banner--warning .kaniop-banner__link {
    color: #92400e;
}

/* Info Banner (for old versions) */
.kaniop-banner--info {
    background: rgba(239, 246, 255, 0.95);
    color: #1e40af;
    border-bottom-color: #3b82f6;
}

.kaniop-banner--info .kaniop-banner__link {
    color: #1d4ed8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .kaniop-banner__inner {
        padding: 0.75rem 1rem;
    }
    
    .kaniop-banner__content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .kaniop-banner__link {
        white-space: normal;
    }
}

.docs-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.docs-header h1 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.docs-description {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.docs-body {
    line-height: 1.7;
    color: #2c3e50;
}

.docs-body a {
    color: #2c3e50;
    text-decoration: underline;
    text-decoration-color: #6c757d;
    transition: all 0.2s ease;
}

.docs-body a:hover {
    color: #495057;
    text-decoration-color: #2c3e50;
}

.docs-body a:visited {
    color: #2c3e50;
}

.docs-body h1,
.docs-body h2,
.docs-body h3,
.docs-body h4,
.docs-body h5,
.docs-body h6 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

.docs-body h1 {
    font-size: 2.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.docs-body h2 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.docs-body h3 {
    font-size: 1.5rem;
}

.docs-body h4 {
    font-size: 1.25rem;
}

.docs-body h5 {
    font-size: 1.1rem;
}

.docs-body h6 {
    font-size: 1rem;
}

.docs-body p {
    margin-bottom: 1.5rem;
}

.docs-body ul,
.docs-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.docs-body li {
    margin-bottom: 0.5rem;
}

.docs-body blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
}

.docs-body blockquote p:last-child {
    margin-bottom: 0;
}

.docs-body code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SFMono-Regular', 'Monaco', 'Inconsolata', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.docs-body pre {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.docs-body pre code {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    color: #374151;
    font-size: 0.875rem;
    font-family: 'SFMono-Regular', 'Monaco', 'Inconsolata', 'Liberation Mono', 'Courier New', monospace;
    line-height: 1.5;
}

/* Remove double boxing from highlighted code blocks */
.docs-body .highlight {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
}

.docs-body .highlight pre {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.docs-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.docs-body table th,
.docs-body table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.docs-body table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.docs-body table tr:last-child td {
    border-bottom: none;
}

/* Note and Warning boxes - NOT for code */
.docs-body .note {
    background: #dbeafe;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    margin: 2rem 0;
}

.docs-body .warning {
    background: #fef3c7;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin: 2rem 0;
}

/* Code blocks - completely override any default styling */
.docs-body .highlighter-rouge,
.docs-body div[class*="highlight"]:not(.highlight),
.docs-body div[class*="language-"] {
    background: #ffffff !important;
    padding: 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    margin: 2rem 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
}

/* Ensure inner .highlight divs inside language containers don't get double borders */
.docs-body div[class*="language-"] .highlight {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.docs-body .highlighter-rouge pre,
.docs-body div[class*="highlight"]:not(.highlight) pre,
.docs-body div[class*="language-"] pre {
    background: none !important;
    padding: 1.5rem !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow-x: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.docs-body .highlighter-rouge code,
.docs-body div[class*="highlight"]:not(.highlight) code,
.docs-body div[class*="language-"] code {
    background: none !important;
    padding: 0 !important;
    border: none !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.docs-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.docs-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.docs-footer-prev,
.docs-footer-next {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.2s ease;
    max-width: 45%;
}

.docs-footer-prev:hover,
.docs-footer-next:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.docs-footer-prev {
    align-items: flex-start;
}

.docs-footer-next {
    align-items: flex-end;
    text-align: right;
}

.docs-footer-direction {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 0.25rem;
}

.docs-footer-title {
    font-weight: 500;
    color: #2c3e50;
}

.docs-footer-edit {
    text-align: center;
}

.docs-footer-edit a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

.docs-footer-edit a:hover {
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .docs-container {
        flex-direction: column;
    }
    
    .docs-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .docs-content {
        max-width: 100%;
    }
    
    .docs-article {
        padding: 2rem 1rem;
    }
    
    .docs-header h1 {
        font-size: 2rem;
    }
    
    .docs-footer-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .docs-footer-prev,
    .docs-footer-next {
        max-width: 100%;
    }
}

/* Enhanced syntax highlighting for code blocks */
.docs-body pre[class*="language-"] {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
}

/* Modern syntax highlighting - VS Code inspired */
.docs-body .highlight .err { background: none; color: #374151; }

/* Comments */
.docs-body pre .c,
.docs-body pre .c1,
.docs-body pre .cm,
.docs-body pre .cp {
    color: #6a737d;
    font-style: italic;
}

/* Keywords */
.docs-body pre .k,
.docs-body pre .kd,
.docs-body pre .kn,
.docs-body pre .kr,
.docs-body pre .kt {
    color: #0969da;
    font-weight: 600;
}

/* Strings */
.docs-body pre .s,
.docs-body pre .s1,
.docs-body pre .s2,
.docs-body pre .sb,
.docs-body pre .sc,
.docs-body pre .sd {
    color: #0a3069;
}

/* Numbers */
.docs-body pre .mi,
.docs-body pre .m,
.docs-body pre .mf,
.docs-body pre .mh {
    color: #0550ae;
}

/* Attributes/Names */
.docs-body pre .na,
.docs-body pre .nc,
.docs-body pre .nd,
.docs-body pre .ne {
    color: #8250df;
    font-weight: 600;
}

/* Variables */
.docs-body pre .nv,
.docs-body pre .vg,
.docs-body pre .vi {
    color: #953800;
}

/* Operators */
.docs-body pre .o,
.docs-body pre .ow {
    color: #cf222e;
}

/* Punctuation */
.docs-body pre .p {
    color: #24292f;
}

/* YAML specific */
.docs-body .language-yaml .na {
    color: #0969da;
    font-weight: 600;
}

.docs-body .language-yaml .s,
.docs-body .language-yaml .s2 {
    color: #0a3069;
}

/* Bash/Shell specific */
.docs-body .language-bash .nb,
.docs-body .language-bash .k {
    color: #cf222e;
    font-weight: 600;
}

.docs-body .language-bash .nv {
    color: #953800;
}

/* JSON specific */
.docs-body .language-json .nt {
    color: #0969da;
    font-weight: 600;
}

.docs-body .language-json .s2 {
    color: #0a3069;
}

.docs-body .language-json .kc {
    color: #0550ae;
}
