/**
 * IntelliRealty Maps Styles
 */

/* Main maps container */
.ir-maps-container {
    width: 100%;
    position: relative;
}

/* Map filters */
.ir-maps-filters {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.ir-map-filter-group {
    flex: 1;
    min-width: 200px;
}

.ir-map-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.ir-map-filter-group input,
.ir-map-filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ir-map-filter-group input:focus,
.ir-map-filter-group select:focus {
    border-color: #007cba;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 124, 186, 0.25);
}

.ir-map-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.15s ease-in-out;
    height: 38px;
    white-space: nowrap;
}

.ir-map-button:hover {
    background: #005a87;
}

/* Map container */
.ir-map {
    width: 100%;
    min-height: 400px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    background: #e9ecef;
}

.ir-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 5px;
    z-index: 1000;
    font-size: 16px;
    color: #6c757d;
}

/* Error states */
.ir-maps-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 10px 0;
}

/* Info window styles */
.ir-map-info-window {
    max-width: 300px;
    font-family: inherit;
}

.ir-map-property-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.ir-map-property-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.ir-map-property-price {
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 8px;
}

.ir-map-property-details {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
}

.ir-map-property-excerpt {
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
    margin-bottom: 12px;
}

.ir-map-property-actions {
    text-align: right;
}

.ir-map-view-property {
    background: #007cba;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.15s ease-in-out;
    display: inline-block;
}

.ir-map-view-property:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Cluster marker styles (these are applied via JavaScript) */
.cluster-marker {
    background: #ff6b6b !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    color: white !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    text-align: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    transition: transform 0.2s ease-in-out !important;
}

.cluster-marker:hover {
    transform: scale(1.1) !important;
}

/* Property detail panel (if needed) */
.ir-map-property-details {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.ir-map-property-content {
    padding: 20px;
}

.ir-map-close-details {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ir-map-close-details:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
    .ir-maps-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .ir-map-filter-group {
        min-width: auto;
    }
    
    .ir-map {
        min-height: 300px;
    }
    
    .ir-map-info-window {
        max-width: 250px;
    }
    
    .ir-map-property-image {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .ir-maps-filters {
        padding: 10px;
    }
    
    .ir-map {
        min-height: 250px;
    }
    
    .ir-map-filter-group input,
    .ir-map-filter-group select,
    .ir-map-button {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Google Maps UI customizations */
.gm-style .gm-style-iw-gm {
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    overflow: visible !important;
}

.gm-style .gm-style-iw-tc {
    display: none;
}

/* Custom marker animations */
@keyframes markerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ir-marker-bounce {
    animation: markerBounce 0.6s ease-in-out;
}

/* Loading spinner */
.ir-map-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Property location display in info window */
.ir-map-property-location {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.ir-map-location-icon {
    font-size: 16px;
}

.ir-map-location-text {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.ir-map-location-privacy {
    font-size: 11px;
    color: #999;
    font-style: italic;
}