/*
 * Mapbox Markers Styles
 * Styles for community markers, lot markers, and interactive map elements
 */

/* Mapbox Container */
.page-id-6460 { background-color:#EFF0EF }
.page-id-6460 .space-top { padding-top:70px !important; }

#map-container { 
    width: 100%; 
}

.elementor-shortcode:has(.mapboxgl-map) { 
    width: 100%; 
    height: auto; 
}

/* Mapbox Wrapper with Filter Bar */
.mapbox-wrapper {
    width: 100%;
    border-radius: 0px;
    overflow: hidden;
}

/* Filter Bar */
.mapbox-filter-bar {
    background-color:#172840;
    padding: 40px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

/* Communities Filter Section */
.communities-filter-section {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.communities-filter-title-wrap {
    flex-shrink: 0;
}

body .communities-filter-section .communities-filter-title {
    font-size: 48px;
    font-weight: 600;
    line-height: 49px;
    color: white;
    margin: 0;
    font-family: 'articulat-cf', sans-serif;
    max-width: 286px;
}

body .communities-filter-section .communities-filter-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background-color: #2483C5;
    margin-top: 20px;
}

.communities-filter-tiles-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.communities-sitemaps-text {
    color: white;
    font-size: 16px;
    text-align: left;
    margin: 20px 0 0 0 !important;
}

.communities-sitemaps-download-link {
    color: #ffffff;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 400;
    opacity: 1;
}

.communities-sitemaps-download-link:hover {
    text-decoration: underline !important;
    color:white;
}

.communities-sitemaps-separator {
    color: #2483C5;
    margin: 0 10px;
}

.communities-tiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 15px;
}

.community-tile {
    background: transparent;
    border: 1px solid #87C1EA;
    border-radius: 0;
    color: white;
    font-size: 24px;
    font-weight: 600;
    line-height: 24px;
    font-family: 'articulat-cf', sans-serif;
    padding: 7px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.community-tile-region {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 17px;
    text-transform: uppercase;
    margin-top: 6px;
    text-align: left;
}

.community-tile:hover {
    background: rgba(135, 193, 234, 0.1);
    border-color: white;
}

.community-tile.active {
    background: #2483C5;
    border:none;
}

.community-reset-row {
    flex-basis: 100%;
    text-align: right;
}

.community-reset-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    font-family: 'articulat-cf', sans-serif;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.community-reset-btn:hover {
    opacity: 0.7;
}

.mapbox-filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-width: 140px;
}

.mapbox-filter-bar .filter-group label {
    font-size: 17px;
    font-weight: 400;
    color: white;
    text-transform: capitalize;
    letter-spacing: 0;
    font-family: 'articulat-cf', sans-serif;
    margin-bottom:0;
}
.mapbox-filter-bar .filter-group select,
.mapbox-filter-bar .filter-group select option { font-size: 17px; font-weight: 400; }

.mapbox-filter-bar .filter-group:has(.clear-filters-btn) { margin-left:auto; }

.mapbox-filter-bar .filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width:266px;
}

.mapbox-filter-bar .filter-select:focus {
    outline: none;
    border-color: #1B6551;
    box-shadow: 0 0 0 2px rgba(27, 101, 81, 0.2);
}

.mapbox-filter-bar .clear-filters-btn {
    background-color:transparent;
    color: white;
    padding: 8px 16px;
    border-radius: 0px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
    align-items: center;
    width:199px; 
    height:59px;
    border:1px solid white;
}

.mapbox-filter-bar .clear-filters-btn:hover {
    opacity:0.8;
    background-color:transparent;
}

/* Mapbox Container with Sidebar */
.mapbox-container {
    display: flex;
    width: 100%;
    height: 600px;
}

.mapbox-sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mapbox-map-wrapper {
    flex: 1;
    position: relative;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sidebar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #2483C5;
    font-family: 'articulat-cf', sans-serif;
}

.sidebar-back-btn {
    background: #2483C5;
    color: white;
    border: none;
    border-radius: 0px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s ease;
    width:198px;
    height:40px;
    display:flex;
    font-weight:400;
    align-items: center;
    justify-content: center;
    padding-left:20px;
    position: relative;
}

.sidebar-back-btn:before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    width: 22px;
    height: 19px;
    background-image: url(../images/full-arrow-white.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sidebar-back-btn:hover {
    opacity:0.8;
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Communities List */
.communities-list {
    padding: 0;
}

.community-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.community-item:hover {
    background-color: #f8f9fa;
}

.community-item.active {
    background-color: #e8f5e8;
    border-left: 4px solid #2483C5;
}

.community-info {
    flex: 1;
    min-width: 0;
}

.community-item h4 {
    margin: 0 0 2.5px 0;
    font-size: 16px;
    font-weight: 500;
    color: #2483C5;
    font-family: 'articulat-cf', sans-serif;
}

.community-city {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.community-stats {
    display: flex;
    gap: 15px;
}

.community-logo-wrapper {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-logo {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.stat {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat.for-sale {
    color: #1B6551;
}

.stat.move-in-ready {
    color: #1B6551;
}

.stat.sold {
    color: #A08355;
}

/* Properties List */
.properties-list {
    padding: 0;
}

.property-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 12px;
}

.property-item:hover {
    background-color: #f8f9fa;
}

.property-item.active {
    background-color: #e8f5e8;
    border-left: 4px solid #1B6551;
}

/* Property Thumbnail */
.property-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 0px;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

/* Property Details Container */
.property-details {
    flex: 1;
    min-width: 0; /* Allows text to truncate properly */
}

.property-item h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 500;
    color: #0D0708;
    font-family: 'articulat-cf', sans-serif;
}

.property-address {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
}

.property-model,
.property-elevation {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #555;
}

.property-model strong,
.property-elevation strong {
    color: #1B6551;
    font-weight: 500;
}

.property-status {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-status.status-for_sale {
    background-color: #e8f5e8;
    color: #1B6551;
}

.property-status.status-move-in-ready {
    background-color: #e8f5e8;
    color: #1B6551;
}

.property-status.status-sold {
    background-color: #f5f0e8;
    color: #A08355;
}

/* Mobile Controls - Hidden on desktop */
.mapbox-mobile-controls {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Mobile header: title + dropdown */
    .mapbox-mobile-controls {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        background: #172840;
        gap: 20px;
    }

    #mobile-controls-mapbox     .mobile-map-title {
        font-size: 36px;
        font-weight: 600;
        line-height: 40px;
        color: white;
        margin: 0;
        font-family: 'articulat-cf', sans-serif;
    }

    #mobile-controls-mapbox .mobile-map-title::after {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: #2483C5;
        margin-top: 16px;
    }

    .mapbox-mobile-controls .mobile-community-select {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
        font-family: 'articulat-cf', sans-serif;
        border: none;
        border-radius: 0;
        background: #fff;
        color: #172840;
        cursor: pointer;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23172840' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 15px center;
        background-size: 12px 8px;
        padding-right: 40px;
    }

    /* Hide desktop filter bar on mobile */
    .mapbox-filter-bar {
        display: none;
    }

    .mapbox-wrapper {
        position: relative;
        overflow: hidden;
    }
    
    .filter-controls {
        gap: 15px;
    }
    
    .filter-group {
        min-width: 120px;
        flex: 1;
    }
    
    .mapbox-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: hidden;
    }
    
    .mapbox-sidebar {
        width: 100%;
        order: 2;
        max-height: 300px;
    }
    
    .mapbox-map-wrapper {
        width: 100%;
        aspect-ratio: 9 / 16;
        min-height: auto;
        overflow: hidden;
        order: 1;
    }
    
    .mapbox-map-wrapper > div {
        width: 100%;
        height: 100%;
    }
    
    .sidebar-content {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .filter-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .clear-filters-btn {
        margin-top: 5px;
        width: 100%;
    }
    
    .mapbox-filter-bar {
        padding: 10px 15px;
    }
    
    .mapbox-sidebar {
        max-height: 250px;
    }
    
    .mapbox-map-wrapper {
        aspect-ratio: 9 / 16;
        height: auto;
    }
    
    .community-item,
    .property-item {
        padding: 15px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
}

/* Mapbox Custom Markers and Popups */
.custom-marker {
    transition: all 0.3s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

.mapboxgl-popup {
    max-width: 300px;
}

.mapboxgl-popup-content {
    padding: 0;
    border-radius: 0px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mapbox-popup-content {
    padding: 20px;
    font-family: 'articulat-cf', sans-serif;
}

.mapbox-popup-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 500;
    color: #1B6551;
    line-height: 1.3;
}

s.mapbox-popup-content h3 .popup-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mapbox-popup-content h3 .popup-title-link:hover {
    color: #A08355;
    text-decoration: underline;
}

.mapbox-popup-content p {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 400;
    color: #0D0708;
    line-height: 1.4;
}

.mapbox-popup-content p:last-child {
    margin-bottom: 0;
}

.mapbox-popup-content .popup-link {
    display: inline-block;
    background-color: #2483C5;
    color: white !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.mapbox-popup-content .popup-link:hover {
    background-color: #A08355;
    text-decoration: none;
}

.mapbox-popup-content a[href^="tel:"] {
    color: #1B6551 !important;
    text-decoration: none;
}

.mapbox-popup-content a[href^="tel:"]:hover {
    color: #A08355 !important;
    text-decoration: underline;
}

.mapboxgl-popup-close-button {
    font-size: 20px;
    color: #666;
    right: 8px;
    top: 8px;
}

.mapboxgl-popup-close-button:hover {
    color: #1B6551;
}

/* Status Indicators in Popups */
.mapbox-popup-content .status-for_sale {
    color: #1B6551 !important;
    font-weight: 500;
    text-transform: capitalize;
}

.mapbox-popup-content .status-sold {
    color: #A08355 !important;
    font-weight: 500;
    text-transform: capitalize;
}

/* Community Markers */
.community-marker {
    position: relative;
}

.community-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5) !important;
}

.community-marker:before {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: #A08355;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Enhanced Popup Buttons */
.mapbox-popup-content .popup-link.secondary {
    background-color: #666;
    margin-top: 10px;
    font-size: 13px;
    padding: 6px 12px;
}

.mapbox-popup-content .popup-link.secondary:hover {
    background-color: #444;
}

/* Popup Home Images */
.popup-image-container {
    margin-bottom: 15px;
    text-align: center;
}

.popup-home-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 0px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

/* Community Popup Styling */
.mapbox-popup-content p strong {
    color: #0D0708;
}

.mapbox-popup-content .status-for_sale {
    color: #1B6551 !important;
    font-weight: 500;
}

.mapbox-popup-content .status-sold {
    color: #A08355 !important;
    font-weight: 500;
}

/* Smooth transitions for marker changes */
.custom-marker, .community-marker {
    opacity: 0;
    animation: fadeInMarker 0.5s ease-in-out forwards;
}

@keyframes fadeInMarker {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Admin Interface Styling */
body.post-type-map_marker .form-table th,
body.post-type-community_marker .form-table th,
body.post-type-lot_marker .form-table th {
    width: 150px;
    font-weight: 500;
}

body.post-type-map_marker .form-table input[type="text"],
body.post-type-community_marker .form-table input[type="text"],
body.post-type-lot_marker .form-table input[type="text"],
body.post-type-map_marker .form-table input[type="number"],
body.post-type-community_marker .form-table input[type="number"],
body.post-type-lot_marker .form-table input[type="number"] {
    font-size: 14px;
    padding: 8px 12px;
}

body.post-type-map_marker .form-table select,
body.post-type-community_marker .form-table select,
body.post-type-lot_marker .form-table select {
    font-size: 14px;
    padding: 8px 12px;
}

/* Map Marker List Table Columns */
.wp-admin .widefat .column-address {
    width: 30%;
}

.wp-admin .widefat .column-status {
    width: 15%;
}

.wp-admin .widefat .column-community,
.wp-admin .widefat .column-community_name {
    width: 20%;
}

.wp-admin .widefat .column-coordinates {
    width: 25%;
}

.wp-admin .widefat .column-city {
    width: 20%;
}

.wp-admin .widefat .column-lot_count {
    width: 15%;
}

/* Status badges in admin list */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 0px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.for_sale {
    background-color: #1B6551;
    color: white;
}

.status-badge.sold {
    background-color: #A08355;
    color: white;
}

@media (max-width: 768px) {
    .home .elementor-shortcode .mapbox-container .mapbox-sidebar { display:none; }
    .home .elementor-shortcode .mapbox-container, .home .elementor-shortcode .mapbox-map-wrapper { height:auto; }
    .mapbox-container { height:800px; }
    .elementor-shortcode .mapbox-sidebar { max-height:400px; }
}