
:root {
    --smaragd: #00D4AA;
    --smaragd-light: #00F5C4;
    --smaragd-dark: #00A88A;
    --smaragd-glow: rgba(0, 212, 170, 0.3);
    --smaragd-subtle: rgba(0, 212, 170, 0.08);
    --smaragd-border: rgba(0, 212, 170, 0.15);

    --bg-primary: #050a0e;
    --bg-secondary: #080d12;
    --bg-card: rgba(12, 20, 28, 0.7);
    --bg-card-hover: rgba(16, 28, 38, 0.85);

    --text-primary: #e8f4f0;
    --text-secondary: #7a9e96;
    --text-muted: #4a6b62;

    --glass-bg: rgba(8, 18, 24, 0.6);
    --glass-border: rgba(0, 212, 170, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px var(--smaragd-glow);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--smaragd); text-decoration: none; }
a:hover { text-decoration: underline; }


.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 2rem;
    transition: all 0.4s ease;
}

.header.scrolled { padding: 0.5rem 2rem; }

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
}

.header.scrolled .header-inner {
    margin-top: 0;
    border-radius: var(--radius-lg);
    background: rgba(8, 18, 24, 0.85);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--smaragd), var(--smaragd-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--smaragd-glow);
}

.logo-icon svg { width: 22px; height: 22px; fill: var(--bg-primary); }

.logo-text { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span { color: var(--smaragd); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--smaragd);
    background: var(--smaragd-subtle);
}

.header-cta {
    background: linear-gradient(135deg, var(--smaragd), var(--smaragd-dark));
    color: var(--bg-primary);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--smaragd-glow);
    font-family: inherit;
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--smaragd-glow);
}


.docs-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 100px;
}


.sidebar {
    width: 300px;
    min-width: 300px;
    height: calc(100vh - 100px);
    position: fixed;
    top: 100px;
    left: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: 1.5rem 0;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-category { margin-bottom: 0.25rem; }

.cat-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: left;
}

.cat-toggle:hover {
    color: var(--text-primary);
    background: var(--smaragd-subtle);
}

.cat-toggle.open { color: var(--smaragd); }

.cat-icon {
    width: 28px;
    height: 28px;
    background: var(--smaragd-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cat-label { flex: 1; font-size: 0.85rem; font-weight: 600; }

.cat-count {
    font-size: 0.7rem;
    background: var(--smaragd-subtle);
    color: var(--smaragd);
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.cat-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.cat-toggle.open .cat-arrow { transform: rotate(180deg); }

.cat-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cat-items.open { max-height: 1000px; }

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: left;
}

.sidebar-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-item.active {
    color: var(--smaragd);
    background: var(--smaragd-subtle);
    border-left: 2px solid var(--smaragd);
}

.item-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.item-icon.font { background: rgba(255, 99, 71, 0.15); color: #FF6347; }
.item-icon.css { background: rgba(38, 77, 228, 0.15); color: #264de4; }
.item-icon.js { background: rgba(240, 219, 79, 0.15); color: #F0DB4F; }
.item-icon.icon { background: rgba(0, 212, 170, 0.15); color: var(--smaragd); }
.item-icon.ui { background: rgba(156, 39, 176, 0.15); color: #9C27B0; }
.item-icon.animation { background: rgba(255, 152, 0, 0.15); color: #FF9800; }
.item-icon.util { background: rgba(33, 150, 243, 0.15); color: #2196F3; }
.item-icon.chart { background: rgba(244, 67, 54, 0.15); color: #F44336; }

.item-title { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.docs-content {
    flex: 1;
    margin-left: 300px;
    padding: 2rem 3rem 4rem;
    min-height: calc(100vh - 100px);
}

.docs-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background: var(--smaragd-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.placeholder-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--smaragd);
}

.docs-placeholder h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}


.doc-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.doc-breadcrumb a { color: var(--text-muted); }
.doc-breadcrumb a:hover { color: var(--smaragd); text-decoration: none; }

.doc-title-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.doc-icon-large {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.doc-icon-large.font { background: rgba(255, 99, 71, 0.15); color: #FF6347; }
.doc-icon-large.css { background: rgba(38, 77, 228, 0.15); color: #264de4; }
.doc-icon-large.js { background: rgba(240, 219, 79, 0.15); color: #F0DB4F; }
.doc-icon-large.icon { background: rgba(0, 212, 170, 0.15); color: var(--smaragd); }
.doc-icon-large.ui { background: rgba(156, 39, 176, 0.15); color: #9C27B0; }
.doc-icon-large.animation { background: rgba(255, 152, 0, 0.15); color: #FF9800; }
.doc-icon-large.util { background: rgba(33, 150, 243, 0.15); color: #2196F3; }
.doc-icon-large.chart { background: rgba(244, 67, 54, 0.15); color: #F44336; }

.doc-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.doc-version {
    font-size: 0.75rem;
    font-family: monospace;
    background: var(--smaragd-subtle);
    color: var(--smaragd);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.doc-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}


.doc-section {
    margin-bottom: 3rem;
}

.doc-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.doc-usage {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}


.code-block {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--smaragd);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-copy {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: var(--smaragd-subtle);
    border: 1px solid var(--smaragd-border);
    border-radius: var(--radius-sm);
    color: var(--smaragd);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.code-copy:hover {
    background: var(--smaragd);
    color: var(--bg-primary);
}

.code-copy.copied {
    background: var(--smaragd);
    color: var(--bg-primary);
}

.code-copy svg { width: 14px; height: 14px; }

.code-block pre {
    padding: 1.25rem;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre;
}


.example-block {
    margin-bottom: 2rem;
}

.example-block h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}


.all-links { display: flex; flex-direction: column; gap: 0.75rem; }

.link-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.link-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--smaragd);
    min-width: 30px;
}

.link-item code {
    flex: 1;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-copy {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--smaragd-subtle);
    border: 1px solid var(--smaragd-border);
    border-radius: var(--radius-sm);
    color: var(--smaragd);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.link-copy:hover {
    background: var(--smaragd);
    color: var(--bg-primary);
}

.link-copy svg { width: 14px; height: 14px; }


.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--smaragd-border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    backdrop-filter: blur(20px);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { color: var(--smaragd); }


@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
    .docs-content {
        margin-left: 260px;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .docs-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .header-inner {
        padding: 1rem 1.5rem;
    }
    .nav-links {
        display: none;
    }
}




@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
    .docs-content {
        margin-left: 260px;
        padding: 2rem;
    }
    .header-inner {
        padding: 1rem 1.5rem;
    }
}


@media (max-width: 768px) {

    .header {
        padding: 0 1rem;
    }
    .header-inner {
        padding: 0.8rem 1rem;
        margin-top: 0.5rem;
    }
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    .logo-icon svg {
        width: 18px;
        height: 18px;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .nav-links {
        display: none;
    }
    .header-cta {
        display: none;
    }


    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--smaragd-subtle);
        border: 1px solid var(--smaragd-border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        flex-shrink: 0;
    }
    .menu-toggle svg {
        width: 20px;
        height: 20px;
        stroke: var(--smaragd);
    }
    .menu-toggle .close-icon {
        display: none;
    }
    .menu-toggle.active .menu-icon {
        display: none;
    }
    .menu-toggle.active .close-icon {
        display: block;
    }


    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        min-width: unset;
        z-index: 1001;
        background: var(--bg-secondary);
        border-right: 1px solid var(--glass-border);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 1rem;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }


    .docs-layout {
        padding-top: 80px;
    }
    .docs-content {
        margin-left: 0;
        padding: 1.25rem 1rem 3rem;
        min-height: calc(100vh - 80px);
    }

    .doc-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    .doc-breadcrumb {
        font-size: 0.7rem;
        gap: 0.3rem;
        flex-wrap: wrap;
    }
    .doc-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .doc-icon-large {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
    }
    .doc-header h1 {
        font-size: 1.4rem;
    }
    .doc-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }


    .doc-section {
        margin-bottom: 2rem;
    }
    .doc-section h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    .doc-usage {
        font-size: 0.85rem;
    }


    .code-block {
        margin-bottom: 1rem;
        border-radius: var(--radius-sm);
    }
    .code-header {
        padding: 0.5rem 0.75rem;
    }
    .code-lang {
        font-size: 0.65rem;
    }
    .code-copy {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    .code-copy svg {
        width: 12px;
        height: 12px;
    }
    .code-block pre {
        padding: 1rem 0.75rem;
    }
    .code-block code {
        font-size: 0.75rem;
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-all;
    }

    
    .example-block {
        margin-bottom: 1.5rem;
    }
    .example-block h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }


    .all-links {
        gap: 0.5rem;
    }
    .link-item {
        padding: 0.6rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .link-label {
        font-size: 0.65rem;
        min-width: 25px;
    }
    .link-item code {
        font-size: 0.7rem;
        flex-basis: calc(100% - 80px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .link-copy {
        width: 28px;
        height: 28px;
    }
    .link-copy svg {
        width: 12px;
        height: 12px;
    }


    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        transform: translateY(150%);
    }
    .toast.show {
        transform: translateY(0);
    }


    .docs-placeholder {
        min-height: 50vh;
    }
    .placeholder-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    .placeholder-icon svg {
        width: 30px;
        height: 30px;
    }
    .docs-placeholder h2 {
        font-size: 1.2rem;
    }
    .docs-placeholder p {
        font-size: 0.85rem;
        padding: 0 1rem;
    }
}


@media (max-width: 480px) {
    .header-inner {
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
    }
    .logo-text {
        font-size: 1rem;
    }
    .header-cta {
        display: none;
    }
    .docs-content {
        padding: 1rem 0.75rem 2.5rem;
    }
    .doc-header h1 {
        font-size: 1.25rem;
    }
    .doc-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .code-block code {
        font-size: 0.7rem;
    }
}


@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 70%;
        max-width: 280px;
    }
    .docs-layout {
        padding-top: 70px;
    }
    .docs-content {
        min-height: calc(100vh - 70px);
    }
}


@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .code-block code {
        font-weight: 400;
    }
}


@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .sidebar {
        transition: none;
    }
    .sidebar-overlay {
        transition: none;
    }
}


@media print {
    .header,
    .sidebar,
    .toast,
    .code-copy,
    .link-copy {
        display: none !important;
    }
    .docs-layout {
        padding-top: 0;
    }
    .docs-content {
        margin-left: 0;
        padding: 0;
    }
    .doc-header {
        border-bottom: 1px solid #ccc;
    }
    .doc-header h1 {
        color: #000;
    }
    .doc-description {
        color: #333;
    }
    .code-block {
        border: 1px solid #ccc;
        background: #f5f5f5;
    }
    .code-block code {
        color: #000;
    }
}


.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--smaragd-subtle);
    border: 1px solid var(--smaragd-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}
.menu-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--smaragd);
}
.menu-toggle .close-icon {
    display: none;
}
.menu-toggle.active .menu-icon {
    display: none;
}
.menu-toggle.active .close-icon {
    display: block;
}


.sidebar-overlay {
    display: none;
}


@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    .sidebar-overlay {
        display: block;
    }
}


.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--smaragd-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--smaragd);
}