/* Filter Container Styles */
.cw-filters {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.cw-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cw-filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.cw-filter-collapse {
    background: none;
    border: none;
    color: #6c757d;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.cw-filter-collapse[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Filter Form Styles */
.cw-filter-form {
    padding: 20px;
}

.cw-filter-group {
    margin-bottom: 20px;
}

.cw-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.cw-filter-label i {
    margin-right: 8px;
    color: #6c757d;
}

/* Search Box Styles */
.cw-search-box {
    position: relative;
    margin-bottom: 20px;
}

.cw-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9375rem;
    transition: border-color 0.15s ease-in-out;
}

.cw-search-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.cw-search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}

/* Select Styles */
.cw-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9375rem;
    color: #495057;
    background-color: #fff;
}

/* Select2 Custom Styles */
.select2-container--bootstrap4 .select2-selection {
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.select2-container--bootstrap4 .select2-selection--single {
    height: 38px;
    padding: 8px;
}

.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: 38px;
}

.select2-container--bootstrap4 .select2-selection__choice {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 4px;
}

/* Range Input Styles */
.cw-filter-range {
    margin-top: 8px;
}

.cw-range-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cw-range-separator {
    color: #6c757d;
    font-size: 0.875rem;
}

.cw-filter-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9375rem;
}

.cw-filter-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Filter Actions Styles */
.cw-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cw-btn-clear,
.cw-btn-apply {
    flex: 1;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.cw-btn-clear {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #6c757d;
}

.cw-btn-clear:hover {
    background-color: #e9ecef;
    border-color: #6c757d;
}

.cw-btn-apply {
    background-color: #d60027;
    border: 1px solid #d60027;
    color: #fff;
}

.cw-btn-apply:hover {
    background-color: #b30020;
    border-color: #b30020;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cw-filter-form {
        padding: 15px;
    }

    .cw-filter-group {
        margin-bottom: 15px;
    }

    .cw-range-input {
        flex-direction: column;
        gap: 8px;
    }

    .cw-range-separator {
        display: none;
    }

    .cw-filter-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
}

/* Loading States */
.cw-filter-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Error States */
.cw-filter-select.is-invalid,
.cw-filter-input.is-invalid {
    border-color: #dc3545;
}

.cw-filter-select.is-invalid:focus,
.cw-filter-input.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Helper Classes */
.mt-2 {
    margin-top: 0.5rem !important;
}
