/* ──────────────────────────────────────────
   Electrolite Docs Page Styles
   Extends base style.css with docs layout
   ────────────────────────────────────────── */

/* ── Docs Layout ──────────────────────────── */
.docs-layout {
    display: flex;
    max-width: 1120px;
    margin: 0 auto;
    padding-top: 64px;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────── */
.docs-sidebar {
    position: sticky;
    top: 64px;
    width: 220px;
    min-width: 220px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: 32px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.sidebar-inner {
    padding: 0 20px 40px 24px;
}

.sidebar-label {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 28px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.sidebar-label:first-child {
    margin-top: 0;
}

.sidebar-link {
    display: block;
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--muted);
    transition: color 0.15s;
    line-height: 1.5;
}

.sidebar-link:hover {
    color: var(--bright);
}

.sidebar-link.active {
    color: var(--cyan);
}

/* ── Mobile sidebar toggle ────────────────── */
.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bright);
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s;
}

.docs-sidebar-toggle:hover {
    border-color: var(--cyan);
}

/* ── Main content ─────────────────────────── */
.docs-main {
    flex: 1;
    min-width: 0;
    padding: 32px 48px 80px;
}

/* ── Docs hero ────────────────────────────── */
.docs-hero {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.docs-hero h1 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.docs-hero p {
    color: var(--muted);
    font-size: 1.05rem;
}

/* ── Sections ─────────────────────────────── */
.docs-section {
    margin-bottom: 48px;
    scroll-margin-top: 80px;
}

.docs-section h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-top: 8px;
}

.docs-section h3 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.docs-section p {
    margin-bottom: 0.75rem;
    color: var(--text);
    line-height: 1.7;
}

.docs-section ul,
.docs-section ol {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text);
    line-height: 1.7;
}

.docs-section li {
    margin-bottom: 0.35rem;
}

.docs-section a:not(.btn) {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(0, 212, 255, 0.3);
    transition: text-decoration-color 0.2s;
}

.docs-section a:not(.btn):hover {
    text-decoration-color: var(--cyan);
}

/* ── Code & Pre ───────────────────────────── */
.docs-section code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--cyan);
}

.docs-section pre {
    margin: 0.75rem 0 1rem;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.docs-section pre code {
    padding: 0;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.6;
}

/* ── Callouts ─────────────────────────────── */
.docs-callout {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.docs-callout--important {
    background: rgba(0, 212, 255, 0.06);
    border-left: 3px solid var(--cyan);
    color: var(--text);
}

.docs-callout--info {
    background: rgba(124, 58, 237, 0.06);
    border-left: 3px solid var(--purple);
    color: var(--text);
}

/* ── Download cards ───────────────────────── */
.docs-download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 1rem 0 1.5rem;
}

.docs-download-card {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
}

.docs-download-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

.docs-download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--cyan);
}

.docs-download-card strong {
    display: block;
    color: var(--bright);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.docs-download-card span {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.docs-download-card span a {
    color: var(--cyan) !important;
}

.docs-download-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    flex-grow: 1;
}

.docs-download-btn {
    display: inline-block;
    margin-top: auto;
    padding: 8px 16px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyan) !important;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.2s, border-color 0.2s;
}

.docs-download-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
}

/* ── Mode cards in docs ───────────────────── */
.docs-modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 1rem 0;
}

.docs-mode-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 20px;
}

.docs-mode-card img {
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.docs-mode-card h3 {
    margin-top: 0;
}

.docs-mode-card p {
    font-size: 0.88rem;
    color: var(--muted);
}

/* ── Tech grid ────────────────────────────── */
.docs-tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 1rem 0;
}

.docs-tech-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.docs-tech-card h3 {
    margin-top: 0;
    font-size: 0.95rem;
    color: var(--cyan);
}

.docs-tech-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0;
}

/* ── Table ────────────────────────────────── */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.88rem;
}

.docs-table th {
    text-align: left;
    padding: 10px 14px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.docs-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.docs-table td:first-child {
    white-space: nowrap;
}

/* ── Checklist ────────────────────────────── */
.docs-checklist li {
    list-style: none;
    position: relative;
    padding-left: 8px;
}

.docs-checklist li::before {
    content: '☐';
    position: absolute;
    left: -16px;
    color: var(--muted);
}

/* ── Divider ──────────────────────────────── */
.docs-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Contact links ────────────────────────── */
.docs-contact-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ── Feedback section ─────────────────────── */
.docs-feedback-section {
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 0;
}

.docs-feedback-section h2 {
    margin-bottom: 0.5rem;
}

/* ── Active nav link ──────────────────────── */
.nav-active {
    color: var(--bright) !important;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 900px) {
    .docs-tech-grid,
    .docs-modes-grid,
    .docs-download-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 90;
        background: var(--void);
        border-right: none;
        border-top: 1px solid var(--border);
        height: auto;
    }

    .docs-sidebar.open {
        display: block;
    }

    .docs-sidebar-toggle {
        display: flex;
    }

    .docs-main {
        padding: 24px 20px 80px;
    }

    .docs-feedback-section {
        padding: 24px 20px;
    }
}
