/* VS CODE DOCUMENTATION STYLE */

:root {
    --primary: #0078d4;
    --text: #333;
    --text-muted: #666;
    --bg: #ffffff;
    --bg-alt: #f3f3f3;
    --border: #d4d4d4;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===========================
   HEADER
   =========================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 50px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: all 200ms;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Search */
.search-container {
    position: relative;
    width: 200px;
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 13px;
    background: var(--bg);
}

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

.search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ===========================
   MAIN LAYOUT
   =========================== */

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.nav-container {
    padding: 15px 0;
}

.nav-section {
    margin: 0;
    padding: 0;
    border: none;
}

.nav-section-title {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.nav-section:first-child .nav-section-title {
    margin-top: 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 8px 15px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms;
    border-left: 3px solid transparent;
    line-height: 1.4;
}

.nav-link:hover {
    background: rgba(0, 120, 212, 0.08);
    color: var(--primary);
}

.nav-link.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--primary);
    font-weight: 500;
    border-left-color: var(--primary);
}

/* ===========================
   CONTENT WRAPPER
   =========================== */

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    background: var(--bg);
}

.breadcrumbs {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border: none;
}

.breadcrumb-item {
    display: inline;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: #bbb;
}

/* ===========================
   TYPOGRAPHY
   =========================== */

.main-content h1 {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text);
    line-height: 1.3;
}

.main-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 28px 0 14px 0;
    color: var(--text);
    line-height: 1.3;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.main-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: var(--text);
    line-height: 1.3;
}

.main-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: var(--text);
}

.main-content p {
    margin-bottom: 14px;
    line-height: 1.6;
    color: var(--text);
}

.main-content a {
    color: var(--primary);
    text-decoration: none;
}

.main-content a:hover {
    text-decoration: underline;
}

.main-content strong {
    font-weight: 600;
}

.main-content ul,
.main-content ol {
    margin: 14px 0 14px 28px;
}

.main-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.main-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    margin: 16px 0;
    background: #f3f3f3;
    color: var(--text-muted);
}

/* ===========================
   CODE & BLOCKS
   =========================== */

.main-content pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 14px;
    overflow-x: auto;
    margin: 16px 0;
}

.main-content pre code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.main-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    background: #f5f5f5;
    color: #d73a49;
    padding: 2px 6px;
    border-radius: 2px;
}

.main-content pre code {
    background: transparent;
    color: #333;
    padding: 0;
    border: none;
}

/* ===========================
   TABLES
   =========================== */

.main-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.main-content table thead {
    background: #f3f3f3;
}

.main-content table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
}

.main-content table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    color: var(--text);
}

.main-content table tbody tr:hover {
    background: #fafafa;
}

/* ===========================
   TOC SIDEBAR
   =========================== */

.toc-sidebar {
    width: 250px;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 40px 15px;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.toc-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.toc-nav {
    list-style: none;
}

.toc-item {
    list-style: none;
    margin-bottom: 6px;
}

.toc-link {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 150ms;
    border-left: 2px solid transparent;
    padding-left: 10px;
    line-height: 1.4;
}

.toc-link:hover {
    color: var(--primary);
    border-left-color: var(--primary);
}

.toc-link.active {
    color: var(--primary);
    font-weight: 500;
    border-left-color: var(--primary);
}

.toc-item.level-3 .toc-link {
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================
   SEARCH MODAL
   =========================== */

.search-modal {
    position: fixed;
    top: 60px;
    right: 30px;
    width: 360px;
    max-height: 380px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow-y: auto;
}

.search-results {
    padding: 0;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 150ms;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-title {
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 3px;
    font-size: 13px;
}

.search-result-preview {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1199px) {
    .toc-sidebar {
        display: none;
    }

    .main-content {
        padding: 30px 40px;
    }
}

@media (max-width: 767px) {
    .menu-toggle {
        display: flex;
    }

    .header {
        padding: 0 16px;
    }

    .search-container {
        width: 30px;
    }

    .search-input {
        width: 0;
        border: none;
        background: transparent;
        padding: 0;
    }

    .search-input:focus {
        width: 180px;
        border: 1px solid var(--border);
        background: var(--bg);
        padding: 6px 10px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 50px;
        width: 70%;
        height: calc(100vh - 50px);
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 200ms;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        padding: 20px;
        max-width: 100%;
    }

    .main-content h1 {
        font-size: 26px;
    }

    .main-content h2 {
        font-size: 20px;
    }

    .toc-sidebar {
        display: none;
    }

    .search-modal {
        right: 16px;
        width: calc(100% - 32px);
        max-width: 360px;
    }
}

@media (max-width: 479px) {
    .header {
        padding: 0 12px;
    }

    .logo {
        font-size: 14px;
        gap: 6px;
    }

    .main-content {
        padding: 16px;
    }

    .main-content h1 {
        font-size: 22px;
    }

    .main-content h2 {
        font-size: 18px;
    }

    .sidebar {
        width: 80%;
    }
}

/* ===========================
   UTILITIES
   =========================== */

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.error {
    background: #fde8e8;
    border-left: 3px solid #c72e1d;
    padding: 12px 14px;
    color: #c72e1d;
    margin: 16px 0;
}

@media print {
    .header,
    .sidebar,
    .toc-sidebar,
    .search-modal,
    .menu-toggle {
        display: none;
    }
}
