/* ===== Docs Page Styles — Redesigned (no sidebar) ===== */

/* --- Page Hero Header --- */
.docs-hero {
    background: linear-gradient(135deg, #0d1e38 0%, #1e3a5f 60%, #1e477b 100%);
    padding: 120px 24px 72px; /* 80px header offset + visual breathing room */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.docs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(96,165,250,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.docs-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.docs-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #93c5fd;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 5px 16px;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}

.docs-hero h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.15;
}

.docs-hero p {
    font-size: 18px;
    color: #93c5fd;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
}

/* --- Sticky Top Nav --- */
.docs-topnav {
    position: sticky;
    top: 80px; /* matches site header height */
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.docs-topnav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.docs-topnav-inner::-webkit-scrollbar { display: none; }

/* Scroll arrow buttons for the topnav */
.topnav-scroll-btn {
    position: absolute;
    top: 0;
    width: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.96);
    border: none;
    cursor: pointer;
    z-index: 10;
    color: var(--text-gray);
    font-size: 13px;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.topnav-scroll-btn:hover {
    color: var(--primary-blue);
    background: rgba(255,255,255,1);
}

.topnav-scroll-btn.btn-left {
    left: 0;
    box-shadow: 4px 0 8px rgba(255,255,255,0.9);
}

.topnav-scroll-btn.btn-right {
    right: 0;
    box-shadow: -4px 0 8px rgba(255,255,255,0.9);
}

.topnav-scroll-btn.hidden {
    display: none;
}

.docs-topnav-group {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.docs-topnav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 8px 0 16px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 52px;
}

.docs-topnav-label:first-child {
    padding-left: 0;
}

.docs-topnav-group + .docs-topnav-group {
    border-left: 1px solid #e2e8f0;
    margin-left: 20px;
    padding-left: 8px;
}

.topnav-link {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-gray);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.18s;
    position: relative;
}

.topnav-link:hover {
    color: var(--primary-blue);
    background: var(--bg-blue-light);
}

.topnav-link.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    font-weight: 600;
}

/* --- Main Content --- */
.docs-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 64px 24px 100px;
}

/* --- Sections --- */
.docs-section {
    margin-bottom: 80px;
    scroll-margin-top: 130px;
}

.docs-section h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.docs-section h2 i {
    width: 40px;
    height: 40px;
    background: var(--bg-blue-light);
    color: var(--primary-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--bg-blue-light), transparent);
    border: none;
    margin: 16px 0 28px;
    border-radius: 2px;
}

.docs-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-dark);
}

.docs-section p {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.85;
    margin-bottom: 16px;
}

/* Quick Start steps flow */
.steps-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: start;
    margin: 28px 0;
}

.step-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px 24px;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.step-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.step-card-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    opacity: 0.5;
}

.step-card-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-blue-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary-blue);
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 17px;
    margin: 0 0 8px;
}

.step-card p {
    font-size: 14px;
    margin: 0;
}

.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    padding-top: 56px;
    color: var(--text-light);
    font-size: 18px;
    flex-shrink: 0;
}

/* Callouts */
.docs-callout {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.75;
}

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

.docs-callout a {
    color: var(--primary-blue);
    text-decoration: underline;
}

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

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

.callout-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.callout-warn i { color: #f59e0b; }

/* Docs Steps (timeline) */
.docs-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 24px 0;
    border-left: 2px solid var(--bg-blue-light);
    padding-left: 0;
}

.docs-step {
    padding: 0 0 32px 28px;
    position: relative;
}

.docs-step::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.docs-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.docs-step-num {
    width: 28px;
    height: 28px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.docs-step-header h3 {
    margin: 0;
    font-size: 16px;
}

.docs-step-body p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.75;
    margin: 0 0 8px;
}

.docs-step-body a {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Inline code */
code {
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Reset code element styles inside dark pre blocks */
.docs-code code,
.docs-code code span {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Code Blocks */
.code-block-wrap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.docs-code {
    margin: 0;
    padding: 20px 24px;
    background: #0d1117;
    font-size: 13px;
    line-height: 1.8;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #c9d1d9;
}

/* YAML syntax highlights */
.yaml-key    { color: #79c0ff; }
.yaml-colon  { color: #c9d1d9; }
.yaml-val    { color: #79c0ff; }
.yaml-str    { color: #a5d6ff; }
.yaml-bool   { color: #ff7b72; }
.yaml-comment{ color: #8b949e; }
.yaml-dash   { color: #ff7b72; }
.t-comment   { color: #8b949e; }

/* Config Table */
.config-desc-table {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.config-desc-table table {
    width: 100%;
    border-collapse: collapse;
}

.config-desc-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.config-desc-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-dark);
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.6;
}

.config-desc-table tr:last-child td { border-bottom: none; }

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.rule-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.rule-card:hover {
    box-shadow: var(--shadow-md);
}

.rule-type {
    display: inline-block;
    background: var(--primary-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: monospace;
}

.rule-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.rule-example {
    display: block;
    background: #f1f5f9;
    color: #be185d;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: monospace;
    margin-bottom: 8px;
}

.rule-note {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0;
}

/* Protocols table */
.protocols-table {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 20px 0;
}

.protocols-table table {
    width: 100%;
    border-collapse: collapse;
}

.protocols-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.protocols-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-gray);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    line-height: 1.6;
}

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

.proto-tag {
    display: inline-block;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Proxy Groups */
.proxy-group-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.pg-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.pg-card:hover {
    box-shadow: var(--shadow-md);
}

.pg-type {
    display: inline-block;
    background: var(--bg-blue-light);
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 10px;
}

.pg-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
}

.pg-card p {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0;
}

/* Performance grid */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0 28px;
}

.perf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.perf-card:hover {
    box-shadow: var(--shadow-md);
}

.perf-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--primary-blue);
    font-size: 17px;
}

.perf-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px;
}

.perf-card p {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.6;
    margin: 0;
}

/* Ordered list */
.docs-ol {
    padding-left: 20px;
    list-style: decimal;
    margin: 16px 0;
}

.docs-ol li {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 8px;
}

.docs-ol li strong { color: var(--text-dark); }

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    transition: box-shadow 0.2s;
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
    user-select: none;
    transition: background 0.15s;
    border-radius: 14px;
}

details[open] > .faq-question {
    border-radius: 14px 14px 0 0;
}

.faq-question:hover { background: var(--bg-gray); }

.faq-question::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--text-gray);
    transition: transform 0.2s;
    flex-shrink: 0;
}

details[open] .faq-question::after { transform: rotate(180deg); }

.faq-answer {
    padding: 16px 24px 20px;
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.8;
    max-height: none;
    overflow: visible;
    border-top: 1px solid #e2e8f0;
}

.faq-answer ol, .faq-answer ul {
    padding-left: 20px;
    margin: 8px 0;
}

.faq-answer ol { list-style: decimal; }
.faq-answer ul { list-style: disc; }
.faq-answer li { margin-bottom: 6px; }

.faq-answer a {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Outline button */
.btn-outline-blue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--border-radius-pill);
    border: 1.5px solid var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-outline-blue:hover { background: var(--bg-blue-light); }

/* Download CTA at bottom */
.docs-dl-cta {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.docs-dl-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    background: linear-gradient(135deg, #0d1e38 0%, #1e3a5f 100%);
    border-radius: 24px;
    padding: 40px 48px;
    flex-wrap: wrap;
}

.docs-dl-cta-inner h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.docs-dl-cta-inner p {
    font-size: 15px;
    color: #93c5fd;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .docs-topnav {
        top: 64px;
    }

    .docs-hero {
        padding-top: 104px; /* 64px header + 40px breathing room */
    }
}

@media (max-width: 768px) {
    .docs-hero h1 { font-size: 32px; }
    .docs-hero p { font-size: 15px; }
    .docs-body { padding: 40px 20px 80px; }

    /* Config & Protocols tables: force horizontal scroll instead of squeezing */
    .config-desc-table {
        -webkit-overflow-scrolling: touch;
    }
    .config-desc-table table {
        min-width: 480px;
        width: max-content;
    }
    .config-desc-table th:first-child,
    .config-desc-table td:first-child {
        white-space: nowrap;
    }

    .protocols-table {
        -webkit-overflow-scrolling: touch;
    }
    .protocols-table table {
        min-width: 520px;
        width: max-content;
    }
    .protocols-table th:first-child,
    .protocols-table td:first-child {
        white-space: nowrap;
    }

    .steps-flow {
        grid-template-columns: 1fr;
    }

    .step-arrow {
        padding-top: 0;
        padding: 4px 0;
        transform: rotate(90deg);
        justify-self: center;
    }

    .rules-grid { grid-template-columns: 1fr; }

    .proxy-group-cards { grid-template-columns: 1fr 1fr; }
    .perf-grid { grid-template-columns: 1fr 1fr; }

    .docs-dl-cta-inner {
        padding: 28px 24px;
        flex-direction: column;
        align-items: flex-start;
    }

    .docs-dl-cta-inner .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .docs-section h2 { font-size: 24px; }
}

@media (max-width: 480px) {
    .proxy-group-cards { grid-template-columns: 1fr; }
    .perf-grid { grid-template-columns: 1fr; }
    .docs-topnav-label { display: none; }
}
