/**
 * MLSGrid IDX Frontend Styles
 * Version: 1.1.0
 */

/* Search Form */
.mlsgrid-search-wrapper {
    margin: 2rem 0;
}

.mlsgrid-search-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.mlsgrid-search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.mlsgrid-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.mlsgrid-field input,
.mlsgrid-field select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.mlsgrid-search-btn {
    background: #007bff;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 1.9rem;
    transition: background 0.3s;
}

.mlsgrid-search-btn:hover {
    background: #0056b3;
}

/* Results Header */
.mlsgrid-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mlsgrid-results-count {
    font-weight: 600;
    color: #555;
}

.mlsgrid-results-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mlsgrid-results-sort label {
    font-weight: 600;
    color: #555;
}

.mlsgrid-results-sort select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Results Grid */
.mlsgrid-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Listing Card */
.mlsgrid-listing-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.mlsgrid-listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.mlsgrid-listing-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.mlsgrid-listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mlsgrid-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mlsgrid-no-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: 600;
}

.mlsgrid-listing-content {
    padding: 1.5rem;
}

.mlsgrid-listing-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.mlsgrid-listing-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.mlsgrid-listing-title a {
    color: #333;
    text-decoration: none;
}

.mlsgrid-listing-title a:hover {
    color: #007bff;
}

.mlsgrid-listing-location {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.mlsgrid-listing-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.mlsgrid-feature {
    color: #555;
    font-size: 0.9rem;
}

.mlsgrid-listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mlsgrid-mls-number {
    color: #888;
    font-size: 0.85rem;
}

.mlsgrid-view-details {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.mlsgrid-view-details:hover {
    text-decoration: underline;
}

/* Pagination */
.mlsgrid-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.mlsgrid-pagination-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mlsgrid-page-link {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s;
}

.mlsgrid-page-link:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.mlsgrid-page-link.mlsgrid-current {
    background: #007bff;
    color: white;
    border-color: #007bff;
    pointer-events: none;
}

.mlsgrid-page-dots {
    padding: 0.5rem;
    color: #999;
}

/* Loading Spinner */
.mlsgrid-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.mlsgrid-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: mlsgrid-spin 1s linear infinite;
}

@keyframes mlsgrid-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.mlsgrid-no-results {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.mlsgrid-no-results p {
    font-size: 1.1rem;
    color: #666;
}

/* Featured Listings */
.mlsgrid-featured-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Single Listing Details */
.mlsgrid-listing-details {
    max-width: 1200px;
    margin: 0 auto;
}

.mlsgrid-listing-gallery {
    margin-bottom: 2rem;
}

.mlsgrid-gallery-main {
    margin-bottom: 1rem;
}

.mlsgrid-gallery-main img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.mlsgrid-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.mlsgrid-gallery-thumbs img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.mlsgrid-gallery-thumbs img:hover {
    opacity: 0.7;
}

.mlsgrid-listing-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.mlsgrid-listing-price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 1rem;
}

.mlsgrid-status {
    font-size: 1rem;
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.mlsgrid-listing-address {
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.mlsgrid-listing-location-header {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.mlsgrid-listing-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.mlsgrid-meta-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.mlsgrid-meta-item strong {
    display: block;
    font-size: 1.5rem;
    color: #007bff;
    margin-bottom: 0.25rem;
}

.mlsgrid-meta-item span {
    color: #666;
    font-size: 0.9rem;
}

.mlsgrid-listing-description {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.mlsgrid-listing-description h2 {
    margin-top: 0;
    color: #333;
}

.mlsgrid-listing-features-grid {
    margin-bottom: 2rem;
}

.mlsgrid-listing-features-grid h2 {
    color: #333;
    margin-bottom: 1rem;
}

.mlsgrid-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.mlsgrid-feature-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mlsgrid-feature-label {
    font-weight: 600;
    color: #555;
}

.mlsgrid-feature-value {
    color: #333;
}

.mlsgrid-listing-map {
    margin-bottom: 2rem;
}

.mlsgrid-listing-map h2 {
    color: #333;
    margin-bottom: 1rem;
}

#mlsgrid-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    background: #f0f0f0;
}

.mlsgrid-virtual-tour {
    margin-bottom: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.mlsgrid-tour-btn {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.mlsgrid-tour-btn:hover {
    background: #0056b3;
}

.mlsgrid-listing-agent {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.mlsgrid-listing-agent h2 {
    margin-top: 0;
    color: #333;
}

.mlsgrid-agent-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mlsgrid-agent-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.mlsgrid-agent-phone a,
.mlsgrid-agent-email a {
    color: #007bff;
    text-decoration: none;
}

.mlsgrid-agent-phone a:hover,
.mlsgrid-agent-email a:hover {
    text-decoration: underline;
}

.mlsgrid-contact-btn {
    background: #28a745;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.mlsgrid-contact-btn:hover {
    background: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mlsgrid-search-row {
        grid-template-columns: 1fr;
    }
    
    .mlsgrid-results-grid {
        grid-template-columns: 1fr;
    }
    
    .mlsgrid-listing-meta {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mlsgrid-features-list {
        grid-template-columns: 1fr;
    }
    
    .mlsgrid-gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mlsgrid-results-header {
        flex-direction: column;
        gap: 1rem;
    }
}