/**
 * Expertenrat-QA - Filter Styles
 * CSS für das Dropdown-Filter-Design
 */

#e8qa-filter {
    margin-bottom: 2rem;
    width: 100%;
    font-family: inherit;
}

.filter-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-header h4 {
    margin: 0 1rem 0.5rem 0;
    font-size: 1.1em;
}

/* Hauptthemen-Zeile Styling */
.main-topics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    position: relative;
    z-index: 10;
    margin-bottom: 1rem;
}

.topic-container {
    position: relative;
    display: inline-block;
    /* margin-right: 0.5rem;
    margin-bottom: 0.5rem; */
}

.topic-btn-wrapper {
    display: flex;
    align-items: stretch;
    border-radius: 4px;
    overflow: hidden;
}

.topic-btn {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    border-right: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f8f8f8;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

#e8qa-filter .topic-container.has-dropdown .topic-btn {
    border-radius: 4px 0 0 4px;
    margin-right: 1px !important;
}
    

.dropdown-toggle {
    padding: 0.6rem 0.7rem;
    border: 1px solid #ddd;
    border-radius: 0 4px 4px 0;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-container:not(.has-dropdown) .topic-btn {
    border-radius: 4px;
    border-right: 1px solid #ddd;
}

.topic-btn.all {
    background-color: #f0f0f0;
    font-weight: 600;
}

.topic-btn.active {
    background-color: #e0e0e0;
    border-color: #aaa;
}

.dropdown-arrow {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.topic-container.open .dropdown-arrow i {
    transform: rotate(180deg);
}

.dropdown-toggle:hover {
    background-color: #e0e0e0;
}

.dropdown-toggle.active {
    background-color: #e0e0e0;
    border-color: #aaa;
}

/* Dropdown Styling */
.subtopics-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 280px;
    max-width: 90vw;
    z-index: 100;
    display: none;
    padding: 0.5rem;
    margin-top: 0.25rem;
}

.topic-container.open .subtopics-dropdown {
    display: block;
}

.subtopic-search {
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    border-bottom: 1px solid #eee;
}

.subtopic-search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.subtopics-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.25rem;
}

.subtopic-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.subtopic-item:hover {
    background-color: #f5f5f5;
}

.subtopic-checkbox {
    margin-right: 0.5rem;
}

.subtopic-name {
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-topics-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .topic-container {
        width: 100%;
        margin-right: 0;
    }
    
    .topic-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .subtopics-dropdown {
        width: 100%;
        position: relative;
    }
}

/* Alle-Filter-Button */
.filter-chip.all {
    background-color: #e9f2fb;
    border-color: #c5d9ea;
    font-weight: 600;
}

/* Hover-Effekte */
.filter-chip:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Aktiver Zustand */
.filter-chip.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .filter-chips-container {
        gap: 0.5rem;
    }
    
    .filter-chip {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }
    
    .topic-group {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Animation für sanfte Übergänge */
.e8qa-item {
    transition: opacity 0.3s ease;
}
