/* ===== DOCS RESET ===== */
.docs-body *,
.docs-body *::before,
.docs-body *::after {
    box-sizing: border-box;
}

/* ===== HEADER ===== */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0f172a;
    z-index: 200;
    border-bottom: 1px solid #1e293b;
}

.docs-header-inner {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
    flex-shrink: 0;
}

.docs-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.docs-logo-sub {
    font-weight: 400;
    color: #94a3b8;
    font-size: 14px;
    margin-left: 2px;
}

/* ===== SEARCH ===== */
.docs-search-wrap {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.docs-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
}

.docs-search-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 14px 8px 36px;
    color: #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.docs-search-input::placeholder {
    color: #64748b;
}

.docs-search-input:focus {
    border-color: #2563eb;
}

.docs-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 300;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.docs-search-results.show {
    display: block;
}

.docs-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #1e293b;
    cursor: pointer;
    transition: background 0.15s;
}

.docs-search-result-item:last-child {
    border-bottom: none;
}

.docs-search-result-item:hover {
    background: #334155;
    color: #fff;
}

.docs-search-result-item .result-icon {
    color: #64748b;
    font-size: 13px;
    min-width: 16px;
    text-align: center;
}

.docs-search-result-item .result-topic {
    font-size: 11px;
    color: #64748b;
    margin-left: auto;
    white-space: nowrap;
}

.docs-search-empty {
    padding: 16px 14px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* ===== BACK TO APP ===== */
.docs-back-app {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.docs-back-app:hover {
    color: #fff;
}

/* ===== BODY LAYOUT ===== */
.docs-body {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ===== SIDEBAR ===== */
.docs-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.docs-sidebar::-webkit-scrollbar {
    width: 5px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.docs-sidebar-inner {
    padding: 16px 0;
}

.docs-nav-group {
    margin-bottom: 8px;
}

.docs-nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    padding: 8px 20px 4px;
}

.docs-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.docs-nav-item i {
    font-size: 15px;
    min-width: 18px;
    text-align: center;
    color: #9ca3af;
    transition: color 0.15s;
}

.docs-nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.docs-nav-item:hover i {
    color: #2563eb;
}

.docs-nav-item.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

.docs-nav-item.active i {
    color: #2563eb;
}

/* ===== CONTENT ===== */
.docs-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px 80px;
    max-width: 920px;
    min-width: 0;
}

/* ===== CONTENT TYPOGRAPHY ===== */
.docs-content h1 {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.docs-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 32px;
    margin-bottom: 12px;
}

.docs-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-top: 24px;
    margin-bottom: 8px;
}

.docs-content p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 14px;
}

.docs-content a {
    color: #2563eb;
    text-decoration: none;
}

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

.docs-content ul,
.docs-content ol {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.7;
    padding-left: 24px;
    margin-bottom: 14px;
}

.docs-content li {
    margin-bottom: 4px;
}

.docs-content code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    color: #be185d;
    font-family: "Cascadia Code", "Fira Code", monospace;
}

.docs-content pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
    font-family: "Cascadia Code", "Fira Code", monospace;
}

.docs-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ===== SUBTITLE ===== */
.docs-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ===== CALLOUT BOXES ===== */
.docs-callout {
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.docs-callout i {
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

.docs-callout-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.docs-callout-tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.docs-callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.docs-callout-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ===== TABLES ===== */
.docs-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

.docs-content table th {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.docs-content table td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    color: #4b5563;
}

.docs-content table tr:hover td {
    background: #f9fafb;
}

/* ===== SECTION CARDS ===== */
.docs-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.docs-section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.docs-section-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
}

.docs-section-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.docs-section-card .card-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}

.docs-section-card .card-icon.purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.docs-section-card .card-icon.green {
    background: #f0fdf4;
    color: #16a34a;
}

.docs-section-card .card-icon.orange {
    background: #fff7ed;
    color: #ea580c;
}

.docs-section-card .card-icon.red {
    background: #fef2f2;
    color: #dc2626;
}

.docs-section-card .card-icon.teal {
    background: #f0fdfa;
    color: #0d9488;
}

.docs-section-card .card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.docs-section-card .card-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* ===== STEP LIST ===== */
.docs-steps {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
    counter-reset: docs-step;
}

.docs-steps li {
    counter-increment: docs-step;
    position: relative;
    padding: 12px 0 12px 52px;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.docs-steps li::before {
    content: counter(docs-step);
    position: absolute;
    left: 0;
    top: 10px;
    width: 32px;
    height: 32px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.docs-steps li:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

/* ===== DIAGRAM / FLOW BOX ===== */
.docs-diagram {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
    white-space: pre;
}

/* ===== COMMAND CATEGORY ===== */
.docs-cmd-group {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.docs-cmd-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.docs-cmd-group-header:hover {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.docs-cmd-group-header h3 {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.docs-cmd-group-header .group-count {
    font-size: 12px;
    color: #9ca3af;
    background: #e5e7eb;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.docs-cmd-group-header .group-toggle {
    color: #6b7280;
    transition: transform 0.2s;
}

.docs-cmd-group-header.collapsed .group-toggle {
    transform: rotate(-90deg);
}

.docs-cmd-group-body {
    padding: 12px;
}

.docs-cmd-group-body.collapsed {
    display: none;
}

/* ===== SINGLE COMMAND CARD ===== */
.docs-cmd-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.docs-cmd-card:last-child {
    margin-bottom: 0;
}

.docs-cmd-card:hover {
    border-color: #e0e7ff;
}

.docs-cmd-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.docs-cmd-name {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.docs-cmd-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.docs-cmd-badge.kb {
    background: #f5f3ff;
    color: #7c3aed;
}

.docs-cmd-badge.fn {
    background: #eff6ff;
    color: #2563eb;
}

.docs-cmd-badge.mouse {
    background: #f0fdf4;
    color: #16a34a;
}

.docs-cmd-badge.var {
    background: #fff7ed;
    color: #ea580c;
}

.docs-cmd-badge.wait {
    background: #fefce8;
    color: #a16207;
}

.docs-cmd-badge.cond {
    background: #fef2f2;
    color: #dc2626;
}

.docs-cmd-badge.dfn {
    background: #fdf4ff;
    color: #a21caf;
}

.docs-cmd-badge.param {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.docs-cmd-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 10px;
}

.docs-cmd-example {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    margin-bottom: 0;
}

.docs-cmd-example-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.docs-cmd-example code {
    font-size: 12px;
}

/* ===== COMPARISON TABLE ===== */
.docs-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.docs-compare-col {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.docs-compare-col h4 {
    margin-top: 0;
    font-size: 14px;
}

.docs-compare-col ul {
    padding-left: 18px;
    font-size: 13px;
}

/* ===== HIGHLIGHT BOX ===== */
.docs-highlight {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.docs-highlight h3 {
    margin-top: 0;
}

/* ===== MOBILE TOGGLE ===== */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    font-size: 22px;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .docs-header-inner {
        padding: 0 16px;
    }

    .docs-logo-sub {
        display: none;
    }

    .docs-back-app {
        display: none;
    }

    .docs-search-wrap {
        max-width: none;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .docs-sidebar.show {
        transform: translateX(0);
    }

    .docs-content {
        margin-left: 0;
        padding: 24px 20px 80px;
    }

    .docs-mobile-toggle {
        display: flex;
    }

    .docs-section-grid {
        grid-template-columns: 1fr;
    }

    .docs-compare {
        grid-template-columns: 1fr;
    }
}
