.docs-wrapper {
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.docs-header {
    text-align: center;
    margin-bottom: 50px;
}

.docs-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.docs-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.docs-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.6;
}

.docs-card {
    background: rgba(15, 10, 10, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.docs-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    opacity: 0.5;
}

.docs-card:hover {
    border-color: rgba(239, 68, 68, 0.4);
}

.docs-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-card-title .icon {
    font-size: 1.4rem;
}

.docs-lead {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Policy specific components */
.policy-intro-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #cbd5e1;
    line-height: 1.8;
}

.policy-item-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.policy-item-desc {
    color: #cbd5e1;
    line-height: 1.8;
    margin-bottom: 0;
}

.policy-box {
    border-radius: 12px;
    transition: all 0.2s ease;
}

.policy-box-allowed {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #cbd5e1;
}

.policy-badge-allowed {
    font-size: 1.1rem;
    font-weight: 700;
    color: #34d399;
}

.policy-box-prohibited {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #cbd5e1;
}

.policy-badge-prohibited {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f87171;
}

/* Code Snippets & Pre blocks */
.code-block {
    background: #0d0909;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 18px 22px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: #f1f5f9;
    overflow-x: auto;
    margin: 18px 0;
    line-height: 1.7;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.code-block .keyword { color: #f87171; font-weight: 700; }
.code-block .comment { color: #64748b; font-style: italic; }
.code-block .variable { color: #fbbf24; }
.code-block .string { color: #34d399; }
.code-block .heading { color: #60a5fa; font-weight: bold; }

/* Documentation Tables */
.docs-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.docs-table th {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    font-family: 'JetBrains Mono', monospace;
    text-align: left;
    white-space: nowrap;
}

.docs-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: top;
    line-height: 1.6;
}

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

.docs-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.docs-wrapper code,
.docs-table code {
    font-family: 'JetBrains Mono', monospace;
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.88em;
}

.docs-wrapper .code-block code {
    font-size: inherit;
}

/* Documentation Badges & Tags */
.docs-wrapper .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.35rem 0.7rem !important;
    font-size: 0.82rem;
    line-height: 1.25;
    border-radius: 6px;
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
}

.docs-wrapper .docs-spoiler-summary .badge {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.8rem;
    line-height: 1.2;
    border-radius: 6px;
    vertical-align: middle;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    justify-content: center;
    flex-shrink: 0;
    text-align: center;
}

.docs-wrapper .docs-table .badge {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.82rem;
    line-height: 1.2;
    border-radius: 6px;
    display: inline-flex !important;
}

/* Feature Checklist & Lists */
.docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav),
.docs-wrapper ol {
    margin: 15px 0;
    padding-left: 1.4rem;
    color: #cbd5e1;
    line-height: 1.75;
}

.docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav) li,
.docs-wrapper ol li {
    padding: 4px 0;
    line-height: 1.75;
}

.docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav) li::marker,
.docs-wrapper ol li::marker {
    color: #f87171;
    font-weight: bold;
}

.feature-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 15px 0;
}

.feature-list > li {
    position: relative;
    padding: 6px 0 6px 1.5rem !important;
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.75;
    text-indent: 0 !important;
}

.feature-list > li > span:first-child:is([style*="color"]) {
    position: absolute;
    left: 0;
    top: 6px;
    line-height: 1.75;
    display: inline-block;
    width: 1.2rem;
    text-align: left;
}

.feature-list > li ul,
.feature-list > li ol {
    margin: 8px 0 4px 0 !important;
    padding-left: 1.4rem !important;
}

.feature-list > li ul li,
.feature-list > li ol li {
    padding: 3px 0 !important;
    line-height: 1.65;
}

.alert-box-warn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
    color: #fca5a5;
    font-size: 0.95rem;
    line-height: 1.6;
}

.alert-box-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
    color: #93c5fd;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Table of Contents Sticky Nav */
.toc-box {
    background: rgba(15, 10, 10, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 100px;
    margin-bottom: 30px;
}

.toc-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f87171;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}

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

.toc-list li {
    margin-bottom: 10px;
}

.toc-list a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
    transition: 0.2s;
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
}

.toc-list a:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.15);
    padding-left: 12px;
}

@media (max-width: 991px) {
    .toc-box {
        position: static;
        margin-bottom: 40px;
    }
}

body.light-mode .docs-title {
    color: #0f172a !important;
}

body.light-mode .docs-subtitle {
    color: #475569 !important;
}

body.light-mode .docs-badge {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

body.light-mode .docs-card {
    background: #ffffff !important;
    border: 1px solid rgba(239, 68, 68, 0.22) !important;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .docs-card::before {
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    opacity: 0.7;
}

body.light-mode .docs-card-title {
    color: #0f172a !important;
}

body.light-mode .docs-lead {
    color: #334155 !important;
}

/* Force dark text on all paragraphs and headings in light mode */
body.light-mode .docs-card p,
body.light-mode .docs-card span:not(.badge):not([class*="badge"]),
body.light-mode .docs-card li,
body.light-mode .docs-card ol,
body.light-mode .docs-card ul {
    color: #334155;
}

body.light-mode .docs-card p[style*="color"],
body.light-mode .docs-card h3[style*="color"],
body.light-mode .docs-card h4[style*="color"],
body.light-mode .docs-card h5[style*="color"],
body.light-mode .docs-card h6[style*="color"],
body.light-mode .docs-card li[style*="color"] {
    color: #334155 !important;
}

body.light-mode .docs-card h3,
body.light-mode .docs-card h4,
body.light-mode .docs-card h5,
body.light-mode .docs-card h6 {
    color: #0f172a !important;
}

body.light-mode .docs-card strong {
    color: #0f172a;
}

/* Policy Card Light Mode */
body.light-mode .policy-intro-card {
    background: #ffffff !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    color: #334155 !important;
}

body.light-mode .policy-item-title {
    color: #0f172a !important;
}

body.light-mode .policy-item-desc {
    color: #334155 !important;
}

body.light-mode .policy-box-allowed {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
}

body.light-mode .policy-box-allowed p {
    color: #065f46 !important;
}

body.light-mode .policy-badge-allowed {
    color: #059669 !important;
}

body.light-mode .policy-box-prohibited {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    color: #9f1239 !important;
}

body.light-mode .policy-box-prohibited p {
    color: #9f1239 !important;
}

body.light-mode .policy-badge-prohibited {
    color: #dc2626 !important;
}

/* Code Blocks in Light Mode (Clean dark terminal container) */
body.light-mode .code-block {
    background: #18181b !important;
    border: 1px solid #3f3f46 !important;
    color: #f4f4f5 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

/* Tables in Light Mode */
body.light-mode .docs-table-wrapper {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .docs-table th {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-bottom: 2px solid #fca5a5 !important;
}

body.light-mode .docs-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155 !important;
}

body.light-mode .docs-table tr:hover td {
    background: #fff5f5 !important;
}

body.light-mode .docs-wrapper code,
body.light-mode .docs-table code {
    background: none !important;
    color: inherit !important;
    border: none !important;
}

/* Feature list and lists in Light Mode */
body.light-mode .docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav),
body.light-mode .docs-wrapper ol {
    color: #334155 !important;
}

body.light-mode .docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav) li,
body.light-mode .docs-wrapper ol li {
    color: #334155 !important;
}

body.light-mode .docs-wrapper ul:not(.toc-list):not(.dropdown-menu):not(.navbar-nav) li::marker,
body.light-mode .docs-wrapper ol li::marker {
    color: #dc2626 !important;
}

body.light-mode .feature-list li {
    color: #334155 !important;
}

/* Alerts in Light Mode */
body.light-mode .alert-box-warn {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    border-left: 4px solid #ef4444 !important;
    color: #9f1239 !important;
}

body.light-mode .alert-box-warn li,
body.light-mode .alert-box-warn p,
body.light-mode .alert-box-warn div {
    color: #9f1239 !important;
}

body.light-mode .alert-box-info {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 4px solid #3b82f6 !important;
    color: #1e40af !important;
}

body.light-mode .alert-box-info li,
body.light-mode .alert-box-info p,
body.light-mode .alert-box-info div {
    color: #1e40af !important;
}

/* Table of Contents in Light Mode */
body.light-mode .toc-box {
    background: #ffffff !important;
    border: 1px solid rgba(239, 68, 68, 0.22) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .toc-title {
    color: #dc2626 !important;
}

body.light-mode .toc-list a {
    color: #475569 !important;
}

body.light-mode .toc-list a:hover {
    color: #dc2626 !important;
    background: #fee2e2 !important;
}

/* Tutorial / Documentation Images */
.docs-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: block;
    margin: 14px 0 8px 0;
}

.docs-figure {
    margin: 16px 0 24px 0;
}

.docs-figcaption {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 6px;
    font-style: italic;
}

body.light-mode .docs-img {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body.light-mode .docs-figcaption {
    color: #64748b;
}

/* Custom Accordion / Spoiler Component */
.docs-spoiler {
    background: rgba(20, 10, 10, 0.5);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.docs-spoiler[open] {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(26, 12, 12, 0.7);
    box-shadow: 0 4px 25px rgba(239, 68, 68, 0.08);
}

.docs-spoiler-summary {
    padding: 16px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.docs-spoiler-summary::-webkit-details-marker {
    display: none;
}

.docs-spoiler-summary:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.docs-spoiler-summary .spoiler-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.docs-spoiler-summary .spoiler-icon {
    font-size: 0.85rem;
    transition: transform 0.25s ease;
    color: #f87171;
}

.docs-spoiler[open] .docs-spoiler-summary .spoiler-icon {
    transform: rotate(180deg);
}

.docs-spoiler-body {
    padding: 10px 22px 24px 22px;
    border-top: 1px solid rgba(239, 68, 68, 0.15);
}

body.light-mode .docs-spoiler {
    background: #ffffff;
    border-color: rgba(239, 68, 68, 0.22);
}

body.light-mode .docs-spoiler[open] {
    border-color: #ef4444;
    background: #fffafa;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.08);
}

body.light-mode .docs-spoiler-summary {
    color: #0f172a;
}

body.light-mode .docs-spoiler-summary:hover {
    background: #fee2e2;
    color: #dc2626;
}

body.light-mode .docs-spoiler-body {
    border-top-color: rgba(239, 68, 68, 0.15);
}
