/* Wiki Specific Styles */
:root {
    --wiki-sidebar-width: 280px;
    --wiki-primary: var(--bs-primary);
    /* Assuming bootstrap usage */
    --wiki-bg-sidebar: rgba(255, 255, 255, 0.95);
    --wiki-bg-content: rgba(255, 255, 255, 0.98);
}

.wiki-wrapper {
    min-height: 80vh;
    display: flex;
    gap: 1.5rem;
    position: relative;
}

/* Sidebar Styling */
.wiki-sidebar {
    width: var(--wiki-sidebar-width);
    flex-shrink: 0;
    background: var(--wiki-bg-sidebar);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 100px);
    /* Adjust based on navbar height */
    position: sticky;
    top: 90px;
    /* Adjust based on navbar height */
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    scrollbar-width: thin;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Search Box */
.wiki-search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.wiki-search-box input {
    padding-left: 2.5rem;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.wiki-search-box input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.wiki-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.9rem;
}

/* Categories & Navigation */
.wiki-category-group {
    margin-bottom: 1rem;
}

.wiki-category-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.wiki-category-btn:hover {
    color: var(--wiki-primary);
}

.wiki-category-btn i {
    transition: transform 0.2s ease;
}

.wiki-category-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.wiki-nav-list {
    padding-left: 0;
    margin-top: 0.5rem;
    list-style: none;
}

.wiki-nav-link {
    display: block;
    padding: 8px 12px;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.wiki-nav-link:hover {
    background: #f8f9fa;
    color: var(--wiki-primary);
    padding-left: 16px;
}

.wiki-nav-link.active {
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--wiki-primary);
    border-left-color: var(--wiki-primary);
}

/* Main Content area */
.wiki-content {
    flex-grow: 1;
    min-width: 0;
    /* Prevent flex overflow */
    background: var(--wiki-bg-content);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile Toggle */
.wiki-mobile-toggle {
    display: none;
    /* Hidden on desktop */
}

/* Markdown Styling Enhancements */
.wiki-article-body {
    color: #212529;
    line-height: 1.7;
}

.wiki-article-body h1 {
    font-weight: 800;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
    font-size: 2.2rem;
}

.wiki-article-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #343a40;
    font-size: 1.75rem;
}

.wiki-article-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.4rem;
}

.wiki-article-body p {
    margin-bottom: 1.2rem;
}

.wiki-article-body ul,
.wiki-article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.wiki-article-body li {
    margin-bottom: 0.4rem;
}

.wiki-article-body blockquote {
    border-left: 4px solid var(--wiki-primary);
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    margin: 1.5rem 0;
}

.wiki-article-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wiki-article-body pre {
    background: #2d2d2d;
    padding: 1rem;
    border-radius: 8px;
    color: #f8f8f2;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.wiki-article-body code {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--wiki-primary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.wiki-article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.wiki-article-body a {
    color: var(--wiki-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.wiki-article-body a:hover {
    color: #0044cc;
}

/* Darker shade needed */

/* Responsive Design */
@media (max-width: 991.98px) {
    .wiki-wrapper {
        gap: 0;
    }

    .wiki-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-100%);
        border-radius: 0;
        width: 280px;
        background: #fff;
    }

    .wiki-sidebar.show {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    /* Backdrop for mobile sidebar */
    .wiki-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .wiki-backdrop.show {
        display: block;
        opacity: 1;
    }

    .wiki-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin: 0 0 1rem 0;
        padding: 12px;
        background-color: #7289DA;
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transition: background-color 0.2s;
        position: static;
    }

    .wiki-mobile-toggle:hover {
        background-color: #5b6eae;
        color: white;
    }

    .wiki-content {
        padding: 1.5rem;
    }
}