/* Modern GitBook.com inspired theme */

/* Variables for easy customization */
:root {
    --primary-color: #3b82f6;
    --sidebar-bg: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-active: #ffffff;
    --content-bg: #030712;
    --text-color: #9ca3af;
    --border-color: #374151;
    --code-bg: #f3f4f6;
    --heading-color: #d1d5db;
    --table-bg: #1f2937;
}

::-webkit-scrollbar {
    width: 0.4rem;
    height: 0.4rem;
}

/* Handle */
:-webkit-scrollbar-thumb {
    display: none;
}

*:hover::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.6);
    border-radius: 0.4rem;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 231, 235, 0.8);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Book Container */
.book {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
        "Oxygen", "Ubuntu", "Cantarell", sans-serif;
}

/* Sidebar Styling */
.book-summary {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    font-size: 14px;
}

.book-summary:hover {
    ::-webkit-scrollbar-thumb {
        background: rgba(107, 114, 128, 0.6);
        border-radius: 0.4rem;
    }
}

.book-header {
    position: fixed;
    padding: 0px;
    margin: 0px;
    background-color: var(--content-bg);
    width: 100%;
    z-index: 999;
    display: flex;
    justify-content: space-between;
}

/* hide everything inside */
.book-header * {
    display: none !important;
}

/* SHOW ONLY the first <a> */
.book-header > a.btn.pull-left.js-toolbar-action {
    display: flex !important;
    line-height: normal;
    align-items: center;
    justify-content: center;
}

/* Show the icon inside it */
.book-header > a.btn.pull-left.js-toolbar-action > i {
    display: inline-block !important;
}
/* KubeKit.io link button */
#kubekit-link-btn {
    display: flex !important;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50px;
    margin-right: 20px;
    margin-top: auto;
    margin-bottom: auto;
    line-height: normal;
    height: fit-content;
    text-transform: none;
    padding: 6px 16px;
}

.heroicons-solid--arrow-sm-right {
    display: inline-block !important;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%233b82f6' fill-rule='evenodd' d='M10.293 5.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414-1.414L12.586 11H5a1 1 0 1 1 0-2h7.586l-2.293-2.293a1 1 0 0 1 0-1.414' clip-rule='evenodd' stroke-width='0.2' stroke='%233b82f6'/%3E%3C/svg%3E");
    margin-left: 6px;
}

.book-summary ul.summary {
    padding: 20px 0;
}

.book-summary ul.summary li {
    margin: 0;
    padding: 0;
}

.book-summary ul.summary li a,
.book-summary ul.summary li span {
    display: block;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 400;
}

.book-summary ul.summary li a:hover {
    background: rgba(59, 130, 246, 0.05);
    color: var(--sidebar-active);
}

.book-summary ul.summary li.active > a {
    background: rgba(59, 130, 246, 0.1);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    font-weight: 500;
}

/* Chapter Headers */
.book-summary ul.summary li.header {
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

/* Content Area */
.book-body {
    top: 0 !important;
    background: var(--content-bg);
    background-color: var(--content-bg);
    color: var(--text-color);
}

.book-body:hover {
    ::-webkit-scrollbar-thumb {
        background: rgba(107, 114, 128, 0.6);
        border-radius: 0.4rem;
    }
}

.markdown-section {
    max-width: 1200px; /* Increased from 800px */
    margin: 0 auto;
    padding: 40px 60px;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
}

/* Make sidebar narrower to give more space to content */
.book-summary {
    width: 300px; /* Decreased from 300px default */
}

/* Typography */
.markdown-section h1 {
    font-size: 3rem; /* Increased from 2.5rem */
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
    border-bottom: none;
    padding-bottom: 0;
}

.markdown-section h2 {
    font-size: 2.25rem; /* Increased from 1.875rem */
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--heading-color);
}

.markdown-section h3 {
    font-size: 1.875rem; /* Increased from 1.5rem */
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

.markdown-section h4 {
    font-size: 1.5rem; /* Increased from 1.25rem */
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

/* Paragraphs */
.markdown-section p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.markdown-section b,
.markdown-section strong {
    filter: brightness(1.2);
}

/* Links */
.markdown-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.markdown-section a:hover {
    /* border-bottom-color: var(--primary-color); */
    text-decoration: underline;
}

/* Code Blocks */
.markdown-section pre {
    background: #111827;
    border-radius: 8px;
    padding: 20px;
    margin: 1.5rem 0;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.markdown-section pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
}

/* Inline Code */
.markdown-section code {
    background: #374151aa;
    color: #bfdbfe;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
}

/* Blockquotes */
.markdown-section blockquote {
    border-left: 4px solid var(--primary-color);
    background: #1f293744;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.markdown-section blockquote p {
    margin: 0;
    color: var(--text-color);
}

/* Tables */
.markdown-section table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    table-layout: fixed; /* Force equal column widths */
}

.markdown-section table th {
    color: var(--text-color);
    background-color: #1f2937;

    padding: 6px 16px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    width: 50%; /* Each column takes exactly 50% */
}

.markdown-section table td {
    color: var(--text-color);
    background-color: #111827;
    text-align: justify;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    width: 50%; /* Each column takes exactly 50% */
    vertical-align: top; /* Align content to top */
}

/* Lists */
.markdown-section ul,
.markdown-section ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-section li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.markdown-section img {
    border: 0;
    max-width: 95%;
    margin: 0px 20px;
    border-radius: 5px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation Buttons */
.navigation {
    border-top: none;
    color: #e5e7eb !important;
    position: absolute;
    top: 40%;
    bottom: 40%;
}

.navigation :hover {
    text-decoration: none !important;
    color: #9ca3af !important;
}

.navigation a {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #f9fafb;
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 500;
    transition: background 0.2s ease;
}

.navigation a:hover {
    background: #f3f4f6;
    border-bottom: none;
}

a.navigation.navigation-next:hover {
    background: #1f293744;
    border-radius: 30px 0px 0px 30px;
}

a.navigation.navigation-prev:hover {
    background: #1f293744;
    border-radius: 0px 30px 30px 0px;
}

/* Search Bar */
#book-search-input {
    padding: 2px 10px;
    margin: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: transparent;
    color: #9ca3af;
}

#book-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#book-search-input input,
#book-search-input input:focus,
#book-search-input input:hover {
    padding: 7px 0px 7px 32px;
    background: no-repeat left center;
    background-size: 1.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' stroke='gray' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' stroke-width='2'/%3E%3Cline x1='16' y1='16' x2='22' y2='22' stroke-width='2'/%3E%3C/svg%3E");
}

/* Copy Code Button */
.copy-code-button {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none !important;
    padding: 4px 6px !important;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-code-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Back to Top Button */
.back-to-top-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.back-to-top-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Page Footer */
.page-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: #6b7280;
    display: none;
}

/* Full-width layout - removes max-width constraint on larger screens */
@media (min-width: 1400px) {
    .markdown-section {
        max-width: 1400px; /* Even wider on large screens */
    }
}

/* Reduce excessive padding */
.page-wrapper {
    padding: 20px 40px;
    background: var(--content-bg);
}

/* Make content use available space better */
.book .book-body .page-wrapper .page-inner {
    max-width: none; /* Remove inner width constraint */
    padding: 0;
}
/* Tables */

.markdown-section table thead {
    background: var(--table-bg);
}

.markdown-section table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

a.gitbook-link {
    display: none !important;
}



@media (max-width: 600px) {
    :root {
        font-size: 0.5rem;
    }
    
    .markdown-section {
        padding: 30px 25px;
    }
    
    .markdown-section h1 {
        font-size: 2rem;
    }
    
    .markdown-section h2 {
        font-size: 1.5rem;
    }
    
    .markdown-section pre {
        border-radius: 6px;
        padding: 15px 20px 15px 20px;
    }

    .markdown-section img {
        max-width: 100%;
    }
    
    .code-wrapper i {
        position: absolute;
        top: 6px;
        right: 6px;
    }
    
    .code-wrapper pre {
        position: static !important;
    }
    
    .page-wrapper {
        padding: 0px 5px;
    }
    
    .navigation {
        min-width: 30px;
    }
    
    .book-summary {
        width: 200px;
    }
    .book.with-summary .book-body {
        left: 200px;
        transform: none;
    }
    
    #book-search-input input,
    #book-search-input input:focus,
    #book-search-input input:hover {
        padding: 7px 0px 7px 24px;
    }

    .book-header {
        height: 30px;
    }

    .book-header > a.btn.pull-left.js-toolbar-action {
        display: block !important;
        padding: 0px 8px;
        line-height: 30px;
    }

    .markdown-section table :is(th, td) {
        text-align: left;
        padding: 4px 8px;
    }
    
    #release-date {
        font-size: small !important;
    }

    #kubekit-link-btn {
        padding: 2px 10px;
        font-size: 1.25rem;
        margin-right: 8px;
    }

    .heroicons-solid--arrow-sm-right {
        width: 16px;
        height: 16px;
        margin-left: 4px;
    }
}

@media (max-width: 1240px) {
    .book-body .body-inner {
        position: inherit;
    }
    
    .navigation {
        max-width: fit-content;
        width: fit-content;
    }

    .navigation.navigation-unique {
        max-width: fit-content;
        width: fit-content;
    }
}

/* For mobile - change color state based on sidebar state */
@media (hover: none) {
    .book-header > a.btn.pull-left.js-toolbar-action {
        color: #fff;
    }

    /* When sidebar is open, change color state */
    .book.with-summary .book-header > a.btn.pull-left.js-toolbar-action {
        color: #444;
    }
}
