/* ================================================================
   ManaVault Documentation Stylesheet
   Shared across all /docs/ pages
   (c) 2024-2026 BTCin Corporate s.r.o.
   ================================================================ */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: #0A0E1A;
    color: #CBD5E1;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #0891B2;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #28C6DF;
}

h1, h2, h3, h4 {
    color: #F8FAFC;
    letter-spacing: -0.02em;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #1E293B;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    color: #0891B2;
}

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

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #1E293B;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.docs-logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: #F8FAFC;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.docs-logo span {
    color: #0891B2;
}

.docs-breadcrumb {
    font-size: 0.875rem;
    color: #64748B;
}

.docs-breadcrumb a {
    color: #94A3B8;
}

.docs-breadcrumb a:hover {
    color: #0891B2;
}

.docs-header-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #F8FAFC;
    background: #0891B2;
    padding: 0.375rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.docs-header-cta:hover {
    background: #28C6DF;
    color: #F8FAFC;
}

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

.docs-layout {
    display: flex;
    max-width: 1200px;
    margin: 56px auto 0;
    min-height: calc(100vh - 56px);
}

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

.docs-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 2rem 1.5rem 2rem 0;
    border-right: 1px solid #1E293B;
}

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

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

.docs-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.docs-toc ol {
    list-style: none;
    counter-reset: toc;
}

.docs-toc li {
    counter-increment: toc;
}

.docs-toc a {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: #94A3B8;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.docs-toc a:hover {
    background: rgba(8, 145, 178, 0.08);
    color: #0891B2;
}

.docs-toc a.active {
    background: rgba(8, 145, 178, 0.12);
    color: #0891B2;
    font-weight: 600;
}

.docs-related {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1E293B;
}

.docs-related-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
}

.docs-related a {
    display: block;
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    color: #64748B;
    border-radius: 6px;
    transition: color 0.15s;
}

.docs-related a:hover {
    color: #0891B2;
}

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

.docs-content {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 0 4rem 3rem;
}

.docs-title-block {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #1E293B;
}

.docs-title-block h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.docs-subtitle {
    font-size: 1.0625rem;
    color: #94A3B8;
    line-height: 1.6;
}

.docs-meta {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748B;
}

/* ================================================================
   SECTIONS
   ================================================================ */

.docs-section {
    margin-bottom: 3rem;
    scroll-margin-top: 5rem;
}

.docs-section h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0891B2;
    display: inline-block;
}

.docs-section h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #E2E8F0;
}

.docs-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: #CBD5E1;
}

.docs-section p {
    margin-bottom: 0.75rem;
}

.docs-section ul,
.docs-section ol {
    margin: 0.5rem 0 1rem 1.25rem;
}

.docs-section li {
    margin-bottom: 0.25rem;
}

/* ================================================================
   STEPS (numbered tutorial steps)
   ================================================================ */

.docs-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #0F172A;
    border: 1px solid #1E293B;
    border-radius: 12px;
}

.docs-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0891B2;
    color: #F8FAFC;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
}

.docs-step-content h4 {
    margin: 0 0 0.25rem;
    color: #F8FAFC;
    font-size: 0.9375rem;
}

.docs-step-content p {
    font-size: 0.875rem;
    color: #94A3B8;
    margin: 0;
}

/* ================================================================
   INFO BOXES (tip / warning / note)
   ================================================================ */

.docs-info-box {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    border-left: 3px solid;
}

.docs-info-box.tip {
    background: rgba(16, 185, 129, 0.08);
    border-color: #10B981;
    color: #6EE7B7;
}

.docs-info-box.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: #F59E0B;
    color: #FCD34D;
}

.docs-info-box.note {
    background: rgba(8, 145, 178, 0.08);
    border-color: #0891B2;
    color: #67E8F9;
}

.docs-info-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

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

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

.docs-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #1E293B;
    color: #F8FAFC;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #334155;
}

.docs-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #1E293B;
    color: #CBD5E1;
    vertical-align: top;
}

.docs-table tr:hover td {
    background: rgba(8, 145, 178, 0.04);
}

.docs-table code {
    font-size: 0.8125rem;
}

/* ================================================================
   SCREENSHOT / IMAGE
   ================================================================ */

.docs-screenshot {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
}

.docs-screenshot img {
    display: block;
    width: 100%;
    height: auto;
}

.docs-screenshot figcaption {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #64748B;
    background: #1E293B;
    text-align: center;
}

/* ================================================================
   NAVIGATION CARDS (hub page grid)
   ================================================================ */

.docs-nav-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.docs-nav-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.docs-nav-card:hover {
    transform: translateY(-2px);
    border-color: rgba(8, 145, 178, 0.4);
    box-shadow: 0 4px 20px rgba(8, 145, 178, 0.1);
}

.docs-nav-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 145, 178, 0.12);
    border-radius: 10px;
    color: #0891B2;
}

.docs-nav-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.docs-nav-card-text h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #F8FAFC;
    margin-bottom: 0.25rem;
}

.docs-nav-card-text p {
    font-size: 0.8125rem;
    color: #94A3B8;
    line-height: 1.5;
}

/* ================================================================
   CODE BLOCKS (API reference)
   ================================================================ */

.docs-code {
    background: #0F172A;
    border: 1px solid #1E293B;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #E2E8F0;
}

.docs-code .method {
    color: #10B981;
    font-weight: 700;
}

.docs-code .url {
    color: #0891B2;
}

.docs-code .param {
    color: #F59E0B;
}

.docs-code .comment {
    color: #64748B;
}

/* ================================================================
   BADGE (module package indicator)
   ================================================================ */

.docs-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: rgba(8, 145, 178, 0.12);
    color: #0891B2;
}

/* ================================================================
   FOOTER
   ================================================================ */

.docs-footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: #475569;
    border-top: 1px solid #1E293B;
}

/* ================================================================
   MOBILE SIDEBAR TOGGLE
   ================================================================ */

.docs-sidebar-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #F8FAFC;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    text-align: left;
}

.docs-sidebar-toggle::after {
    content: " ▾";
    color: #64748B;
}

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

@media (max-width: 1024px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #1E293B;
        padding: 1.5rem;
    }

    .docs-sidebar .docs-toc {
        display: none;
    }

    .docs-sidebar.open .docs-toc {
        display: block;
    }

    .docs-sidebar-toggle {
        display: block;
    }

    .docs-content {
        padding: 2rem 1.5rem 3rem;
    }

    .docs-nav-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 0 1rem;
    }

    .docs-breadcrumb {
        display: none;
    }

    .docs-content {
        padding: 1.5rem 1rem 3rem;
    }

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

    .docs-table {
        font-size: 0.8125rem;
    }

    .docs-table th,
    .docs-table td {
        padding: 0.5rem 0.625rem;
    }

    .docs-step {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ================================================================
   PRINT
   ================================================================ */

@media print {
    body {
        background: #fff;
        color: #1a1a1a;
    }

    .docs-header,
    .docs-sidebar,
    .docs-footer {
        display: none;
    }

    .docs-layout {
        display: block;
        margin-top: 0;
    }

    .docs-content {
        padding: 0;
    }

    .docs-section h2 {
        color: #1a1a1a;
        border-color: #1a1a1a;
    }

    a {
        color: #1a1a1a;
        text-decoration: underline;
    }

    .docs-info-box {
        border: 1px solid #ccc;
        background: #f9f9f9;
        color: #333;
    }

    .docs-nav-card {
        border: 1px solid #ccc;
        background: #f9f9f9;
    }

    .docs-table th {
        background: #eee;
        color: #1a1a1a;
    }

    .docs-code {
        background: #f5f5f5;
        border-color: #ddd;
        color: #1a1a1a;
    }
}

/* ================================================================
   SIDEBAR TOC SCROLL SPY (JS-driven)
   ================================================================ */

.docs-toc a {
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.docs-toc a.active {
    border-left-color: #0891B2;
}
