/* BERKDOC - Documentation Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-color: #f8f9fa;
    --sidebar-bg: #2c3e50;
    --content-bg: #ffffff;
    --border-color: #dee2e6;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --code-bg: #f4f4f4;
    --link-color: #3498db;
    --link-hover: #2980b9;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    color: #ecf0f1;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header .back-link {
    display: block;
    padding: 8px 12px;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.1);
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-header .back-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-3px);
}

.sidebar-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.sidebar-header h1 a {
    color: #ecf0f1;
    text-decoration: none;
}

.sidebar-header .version {
    font-size: 0.9rem;
    color: #95a5a6;
}

.search-box {
    margin: 20px 0;
}

#search-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    color: #ecf0f1;
}

#search-input::placeholder {
    color: #95a5a6;
}

#search-results {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    display: none;
}

#search-results.active {
    display: block;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-nav {
    margin: 20px 0;
}

.nav-link {
    display: block;
    padding: 10px;
    margin: 5px 0;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.content {
    margin-left: 300px;
    flex: 1;
    padding: 40px;
    max-width: 1200px;
}

.content-wrapper {
    background: var(--content-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Page Header */
.page-header {
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.package-version {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--link-color);
    text-decoration: none;
}

.breadcrumb .separator {
    margin: 0 8px;
}

/* Item Header */
.item-header {
    margin-bottom: 20px;
}

.item-kind {
    display: inline-block;
    padding: 5px 15px;
    background: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.item-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
}

/* Signatures */
.item-signature {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin: 20px 0;
}

.item-signature code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
}

.signature {
    font-family: 'Courier New', Courier, monospace;
    background: var(--code-bg);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* Documentation Content */
.item-docs {
    margin: 30px 0;
    line-height: 1.8;
}

.item-docs h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.item-docs h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.item-docs p {
    margin-bottom: 15px;
}

.item-docs code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.item-docs pre {
    background: #2b2b2b;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.item-docs pre code {
    background: none;
    padding: 0;
    color: #f8f8f2;
}

.item-docs ul, .item-docs ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

.item-docs a {
    color: var(--link-color);
    text-decoration: none;
}

.item-docs a:hover {
    text-decoration: underline;
}

/* Item Cards */
.item-section {
    margin: 40px 0;
}

.item-section h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.item-list {
    display: grid;
    gap: 20px;
}

.item-card {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.item-card h3 {
    margin-bottom: 10px;
}

.item-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.item-card h3 a:hover {
    color: var(--link-hover);
}

.item-docs {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-public {
    background: #27ae60;
    color: white;
}

.badge-private {
    background: #95a5a6;
    color: white;
}

/* Statistics */
.statistics {
    margin: 40px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

/* Module Tree */
.module-tree {
    margin: 20px 0;
}

.tree-node {
    margin-left: 20px;
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
    margin-bottom: 10px;
}

.tree-node-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.tree-icon {
    margin-right: 8px;
}

.tree-items {
    list-style: none;
    margin-left: 25px;
}

.tree-items li {
    margin: 5px 0;
}

.tree-items a {
    color: var(--link-color);
    text-decoration: none;
}

.tree-items a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    margin-top: 60px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .content {
        margin-left: 250px;
        padding: 20px;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .content {
        margin-left: 0;
    }
}
