/* Knowledge Database Frontend Styles */
.knowledge-database {
    max-width: 1200px;
    margin: 0 auto;
}

/* Search form */
.knowledge-search-form {
    margin-bottom: 30px;
}

.knowledge-search-field {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.knowledge-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
}

.knowledge-search-input:focus {
    outline: none;
    border-color: #2271b1;
}

.knowledge-search-submit {
    padding: 10px 20px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.knowledge-search-submit:hover {
    background: #135e96;
}

/* Filters */
.knowledge-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* List view */
.knowledge-list .knowledge-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.knowledge-list .knowledge-item {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: box-shadow 0.2s ease;
}

.knowledge-list .knowledge-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Grid view */
.knowledge-grid .knowledge-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.knowledge-grid .knowledge-item {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Item styles */
.knowledge-item-header {
    margin-bottom: 15px;
}

.knowledge-item-title {
    margin: 0 0 10px 0;
    font-size: 1.25em;
}

.knowledge-item-title a {
    text-decoration: none;
    color: #1e293b;
}

.knowledge-item-title a:hover {
    color: #2271b1;
}

.knowledge-item-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.875em;
    color: #64748b;
}

.reading-time {
    font-weight: 500;
}

.difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-easy {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-hard {
    background: #fee2e2;
    color: #991b1b;
}

.knowledge-item-excerpt {
    margin-bottom: 15px;
    color: #475569;
    line-height: 1.6;
}

.knowledge-item-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.knowledge-item-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.knowledge-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 16px;
    font-size: 0.875em;
    transition: background-color 0.2s ease;
}

.knowledge-category:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Single item view */
.knowledge-item-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 0;
}

.knowledge-item-single .knowledge-item-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.knowledge-item-single .knowledge-item-title {
    font-size: 2em;
    margin-bottom: 15px;
}

.knowledge-item-single .knowledge-item-meta {
    font-size: 1em;
    margin-bottom: 15px;
}

.knowledge-item-single .knowledge-author,
.knowledge-item-single .knowledge-source {
    font-weight: 500;
}

.knowledge-item-content {
    line-height: 1.7;
    margin-bottom: 30px;
}

.knowledge-item-content h2,
.knowledge-item-content h3,
.knowledge-item-content h4 {
    margin-top: 30px;
    margin-bottom: 15px;
}

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

.knowledge-item-content ul,
.knowledge-item-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.knowledge-item-related {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.knowledge-item-related h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.knowledge-related-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.knowledge-related-links li {
    margin-bottom: 8px;
    padding-left: 0;
}

.knowledge-related-links li::before {
    content: "→";
    margin-right: 8px;
    color: #2271b1;
}

.knowledge-related-links a {
    text-decoration: none;
    color: #475569;
}

.knowledge-related-links a:hover {
    color: #2271b1;
}

.knowledge-external-link {
    margin-top: 30px;
    text-align: center;
}

/* Pagination */
.knowledge-pagination {
    margin-top: 40px;
    text-align: center;
}

.knowledge-pagination .page-numbers {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.knowledge-pagination .page-numbers li {
    margin: 0;
}

.knowledge-pagination .page-numbers a,
.knowledge-pagination .page-numbers span {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: #475569;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.knowledge-pagination .page-numbers a:hover {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.knowledge-pagination .page-numbers .current {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* No items message */
.knowledge-no-items {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .knowledge-grid .knowledge-items {
        grid-template-columns: 1fr;
    }
    
    .knowledge-search-field {
        flex-direction: column;
    }
    
    .knowledge-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .knowledge-item-single .knowledge-item-title {
        font-size: 1.5em;
    }
}