/* Sentinel-Ops Documentation Styles
   Extends the YadriWorks design system (styles.css) */

/* === Docs Layout === */

.docs-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* === Sidebar === */

.docs-sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.docs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.docs-product-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.docs-sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

/* Persona quick links */

.docs-persona-links {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.docs-persona-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.docs-persona-tag {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    margin: 0.125rem 0.125rem 0.125rem 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.4;
}

.docs-persona-tag:hover {
    background: var(--navy-700);
    border-color: var(--navy-700);
    color: var(--bg-card);
}

/* Sidebar navigation */

.docs-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.docs-nav ul,
.docs-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Top-level items */

.docs-nav > ul > li {
    margin-bottom: 0;
}

.docs-nav > ul > li > a {
    display: block;
    padding: 0.375rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.docs-nav > ul > li > a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.docs-nav > ul > li > a.docs-nav-active {
    color: var(--navy-700);
    border-left-color: var(--navy-700);
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Sub-nav items (nested ul) */

.docs-nav > ul > li > ul {
    padding: 0 0 0.25rem;
}

.docs-nav > ul > li > ul > li {
    margin: 0;
}

.docs-nav > ul > li > ul > li > a {
    display: block;
    padding: 0.1875rem 1.25rem 0.1875rem 2.25rem;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
    line-height: 1.4;
}

.docs-nav > ul > li > ul > li > a:hover {
    color: var(--text-primary);
}

/* === Mobile sidebar toggle button === */

.docs-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 60;
    background: var(--navy-700);
    color: var(--bg-card);
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
    gap: 0.375rem;
}

.docs-sidebar-toggle-icon {
    font-size: 1rem;
}

/* === Main content === */

.docs-main {
    flex: 1;
    margin-left: 260px;
    max-width: 820px;
    padding: 3rem 3rem 5rem;
}

.docs-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

.docs-main h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.docs-lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Section spacing */

.docs-main section {
    margin-bottom: 4rem;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.docs-main section:last-child {
    margin-bottom: 2rem;
}

.docs-main h2 {
    font-size: 1.625rem;
    margin-bottom: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.docs-main section > h2:first-child,
#overview h2 {
    border-top: none;
    padding-top: 0;
}

.docs-main h3 {
    font-size: 1.125rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.docs-main h4 {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.docs-main p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.docs-main ul,
.docs-main ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.docs-main li {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 0.375rem;
}

.docs-main a {
    color: var(--accent);
    font-weight: 500;
}

.docs-main a:hover {
    color: var(--accent-hover);
}

/* === How it works === */

.docs-how-it-works {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.docs-how-it-works h2 {
    border-top: none;
    padding-top: 0;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.docs-steps-list li {
    padding: 0.25rem 0;
}

.docs-steps-list li strong {
    color: var(--text-primary);
}

/* === Notes === */

.docs-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
}

/* === Steps === */

.docs-step {
    margin-bottom: 2.5rem;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border);
}

.docs-step h3 {
    margin-top: 0;
}

.docs-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

/* === Code blocks === */

.docs-main code {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    color: var(--navy-800);
}

.docs-main pre {
    background: var(--navy-900);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border: 1px solid var(--navy-800);
}

.docs-main pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: #e2e8f0;
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* === Tables === */

.docs-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.docs-main table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.docs-main thead {
    background: var(--bg-secondary);
}

.docs-main th {
    text-align: left;
    padding: 0.625rem 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.docs-main td {
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
    vertical-align: top;
}

.docs-main tr:last-child td {
    border-bottom: none;
}

.docs-main td code {
    font-size: 0.75rem;
}

/* === API Endpoints === */

.docs-endpoint {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.docs-method {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.docs-method-post {
    background: #059669;
    color: #fff;
}

.docs-method-get {
    background: #2563eb;
    color: #fff;
}

/* === Subsections === */

.docs-subsection {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

/* Persona sections */

.docs-persona-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 2rem;
}

.docs-persona-section h3 {
    margin-top: 0;
}

/* === Built by === */

.docs-built-by {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* === Responsive === */

@media (max-width: 1024px) {
    .docs-main {
        padding: 2rem 2rem 4rem;
    }
}

@media (max-width: 860px) {
    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 90;
        width: 260px;
        box-shadow: none;
    }

    .docs-sidebar.docs-sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

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

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

    .docs-main {
        margin-left: 0;
        padding: 2rem 1.5rem 5rem;
        max-width: 100%;
    }

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

    .docs-persona-section {
        padding: 1.25rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .docs-main {
        padding: 1.5rem 1.25rem 5rem;
    }

    .docs-main h1 {
        font-size: 1.75rem;
    }

    .docs-main h2 {
        font-size: 1.375rem;
    }

    .docs-main pre {
        padding: 1rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .docs-how-it-works {
        padding: 1.25rem;
    }

    .docs-step {
        padding-left: 1rem;
    }

    .docs-table-wrap {
        border-radius: 6px;
    }

    .docs-main th,
    .docs-main td {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
}
