/* Google Maps Property Clusters - Enhanced UX Design
 * 
 * Features:
 * - Two-line layout with prominent count and price range
 * - Color-coded by price range for instant visual recognition
 * - Featured property indicators with star badges
 * - Improved typography and spacing for better readability
 * - Responsive design optimized for mobile devices
 * - Enhanced hover effects and animations
 * - Accessibility-focused design with proper contrast
 */

.gm-cluster-container {
    position: relative;
    z-index: 1000;
}

/* Cluster Marker Styles */
.gm-cluster-marker {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1b449d;
    border: 2px solid #fff;
    border-radius: 18px;
    padding: 8px 12px;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(27, 68, 157, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 65px;
    min-height: 50px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gm-cluster-marker:hover {
    background: #1b449d;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(27, 68, 157, 0.6);
}

/* Cluster Count Styling */
.cluster-count {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
    color: #fff;
}

/* Cluster Price Styling */
.cluster-price {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    opacity: 0.95;
    letter-spacing: 0.2px;
}

.cluster-price-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    opacity: 0.85;
    font-style: italic;
}

.gm-cluster-marker::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #ffffff;
    transform: translateX(-50%);
    transition: all 0.2s ease;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
    z-index: -1;
}

.gm-cluster-marker:hover::after {
    border-top-color: #ffffff;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2));
}

/* Regular Property Marker Styles */
.gm-marker {
    position: relative;
    display: inline-block;
    background: #1b449d;
    border: 2px solid #fff;
    border-radius: 15px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(27, 68, 157, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    line-height: 1.3;
    z-index: 1001;
}

.gm-marker:hover {
    background: #0f2a66;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(27, 68, 157, 0.6);
}

.gm-marker::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffffff;
    margin-left: 0px;
    transform: translateX(-50%);
    transition: border-top-color 0.2s ease;
    z-index: -1;
}

.gm-marker:hover::after {
    border-top-color: #ffffff;
}

.gm-marker-price {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

/* Featured Property Styles */
.gm-featured-marker {
    position: relative;
    display: inline-block;
    background: #71b63b;
    border: 2px solid #fff;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(113, 182, 59, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    line-height: 1.2;
    animation: featuredPulse 2s infinite;
    z-index: 1002;
}

.gm-featured-marker:hover {
    background: #5A942F;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(113, 182, 59, 0.7);
}

.gm-featured-marker::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
    transform: translateX(-50%);
    transition: border-top-color 0.3s ease;
    z-index: -1;
}

.gm-featured-marker:hover::after {
    border-top-color: #ffffff;
}

.gm-featured-marker::before {
    content: '★';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    color: #71b63b;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Featured Cluster Styles - Enhanced with star indicator */
.gm-cluster-featured::before {
    content: '★';
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: #71b63b;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 1001;
    transition: all 0.2s ease;
}

.gm-cluster-featured:hover::before {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Enhanced hover effect for featured clusters */
.gm-cluster-featured:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Featured cluster glow effect */
.gm-cluster-featured {
    position: relative;
    animation: featuredClusterGlow 3s ease-in-out infinite;
}

@keyframes featuredClusterGlow {
    0%, 100% { 
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(113, 182, 59, 0.7);
    }
    50% { 
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(113, 182, 59, 0.3);
    }
}

@keyframes featuredPulse {
    0% { box-shadow: 0 4px 12px rgba(113, 182, 59, 0.5); }
    50% { box-shadow: 0 4px 12px rgba(113, 182, 59, 0.8); }
    100% { box-shadow: 0 4px 12px rgba(113, 182, 59, 0.5); }
}

/* Visited Property Markers - Simplified styling */
.gm-marker.visited-property {
    background: #697180 !important;
    opacity: 0.65 !important;
    border-color: #E5E7EB !important;
    transition: all 0.3s ease !important;
}

.gm-marker.visited-property:hover {
    background: #6B7280 !important;
    opacity: 0.95 !important;
    transform: scale(1.05) !important;
}

.gm-marker.visited-property::after {
    border-top-color: #E5E7EB !important;
}

.gm-featured-marker.visited-property {
    background: #608e3d !important;
    opacity: 0.85 !important;
    border-color: #E5E7EB !important;
    animation: none !important;
}

.gm-featured-marker.visited-property:hover {
    background: #608e3d !important;
    opacity: 0.95 !important;
    transform: scale(1.1) !important;
}

.gm-featured-marker.visited-property::after {
    border-top-color: #E5E7EB !important;
}

.gm-featured-marker.visited-property::before {
    background: #E5E7EB !important;
    color: #608e3d !important;
    font-size: 9px !important;
}

/* Visited Property Listings - Simple transparency */
.item-listing-wrap.visited-property {
    opacity: 0.85 !important;
}

/* Price text styling for visited markers */
.gm-marker.visited-property .gm-marker-price {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

/* Compact Property Details Styles */
.item-compact-details {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
}

/* Capitalize item titles */
.item-title {
    text-transform: unset;  
    white-space: normal;
    text-overflow: unset;
}

.item-compact-details > div {
    margin-bottom: 4px;
    color: #555;
}

.item-compact-details > div:last-child {
    margin-bottom: 0;
}

.property-basic-info {
    font-weight: 600;
    color: #333;
}

.hangar-info {
    color: #1b449d;
    font-weight: 500;
}

.runway-info {
    color: #666;
    font-weight: 500;
}

/* Map Info Window Overrides */
.map-info-window {
    width: 570px !important;
    min-width: 570px !important;
    max-width: 570px !important;
}

.map-info-window .item-wrap {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Image container with 16:9 aspect ratio for desktop/iPad */
.map-info-window .item-header {
    width: 280px !important;
    height: 210px !important; /* 16:9 aspect ratio (280 * 9/16) */
    padding: 0 !important;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    position: relative;
}

.map-info-window .item-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    max-height: none;
}

.map-info-window .item-wrap img:hover {
    transform: scale(1.05);
}

.map-info-window .item-body {
    width: 220px !important;
    height: auto !important;
    min-height: 110px !important;
    padding: 12px 15px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.map-info-window .item-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-transform: none !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    overflow: visible !important;
}

.map-info-window .item-title a {
    color: #333 !important;
    text-decoration: none;
}

.map-info-window .item-title a:hover {
    color: #1b449d !important;
}

.map-info-window .item-info {
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
}

.map-info-window .item-info .item-price {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1b449d !important;
    margin-bottom: 4px !important;
    padding: 2px 0 !important;
    border-bottom: 1px solid #e9ecef !important;
    display: inline-block !important;
}

.map-info-window .item-info .item-type {
    text-transform: none !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #666 !important;
}

.map-info-window .item-compact-details {
    margin-top: 6px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.map-info-window .item-compact-details > div {
    margin-bottom: 3px !important;
    color: #555 !important;
}

.map-info-window .item-compact-details > div:last-child {
    margin-bottom: 0 !important;
}

.map-info-window .property-basic-info {
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 12px !important;
}

.map-info-window .hangar-info {
    color: #1b449d !important;
    font-weight: 500 !important;
    font-size: 11px !important;
}

.map-info-window .runway-info {
    color: #666 !important;
    font-weight: 500 !important;
    font-size: 11px !important;
}

/* Infobox Gallery Styles */
.map-info-window .listing-gallery-wrap {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
}

.map-info-window .houzez-listing-carousel-infobox {
    display: none;
}

.map-info-window .houzez-listing-carousel-infobox.slick-initialized {
    display: block;
}

.map-info-window .houzez-listing-carousel-infobox {
    height: 100%;
    width: 100%;
}

.map-info-window .houzez-listing-carousel-infobox .item {
    height: 100%;
    width: 100%;
}

.map-info-window .houzez-listing-carousel-infobox .item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* Gallery Overlay Styles */
.map-info-window .listing-image-wrap {
    position: relative;
    height: 210px; /* Ensure minimum height for overlay */
    width: 100%;
}

.map-info-window .gallery-overlay {
    position: absolute ;
    top: 0 ;
    left: 0 ;
    width: 100% ;
    height: 100% ;
    z-index: 10 ;
    opacity: 1 ;
    transition: opacity 0.5s ease-out ;
    background: #f8f9fa ;
    display: flex ;
    align-items: center ;
    justify-content: center ;
}

.map-info-window .gallery-overlay img {
    width: 100% ;
    height: 100% ;
    object-fit: cover ;
    display: block ;
}

/* Hide overlay when gallery is initialized */
.map-info-window .houzez-listing-carousel-infobox.slick-initialized + .gallery-overlay {
    opacity: 0;
    pointer-events: none;
    transition-delay: 0.2s; /* Small delay to ensure smooth transition */
}

/* .map-info-window .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
    z-index: 10 !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
} */

.map-info-window .slick-arrow:hover {
    opacity: 1 !important;
}

.map-info-window .slick-prev {
    background:none;
    text-shadow: 2px 0px 2px #000;
    left: 5px;
}

.map-info-window .slick-next {
    background:none;
    text-shadow: -2px 0px 2px #000;
    right: 5px;
}

.map-info-window .slick-arrow:before {
    font-size: 24px;
    -webkit-text-stroke: 1px #fff;
    color: #fff;
}



.map-info-window .infobox-dots {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex !important;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.map-info-window .infobox-dots li {
    margin: 0 2px !important;
    padding: 0 !important;
}

.map-info-window .infobox-dots li button {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.3s ease !important;
}

.map-info-window .infobox-dots li.slick-active button {
    background: rgba(255, 255, 255, 0.9) !important;
}

.map-info-window .infobox-dots li button:before {
    display: none !important;
}

.map-info-window  .slick-dotted.slick-slider {
    margin-bottom: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .gm-cluster-marker {
        padding: 6px 8px;
        min-width: 55px;
        min-height: 40px;
        border-radius: 14px;
    }
    
    .cluster-count {
        font-size: 14px;
        margin-bottom: 1px;
    }
    
    .cluster-price {
        font-size: 9px;
        letter-spacing: 0.1px;
    }
    
    .cluster-price-text {
        font-size: 8px;
    }
    
    .gm-cluster-marker::after {
        border-left-width: 5px;
        border-right-width: 5px;
        border-top-width: 5px;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
        z-index: -1;
    }
    
    .gm-marker {
        padding: 3px 6px;
        font-size: 10px;
        min-width: 45px;
    }
    
    .gm-marker::after {
        border-left-width: 5px;
        border-right-width: 5px;
        border-top-width: 5px;
        z-index: -1;
    }
    
    .gm-marker-price {
        font-size: 10px;
    }
    
    .gm-featured-marker {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 50px;
    }
    
    .gm-featured-marker::before {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }
    
    .gm-cluster-featured::before {
        width: 15px;
        height: 15px;
        font-size: 9px;
        top: -5px;
        right: -5px;
    }
    
    .gm-cluster-featured:hover {
        transform: scale(1.1);
    }
    
    .gm-featured-marker.visited-property::before {
        width: 12px !important;
        height: 12px !important;
        font-size: 7px !important;
    }
    
    /* Compact details responsive styles */
    .item-compact-details {
        font-size: 12px;
        margin-top: 6px;
    }
    
    .item-compact-details > div {
        margin-bottom: 3px;
    }
    
    /* Map info window responsive - Mobile layout with gallery on top */
    .map-info-window {
        width: 320px !important;
        min-width: 320px !important;
        max-width: 320px !important;
    }
    
    .map-info-window .item-wrap {
        flex-direction: column !important;
    }
    
    .map-info-window .item-wrap img {
        width: 100% !important;
        height: 100% !important;
    }
    
    .map-info-window .item-header {
        width: 100% !important;
        height: 210px !important;
        overflow: hidden;
        border-radius: 8px 8px 0 0 !important;
        flex-shrink: 0;
    }
    
    .map-info-window .item-body {
        width: 100% !important;
        min-height: 95px !important;
        padding: 10px 12px !important;
        flex: 1;
    }   
    
    .map-info-window .item-title {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    .map-info-window .item-info .item-price {
        font-size: 14px !important;
        padding: 2px 0 !important;
        border-bottom: 1px solid #e9ecef !important;
    }
    
    .map-info-window .item-compact-details {
        font-size: 11px !important;
        margin-top: 5px !important;
    }
    
    .map-info-window .property-basic-info {
        font-size: 11px !important;
    }
    
    .map-info-window .hangar-info {
        font-size: 10px !important;
    }
    
    .map-info-window .runway-info {
        font-size: 10px !important;
    }
    
    /* Mobile infobox gallery adjustments */   
    
    .map-info-window .infobox-dots li button {
        width: 6px !important;
        height: 6px !important;
    }
    
    @keyframes featuredClusterGlow {
        0%, 100% { 
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(113, 182, 59, 0.7);
        }
        50% { 
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(113, 182, 59, 0.3);
        }
    }
}

/* Highlighted marker styles for mouseover */
.gm-marker.highlighted {
    background: #EC407A !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.6) !important;
    transition: all 0.3s ease !important;
    z-index: 1001 !important;
}

.gm-marker.highlighted::after {
    border-top-color: #ffffff !important;
}

.gm-featured-marker.highlighted {
    background: #EC407A !important;
    transform: scale(1.15) !important;
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.7) !important;
    transition: all 0.3s ease !important;
    z-index: 1002 !important;
}

.gm-featured-marker.highlighted::after {
    border-top-color: #ffffff !important;
}

/* Hide listing view on mobile by default */
@media (max-width: 767.98px) {
    #half-map-listing-area {
        display: none !important;
    }
    
    /* Show listing view only when listing button is active */
    #houzez-btn-listing-view.active ~ #half-map-listing-area,
    #houzez-btn-listing-view.active + * #half-map-listing-area,
    body.listing-view-active #half-map-listing-area {
        display: block !important;
    }
} 