/* wiki.css - Knowledge Base & Wiki Styles */

/* ==================== */
/* Container */
/* ==================== */

#wiki-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== */
/* Loading & Error */
/* ==================== */

.wiki-loading,
.wiki-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
}

.wiki-error {
    color: #f56565;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.wiki-error button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== */
/* Wiki Page */
/* ==================== */

.wiki-page {
    background: white;
    border-radius: 16px;
    padding: 32px;
    min-height: calc(100vh - 120px);
}

/* ==================== */
/* Header */
/* ==================== */

.wiki-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 3px solid #e2e8f0;
}

.wiki-title {
    font-size: 36px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 8px 0;
}

.wiki-subtitle {
    font-size: 16px;
    color: #718096;
    margin: 0;
}

/* ==================== */
/* Toolbar */
/* ==================== */

.wiki-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
}

.wiki-search {
    display: flex;
    gap: 12px;
}

.wiki-search input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.wiki-search input:focus {
    outline: none;
    border-color: #667eea;
}

.wiki-search button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.wiki-search button:hover {
    background: #5568d3;
}

/* Categories */
.wiki-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-btn {
    padding: 8px 16px;
    background: white;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ==================== */
/* Articles Grid */
/* ==================== */

.wiki-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.wiki-article-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.wiki-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background: #edf2f7;
    color: #2d3748;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.article-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #718096;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.company-badge {
    padding: 2px 8px;
    background: #bee3f8;
    color: #2c5282;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================== */
/* Empty State */
/* ==================== */

.wiki-empty {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.wiki-empty p {
    color: #718096;
    font-size: 16px;
}

/* ==================== */
/* Article View */
/* ==================== */

.wiki-breadcrumb {
    margin-bottom: 24px;
}

.wiki-breadcrumb button {
    padding: 8px 16px;
    background: #f7fafc;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wiki-breadcrumb button:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.wiki-article {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.article-category-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.article-title-large {
    font-size: 42px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.article-meta-bar {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #718096;
}

/* Article Content */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2d3748;
}

.article-content h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1a202c;
    margin: 40px 0 20px 0;
    line-height: 1.3;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    margin: 32px 0 16px 0;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 24px 0 12px 0;
}

.article-content p {
    margin: 0 0 16px 0;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    font-weight: 700;
    color: #1a202c;
}

.article-content em {
    font-style: italic;
    color: #4a5568;
}

.article-content a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.article-content a:hover {
    color: #5568d3;
}

.article-content code {
    padding: 2px 6px;
    background: #edf2f7;
    color: #c7254e;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.article-content pre {
    background: #1a202c;
    color: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ==================== */
/* Responsive */
/* ==================== */

@media (max-width: 768px) {
    .wiki-page {
        padding: 20px;
    }

    .wiki-title {
        font-size: 28px;
    }

    .wiki-articles-grid {
        grid-template-columns: 1fr;
    }

    .article-title-large {
        font-size: 32px;
    }

    .wiki-toolbar {
        padding: 16px;
    }

    .wiki-search {
        flex-direction: column;
    }

    .wiki-search button {
        width: 100%;
    }
}
