/* Documentation Site Styles
 * Uses CSS variables from core.css for consistency
 * Design philosophy: data-first hierarchy, semantic clarity, performance
 */

/* Layout */
body {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    line-height: 1.6;
}

/* Typography - Code blocks */
pre {
    background: #f4f4f4;
    padding: 12px 16px;
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono, monospace);
    font-size: 0.9em;
}

pre code {
    background: none;
    padding: 0;
    border: none;
}

/* Headings */
h1 {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

h2 {
    margin-top: 2em;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

/* Links */
a {
    color: var(--accent-color, #0066cc);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
nav.doc-nav {
    margin-bottom: 2em;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
}

nav.doc-nav a {
    margin-right: 16px;
}

.site-logo {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Table of Contents */
.toc {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px 24px;
    margin-bottom: 2em;
}

.toc-title {
    font-weight: 600;
    margin: 0 0 12px 0;
    font-size: 0.9em;
    color: #555;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin: 6px 0;
}

.toc a {
    font-size: 0.95em;
}

/* Index Page */
.doc-header {
    display: flex;
    align-items: center;
    margin-bottom: 2em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 16px;
}

.doc-header img {
    width: 48px;
    height: 48px;
    margin-right: 16px;
}

.doc-header h1 {
    margin: 0;
    border: none;
    padding: 0;
}

/* Quick Links Navigation */
.quick-links {
    display: flex;
    gap: 12px;
    margin-bottom: 2em;
    flex-wrap: wrap;
}

.quick-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: var(--accent-color, #0066cc);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.quick-link:hover {
    background: #f0f0f0;
    text-decoration: none;
}

/* Search */
.search-container {
    margin-bottom: 2em;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #000;
    box-sizing: border-box;
}

.search-input:focus {
    outline: 2px solid var(--accent-color, #0066cc);
    outline-offset: -1px;
    border-color: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-results {
    margin-top: 1em;
}

.search-result {
    padding: 12px 16px;
    margin: 8px 0;
    background: #f9f9f9;
    border-radius: 4px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.search-result-title {
    font-weight: 500;
    color: var(--accent-color, #0066cc);
}

.search-result-category {
    font-size: 0.85em;
    color: #666;
    margin-left: 8px;
}

.search-result-snippet {
    font-size: 0.9em;
    color: #555;
    margin-top: 4px;
}

.search-result-snippet mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-results {
    color: #666;
    padding: 12px 0;
}

/* Downloads Page */
.download-section {
    margin: 2em 0;
}

.download-section h2 {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 1em;
}

.download-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.download-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.download-card-icon {
    font-size: 1.5em;
    margin-right: 12px;
}

.download-card-title {
    font-weight: 600;
    font-size: 1.1em;
}

.download-card-desc {
    color: #555;
    font-size: 0.9em;
    flex-grow: 1;
    margin-bottom: 16px;
}

.download-btn {
    display: inline-block;
    background: var(--accent-color, #0066cc);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.15s;
}

.download-btn:hover {
    background: #0055aa;
    text-decoration: none;
}

.install-code {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 0.9em;
    overflow-x: auto;
    margin: 1em 0;
}

.platform-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.platform-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.platform-list li:last-child {
    border-bottom: none;
}

.platform-name {
    font-weight: 500;
}

.platform-link {
    font-size: 0.9em;
}

/* Release Version Cards */
.release-version {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.release-version.latest {
    border-color: var(--accent-color, #0066cc);
    border-width: 2px;
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.release-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.release-date {
    color: #666;
    font-size: 0.85em;
}

.latest-badge {
    background: var(--accent-color, #0066cc);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.prerelease-badge {
    background: var(--color-warning, #ffaa00);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.download-link {
    font-weight: 500;
}

.file-size {
    color: #888;
    font-size: 0.85em;
    margin-left: 4px;
}

.loading {
    color: #666;
    font-style: italic;
}

.error {
    color: var(--color-error, #ef4444);
}

/* Provenance Footer */
.site-footer {
    margin-top: 4em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.provenance {
    font-size: 0.8em;
    color: #888;
    text-align: center;
}

.provenance a {
    color: #888;
    font-family: var(--font-mono, monospace);
}

.provenance a:hover {
    color: var(--accent-color, #0066cc);
}

/* Nix Infrastructure Tables */
.nix-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.nix-table th,
.nix-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.nix-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.nix-table code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

.container-details {
    margin-top: 12px;
    font-size: 0.9em;
}

.container-details p {
    margin: 4px 0;
}

.container-details code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Category sections with SEG symbols */
.category-section {
    margin-top: 2em;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1em;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.category-symbol {
    font-size: 1.5em;
    margin-right: 12px;
    opacity: 0.7;
}

.category-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.category-desc {
    font-size: 0.85em;
    color: #666;
    margin-left: auto;
}

/* Document list */
.doc-list {
    list-style: none;
    padding: 0;
}

.doc-list li {
    margin: 8px 0;
}

.doc-list a {
    display: block;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 4px;
    transition: background 0.15s;
}

.doc-list a:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.doc-list .doc-name {
    font-weight: 500;
}

/* Tables - data-first display */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f9f9f9;
    font-weight: 600;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .doc-list a {
        transition: none;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    h1, h2 {
        border-color: #333;
    }

    h2 {
        border-color: #2a2a2a;
    }

    pre, code {
        background: #2a2a2a;
    }

    pre {
        border-color: #333;
    }

    a {
        color: #6db3f2;
    }

    nav.doc-nav,
    .toc,
    .doc-list a,
    th {
        background: #242424;
    }

    .toc {
        border-color: #333;
    }

    .doc-list a:hover {
        background: #2a2a2a;
    }

    .doc-header {
        border-color: #333;
    }

    .quick-link {
        background: #242424;
        border-color: #333;
    }

    .quick-link:hover {
        background: #2a2a2a;
    }

    .category-header {
        border-color: #333;
    }

    .category-title {
        color: #e0e0e0;
    }

    .category-desc {
        color: #999;
    }

    .toc-title {
        color: #aaa;
    }

    th, td {
        border-color: #333;
    }

    .search-input {
        background: #2a2a2a;
        border-color: #333;
        color: #e0e0e0;
    }

    .search-input::placeholder {
        color: #666;
    }

    .search-result {
        background: #242424;
    }

    .search-result:hover {
        background: #2a2a2a;
    }

    .search-result-category {
        color: #888;
    }

    .search-result-snippet {
        color: #aaa;
    }

    .search-result-snippet mark {
        background: #5c4a00;
        color: #fff;
    }

    .search-no-results {
        color: #888;
    }

    .download-card {
        background: #242424;
        border-color: #333;
    }

    .download-card-desc {
        color: #aaa;
    }

    .download-btn {
        background: #0077cc;
    }

    .download-btn:hover {
        background: #0088dd;
    }

    .platform-list li {
        border-color: #333;
    }

    .release-version {
        background: #242424;
        border-color: #333;
    }

    .release-version.latest {
        border-color: #0077cc;
    }

    .release-date {
        color: #888;
    }

    .file-size {
        color: #666;
    }

    .loading {
        color: #888;
    }

    .site-footer {
        border-color: #333;
    }

    .provenance a:hover {
        color: #6db3f2;
    }

    .nix-table th,
    .nix-table td {
        border-color: #333;
    }

    .nix-table th {
        background: #242424;
    }

    .nix-table code,
    .container-details code {
        background: #2a2a2a;
    }
}

/* Print styles */
@media print {
    nav.doc-nav {
        display: none;
    }

    body {
        max-width: none;
        padding: 0;
    }
}
