/* ========================================
   FILE SECURITY ANALYZER
   DOCUMENTATION PAGE
======================================== */


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

.docs-page {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 54px 34px 110px;

    display: flex;
    align-items: flex-start;
    gap: 54px;
}


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

.docs-sidebar {
    width: 300px;
    flex: 0 0 300px;

    position: sticky;
    top: 92px;

    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) transparent;
}

.docs-sidebar-inner {
    padding: 24px;

    background:
        linear-gradient(
            180deg,
            rgba(25, 218, 89, 0.035),
            transparent 28%
        ),
        var(--surface);

    border: 1px solid var(--border);
    border-radius: 22px;
}

.docs-sidebar-title {
    padding: 2px 4px 20px;
    border-bottom: 1px solid var(--border);
}

.docs-sidebar-title > span {
    display: block;

    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.docs-sidebar-title strong {
    display: block;
    margin-top: 8px;

    color: var(--text-primary);

    font-size: 18px;
}


/* ========================================
   DOCUMENTATION TREE
======================================== */

.docs-tree {
    padding: 14px 0;
}

.docs-tree-group + .docs-tree-group {
    margin-top: 4px;
}

.docs-tree-parent {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 10px;

    color: var(--text-secondary);
    background: transparent;

    border: 0;
    border-radius: 10px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;

    cursor: pointer;

    transition:
        color 0.22s ease,
        background 0.22s ease;
}

.docs-tree-parent:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.docs-chevron {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform: rotate(-45deg);

    transition: transform 0.25s ease;
}

.docs-tree-group.open .docs-chevron {
    transform: rotate(45deg);
}

.docs-tree-children {
    max-height: 0;
    overflow: hidden;
    opacity: 0;

    transition:
        max-height 0.32s ease,
        opacity 0.22s ease;
}

.docs-tree-group.open .docs-tree-children {
    max-height: 320px;
    opacity: 1;
}

.docs-tree-children a {
    min-height: 36px;

    display: flex;
    align-items: center;

    position: relative;

    margin-left: 13px;
    padding: 0 10px 0 21px;

    color: var(--text-muted);
    text-decoration: none;

    border-left: 1px solid var(--border);

    font-size: 12px;
    line-height: 1.35;

    transition:
        color 0.22s ease,
        border-color 0.22s ease,
        transform 0.22s ease;
}

.docs-tree-children a::before {
    content: "";

    width: 5px;
    height: 5px;

    position: absolute;
    left: -3px;

    background: var(--border-hover);
    border-radius: 50%;

    transition:
        background 0.22s ease,
        box-shadow 0.22s ease;
}

.docs-tree-children a:hover {
    color: var(--text-primary);
    transform: translateX(3px);
}

.docs-tree-children a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.docs-tree-children a.active::before {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(25, 218, 89, 0.10);
}


/* ========================================
   MOBILE NAVIGATION BUTTON
======================================== */

.docs-mobile-toggle {
    display: none;

    width: 100%;
    min-height: 52px;

    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 0 18px;

    color: var(--text-primary);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    font: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.docs-mobile-toggle-icon {
    width: 18px;
    height: 14px;

    position: relative;

    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.docs-mobile-toggle-icon::after {
    content: "";

    position: absolute;
    top: 5px;
    left: 0;

    width: 18px;

    border-top: 2px solid currentColor;
}


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

.docs-content {
    width: calc(100% - 354px);
    min-width: 0;
}

.docs-hero {
    padding: 28px 0 64px;
}

.docs-eyebrow,
.docs-number {
    display: block;

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.docs-hero h1 {
    max-width: 940px;

    margin: 14px 0 22px;

    color: var(--text-primary);

    font-size: clamp(44px, 6vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.docs-hero p {
    max-width: 820px;
    margin: 0;

    color: var(--text-secondary);

    font-size: 18px;
    line-height: 1.7;
}


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

.docs-section {
    padding: 62px 0;

    border-top: 1px solid var(--border);

    scroll-margin-top: 110px;
}

.docs-section-header {
    max-width: 900px;
    margin-bottom: 32px;
}

.docs-section h2 {
    margin: 10px 0 16px;

    color: var(--text-primary);

    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.docs-section h3 {
    margin: 34px 0 12px;

    color: var(--text-primary);

    font-size: 22px;
    line-height: 1.25;
}

.docs-section p {
    max-width: 920px;

    margin: 0 0 18px;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.8;
}

.docs-section ul,
.docs-section ol {
    max-width: 900px;

    margin: 20px 0 24px;
    padding-left: 24px;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.8;
}

.docs-section li + li {
    margin-top: 8px;
}

.docs-section strong {
    color: var(--text-primary);
}


/* ========================================
   INFORMATION CARDS
======================================== */

.docs-cards {
    display: flex;
    flex-wrap: wrap;

    gap: 16px;

    margin: 28px 0;
}

.docs-card {
    width: calc(50% - 8px);
    min-width: 260px;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.docs-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.docs-card-label {
    display: block;

    margin-bottom: 9px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.docs-card h3 {
    margin: 0 0 10px;

    font-size: 18px;
}

.docs-card p {
    margin: 0;

    font-size: 14px;
    line-height: 1.65;
}


/* ========================================
   STEPS
======================================== */

.docs-steps {
    margin: 28px 0;
}

.docs-step {
    display: flex;
    align-items: flex-start;
    gap: 18px;

    position: relative;

    padding: 0 0 30px;
}

.docs-step:last-child {
    padding-bottom: 0;
}

.docs-step-number {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    z-index: 2;

    color: var(--accent);
    background: var(--surface);

    border: 1px solid var(--border-hover);
    border-radius: 50%;

    font-size: 12px;
    font-weight: 800;
}

.docs-step:not(:last-child)::after {
    content: "";

    position: absolute;
    top: 38px;
    left: 18px;

    width: 1px;
    height: calc(100% - 38px);

    background: var(--border);
}

.docs-step-content {
    padding-top: 5px;
}

.docs-step-content h3 {
    margin: 0 0 7px;

    font-size: 17px;
}

.docs-step-content p {
    margin: 0;

    font-size: 14px;
}


/* ========================================
   BETA WARNING
======================================== */

.docs-beta-warning {
    max-width: 920px;
    margin: -28px 0 46px;
    padding: 20px 22px;

    display: flex;
    align-items: flex-start;
    gap: 16px;

    background: rgba(255, 180, 0, 0.055);

    border: 1px solid rgba(255, 180, 0, 0.24);
    border-radius: 16px;
}

.docs-beta-warning-badge {
    flex: 0 0 auto;
    padding: 6px 9px;

    color: #ffc44d;
    background: rgba(255, 180, 0, 0.10);

    border: 1px solid rgba(255, 180, 0, 0.20);
    border-radius: 8px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.docs-beta-warning-content strong {
    display: block;
    margin: 1px 0 6px;

    color: var(--text-primary);

    font-size: 15px;
}

.docs-beta-warning-content p {
    max-width: 760px;
    margin: 0;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.65;
}

html[data-theme="light"] .docs-beta-warning {
    background: rgba(205, 135, 0, 0.055);
    border-color: rgba(180, 115, 0, 0.22);
}

html[data-theme="light"] .docs-beta-warning-badge {
    color: #9a6500;
    background: rgba(205, 135, 0, 0.08);
    border-color: rgba(180, 115, 0, 0.18);
}

/* ========================================
   NOTE / WARNING BLOCKS
======================================== */

.docs-note {
    max-width: 920px;

    margin: 28px 0;
    padding: 20px 22px;

    background: rgba(25, 218, 89, 0.045);

    border: 1px solid rgba(25, 218, 89, 0.20);
    border-radius: 15px;
}

.docs-note strong {
    display: block;

    margin-bottom: 6px;

    color: var(--accent);

    font-size: 13px;
}

.docs-note p {
    margin: 0;

    font-size: 14px;
}


/* ========================================
   CODE / VALUES
======================================== */

.docs-code {
    max-width: 920px;

    margin: 22px 0;
    padding: 18px 20px;

    overflow-x: auto;

    color: var(--text-primary);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 13px;
    line-height: 1.7;
}


/* ========================================
   APPEAR ANIMATION
======================================== */

.docs-animate {
    opacity: 0;
    transform: translateY(22px);

    transition:
        opacity 0.65s ease,
        transform 0.65s ease;
}

.docs-animate.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ========================================
   LIGHT THEME
======================================== */

html[data-theme="light"] .docs-sidebar-inner {
    background:
        linear-gradient(
            180deg,
            rgba(25, 170, 75, 0.045),
            transparent 28%
        ),
        var(--surface);
}

html[data-theme="light"] .docs-note {
    background: rgba(25, 170, 75, 0.055);
    border-color: rgba(25, 170, 75, 0.18);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1100px) {

    .docs-page {
        gap: 32px;
        padding-left: 26px;
        padding-right: 26px;
    }

    .docs-sidebar {
        width: 260px;
        flex-basis: 260px;
    }

    .docs-content {
        width: calc(100% - 292px);
    }

    .docs-card {
        width: 100%;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 820px) {

    .docs-page {
        display: block;

        padding:
            28px
            18px
            80px;
    }

    .docs-mobile-toggle {
        display: flex;
        margin-bottom: 14px;
    }

    .docs-sidebar {
        width: 100%;
        max-height: none;

        position: static;

        margin-bottom: 28px;

        overflow: visible;
    }

    .docs-sidebar-inner {
        display: none;

        padding: 18px;

        border-radius: 16px;
    }

    .docs-sidebar.mobile-open .docs-sidebar-inner {
        display: block;

        animation: docsMobileMenu 0.28s ease;
    }

    .docs-content {
        width: 100%;
    }

    .docs-hero {
        padding: 20px 0 46px;
    }

    .docs-hero h1 {
        margin-top: 12px;

        font-size: clamp(40px, 13vw, 62px);
    }

    .docs-hero p {
        font-size: 16px;
        line-height: 1.65;
    }

    .docs-beta-warning {
        margin-top: -18px;
        margin-bottom: 34px;
        padding: 17px;
        flex-direction: column;
        gap: 11px;
    }

    .docs-section {
        padding: 48px 0;
        scroll-margin-top: 86px;
    }

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

    .docs-card {
        width: 100%;
        min-width: 0;
    }
}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 480px) {

    .docs-page {
        padding:
            22px
            14px
            64px;
    }

    .docs-sidebar-inner {
        padding: 14px;
    }

    .docs-hero h1 {
        font-size: 42px;
    }

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

    .docs-section p,
    .docs-section ul,
    .docs-section ol {
        font-size: 14px;
    }

    .docs-card {
        padding: 20px;
        border-radius: 15px;
    }

    .docs-step {
        gap: 14px;
    }
}


/* ========================================
   MOBILE MENU ANIMATION
======================================== */

@keyframes docsMobileMenu {

    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================================
   REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    .docs-animate,
    .docs-card,
    .docs-tree-parent,
    .docs-tree-children,
    .docs-tree-children a,
    .docs-chevron {
        transition: none;
    }

    .docs-animate {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   MOBILE HEADER OFFSET
======================================== */

@media (max-width: 768px) {

    .docs-page {
        padding-top: 96px;
    }

    .docs-hero {
        scroll-margin-top: 120px;
    }

    .docs-section {
        scroll-margin-top: 120px;
    }

}
