/* Search bar and results */
.kb-home {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.kb-search-form {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#kb-search {
    flex: 1 1 60%;
    min-width: 200px;
    padding: 10px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 3px;
}

#kb-category-filter {
    flex: 0 1 30%;
    min-width: 150px;
    padding: 10px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 3px;
}

#kb-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 60%;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

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

.kb-suggestions-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

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

.kb-suggestions-list li a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.kb-suggestions-list li a:hover {
    background: #f5f5f5;
}

#kb-search-results {
    margin-top: 15px;
}

#kb-search-results ul {
    list-style: none;
    padding: 0;
}

#kb-search-results li {
    margin-bottom: 15px;
}

#kb-search-results li a {
    text-decoration: none;
    font-weight: 600;
}

#kb-search-results li p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

/* Voting buttons */
.kb-vote-container {
    margin-top: 20px;
    padding: 10px 0;
}

.kb-vote {
    display: inline-block;
    padding: 8px 15px;
    margin-right: 10px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    transition: background 0.2s;
}

.kb-vote:hover {
    background: #f5f5f5;
}

/* Table of Contents */
.kb-toc {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 25px;
    position: sticky;
    top: 20px;
    background: #fff;
    z-index: 10;
    border-radius: 3px;
}

.kb-toc h4 {
    margin: 0 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.kb-toc-toggle {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.kb-toc-toggle:hover {
    text-decoration: underline;
}

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

.kb-toc-list li {
    margin-bottom: 8px;
}

.kb-toc-list li a {
    text-decoration: none;
    color: inherit;
}

.kb-toc-list li a:hover {
    color: #0073aa;
}

/* Related Articles */
.kb-related-articles {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.kb-related-articles h2 {
    margin: 0 0 15px;
    font-size: 18px;
}

.kb-related-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-related-articles li {
    margin-bottom: 12px;
}

.kb-related-articles li a {
    text-decoration: none;
    font-weight: 600;
    color: inherit;
}

.kb-related-articles li a:hover {
    text-decoration: underline;
}

/* Ensure responsiveness */
@media (max-width: 600px) {
    .kb-home {
        padding: 10px;
    }

    #kb-search,
    #kb-category-filter {
        flex: 1 1 100%;
        min-width: 100%;
        margin-bottom: 10px;
    }

    #kb-suggestions {
        width: 100%;
    }

    .kb-toc {
        position: static;
    }

    .kb-toc-list {
        display: none; /* Collapsed by default on mobile */
    }
}

.kb-categories-grid {
    display: grid;
    gap: 20px;
}

.kb-articles-grid {
    display: grid;
    gap: 20px;
}

.kb-articles-grid li {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
}