/* MLS Property Manager Frontend Styles */

/* Search Form Styles */
.mls-search-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.mls-search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.mls-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.mls-field input,
.mls-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.mls-field input:focus,
.mls-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.mls-price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mls-search-submit {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.mls-search-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mls-search-button:hover {
    background: #005a87;
}

.mls-clear-button {
    background: #666;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mls-clear-button:hover {
    background: #555;
}

/* Widget Search Form */
.mls-search-widget .mls-search-form {
    background: transparent;
    padding: 0;
    border: none;
}

.mls-search-widget .mls-search-fields {
    grid-template-columns: 1fr;
    gap: 10px;
}

.mls-search-widget .mls-price-range {
    grid-template-columns: 1fr;
}

/* Listings Container */
.mls-listings-container {
    margin: 20px 0;
}

.mls-listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.mls-results-info {
    color: #666;
    font-size: 14px;
}

.mls-view-toggle {
    display: flex;
    gap: 5px;
}

.mls-view-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mls-view-btn:hover,
.mls-view-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mls-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Grid View */
.mls-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* List View */
.mls-listings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mls-property-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: start;
}

/* Property Cards */
.mls-property-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mls-property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mls-property-image {
    position: relative;
    overflow: hidden;
}

.mls-property-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mls-property-card:hover .mls-property-image img {
    transform: scale(1.05);
}

.mls-property-status {
    position: absolute;
    top: 10px;
    left: 10px;
}

.mls-status-badge {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mls-status-active { background: #46b450; }
.mls-status-sold { background: #dc3232; }
.mls-status-pending { background: #ffb900; }

.mls-property-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.mls-price {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
}

.mls-property-details {
    padding: 20px;
}

.mls-property-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.mls-property-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mls-property-title a:hover {
    color: #0073aa;
}

.mls-property-location {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
}

.mls-property-features {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mls-feature {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    font-size: 14px;
}

.mls-feature .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.mls-property-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 12px;
    color: #999;
}

.mls-property-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.mls-property-actions {
    display: flex;
    gap: 10px;
}

.mls-btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mls-btn-primary {
    background: #0073aa;
    color: white;
}

.mls-btn-primary:hover {
    background: #005a87;
    color: white;
}

.mls-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.mls-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* List View Specific */
.mls-property-list .mls-property-image {
    grid-row: 1 / -1;
}

.mls-property-list .mls-property-image img {
    height: 150px;
}

/* Map View */
.mls-map-container {
    position: relative;
}

.mls-map {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* Map Info Window */
.mls-map-info-window {
    max-width: 250px;
}

.mls-map-info-window img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.mls-map-info-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.mls-map-info-price {
    font-size: 16px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 8px;
}

.mls-map-info-link {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.mls-map-info-link:hover {
    background: #005a87;
    color: white;
}

/* Pagination */
.mls-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.mls-pagination-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.mls-pagination-link:hover,
.mls-pagination-link.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mls-pagination-numbers {
    display: flex;
    gap: 5px;
}

/* Featured Properties Widget */
.mls-featured-properties-widget-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mls-featured-property-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.mls-property-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
}

.mls-property-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mls-property-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    line-height: 1.3;
}

.mls-property-info h4 a {
    color: #333;
    text-decoration: none;
}

.mls-property-info h4 a:hover {
    color: #0073aa;
}

.mls-property-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.mls-property-price {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 4px;
}

.mls-property-details {
    font-size: 11px;
    color: #999;
}

.mls-property-details span {
    margin-right: 8px;
}

/* No Results */
.mls-no-results,
.mls-no-featured {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Loading States */
.mls-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.mls-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: mls-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes mls-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mls-search-fields {
        grid-template-columns: 1fr;
    }
    
    .mls-listings-grid {
        grid-template-columns: 1fr;
    }
    
    .mls-property-list {
        grid-template-columns: 1fr;
    }
    
    .mls-listings-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .mls-view-toggle {
        justify-content: center;
    }
    
    .mls-search-submit {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mls-search-button,
    .mls-clear-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .mls-property-features {
        flex-direction: column;
        gap: 8px;
    }
    
    .mls-property-actions {
        flex-direction: column;
    }
    
    .mls-pagination-wrapper {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .mls-featured-property-item {
        flex-direction: column;
        text-align: center;
    }
    
    .mls-property-thumbnail {
        align-self: center;
        width: 80px;
        height: 80px;
    }
}

/* Print Styles */
@media print {
    .mls-search-form,
    .mls-view-toggle,
    .mls-pagination-wrapper,
    .mls-property-actions {
        display: none;
    }
    
    .mls-property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}