/* Interactive Property Map - Frontend Styles */

/* Container */
.ipm-container {
    width: 100%;
    margin: 0 auto;
}

/* Filter Bar */
.ipm-filter-bar {
    padding: 20px 0;
    margin-bottom: 20px;
    text-align: left;
}

.ipm-category-select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ipm-category-select:hover,
.ipm-category-select:focus {
    border-color: #2c5f2d;
    outline: none;
    box-shadow: 0 0 0 2px rgba(44, 95, 45, 0.1);
}

/* Map Container */
#ipm-map {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 30px;
}

/* Info Window Styles */
.ipm-info-window {
    max-width: 400px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ipm-info-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.ipm-info-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ipm-info-status-container {
    margin: 0 15px 15px 15px;
}

.ipm-info-status {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
    width: 100%;
}

.ipm-status-active {
    background-color: #2d5f3a;
    color: white;
}

.ipm-status-coming-soon {
    background-color: #ffc107;
    color: #333;
}

.ipm-status-sold-out {
    background-color: #dc3545;
    color: white;
}

.ipm-info-title {
    margin: 0 15px 12px 15px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.ipm-info-excerpt {
    margin: 0 15px 20px 15px;
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

.ipm-info-button-container {
    margin: 0 15px 15px 15px;
}

.ipm-info-link {
    display: block;
    padding: 12px 20px;
    background-color: transparent;
    color: #5a9f5e;
    text-decoration: none;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: color 0.3s ease;
}

.ipm-info-link:hover {
    color: #2d5f3a;
    text-decoration: underline;
}

/* Override Google Maps info window defaults */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important;
    max-width: 400px !important;
}

.gm-style .gm-style-iw-t::after {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Position close button over the image */
.gm-style .gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 2px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

.gm-style .gm-ui-hover-effect > span {
    background-color: #666 !important;
    width: 16px !important;
    height: 16px !important;
    margin: 8px !important;
}

.gm-style .gm-ui-hover-effect:hover {
    background: white !important;
}

.gm-style .gm-ui-hover-effect:hover > span {
    background-color: #333 !important;
}

/* Listings Container */
.ipm-listings-container {
    margin-top: 40px;
}

.ipm-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* Listing Card */
.ipm-listing-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.ipm-listing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #2c5f2d;
}

.ipm-listing-highlighted {
    border-color: #2c5f2d;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.2);
    animation: pulse 1s ease-in-out 2;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(44, 95, 45, 0.3);
    }
}

.ipm-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.ipm-listing-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.ipm-listing-status {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ipm-listing-description {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.ipm-listing-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.ipm-detail-item {
    font-size: 14px;
    color: #666;
}

.ipm-detail-item strong {
    color: #333;
    font-weight: 600;
}

.ipm-listing-footer {
    margin-top: 15px;
}

.ipm-listing-button {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ipm-listing-button:hover {
    background-color: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* No Properties Message */
.ipm-no-properties {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ipm-listings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ipm-listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ipm-listing-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .ipm-category-select {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    #ipm-map {
        height: 350px !important;
    }
    
    .ipm-listing-card {
        padding: 15px;
    }
    
    .ipm-listing-title {
        font-size: 18px;
    }
    
    .ipm-category-select {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    #ipm-map {
        display: none;
    }
    
    .ipm-filter-bar {
        display: none;
    }
    
    .ipm-listing-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
