/* CCAI9012 Documentation Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --sidebar-hover: #334155;
    --content-bg: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --code-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8fafc;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
#sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sidebar-text);
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

/* Section labels inside the sidebar (e.g., "API Modules") */
.nav-menu .nav-section-label {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    border-top: 1px solid var(--sidebar-hover);
    margin-top: 0.75rem;
}

/* Sub items (e.g., Starter Kits module pages) */
.nav-menu li.sub-item {
    margin: 0;
}

.nav-menu li.sub-item a {
    padding: 0.55rem 1.5rem 0.55rem 2.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
    border-left-color: transparent;
}

.nav-menu li.sub-item a:hover {
    color: var(--sidebar-text);
}

.nav-menu li.sub-item a.active {
    color: var(--sidebar-text);
}

.nav-menu li {
    margin: 0.25rem 0;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-menu a:hover {
    background-color: var(--sidebar-hover);
    border-left-color: var(--primary-color);
}

.nav-menu a.active {
    background-color: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content Styles */
#content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: 1200px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 1.0 rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/*ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

*/

ul, ol {
    margin-left: 1.25rem;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

li {
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    line-height: 1.35;
}

/* Prevent extra spacing if Markdown wraps list items in <p> */
li p {
    margin: 0;
}
/* Code Styles */
code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #e11d48;
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
    font-size: 0.875rem;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--content-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.card p {
    margin-bottom: 1rem;
    color: #64748b;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn.btn-secondary {
    background-color: #475569;
}

.btn.btn-secondary:hover {
    background-color: #334155;
}

/* Module Styles */
.module {
    background: var(--content-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.module h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.module-links,
.module-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.muted {
    color: #64748b;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--content-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: var(--code-bg);
}

th {
    font-weight: 600;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Alert/Info Boxes */
.info-box {
    background-color: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.warning-box {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* ----------------------------
   API documentation tweaks
   ---------------------------- */

.api-content {
    max-width: 1200px;
}

/* pdoc emits <article class="api-doc"> ... */
.api-doc header h1.title {
    margin-bottom: 1rem;
}

/* Related starter kits block under the API title */
.api-related-block {
    margin: 1rem 0 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--content-bg);
    box-shadow: var(--card-shadow);
}

.api-related-block__title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 0.75rem;
}

.api-related-block ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* pdoc definition lists can get very wide; keep them readable */
.api-doc dl {
    margin-bottom: 2rem;
}

.api-doc dd {
    margin-left: 1.5rem;
}

.api-doc pre {
    border: 1px solid var(--border-color);
}

/* Avoid pdoc's legacy flex helpers causing surprises if present */
.api-doc .flex {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    #content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .container {
        flex-direction: column;
    }

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--code-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
