/* ==========================================================================
   Batchy & Friends — Documentation Page Styles
   ========================================================================== */

/* ---------- Docs Layout ---------- */
.docs-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* ---------- Sidebar ---------- */
.docs-sidebar {
    position: sticky;
    top: 56px;
    width: 260px;
    min-width: 260px;
    height: calc(100vh - 56px);
    background: var(--dark);
    color: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-close {
    display: none;
}

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-link {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.65);
    border-left: 3px solid transparent;
    transition: color 0.2s, border-left-color 0.2s, background 0.2s;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* ---------- Mobile sidebar toggle ---------- */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 50;
    width: 48px;
    height: 48px;
    background: var(--dark);
    border: var(--border);
    border-radius: 50%;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

/* ---------- Main Content ---------- */
.docs-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem 4rem;
    max-width: 900px;
}

/* ---------- Section Style ---------- */
.doc-section {
    margin-bottom: 3rem;
}

.section-header {
    padding: 0.8rem 1.25rem;
    border: var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.section-body {
    border: var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 1.5rem;
}

.section-body > h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-body > p {
    font-size: 0.92rem;
    color: #333;
    line-height: 1.65;
    margin-bottom: 1rem;
}

/* ---------- Collapsible Sections ---------- */
details {
    margin-bottom: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    overflow: hidden;
}

details:last-of-type {
    margin-bottom: 0;
}

summary {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: #f8f8f8;
    transition: background 0.2s;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: '\25B6';
    font-size: 0.65rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

details[open] > summary::before {
    transform: rotate(90deg);
}

summary:hover {
    background: #f0f0f0;
}

.details-content {
    padding: 1rem;
}

.details-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

.details-content h4:first-child {
    margin-top: 0;
}

.details-content p {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.details-content p:last-child {
    margin-bottom: 0;
}

/* ---------- Lists ---------- */
.doc-list {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding-left: 0;
}

.doc-list li {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.2rem 0 0.2rem 1.25rem;
    position: relative;
}

.doc-list li::before {
    content: '\2022';
    position: absolute;
    left: 0.25rem;
    color: #666;
}

ol.doc-list {
    counter-reset: doc-counter;
}

ol.doc-list > li {
    counter-increment: doc-counter;
}

ol.doc-list > li::before {
    content: counter(doc-counter) '.';
    font-weight: 700;
    color: #333;
}

.doc-list .doc-list {
    margin: 0.25rem 0 0.25rem;
}

/* ---------- Tables ---------- */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    font-size: 0.88rem;
}

.doc-table th,
.doc-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

.doc-table th {
    background: #f0f0f0;
    font-weight: 700;
    font-size: 0.85rem;
}

.doc-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.doc-table code {
    font-size: 0.82rem;
    background: #e8e8e8;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* ---------- Code Blocks ---------- */
pre {
    background: var(--dark);
    color: #e0e0e0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    font-family: var(--font);
    font-size: 0.82rem;
    line-height: 1.55;
    border: 2px solid #333;
}

code {
    font-family: var(--font);
    font-size: 0.88em;
}

p code,
li code {
    background: #e8e8e8;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85em;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

/* ---------- Keyboard Keys ---------- */
kbd {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-bottom: 2px solid #bbb;
    border-radius: 3px;
    white-space: nowrap;
}

/* ---------- Status Badges ---------- */
.status-resolved {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--lime);
    border: 2px solid #000;
    border-radius: 3px;
    text-transform: uppercase;
}

.no-issues {
    font-size: 0.9rem;
    color: #555;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: var(--radius);
    text-align: center;
}

/* ---------- Nav active state (docs page) ---------- */
.docs-page .nav-links .active {
    color: var(--cyan);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .docs-content {
        padding: 1.5rem 1.25rem 3rem;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        min-width: 280px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 200;
    }

    .docs-sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar-close {
        display: block;
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        line-height: 1;
    }

    .sidebar-toggle {
        display: flex;
    }

    .docs-content {
        padding: 1.25rem 1rem 4rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .doc-table {
        font-size: 0.82rem;
    }

    .doc-table th,
    .doc-table td {
        padding: 0.4rem 0.5rem;
    }

    pre {
        font-size: 0.78rem;
        padding: 0.75rem;
    }
}
