/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4f46e5;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 100;
}

.skip-link:focus {
    top: 10px;
}

a {
    text-decoration: none;
    color: #4f46e5;
    transition: color 0.2s ease;
}

a:hover {
    color: #6366f1;
}

/* Docs Layout */
.docs-wrapper {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    gap: 2rem;
}

/* LEFT SIDEBAR */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    height: calc(100vh - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
}

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

.sidebar::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.sidebar-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.5rem;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background: #eef2ff;
    color: #1e293b;
}

.sidebar-menu .active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

/* MAIN CONTENT */
.content {
    flex: 1;
    max-width: 780px;
    min-width: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #64748b;
}

.breadcrumb a:hover {
    color: #4f46e5;
}

.breadcrumb span {
    color: #94a3b8;
}

.breadcrumb .current {
    color: #0f172a;
    font-weight: 600;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    color: #0f172a;
}

.intro {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.doc-section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.doc-section h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #0f172a;
    letter-spacing: -0.01em;
    padding-top: 0.5rem;
}

.doc-section p {
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 1.25rem;
}

.doc-section ul,
.doc-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.doc-section li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
}

.doc-section li strong {
    color: #0f172a;
}

.doc-section a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.doc-section a:hover {
    text-decoration-thickness: 2px;
}

/* Note Box */
.note-box {
    background: #fefce8;
    border-left: 4px solid #eab308;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.note-box p {
    margin-bottom: 0;
    color: #854d0e;
}

.tip-box {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.tip-box p {
    margin-bottom: 0;
    color: #065f46;
}

.warning-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.warning-box p {
    margin-bottom: 0;
    color: #991b1b;
}

/* RIGHT TOC */
.toc {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    height: calc(100vh - 4rem);
    overflow-y: auto;
}

.toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 1rem;
}

.toc nav ul {
    list-style: none;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
}

.toc li {
    margin-bottom: 0.75rem;
}

.toc a {
    color: #475569;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.toc a:hover {
    color: #4f46e5;
    transform: translateX(4px);
}

.toc .active {
    color: #4f46e5;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-wrapper {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 1rem;
    }

    .sidebar-section {
        display: inline-block;
        margin-right: 1.5rem;
        border-bottom: none;
    }

    .sidebar-menu {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-menu li {
        display: inline-block;
    }

    .content {
        max-width: 100%;
    }

    h1 {
        font-size: 2rem;
    }

    .intro {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .sidebar-section {
        display: block;
        margin-bottom: 1rem;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .toc,
    .breadcrumb,
    .skip-link {
        display: none;
    }

    .docs-wrapper {
        padding: 0;
        margin: 0;
    }

    .content {
        max-width: 100%;
    }

    .doc-section {
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
        color: black;
    }
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 2px;
}