/* ================================================
   DOCUMENTATION STYLES
   ================================================ */

/* ===== Docs Index Page ===== */
.docs-index {
    padding: 6rem 0 4rem;
    min-height: 80vh;
}

.docs-index__hero {
    text-align: center;
    margin-bottom: 4rem;
}

.docs-index__hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--color-gray-900);
    margin-bottom: 0.75rem;
}

.docs-index__hero p {
    font-size: 1.125rem;
    color: var(--color-gray-500);
    max-width: 560px;
    margin: 0 auto;
}

.docs-index__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.docs-index__section {
    background: var(--color-white);
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.docs-index__section:hover {
    border-color: var(--color-gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.docs-index__section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.docs-index__section-header svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.docs-index__section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin: 0;
}

.docs-index__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-index__links li {
    border-top: 1px solid var(--color-gray-50);
}

.docs-index__links li:first-child {
    border-top: none;
}

.docs-index__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    font-size: 0.9375rem;
    color: var(--color-gray-600);
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-index__links a:hover {
    color: var(--color-primary);
}

.docs-index__links a svg {
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.docs-index__links a:hover svg {
    opacity: 1;
    transform: translateX(2px);
}

.docs-index__section-desc {
    color: var(--color-gray-500);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
}

/* ===== Changelog styles ===== */
.docs__toc {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
}

.docs__toc h2 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    margin-bottom: 0.75rem;
}

.docs__toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.25rem 1.5rem;
}

.docs__toc li {
    font-size: 0.875rem;
}

.docs__toc a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.docs__toc a:hover {
    text-decoration: underline;
}


/* ===== Docs Layout ===== */
.docs {
    padding-top: 4.5rem;
    min-height: 100vh;
    background: var(--color-white);
}

.docs__container {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1280px;
    margin: 0 auto;
    min-height: calc(100vh - 4.5rem);
}


/* ===== Sidebar ===== */
.docs__sidebar {
    border-right: 1px solid var(--color-gray-100);
    padding: 2rem 0;
    position: sticky;
    top: 4.5rem;
    height: calc(100vh - 4.5rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-200) transparent;
}

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

.docs__sidebar::-webkit-scrollbar-thumb {
    background: var(--color-gray-200);
    border-radius: 4px;
}

.docs__sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 1.25rem;
    border-bottom: 1px solid var(--color-gray-100);
    margin-bottom: 1rem;
}

.docs__sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-gray-900);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs__sidebar-brand svg {
    color: var(--color-primary);
}

.docs__sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 0.25rem;
}


/* ===== Nav Groups ===== */
.docs__nav {
    padding: 0 0.75rem;
}

.docs__nav-group {
    margin-bottom: 0.25rem;
}

.docs__nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gray-400);
    transition: color 0.15s ease;
}

.docs__nav-heading:hover {
    color: var(--color-gray-600);
}

.docs__nav-chevron {
    transition: transform 0.2s ease;
}

.docs__nav-group--open .docs__nav-chevron {
    transform: rotate(180deg);
}

.docs__nav-pages {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.docs__nav-group--open .docs__nav-pages {
    max-height: 600px;
}

.docs__nav-link {
    display: block;
    padding: 0.375rem 0.75rem 0.375rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--color-gray-500);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: all 0.15s ease;
    line-height: 1.5;
}

.docs__nav-link:hover {
    color: var(--color-gray-800);
    background: var(--color-gray-50);
}

.docs__nav-link--active {
    color: var(--color-primary);
    background: var(--color-indigo-50);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

.docs__nav-link--active:hover {
    color: var(--color-primary);
    background: var(--color-indigo-50);
}

/* Standalone nav items (Changelog, etc.) */
.docs__nav-standalone {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-200);
}

.docs__nav-standalone .docs__nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: none;
    padding-left: 1rem;
}

.docs__nav-standalone .docs__nav-link svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.docs__nav-standalone .docs__nav-link--active svg,
.docs__nav-standalone .docs__nav-link:hover svg {
    opacity: 1;
}


/* ===== Mobile sidebar toggle ===== */
.docs__sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    align-items: center;
    gap: 0.5rem;
}


/* ===== Main Content ===== */
.docs__main {
    padding: 2rem 3rem 4rem;
    max-width: 820px;
    min-width: 0;
}


/* ===== Breadcrumbs ===== */
.docs__breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-gray-400);
    margin-bottom: 1.5rem;
}

.docs__breadcrumbs a {
    color: var(--color-gray-400);
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs__breadcrumbs a:hover {
    color: var(--color-primary);
}

.docs__breadcrumb-sep {
    color: var(--color-gray-300);
}

.docs__breadcrumb-current {
    color: var(--color-gray-600);
    font-weight: 500;
}


/* ===== Article Content ===== */
.docs__content {
    line-height: 1.75;
    color: var(--color-gray-700);
}

.docs__content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-gray-900);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.docs__content h1 + .docs__subtitle {
    font-size: 1.0625rem;
    color: var(--color-gray-500);
    margin-bottom: 2rem;
    line-height: 1.65;
}

.docs__content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-gray-100);
}

.docs__content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.docs__content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-gray-800);
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.docs__content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs__content p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.docs__content ul,
.docs__content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.docs__content li {
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
}

.docs__content li > ul,
.docs__content li > ol {
    margin-top: 0.375rem;
    margin-bottom: 0.375rem;
}

.docs__content a {
    color: var(--color-primary);
    text-decoration: none;
}

.docs__content a:hover {
    text-decoration: underline;
}

.docs__content strong {
    color: var(--color-gray-800);
    font-weight: 600;
}

.docs__content code {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.8125rem;
    background: var(--color-gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--color-gray-700);
}

.docs__content pre {
    background: var(--color-gray-900);
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
    line-height: 1.7;
}

.docs__content pre code {
    background: none;
    padding: 0;
    color: inherit;
    border-radius: 0;
}

.docs__content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-100);
    margin: 1rem 0;
}

.docs__content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.docs__content table th,
.docs__content table td {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-gray-200);
    text-align: left;
}

.docs__content table th {
    background: var(--color-gray-50);
    font-weight: 600;
    color: var(--color-gray-800);
}

.docs__content table td {
    color: var(--color-gray-600);
}

.docs__content hr {
    border: none;
    border-top: 1px solid var(--color-gray-100);
    margin: 2rem 0;
}


/* ===== Screenshots ===== */
.docs__screenshot {
    margin: 2rem 0 2.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

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


/* ===== Callout Boxes ===== */
.docs__callout {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.65;
}

.docs__callout p {
    margin: 0;
    font-size: 0.875rem;
}

.docs__callout-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs__callout--tip {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
}
.docs__callout--tip .docs__callout-title {
    color: #059669;
}

.docs__callout--note {
    background: var(--color-indigo-50);
    border-left: 3px solid var(--color-primary);
}
.docs__callout--note .docs__callout-title {
    color: var(--color-primary);
}

.docs__callout--warning {
    background: #fff7ed;
    border-left: 3px solid #f97316;
}
.docs__callout--warning .docs__callout-title {
    color: #ea580c;
}

.docs__callout--important {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}
.docs__callout--important .docs__callout-title {
    color: #dc2626;
}


/* ===== Steps / Numbered procedures ===== */
.docs__steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.docs__steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
}

.docs__steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.125rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===== Prev / Next Pager ===== */
.docs__pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-100);
}

.docs__pager-link {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docs__pager-link:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.docs__pager-link--next {
    text-align: right;
}

.docs__pager-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gray-400);
    margin-bottom: 0.25rem;
}

.docs__pager-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-primary);
}


/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .docs__main {
        padding: 1.5rem 2rem 3rem;
    }
}

@media (max-width: 768px) {
    .docs__container {
        grid-template-columns: 1fr;
    }

    .docs__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 100;
        background: var(--color-white);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--color-gray-200);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    }

    .docs__sidebar--open {
        transform: translateX(0);
    }

    .docs__sidebar-close {
        display: block;
    }

    .docs__sidebar-toggle {
        display: flex;
    }

    .docs__main {
        padding: 1.5rem 1.25rem 5rem;
    }

    .docs__content h1 {
        font-size: 1.625rem;
    }

    .docs__pager {
        grid-template-columns: 1fr;
    }

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

    .docs-index__hero h1 {
        font-size: 2rem;
    }
}
