/**
 * BME Advanced Search Styles
 * Updated to use design system tokens
 *
 * @package Bridge_MLS_Extractor_Pro
 * @version 4.0.11
 */

.bme-advanced-search-form {
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-lg, 8px);
    padding: var(--ds-space-5, 20px);
    margin-bottom: var(--ds-space-5, 20px);
    box-shadow: var(--ds-shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
}

.bme-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-4, 15px);
    margin-bottom: var(--ds-space-4, 15px);
}

.bme-search-field {
    flex: 1;
    min-width: 200px;
}

.bme-search-field label {
    display: block;
    margin-bottom: var(--ds-space-1, 5px);
    font-weight: 600;
    color: var(--ds-text-primary, #000);
}

.bme-search-field input,
.bme-search-field select {
    width: 100%;
    padding: var(--ds-space-3, 10px);
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-md, 6px);
    font-size: var(--ds-text-sm, 14px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bme-search-field input:focus,
.bme-search-field select:focus {
    outline: none;
    border-color: var(--ds-teal, #0891B2);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.bme-filter-section {
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-md, 6px);
    margin-bottom: var(--ds-space-4, 15px);
}

.bme-filter-header {
    background: var(--ds-surface-subtle, #f9fafb);
    padding: var(--ds-space-3, 10px) var(--ds-space-4, 15px);
    border-bottom: 1px solid var(--ds-border, #e5e7eb);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bme-filter-toggle {
    margin-right: var(--ds-space-3, 10px);
}

.bme-filter-title {
    font-weight: 600;
    color: var(--ds-text-primary, #000);
}

.bme-filter-content {
    padding: var(--ds-space-4, 15px);
    display: none;
}

.bme-filter-content.active {
    display: block;
}

.bme-price-range-container {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3, 10px);
}

.bme-price-range {
    flex: 1;
}

.bme-price-display {
    min-width: 80px;
    font-weight: 600;
    color: var(--ds-teal, #0891B2);
}

.bme-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-4, 15px);
}

.bme-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--ds-space-1, 5px);
}

.bme-search-actions {
    display: flex;
    gap: var(--ds-space-3, 10px);
    justify-content: flex-end;
    align-items: center;
    margin-top: var(--ds-space-5, 20px);
    padding-top: var(--ds-space-5, 20px);
    border-top: 1px solid var(--ds-border, #e5e7eb);
}

.bme-search-btn {
    background: linear-gradient(135deg, var(--ds-teal, #0891B2) 0%, var(--ds-teal-hover, #0E7490) 100%);
    color: var(--ds-white, white);
    border: none;
    padding: var(--ds-space-3, 12px) var(--ds-space-6, 24px);
    border-radius: var(--ds-radius-md, 6px);
    cursor: pointer;
    font-size: var(--ds-text-sm, 14px);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.bme-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}

.bme-search-btn:disabled {
    background: var(--ds-border-strong, #d1d5db);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.bme-clear-filters,
.bme-save-search {
    background: var(--ds-surface-subtle, #f9fafb);
    color: var(--ds-text-primary, #000);
    border: 1px solid var(--ds-border, #e5e7eb);
    padding: var(--ds-space-3, 10px) var(--ds-space-5, 20px);
    border-radius: var(--ds-radius-md, 6px);
    cursor: pointer;
    font-size: var(--ds-text-sm, 14px);
    transition: all 0.3s ease;
}

.bme-clear-filters:hover,
.bme-save-search:hover {
    background: var(--ds-border, #e5e7eb);
}

#bme-search-map {
    height: 300px;
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-md, 6px);
    margin-top: var(--ds-space-3, 10px);
}

.bme-search-results {
    margin-top: var(--ds-space-8, 30px);
}

.bme-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ds-space-5, 20px);
    padding: var(--ds-space-4, 15px) 0;
    border-bottom: 1px solid var(--ds-border, #e5e7eb);
}

.bme-results-count {
    font-size: var(--ds-text-lg, 18px);
    font-weight: 600;
    color: var(--ds-text-primary, #000);
}

.bme-results-controls {
    display: flex;
    gap: var(--ds-space-3, 10px);
    align-items: center;
}

.bme-sort-select {
    padding: var(--ds-space-2, 8px) var(--ds-space-3, 12px);
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-md, 6px);
    font-size: var(--ds-text-sm, 14px);
}

.bme-toggle-view {
    background: var(--ds-surface-subtle, #f9fafb);
    border: 1px solid var(--ds-border, #e5e7eb);
    padding: var(--ds-space-2, 8px) var(--ds-space-3, 12px);
    border-radius: var(--ds-radius-md, 6px);
    cursor: pointer;
    font-size: var(--ds-text-sm, 14px);
}

.bme-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--ds-space-5, 20px);
}

.bme-property-card {
    background: var(--ds-white, #fff);
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-lg, 8px);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bme-property-card:hover {
    box-shadow: var(--ds-shadow-lg, 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: var(--ds-space-3, 10px);
    right: var(--ds-space-3, 10px);
    display: flex;
    gap: var(--ds-space-1, 5px);
}

.bme-favorite-btn,
.bme-compare-btn {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    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: var(--ds-white, white);
    transform: scale(1.1);
}

.bme-favorite-btn.active {
    background: var(--ds-red, #DC2626);
    color: var(--ds-white, white);
}

.bme-property-details {
    padding: var(--ds-space-4, 15px);
}

.bme-property-price {
    font-size: var(--ds-text-xl, 20px);
    font-weight: 700;
    color: var(--ds-teal, #0891B2);
    margin-bottom: var(--ds-space-1, 5px);
}

.bme-property-address {
    font-size: var(--ds-text-base, 16px);
    color: var(--ds-text-primary, #000);
    margin-bottom: var(--ds-space-3, 10px);
    font-weight: 500;
}

.bme-property-specs {
    display: flex;
    gap: var(--ds-space-4, 15px);
    margin-bottom: var(--ds-space-3, 10px);
    color: var(--ds-text-muted, #6b7280);
    font-size: var(--ds-text-sm, 14px);
}

.bme-property-specs span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bme-property-status {
    background: var(--ds-success, #10b981);
    color: var(--ds-white, white);
    padding: 3px 8px;
    border-radius: var(--ds-radius-sm, 4px);
    font-size: var(--ds-text-xs, 12px);
    font-weight: 600;
    display: inline-block;
    margin-bottom: var(--ds-space-1, 5px);
}

.bme-property-status.pending {
    background: var(--ds-warning, #F59E0B);
}

.bme-property-status.sold {
    background: var(--ds-red, #DC2626);
}

.bme-property-mls {
    color: var(--ds-text-muted, #6b7280);
    font-size: var(--ds-text-xs, 12px);
}

.bme-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--ds-space-1, 5px);
    margin-top: var(--ds-space-8, 30px);
    padding: var(--ds-space-5, 20px) 0;
}

.bme-page-btn {
    background: var(--ds-surface-subtle, #f9fafb);
    border: 1px solid var(--ds-border, #e5e7eb);
    padding: var(--ds-space-2, 8px) var(--ds-space-3, 12px);
    border-radius: var(--ds-radius-md, 6px);
    cursor: pointer;
    font-size: var(--ds-text-sm, 14px);
    transition: all 0.3s ease;
}

.bme-page-btn:hover {
    background: var(--ds-border, #e5e7eb);
}

.bme-page-btn.active {
    background: var(--ds-teal, #0891B2);
    color: var(--ds-white, white);
    border-color: var(--ds-teal, #0891B2);
}

.bme-pagination-dots {
    padding: var(--ds-space-2, 8px) var(--ds-space-3, 12px);
    color: var(--ds-text-muted, #6b7280);
}

.bme-loading {
    text-align: center;
    padding: var(--ds-space-10, 40px);
    font-size: var(--ds-text-base, 16px);
    color: var(--ds-text-muted, #6b7280);
}

.bme-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: var(--ds-space-3, 10px);
    border: 2px solid var(--ds-border, #e5e7eb);
    border-top: 2px solid var(--ds-teal, #0891B2);
    border-radius: 50%;
    animation: bme-spin 1s linear infinite;
}

@keyframes bme-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bme-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--ds-red, #DC2626);
    padding: var(--ds-space-4, 15px);
    border-radius: var(--ds-radius-md, 6px);
    border-left: 4px solid var(--ds-red, #DC2626);
    margin: var(--ds-space-5, 20px) 0;
}

.bme-no-results {
    text-align: center;
    padding: var(--ds-space-10, 40px);
    font-size: var(--ds-text-base, 16px);
    color: var(--ds-text-muted, #6b7280);
    background: var(--ds-surface-subtle, #f9fafb);
    border-radius: var(--ds-radius-lg, 8px);
}

.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--ds-border, #e5e7eb);
    border-radius: var(--ds-radius-md, 6px);
    background: var(--ds-white, white);
    box-shadow: var(--ds-shadow-lg, 0 2px 8px rgba(0,0,0,0.15));
}

.ui-autocomplete .ui-menu-item {
    padding: var(--ds-space-2, 8px) var(--ds-space-3, 12px);
    border-bottom: 1px solid var(--ds-border-light, #f0f0f0);
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item:hover,
.ui-autocomplete .ui-menu-item.ui-state-active {
    background: var(--ds-surface-subtle, #f9fafb);
}

@media (max-width: 768px) {
    .bme-search-row {
        flex-direction: column;
    }

    .bme-search-field {
        min-width: 100%;
    }

    .bme-results-header {
        flex-direction: column;
        gap: var(--ds-space-4, 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: var(--ds-space-1, 5px);
    }

    .bme-search-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .bme-advanced-search-form {
        padding: var(--ds-space-4, 15px);
    }

    .bme-pagination {
        flex-wrap: wrap;
    }

    .bme-page-btn {
        min-width: 40px;
    }
}
