/*-----------------------
--- css/style-docs.css ---
-----------------------*/
/* === GLOBAL VARIABLES === */
/* Variables are now primarily defined in style-shared.css */

/* Docs specific layout vars */
:root {
    --sidebar-width: 260px;
    --header-height-docs: 60px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body.docs-page {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    color: var(--text-secondary); /* Use generic variable */
    background-color: var(--bg-primary); /* Use generic variable */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--theme-transition);
}

/* === DOCS HEADER === */
.header-docs {
    background-color: rgba(var(--bg-secondary-rgb, 30, 30, 30), 0.9); /* Use RGB var */
    backdrop-filter: blur(8px);
    padding: 0;
    border-bottom: 1px solid var(--border-color); /* Use generic variable */
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height-docs);
    display: flex;
    align-items: center;
    transition: var(--theme-transition);
}
.nav-docs { display: flex; justify-content: space-between; align-items: center; height: 100%; width: 100%; }
.logo-docs { display: flex; align-items: center; text-decoration: none; }
.logo-docs img { max-height: 30px; margin-right: 0.8rem; filter: brightness(1.1); transition: filter 0.3s ease; }
.logo-docs span { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); } /* Use generic variable */
.nav-docs-links { display: flex; gap: 0.8rem; align-items: center;}

/* Buttons use variables from shared */
.btn-primary-docs, .btn-secondary-docs {
    padding: 0.4rem 0.9rem; border-radius: 15px; font-size: 0.85rem; font-weight: 600;
    text-decoration: none; transition: all 0.3s ease, var(--theme-transition); display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-primary-docs { background-color: var(--primary-color); color: var(--bg-primary); }
.btn-primary-docs:hover { background-color: var(--secondary-color); transform: translateY(-1px); }
.btn-secondary-docs { background-color: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary-docs:hover { background-color: var(--bg-secondary); color: var(--text-primary); }

.mobile-toc-toggle {
    display: none;
    background: var(--bg-tertiary); /* Use generic variable */
    border: 1px solid var(--border-color); /* Use generic variable */
    color: var(--text-secondary); /* Use generic variable */
    padding: 0.4rem 0.8rem; border-radius: 5px; cursor: pointer; font-size: 0.9rem; margin-left: 1rem;
    transition: var(--theme-transition);
}
.mobile-toc-toggle i { margin-right: 0.4rem; }

/* === DOCS LAYOUT === */
.container-docs { width: 95%; max-width: 1400px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.docs-wrapper { display: flex; gap: 2.5rem; padding-top: 2rem; padding-bottom: 3rem; flex-grow: 1; }

/* Sidebar Styles */
.docs-sidebar {
    width: var(--sidebar-width); flex-shrink: 0; position: sticky;
    top: calc(var(--header-height-docs) + 2rem);
    height: calc(100vh - var(--header-height-docs) - 4rem);
    overflow-y: auto; padding-right: 1rem;
}
/* Custom Scrollbar */
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: var(--bg-secondary); } /* Use generic variable */
.docs-sidebar::-webkit-scrollbar-thumb { background: #444; border-radius: 3px;} /* Needs theme adjustment */
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: #555; } /* Needs theme adjustment */
body.light-theme .docs-sidebar::-webkit-scrollbar-track { background: var(--bg-tertiary); }
body.light-theme .docs-sidebar::-webkit-scrollbar-thumb { background: #adb5bd; }
body.light-theme .docs-sidebar::-webkit-scrollbar-thumb:hover { background: #9fa7af; }


.toc-nav .toc-title {
    font-size: 0.9rem; font-weight: 700; color: var(--text-muted); /* Use generic variable */
    text-transform: uppercase; margin-bottom: 1rem; padding-left: 10px;
}

.toc-nav ul { list-style: none; padding: 0; margin: 0; }
.toc-nav li { margin-bottom: 0.2rem; }
.toc-nav a {
    display: block; padding: 6px 10px; text-decoration: none;
    color: var(--text-muted); /* Use generic variable */
    font-size: 0.9rem; border-radius: 5px;
    transition: all 0.2s ease, var(--theme-transition);
    border-left: 3px solid transparent;
}
.toc-nav a:hover { background-color: var(--bg-tertiary); color: var(--text-primary); } /* Use generic variables */
.toc-nav a.active {
    background-color: rgba(var(--primary-color-rgb), 0.1); /* Use RGB var */
    color: var(--primary-color); /* Use generic variable */
    font-weight: 600;
    border-left-color: var(--primary-color); /* Use generic variable */
}

/* Submenu Styles */
.toc-submenu {
    margin-top: 0.3rem; margin-bottom: 0.5rem; padding-left: 15px;
    border-left: 1px solid var(--border-color); /* Use generic variable */
    margin-left: 5px; transition: var(--theme-transition);
}
.toc-submenu a { font-size: 0.85rem; padding: 4px 10px; color: var(--text-muted); opacity: 0.8; } /* Use generic variable */
.toc-submenu a:hover { color: var(--text-secondary); opacity: 1;} /* Use generic variable */
.toc-submenu a.active {
    background-color: rgba(var(--primary-color-rgb), 0.08); /* Use RGB var */
    color: var(--primary-color); /* Use generic variable */
    border-left-color: transparent; opacity: 1;
}


/* Main Content Styles */
.docs-content { flex-grow: 1; min-width: 0; }
.docs-content article section { margin-bottom: 3.5rem; }

.docs-content h1 {
    font-size: 2.5rem; color: var(--text-primary); margin-bottom: 0.5rem; /* Use generic variables */
    border-bottom: 1px solid var(--border-color); padding-bottom: 0.8rem; transition: var(--theme-transition);
}
.docs-content .doc-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 2.5rem; } /* Use generic variable */
.docs-content .doc-meta a { color: var(--secondary-color); text-decoration: none; } /* Use generic variable */
.docs-content .doc-meta a:hover { text-decoration: underline; }

.docs-content h2 {
    font-size: 1.8rem; color: var(--text-primary); margin-top: 2rem; margin-bottom: 1.5rem; /* Use generic variables */
    padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color);
    scroll-margin-top: calc(var(--header-height-docs) + 20px);
    transition: var(--theme-transition);
}
.docs-content h3 {
    font-size: 1.4rem; color: var(--text-secondary); margin-top: 2rem; margin-bottom: 1rem; /* Use generic variables */
    scroll-margin-top: calc(var(--header-height-docs) + 20px);
    transition: var(--theme-transition);
}
.docs-content .subsection h3 {
    margin-top: 1.5rem; margin-bottom: 0.8rem; font-size: 1.3rem;
    color: var(--secondary-color); /* Use generic variable */
}

.docs-content p { margin-bottom: 1rem; line-height: 1.8; color: var(--text-secondary); } /* Use generic variable */
.docs-content ul, .docs-content ol { margin-bottom: 1rem; padding-left: 25px; color: var(--text-secondary); } /* Use generic variable */
.docs-content ul li, .docs-content ol li { margin-bottom: 0.6rem; }
.docs-content ul ul, .docs-content ol ol { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.docs-content li > p { margin-bottom: 0.3rem; }

.docs-content a { color: var(--link-color); text-decoration: none; transition: color 0.3s ease; } /* Use generic variable */
.docs-content a:hover { text-decoration: underline; color: var(--link-hover); } /* Use generic variable */

.docs-content strong { font-weight: 600; color: var(--text-primary); } /* Use generic variable */
.docs-content em { font-style: italic; color: var(--text-secondary); } /* Use generic variable */

.docs-content code {
    font-family: 'Fira Code', monospace;
    background-color: var(--bg-tertiary); /* Use generic variable */
    color: var(--secondary-color); /* Use generic variable */
    padding: 0.2em 0.4em; border-radius: 4px; font-size: 0.9em;
    border: 1px solid var(--border-color); /* Use generic variable */
    word-break: break-word;
    transition: var(--theme-transition);
}
.docs-content pre {
    margin: 1.5rem 0; border-radius: 8px;
    border: 1px solid var(--border-color); /* Use generic variable */
    font-family: 'Fira Code', monospace; font-size: 0.9em; overflow-x: auto;
    /* Background applied by Prism theme override */
    transition: var(--theme-transition);
}
.docs-content pre code {
    font-family: inherit; background: none; border: none; padding: 0;
    color: inherit; font-size: inherit; word-break: normal;
}


/* Screenshot Placeholders */
.screenshot-placeholder {
    background-color: var(--bg-tertiary); /* Use generic variable */
    border: 2px dashed var(--border-color); /* Use generic variable */
    padding: 2rem 1rem; margin: 1.5rem 0; text-align: center;
    color: var(--text-muted); /* Use generic variable */
    font-style: italic; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; min-height: 100px;
    transition: var(--theme-transition);
}
.screenshot-placeholder i { font-size: 1.2rem; }

/* Note/Warning Boxes */
.note {
    padding: 1rem 1.5rem; margin: 1.5rem 0; border-radius: 8px;
    border-left-width: 5px; border-left-style: solid;
    transition: var(--theme-transition);
}
.note p:last-child { margin-bottom: 0; }
.note i { margin-right: 0.6rem; }

.note-info { background-color: rgba(var(--primary-color-rgb), 0.08); border-color: var(--primary-color); color: var(--text-secondary); }
.note-info strong { color: var(--primary-color); }

.note-warning {
    /* Variables defined in style-legal.css are accessible if loaded after */
    --warning-color-rgb-dark: 255, 167, 38;
    --warning-color-light: #ffc107;
    --warning-color-rgb-light: 255, 193, 7;
    --warning-color: #ffa726;
    --warning-color-rgb: var(--warning-color-rgb-dark);
    background-color: rgba(var(--warning-color-rgb), 0.1); border-color: var(--warning-color); color: var(--text-secondary);
}
.note-warning strong { color: var(--warning-color); }
body.light-theme .note-warning { --warning-color: var(--warning-color-light); --warning-color-rgb: var(--warning-color-rgb-light); }

.note-important {
     /* Define RGB for important */
    --important-color-rgb-dark: 239, 83, 80;
    --important-color-light: #ef5350;
    --important-color-rgb-light: 220, 53, 69;
    --important-color: #ef5350;
    --important-color-rgb: var(--important-color-rgb-dark);
    background-color: rgba(var(--important-color-rgb), 0.1); border-color: var(--important-color); color: var(--text-secondary);
}
.note-important strong { color: var(--important-color); }
body.light-theme .note-important { --important-color: var(--important-color-light); --important-color-rgb: var(--important-color-rgb-light); }

/* Tags */
.tag { display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 10px; margin-left: 0.5rem; font-weight: 500; vertical-align: middle; transition: var(--theme-transition); }
.tag-requires-license { background-color: var(--primary-color); color: var(--bg-primary); }

/* Text Highlighting */
.text-success { color: var(--success-color); font-weight: bold; } /* Use generic variable */
.text-error { color: var(--error-color); font-weight: bold; } /* Use generic variable */

/* === DOCS FOOTER - Uses Shared Footer Styles === */

/* === RESPONSIVE (Docs Page) === */
@media screen and (max-width: 992px) { :root { --sidebar-width: 220px; } .docs-wrapper { gap: 1.5rem; } }
@media screen and (max-width: 768px) {
    .docs-wrapper { flex-direction: column; padding-top: 1rem; }
    .docs-sidebar { position: static; width: 100%; height: auto; max-height: none; overflow-y: visible; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; padding-right: 0; display: none; margin-bottom: 1.5rem; }
    .docs-sidebar.mobile-visible { display: block; }
    .docs-content { padding-top: 1rem; }
    .mobile-toc-toggle { display: inline-flex; align-items: center; }
    .nav-docs-links { flex-grow: 1; justify-content: flex-end; }
    .logo-docs span { display: none; }
    .toc-nav a, .toc-submenu a { font-size: 1rem; padding: 8px 10px; }
}

/* --- PrismJS Theme adjustments (Place AFTER Prism CSS link) --- */
pre[class*="language-"] {
    background: var(--bg-tertiary) !important; /* Use CSS variable */
    border: 1px solid var(--border-color) !important; /* Use CSS variable */
    border-radius: 8px !important; padding: 1em !important;
    text-shadow: none !important;
    color: var(--text-secondary) !important; /* Default code color */
    transition: var(--theme-transition);
}
/* Line numbers */
pre.line-numbers { position: relative; padding-left: 3.8em !important; counter-reset: linenumber; }
.line-numbers .line-numbers-rows {
    position: absolute; pointer-events: none; top: 0; font-size: 100%; left: -3.8em; width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid var(--border-color) !important; /* Use CSS variable */
    background: rgba(var(--bg-primary-rgb), 0.1) !important; /* Use RGB var */
    user-select: none; -webkit-user-select: none; padding-top: 1em; padding-bottom: 1em;
    transition: var(--theme-transition);
}
.line-numbers-rows > span { pointer-events: none; display: block; counter-increment: linenumber; }
.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: var(--text-muted) !important; /* Use CSS variable */
    display: block; padding-right: 0.8em; text-align: right; text-shadow: none !important;
    transition: var(--theme-transition);
}
pre[class*="language-"] > code[class*="language-"] { position: relative; z-index: 1; }

/* Token color overrides (Ensure these work well in BOTH themes) */
/* Okaidia default dark theme tokens are generally good, light overrides in shared CSS */
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string {
    background: none !important;
}
/* Add more specific token overrides here if needed for dark theme contrast */
body.dark-theme .token.comment { color: #6a737d !important; } /* Example: Slightly lighter comment */