/**
 * BME Advanced Search Styles
 * Version: 1.0.0
 */

.bme-advanced-search-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bme-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.bme-search-field {
    flex: 1;
    min-width: 200px;
}

.bme-search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.bme-search-field input,
.bme-search-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.bme-search-field input:focus,
.bme-search-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.bme-filter-section {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 15px;
}

.bme-filter-header {
    background: #f7f7f7;
    padding: 10px 15px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bme-filter-toggle {
    margin-right: 10px;
}

.bme-filter-title {
    font-weight: 600;
    color: #333;
}

.bme-filter-content {
    padding: 15px;
    display: none;
}

.bme-filter-content.active {
    display: block;
}

.bme-price-range-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bme-price-range {
    flex: 1;
}

.bme-price-display {
    min-width: 80px;
    font-weight: 600;
    color: #0073aa;
}

.bme-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.bme-checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bme-search-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.bme-search-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.bme-search-btn:hover {
    background: #005a87;
}

.bme-search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bme-clear-filters,
.bme-save-search {
    background: #f7f7f7;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bme-clear-filters:hover,
.bme-save-search:hover {
    background: #e5e5e5;
}

#bme-search-map {
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

.bme-search-results {
    margin-top: 30px;
}

.bme-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e5e5e5;
}

.bme-results-count {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.bme-results-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bme-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bme-toggle-view {
    background: #f7f7f7;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.bme-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.bme-property-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bme-property-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.bme-property-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.bme-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bme-property-card:hover .bme-property-image img {
    transform: scale(1.05);
}

.bme-property-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.bme-favorite-btn,
.bme-compare-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bme-favorite-btn:hover,
.bme-compare-btn:hover {
    background: white;
    transform: scale(1.1);
}

.bme-favorite-btn.active {
    background: #dc3232;
    color: white;
}

.bme-property-details {
    padding: 15px;
}

.bme-property-price {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.bme-property-address {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.bme-property-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.bme-property-specs span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bme-property-status {
    background: #46b450;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.bme-property-status.pending {
    background: #ffb900;
}

.bme-property-status.sold {
    background: #dc3232;
}

.bme-property-mls {
    color: #666;
    font-size: 12px;
}

.bme-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
    padding: 20px 0;
}

.bme-page-btn {
    background: #f7f7f7;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bme-page-btn:hover {
    background: #e5e5e5;
}

.bme-page-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.bme-pagination-dots {
    padding: 8px 12px;
    color: #666;
}

.bme-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.bme-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: bme-spin 1s linear infinite;
}

@keyframes bme-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bme-error {
    background: #ffeaea;
    color: #dc3232;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #dc3232;
    margin: 20px 0;
}

.bme-no-results {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ui-autocomplete .ui-menu-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item:hover,
.ui-autocomplete .ui-menu-item.ui-state-active {
    background: #f7f7f7;
}

@media (max-width: 768px) {
    .bme-search-row {
        flex-direction: column;
    }
    
    .bme-search-field {
        min-width: 100%;
    }
    
    .bme-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .bme-results-controls {
        justify-content: space-between;
    }
    
    .bme-results-grid {
        grid-template-columns: 1fr;
    }
    
    .bme-property-specs {
        flex-direction: column;
        gap: 5px;
    }
    
    .bme-search-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .bme-advanced-search-form {
        padding: 15px;
    }
    
    .bme-pagination {
        flex-wrap: wrap;
    }
    
    .bme-page-btn {
        min-width: 40px;
    }
}