/* KPI Filter Styles */
.custom-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.custom-filter-form-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.custom-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-field {
    flex: 1;
    min-width: 200px;
}

.filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.filter-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.filter-field select[multiple] {
    min-height: 100px;
    padding: 8px;
}

.filter-field select[multiple] option {
    padding: 4px 8px;
}

.filter-field select[multiple] option:checked {
    background: #007cba;
    color: white;
}

.custom-filter-results-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    min-height: 200px;
}

.custom-active-filters {
    background: #e7f3ff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #007cba;
}

.filter-pill {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    margin: 2px;
    font-size: 12px;
}

.pill-remove {
    cursor: pointer;
    margin-left: 5px;
    font-weight: bold;
}

.pill-remove:hover {
    color: #ff6b6b;
}

.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 20px 0;
}

.custom-loading-indicator {
    text-align: center;
    padding: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-count {
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.group-heading {
    background: #f0f0f0;
    padding: 10px 15px;
    margin: 10px 0 5px 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    border-left: 4px solid #007cba;
}

.group-heading:hover {
    background: #e0e0e0;
}

.group-posts {
    margin-left: 20px;
    margin-bottom: 15px;
}

.kpi-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.kpi-item:last-child {
    border-bottom: none;
}

.kpi-item a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.kpi-item a:hover {
    text-decoration: underline;
}

#reset-button-container {
    text-align: right;
    margin-top: 15px;
}

#reset-filters {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#reset-filters:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-filter-form {
        flex-direction: column;
    }
    
    .filter-field {
        min-width: 100%;
    }
    
    .group-posts {
        margin-left: 10px;
    }
}
