/* DataTable Filters - Magento Style */
.datatable-filters {
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    width: 100%;
}

/* Filter content panel - full width above */
.datatable-filters .filter-content {
    width: 100%;
}

.datatable-filters .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.datatable-filters .filter-group {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

.datatable-filters .filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* Use Bootstrap form-control styling - just ensure full width */
.datatable-filters .filter-group .form-control {
    width: 100%;
}

/* Range inputs */
.datatable-filters .filter-range {
    display: flex;
    gap: 5px;
    align-items: center;
}

.datatable-filters .filter-range .form-control {
    flex: 1;
    min-width: 60px;
}

.datatable-filters .filter-range span {
    color: #858796;
    font-size: 12px;
}

/* Date range picker */
.datatable-filters .filter-daterange {
    position: relative;
}

.datatable-filters .filter-daterange .form-control {
    padding-right: 30px;
}

.datatable-filters .filter-daterange .clear-date {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #858796;
    font-size: 12px;
}

.datatable-filters .filter-daterange .clear-date:hover {
    color: #e74a3b;
}

/* Filter buttons */
.datatable-filters .filter-buttons {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 2px;
}

.datatable-filters .btn-filter {
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 600;
}

.datatable-filters .btn-filter-apply {
    background: #4e73df;
    border-color: #4e73df;
    color: #fff;
}

.datatable-filters .btn-filter-apply:hover {
    background: #2e59d9;
    border-color: #2653d4;
}

.datatable-filters .btn-filter-reset {
    background: #858796;
    border-color: #858796;
    color: #fff;
}

.datatable-filters .btn-filter-reset:hover {
    background: #6c6e7e;
    border-color: #656776;
}

/* Filter toggle button - positioned next to search */
.filter-toggle-wrapper {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4e73df;
    background: #fff;
    border: 1px solid #4e73df;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-toggle:hover {
    background: #4e73df;
    color: #fff;
}

.btn-filter-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn-filter-toggle .toggle-icon {
    transition: transform 0.2s;
    font-size: 11px;
}

.btn-filter-toggle:not(.collapsed) .toggle-icon {
    transform: rotate(90deg);
}

/* Make DataTables filter area flex for proper alignment */
.dataTables_filter {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0;
}

/* Active filter indicator */
.filter-group.has-value label::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #1cc88a;
    border-radius: 50%;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .datatable-filters .filter-group {
        min-width: 100%;
        max-width: 100%;
    }

    .datatable-filters .filter-buttons {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
}
