/* =========================================
   Feature 16: Active Filters Management UI
   ========================================= */

/* --- Main Container --- */
.filter-panel-container {
  background-color: var(--panel-color);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  margin-top: 20px; /* Spacing from Action Dock */
  width: 100%;
  max-width: 1160px; /* Matches grid width */
}

/* --- Header --- */
.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-count {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.filter-panel-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}

.control-separator {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
  margin: 0 5px;
}

/* --- List Header --- */
.filter-list-header {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  padding-right: 35px; /* Offset for scrollbar */
}

.header-name { flex: 1; }
.header-cat { width: 100px; text-align: center; } 
.header-actions { width: 70px; text-align: right; }

/* --- Scrollable Area --- */
.active-filters-list {
  max-height: 300px; /* Reasonable height */
  overflow-y: scroll; 
  padding: 0;
  margin: 0;
  list-style: none;
}

.active-filters-list::-webkit-scrollbar { width: 8px; }
.active-filters-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.active-filters-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.active-filters-list::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Filter Item Row --- */
.filter-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.1s;
  position: relative;
}
.filter-item:last-child { border-bottom: none; }
.filter-item:hover { background: rgba(255, 255, 255, 0.03); }

.filter-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  padding-right: 15px;
}

.filter-category-badge {
  width: 100px;
  font-size: 0.75rem;
  color: var(--brand-yellow);
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-actions {
  width: 70px;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

/* --- Icon Buttons --- */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; 
}
.icon-btn:hover { color: var(--brand-yellow); background: rgba(255, 204, 0, 0.1); }
.icon-btn.delete:hover { color: var(--val-bad); background: rgba(239, 68, 68, 0.15); }

/* --- Tooltips --- */
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%; 
  margin-top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  pointer-events: none;
}

.filter-placeholder {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* =========================================
   MODAL STYLES (Shared)
   ========================================= */
/* (Reusing existing modal-backdrop classes from global/previous features) */