/* =============================================
   filters.css — Seção de filtros
   Power BI Modern Theme
   ============================================= */

.filters-section {
    background: var(--pbi-card);
    border-radius: var(--pbi-radius-md);
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: var(--pbi-shadow-sm);
    border: 1px solid var(--pbi-border);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pbi-border2);
}

.filters-section h2 {
    color: var(--pbi-text);
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-clear {
    padding: 5px 12px;
    background: transparent;
    color: var(--pbi-red);
    border: 1px solid var(--pbi-red);
    border-radius: var(--pbi-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.btn-clear:hover {
    background: var(--pbi-red);
    color: #fff;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.filter-card {
    background: #FAFAFA;
    border-radius: var(--pbi-radius);
    padding: 12px;
    transition: box-shadow 0.15s ease;
    border: 1px solid var(--pbi-border);
    border-top-width: 2px;   /* sobrescrito inline pelo JS com a cor */
}

.filter-card:hover {
    box-shadow: var(--pbi-shadow-sm);
}

.filter-card h4 {
    color: var(--pbi-text-muted);
    font-size: 10px;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 170px;
    overflow-y: auto;
}

/* Scrollbar personalizada */
.filter-options::-webkit-scrollbar       { width: 4px; }
.filter-options::-webkit-scrollbar-track { background: #F0F0F0; border-radius: 4px; }
.filter-options::-webkit-scrollbar-thumb { background: #C8C8C8; border-radius: 4px; }
.filter-options::-webkit-scrollbar-thumb:hover { background: var(--pbi-blue); }

.filter-option {
    background: var(--pbi-card);
    border: 1px solid var(--pbi-border);
    padding: 4px 9px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 26px;
    flex: 1 1 auto;
    min-width: fit-content;
    color: var(--pbi-text);
}

.filter-option:hover:not(.disabled) {
    border-color: var(--pbi-blue);
    background: var(--pbi-blue-lt);
    color: var(--pbi-blue);
}

.filter-option.selected {
    background: var(--pbi-yellow);
    color: var(--pbi-dark);
    border-color: var(--pbi-yellow-dk);
    font-weight: 700;
}

.filter-option.selected:hover {
    background: var(--pbi-yellow-dk);
    border-color: #B8960D;
}

.filter-option.disabled {
    opacity: 0.3;
    pointer-events: none;
    background: #F5F5F5;
}

.filter-label {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(0,0,0,0.07);
    padding: 1px 5px;
    border-radius: 10px;
    white-space: nowrap;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.filter-option.selected .filter-count {
    background: rgba(0,0,0,0.15);
    color: var(--pbi-dark);
}
