/**
 * Dashboard Filters Component - 100% ISOLATED & CONFLICT-FREE
 * ==========================================================
 * ZERO external dependencies, ZERO style leakage, ZERO conflicts
 * All styles scoped to .dashboard-filters-component-root
 */

/* COMPONENT ISOLATION CONTAINER - COMPLETE RESET */
.dashboard-filters-component-root {
    /* CSS Container Isolation */
    isolation: isolate !important;
    contain: layout style !important;
    
    /* Complete style reset for this component tree */
    all: initial !important;
    display: block !important;
    
    /* Re-establish base styles ONLY for this component */
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #374151 !important;
    box-sizing: border-box !important;
    
    /* Force isolation from parent styles */
    position: relative !important;
    z-index: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* ENSURE ALL CHILD ELEMENTS USE COMPONENT SCOPING */
.dashboard-filters-component-root *,
.dashboard-filters-component-root *::before,
.dashboard-filters-component-root *::after {
    box-sizing: border-box !important;
}

/* Filters Component Variables - COMPLETELY INDEPENDENT */
.dashboard-filters-component-root {
    /* Filters Color Palette - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-primary-gray: #4B5563;
    --dashboard-filters-light-gray: #F9FAFB;
    --dashboard-filters-dark-gray: #1F2937;
    --dashboard-filters-medium-gray: #6B7280;
    --dashboard-filters-border-gray: #D1D5DB;
    --dashboard-filters-text-gray: #374151;
    --dashboard-filters-white: #FFFFFF;
    --dashboard-filters-focus-blue: #3B82F6;
    
    /* Filters Spacing - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-spacing-xs: 0.25rem;
    --dashboard-filters-spacing-sm: 0.5rem;
    --dashboard-filters-spacing-md: 0.75rem;
    --dashboard-filters-spacing-lg: 1rem;
    --dashboard-filters-spacing-xl: 1.5rem;
    --dashboard-filters-spacing-2xl: 2rem;
    
    /* Filters Border Radius - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-radius-sm: 4px;
    --dashboard-filters-radius-md: 6px;
    --dashboard-filters-radius-lg: 8px;
    
    /* Filters Shadows - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --dashboard-filters-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
    --dashboard-filters-shadow-focus: 0 0 0 3px rgba(75, 85, 99, 0.1);
    --dashboard-filters-shadow-dropdown: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Filters Transitions - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-transition-fast: 0.15s ease-in-out;
    --dashboard-filters-transition-normal: 0.3s ease;
    
    /* Filters Typography - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-font-primary: 'Inter', sans-serif;
    --dashboard-filters-font-weight-normal: 400;
    --dashboard-filters-font-weight-medium: 500;
    --dashboard-filters-font-weight-semibold: 600;
    
    /* Filters Control Heights - UNIQUE TO THIS COMPONENT */
    --dashboard-filters-control-height: 42px;
    --dashboard-filters-button-width: 140px;
}

/* COMPONENT-SCOPED STYLES - NO CONFLICTS POSSIBLE */
.dashboard-filters-component-root .dashboard-filters-section {
    background: var(--dashboard-filters-white);
    border-radius: var(--dashboard-filters-radius-lg);
    border: 1px solid var(--dashboard-filters-border-gray);
    padding: var(--dashboard-filters-spacing-xl);
    margin-bottom: var(--dashboard-filters-spacing-2xl);
    box-shadow: var(--dashboard-filters-shadow-md);
    position: relative;
}

.dashboard-filters-component-root .dashboard-filters-title {
    font-family: var(--dashboard-filters-font-primary);
    font-size: 1.125rem;
    font-weight: var(--dashboard-filters-font-weight-semibold);
    color: var(--dashboard-filters-dark-gray);
    margin: 0 0 var(--dashboard-filters-spacing-lg) 0;
    padding: 0;
    border: none;
}

.dashboard-filters-component-root .dashboard-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--dashboard-filters-spacing-lg);
    margin-bottom: var(--dashboard-filters-spacing-xl);
}

.dashboard-filters-component-root .dashboard-filters-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--dashboard-filters-spacing-sm);
}

.dashboard-filters-component-root .dashboard-filters-label {
    font-family: var(--dashboard-filters-font-primary);
    font-size: 0.875rem;
    font-weight: var(--dashboard-filters-font-weight-medium);
    color: var(--dashboard-filters-text-gray);
    margin: 0;
    padding: 0;
}

.dashboard-filters-component-root .dashboard-filters-input,
.dashboard-filters-component-root .dashboard-filters-select {
    width: 100%;
    height: var(--dashboard-filters-control-height);
    padding: var(--dashboard-filters-spacing-sm) var(--dashboard-filters-spacing-md);
    border: 1px solid var(--dashboard-filters-border-gray);
    border-radius: var(--dashboard-filters-radius-md);
    background: var(--dashboard-filters-white);
    font-family: var(--dashboard-filters-font-primary);
    font-size: 0.875rem;
    color: var(--dashboard-filters-text-gray);
    transition: var(--dashboard-filters-transition-fast);
    outline: none;
}

.dashboard-filters-component-root .dashboard-filters-input:focus,
.dashboard-filters-component-root .dashboard-filters-select:focus {
    border-color: var(--dashboard-filters-focus-blue);
    box-shadow: var(--dashboard-filters-shadow-focus);
}

.dashboard-filters-component-root .dashboard-filters-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--dashboard-filters-button-width);
    height: var(--dashboard-filters-control-height);
    padding: 0 var(--dashboard-filters-spacing-lg);
    border: 1px solid var(--dashboard-filters-primary-gray);
    border-radius: var(--dashboard-filters-radius-md);
    background: var(--dashboard-filters-primary-gray);
    color: var(--dashboard-filters-white);
    font-family: var(--dashboard-filters-font-primary);
    font-size: 0.875rem;
    font-weight: var(--dashboard-filters-font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: var(--dashboard-filters-transition-fast);
    outline: none;
}

.dashboard-filters-component-root .dashboard-filters-button:hover {
    background: var(--dashboard-filters-dark-gray);
    border-color: var(--dashboard-filters-dark-gray);
}

.dashboard-filters-component-root .dashboard-filters-button:focus {
    box-shadow: var(--dashboard-filters-shadow-focus);
}

.dashboard-filters-component-root .dashboard-filters-button-secondary {
    background: var(--dashboard-filters-white);
    color: var(--dashboard-filters-primary-gray);
    border-color: var(--dashboard-filters-border-gray);
}

.dashboard-filters-component-root .dashboard-filters-button-secondary:hover {
    background: var(--dashboard-filters-light-gray);
    border-color: var(--dashboard-filters-medium-gray);
    color: var(--dashboard-filters-dark-gray);
}

/* ACTION BUTTONS CONTAINER */
.dashboard-filters-component-root .action-buttons {
    display: flex;
    gap: var(--dashboard-filters-spacing-md);
    flex-wrap: wrap;
}

/* CUSTOM DROPDOWN STYLING - SCOPED TO COMPONENT */
.dashboard-filters-component-root .custom-dropdown {
    position: relative;
    width: 100%;
}

.dashboard-filters-component-root .dropdown-toggle {
    height: var(--dashboard-filters-control-height);
    padding: var(--dashboard-filters-spacing-sm) var(--dashboard-filters-spacing-md);
    background: var(--dashboard-filters-white);
    border: 1px solid var(--dashboard-filters-border-gray);
    border-radius: var(--dashboard-filters-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--dashboard-filters-font-primary);
    font-size: 0.875rem;
    color: var(--dashboard-filters-text-gray);
    transition: var(--dashboard-filters-transition-fast);
    user-select: none;
    width: 100%;
}

.dashboard-filters-component-root .dropdown-toggle:hover {
    border-color: var(--dashboard-filters-primary-gray);
}

.dashboard-filters-component-root .dropdown-toggle.active {
    border-color: var(--dashboard-filters-primary-gray);
    box-shadow: var(--dashboard-filters-shadow-focus);
}

.dashboard-filters-component-root .dropdown-toggle .selected-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-filters-component-root .dropdown-toggle i {
    transition: transform var(--dashboard-filters-transition-normal);
    color: var(--dashboard-filters-medium-gray);
}

.dashboard-filters-component-root .dropdown-toggle.active i {
    transform: rotate(180deg);
}

/* DROPDOWN MENU STYLING */
.dashboard-filters-component-root .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dashboard-filters-white);
    border: 1px solid var(--dashboard-filters-border-gray);
    border-top: none;
    border-radius: 0 0 var(--dashboard-filters-radius-md) var(--dashboard-filters-radius-md);
    box-shadow: var(--dashboard-filters-shadow-dropdown);
    z-index: 1000;
    max-height: 200px;
    overflow: hidden;
    display: none;
}

.dashboard-filters-component-root .dropdown-menu.show {
    display: block;
}

/* DROPDOWN SEARCH */
.dashboard-filters-component-root .dropdown-search {
    padding: var(--dashboard-filters-spacing-sm);
    border-bottom: 1px solid var(--dashboard-filters-border-gray);
}

.dashboard-filters-component-root .dropdown-search .search-input {
    width: 100%;
    padding: 0.375rem var(--dashboard-filters-spacing-sm);
    border: 1px solid var(--dashboard-filters-border-gray);
    border-radius: var(--dashboard-filters-radius-sm);
    font-size: 0.875rem;
    font-family: var(--dashboard-filters-font-primary);
    transition: border-color var(--dashboard-filters-transition-normal);
    outline: none;
    background: var(--dashboard-filters-white);
    color: var(--dashboard-filters-text-gray);
}

.dashboard-filters-component-root .dropdown-search .search-input:focus {
    border-color: var(--dashboard-filters-primary-gray);
    box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.1);
}

/* DROPDOWN OPTIONS */
.dashboard-filters-component-root .dropdown-options {
    max-height: 150px;
    overflow-y: auto;
}

.dashboard-filters-component-root .dropdown-option {
    display: flex;
    align-items: center;
    padding: var(--dashboard-filters-spacing-sm) var(--dashboard-filters-spacing-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: var(--dashboard-filters-font-primary);
    color: var(--dashboard-filters-text-gray);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
}

.dashboard-filters-component-root .dropdown-option:hover {
    background-color: var(--dashboard-filters-light-gray);
}

.dashboard-filters-component-root .dropdown-option input[type="checkbox"] {
    margin-right: var(--dashboard-filters-spacing-sm);
    accent-color: var(--dashboard-filters-primary-gray);
}

.dashboard-filters-component-root .dropdown-option.selected {
    background-color: rgba(75, 85, 99, 0.1);
}

/* LOADING STATES */
.dashboard-filters-component-root .filter-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    display: none;
}

.dashboard-filters-component-root .filter-section.loading .filter-loading-spinner {
    display: block;
}

.dashboard-filters-component-root .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--dashboard-filters-border-gray);
    border-top: 3px solid var(--dashboard-filters-focus-blue);
    border-radius: 50%;
    animation: dashboardFiltersSpin 1s linear infinite;
}

@keyframes dashboardFiltersSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .dashboard-filters-component-root .dashboard-filters-grid {
        grid-template-columns: 1fr;
        gap: var(--dashboard-filters-spacing-md);
    }
    
    .dashboard-filters-component-root .action-buttons {
        flex-direction: column;
    }
    
    .dashboard-filters-component-root .dashboard-filters-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-filters-component-root .dashboard-filters-section {
        padding: var(--dashboard-filters-spacing-lg);
    }
} 