.modern-filters {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    color-scheme: light;
    color: #2c2c2c;
}

/* iOS specific fix */
@supports (-webkit-touch-callout: none) {
    .form-select {
        background-color: #ffffff !important;
        color: #2c2c2c !important;
        text-indent: 0 !important;
    }
}

.form-input,
.form-select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    background-color: white;
}

.search-input {
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    padding: 14px 18px;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.price-inputs {
    display: flex;
    align-items: center;
}

.currency-input {
    position: relative;
    flex: 1;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a5568;
    font-weight: 500;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

.currency-input .form-input {
    padding-left: 26px;
}

.range-separator {
    margin: 0 8px;
    color: #a0aec0;
    font-weight: 500;
}

.form-select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    background-color: white;
}

.location-field {
    grid-column: 3;
}

.tags-field {
    position: relative;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
}

.checkbox-field input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #475569;
    border-radius: 4px;
    margin-right: 8px;
    display: grid;
    place-content: center;
    cursor: pointer;
}

.checkbox-field input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-field input[type="checkbox"]:checked::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(1);
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.filter-action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.apply-filters-btn {
    background-color: #2c2c2c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 0;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex: 1;
}

.create-listing-button:hover {
    background: #4a4a4a;
    transform: translateY(-2px);
}

.clear-filters-btn {
    color: #2c2c2c;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 0;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
}

.clear-filters-btn:hover {
    background-color: #f9fafb;
}

@media (max-width: 1024px) {
    .filters-row {
        grid-template-columns: 1fr 1fr;
    }

    .location-field {
        grid-column: 1;
    }

    .filter-action-buttons {
        grid-column: span 2;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .filters-row {
        grid-template-columns: 1fr;
    }

    .price-range-field,
    .select-field,
    .location-field,
    .tags-field,
    .filter-action-buttons {
        grid-column: 1;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    color: #4a5568;
}

.autocomplete-dropdown.floating-dropdown {
    position: fixed;
    z-index: 9999;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.autocomplete-dropdown.floating-dropdown.position-top {
    border-radius: 8px 8px 0 0;
}

.autocomplete-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f1f5f9;
}

.autocomplete-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

.form-input:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.autocomplete-loading {
    padding: 10px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

@media (max-width: 640px) {
    .autocomplete-dropdown {
        max-height: 150px;
    }

    .autocomplete-item {
        padding: 10px 12px;
        font-size: 14px;
    }
}

.validation-summary {
    color: #dc3545;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-input.validation-error,
.form-select.validation-error {
    border-color: #dc3545;
}

.form-input.validation-error:focus,
.form-select.validation-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.filters-mobile-header {
    display: none;
}

.toggle-filters-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #2c2c2c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-filters-btn:hover {
    background-color: #f1f5f9;
}

.toggle-filters-btn .filter-icon {
    margin-right: 8px;
}

.toggle-filters-btn .chevron-icon {
    transition: transform 0.3s ease;
}

.toggle-filters-btn.active .chevron-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .filters-mobile-header {
        display: block;
        margin-bottom: 16px;
    }
    
    .filters-collapsible {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .filters-collapsible.show {
        max-height: 1000px;
        transition: max-height 0.5s ease-in;
    }
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    align-items: center;
}

.tag-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.tag {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    gap: 4px;
}

.tag-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.2s;
}

.tag-remove:hover {
    color: #64748b;
}

.tag-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

/* Category-specific filters */
#categorySpecificFilters {
    width: 100%;
    margin-top: 16px;
}

.category-filters {
    display: none;
    width: 100%;
}

.category-filters.show {
    display: block !important;
}

.category-filters .filters-row {
    margin-bottom: 12px;
}

.category-filters .year-range-field,
.category-filters .mileage-range-field,
.category-filters .salary-range-field {
    display: flex;
    align-items: center;
}

.category-filters .range-inputs {
    display: flex;
    align-items: center;
    width: 100%;
}

.category-filters .range-inputs input {
    flex: 1;
}

.category-filters .range-inputs .range-separator {
    margin: 0 8px;
    color: #a0aec0;
    font-weight: 500;
}

.category-filters .area-range-field,
.category-filters .rooms-range-field {
    display: flex;
    align-items: center;
}

.category-filters .input-field,
.category-filters .select-field {
    flex: 1;
}

@media (max-width: 1024px) {
    .category-filters .filters-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .category-filters .filters-row {
        grid-template-columns: 1fr;
    }
    
    .category-filters .year-range-field,
    .category-filters .mileage-range-field,
    .category-filters .area-range-field,
    .category-filters .rooms-range-field {
        grid-column: 1;
    }
}