/* Filter Panel Toggle Button - styled as filter-menu-item */
.filter-panel-toggle-btn {
    /* Inherits styles from .filter-menu-item */
    position: relative;
}

.filter-panel-toggle-btn.active {
    /* Add active state styling if needed */
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-panel.visible {
    right: 0;
}

.filter-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.filter-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.filter-panel-actions {
    display: flex;
    gap: 10px;
}

.filter-panel-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s;
}

.filter-panel-actions button:hover {
    color: var(--primary-color);
}

.filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Filter Panel Section */
.filter-panel-section {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.filter-panel-section-header {
    padding: 15px;
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.filter-panel-section-header:hover {
    background: #e9ecef;
}

.filter-panel-section-header.filter-active {
    background: #e7f3ff;
    border-left: 3px solid var(--primary-color);
}

.filter-panel-section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.filter-panel-active-items {
    font-size: 11px;
    color: #666;
    margin-left: 0px;
    display: none;
    flex-basis: 100%; 
}

[data-theme="dark"] .filter-panel-active-items {
    color: #aaa;
}

.filter-panel-section-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    margin-left: 0px;
    position:relative;
}

.filter-panel-toggle-btn:not(.filter-active) .indicator{
    display:none;
}
.filter-panel-toggle-btn.filter-active .indicator{
    display:block;
    width:8px;
    height:8px;
    background-color:orange;
    position:absolute;
    top: 9px;
    left: 12px;
    border-radius:50%;
}


.filter-panel-include-all {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 9px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 0px;
    transition: background 0.2s;
}

.filter-panel-include-all:hover {
    background: var(--primary-color);
}

.filter-panel-section-body {
    padding: 15px;
    background: white;
}


/* Search input in panel */
.filter-panel-section-body .mb-1 {
    margin-bottom: 10px;
}

.filter-panel-section-body .mb-1 input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
        height: 38px;
}

.filter-panel-section-body .mb-1 hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* Filter select controls in panel */
.filter-panel-section-body .filter-select {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 14px;
    align-items: center;
}

.filter-panel-section-body .filter-select .select,
.filter-panel-section-body .filter-select .deselect {
    cursor: pointer;
    color: var(--primary-color);
    transition: text-decoration 0.2s;
}

.filter-panel-section-body .filter-select .select:hover,
.filter-panel-section-body .filter-select .deselect:hover {
    text-decoration: underline;
}

.filter-panel-section-body .filter-select span {
    color: #ccc;
}

.filter-panel-list-container{
        max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Source code list in panel */
.filter-panel-section-body .list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-panel-section-body .list li {
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}

.filter-panel-section-body .list li.hidden {
    display: none;
}

.filter-panel-section-body .list .form-check {
    display: flex;
    align-items: center;
}

.filter-panel-section-body .list .form-check-input {
    margin-right: 10px;
    cursor: pointer;
}

.filter-panel-section-body .list .form-check-label {
    cursor: pointer;
    flex: 1;
}
.filter-panel-section-body .list .form-check-label small {
    display:block;
}
.filter-panel-section-body .list .form-check-label small:first-child {
    color:black;
    font-weight:bold;
}

/* Dark mode support */
[data-theme="dark"] .filter-panel {
    background: #1a1a1a;
    color: #fff;
}

[data-theme="dark"] .filter-panel-header {
    background: #2a2a2a;
    border-bottom-color: #3a3a3a;
}

[data-theme="dark"] .filter-panel-section {
    border-color: #3a3a3a;
}

[data-theme="dark"] .filter-panel-section-header {
    background: #2a2a2a;
}

[data-theme="dark"] .filter-panel-section-header:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .filter-panel-section-body {
    background: #1a1a1a;
}

[data-theme="dark"] .filter-panel-section-body .sourcecode-list li {
    border-bottom-color: #3a3a3a;
}



.filter-panel-save-btn{
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}