.search-filter-section .card {
    border-radius: 16px;
    overflow: hidden;
}

/* Filter toggle button */
#toggle-filters {
    color: inherit;
    transition: opacity 0.2s ease;
}

#toggle-filters:hover {
    opacity: 0.8;
}

#filter-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

#filter-toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Smooth collapse transition */
#filter-content {
    transition: height 0.3s ease, opacity 0.3s ease;
}

#filter-content.collapsing {
    overflow: hidden;
}

/* Active Filters Summary */
.active-filters-summary {
    display: none;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.active-filters-summary .location-filter-info {
    flex: 0 0 100%;
}

.active-filters-summary.has-filters:not(.hidden) {
    display: flex;
}

.active-filters-summary.hidden {
    display: none !important;
}

.active-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    background-color: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.25);
    color: #0d6efd;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: none;
    transform: none;
}

.active-filter-badge:hover {
    background-color: rgba(13, 110, 253, 0.04);
    box-shadow: 0 1px 3px rgba(13, 110, 253, 0.06);
    transform: none;
}

.active-filter-badge.active {
    background-color: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.25);
    color: #0d6efd;
    box-shadow: none;
    transform: none;
}

.active-filter-badge.active:hover {
    background-color: rgba(13, 110, 253, 0.10);
    box-shadow: none;
    transform: none;
}

.active-filter-badge .remove-filter {
    cursor: pointer;
    opacity: 0.8;
    font-size: 0.875rem;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.active-filter-badge .remove-filter:hover {
    opacity: 1;
}

.location-search {
    padding: 0.6rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-search:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: none;
}

.filter-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    display: flex;
    align-items: center;
}

.filter-groups {
    margin-top: 1rem;
}

.filter-group {
    position: relative;
}

/* ----------------------------------------------------------------------------
   Pill-based Filter Buttons
   ---------------------------------------------------------------------------- */

.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    padding: 0.4rem 0.85rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    background-color: #ffffff;
    color: #333;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.filter-pill:hover {
    /* subtle tint instead of an obvious border change */
    background-color: rgba(13, 110, 253, 0.04);
    box-shadow: 0 1px 3px rgba(13, 110, 253, 0.06);
}

.filter-pill.active {
    background-color: rgba(13, 110, 253, 0.08); /* subtle tint instead of strong gradient */
    border-color: rgba(13, 110, 253, 0.25);
    color: #0d6efd;
    box-shadow: none;
    transform: none;
}

.filter-pill.active:hover {
    background-color: rgba(13, 110, 253, 0.10);
    /* keep hover subtle — no lift or heavy shadow */
    transform: none;
    box-shadow: none;
}

.filter-pill i,
.filter-pill iconify-icon {
    opacity: 0.8;
}

.filter-pill.active i,
.filter-pill.active iconify-icon {
    opacity: 1;
}

/* ----------------------------------------------------------------------------
   Clear Filters Button
   ---------------------------------------------------------------------------- */

#clear-filters {
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#clear-filters:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------------------------------------------
   Results Count Badge
   ---------------------------------------------------------------------------- */

#results-count {
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------------------
   Vehicle Cards Enhancement
   ---------------------------------------------------------------------------- */

#vehicle-grid .card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

#vehicle-grid .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* ----------------------------------------------------------------------------
   Mobile Responsive Adjustments
   ---------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .search-filter-section .card-body {
        padding: 1.5rem !important;
    }

    /* Start with filters collapsed on mobile */
    #filter-content.collapse:not(.show) {
        display: none;
    }

    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .d-flex.align-items-center.gap-3 {
        width: 100%;
        justify-content: space-between;
    }

    .filter-label {
        font-size: 0.9rem;
    }

    .filter-pill {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    #results-count {
        font-size: 0.875rem !important;
        padding: 0.4rem 0.75rem !important;
    }

    #clear-filters {
        font-size: 0.8125rem;
        padding: 0.35rem 0.85rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .search-filter-section .card-body {
        padding: 2rem !important;
    }

    .filter-pill {
        padding: 0.4rem 0.85rem;
        font-size: 0.8125rem;
    }
}

/* Desktop - keep compact size */
@media (min-width: 992px) {
    .filter-pill {
        padding: 0.45rem 0.9rem;
        font-size: 0.8125rem;
    }
}

/* ----------------------------------------------------------------------------
   Smooth Transitions for Filtering
   ---------------------------------------------------------------------------- */

.vehicle-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vehicle-card[style*="display: none"] {
    opacity: 0;
    transform: scale(0.95);
}

/* ----------------------------------------------------------------------------
   Empty State (when no vehicles match filters)
   ---------------------------------------------------------------------------- */

.no-results-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-results-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ----------------------------------------------------------------------------
   Accessibility Improvements
   ---------------------------------------------------------------------------- */

.filter-pill:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

#clear-filters:focus {
    outline: 2px solid #6c757d;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .filter-pill,
    .vehicle-card,
    #vehicle-grid .card,
    #clear-filters {
        transition: none;
    }

    #vehicle-grid .card:hover {
        transform: none;
    }

    .filter-pill:hover {
        transform: none;
    }
}