/* Docs Page Specific Styles - GitBook Inspired */

/* Override base styles for docs */
body.docs-page {
    background: #0d1117; /* Slightly lighter dark background for readability */
    color: #c9d1d9;
    height: 100vh;
    overflow: hidden; /* Prevent body scroll, layout handles it */
}

/* Docs Navbar */
.docs-navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    z-index: 1000;
    box-shadow: none !important;
}

.docs-navbar .nav-container {
    height: 100%;
    padding: 0 20px;
    max-width: 100%;
}

.docs-badge {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
    font-weight: 600;
    border: 1px solid rgba(0, 242, 255, 0.2);
    white-space: nowrap;
}

.mobile-sidebar-btn {
    display: none;
    color: #c9d1d9;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 15px;
}

/* Docs Layout */
.docs-layout {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
}

/* Left Sidebar Navigation */
.docs-sidebar {
    width: 300px;
    min-width: 300px;
    background: #161b22;
    border-right: 1px solid #30363d;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* Custom Scrollbar for Sidebar */
.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.sidebar-search {
    padding: 20px;
    position: relative;
    border-bottom: 1px solid #30363d;
    position: sticky;
    top: 0;
    background: #161b22;
    z-index: 10;
}

.sidebar-search input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 10px 10px 10px 35px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search input:focus {
    border-color: var(--primary-color);
}

.sidebar-search i {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
}

.sidebar-nav {
    padding: 20px 0;
    flex-grow: 1;
}

.nav-group {
    margin-bottom: 20px;
}

.group-title {
    font-size: 0.85rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    margin-bottom: 5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
}

.group-title:hover {
    color: #c9d1d9;
    background: rgba(255, 255, 255, 0.05);
}

.group-title::after {
    content: '\f107'; /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-group.collapsed .group-title::after {
    transform: rotate(-90deg);
}

.nav-group.collapsed .group-list {
    display: none;
}

.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-list li a {
    display: block;
    padding: 8px 20px 8px 30px;
    color: #c9d1d9;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.group-list li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.group-list li a.active {
    color: var(--primary-color);
    background: rgba(0, 242, 255, 0.05);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Area */
.docs-content {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    display: flex;
    background: #0d1117;
    scroll-behavior: smooth;
}

.content-wrapper {
    flex-grow: 1;
    max-width: 850px;
    padding: 40px 60px;
    margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb i {
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: #c9d1d9;
}

/* Article Typography (GitBook style) */
.doc-article {
    color: #c9d1d9;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Document List Styles */
.doc-list-container {
    margin-bottom: 40px;
}

.category-title {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 10px;
}

.category-desc {
    font-size: 1.1rem;
    color: #8b949e;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list li {
    margin-bottom: 15px;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.article-info h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    transition: color 0.2s;
}

.article-item:hover .article-info h3 {
    color: var(--primary-color);
}

.article-info p {
    color: #8b949e;
    font-size: 0.95rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    color: #8b949e;
    font-size: 0.85rem;
    min-width: 100px;
    text-align: right;
    flex-shrink: 0;
}

/* Search Page Input */
.search-page-input {
    display: flex;
    margin-bottom: 30px;
    background: #161b22;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.search-page-input input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: #c9d1d9;
    font-size: 1rem;
    outline: none;
}

.search-page-input button {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 0 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.search-page-input button:hover {
    background: #00d9e6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.doc-article h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

.doc-article h2 {
    font-size: 1.75rem;
    color: #fff;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #21262d;
}

.doc-article h3 {
    font-size: 1.25rem;
    color: #fff;
    margin: 30px 0 15px;
}

.doc-article p {
    margin-bottom: 16px;
}

.doc-article .lead {
    font-size: 1.2rem;
    color: #8b949e;
    margin-bottom: 40px;
}

.doc-article a {
    color: var(--primary-color);
    text-decoration: none;
}

.doc-article a:hover {
    text-decoration: underline;
}

.doc-article code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #ff7b72;
}

.doc-article ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.doc-article li {
    margin-bottom: 8px;
}

/* Warning Box */
.warning-box {
    background: rgba(210, 153, 34, 0.1);
    border-left: 4px solid #d29922;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.warning-box i {
    color: #d29922;
    font-size: 1.2rem;
    margin-top: 3px;
}

.warning-text {
    color: #e3b341;
    font-size: 0.95rem;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}

.doc-table th, .doc-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #30363d;
}

.doc-table th {
    background: #161b22;
    color: #fff;
    font-weight: 600;
}

.doc-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Step Boxes */
.step-box {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    background: #161b22;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.step-num {
    background: var(--primary-color);
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.step-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #8b949e;
}

/* Next / Prev Navigation */
.next-prev-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.nav-prev, .nav-next {
    display: flex;
    flex-direction: column;
    max-width: 45%;
}

.nav-next {
    text-align: right;
    margin-left: auto;
}

.next-prev-nav span {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 5px;
}

.next-prev-nav a {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.nav-prev.disabled a {
    color: #484f58;
    cursor: default;
    text-decoration: none;
}

/* Docs Footer */
.docs-footer {
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
    text-align: center;
    color: #8b949e;
    font-size: 0.9rem;
}

/* Right TOC Sidebar */
.toc-sidebar {
    width: 250px;
    min-width: 250px;
    padding: 40px 20px 40px 0;
    display: block;
}

.toc-container {
    position: sticky;
    top: 40px;
}

.toc-container h4 {
    font-size: 0.85rem;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 15px;
    padding-left: 10px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid #30363d;
}

.toc-list li a {
    display: block;
    padding: 6px 10px 6px 15px;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    margin-left: -1px;
}

.toc-list li a:hover {
    color: #c9d1d9;
}

.toc-list li a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .toc-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-sidebar-btn {
        display: block;
        order: 3;
    }

    .docs-navbar .nav-links {
        display: none; /* Hide standard links on mobile docs */
    }

    .docs-badge {
        font-size: 0.7rem;
        padding: 2px 5px;
        margin-left: 5px;
    }

    .docs-sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        transform: translateX(-100%);
        z-index: 999;
        width: 85vw;
        height: calc(100vh - 60px);
        bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .docs-sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .content-wrapper {
        padding: 20px;
    }
    
    .doc-article h1 {
        font-size: 2rem;
    }
    
    .step-box {
        flex-direction: column;
        gap: 10px;
    }

    .group-title,
    .group-list li a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
