
/* Map-specific styles with unique class names to avoid conflicts */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.map-sidebar-checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.map-detailed-section {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.map-detailed-section-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
}

.map-detailed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.map-detailed-checkbox-group {
    margin-bottom: 20px;
}

.group-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.map-detailed-checkbox-group label {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
    margin-bottom: 10px;
}

.map-detailed-checkbox-group label:nth-child(even) {
    margin-right: 0;
}

.map-detailed-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

.map-filter-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.map-detailed-grid div {
    display: flex;
    flex-direction: column;
}

.map-detailed-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.map-detailed-checkbox-group input[type="checkbox"]:checked {
    transform: scale(1.1); /* Slightly enlarges the checkbox when checked */
    opacity: 1;
}



.map-page {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

.map-sidebar {
    width: 320px;
    height: 100vh;
    background-color: white;
    overflow-y: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.map-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.map-sidebar-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.map-sidebar-location {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.map-sidebar-location-text {
    font-size: 14px;
}

.map-sidebar-location-change {
    color: #00857e;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.map-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.map-sidebar-section {
    margin-bottom: 20px;
}

.map-sidebar-section-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 10px;
}

.map-sidebar-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.map-sidebar-select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.map-sidebar-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.map-sidebar-checkbox input {
    margin-right: 8px;
}

.map-sidebar-count {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.map-sidebar-buttons {
    padding: 15px;
    border-top: 1px solid #eee;
}

.map-sidebar-button {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: center;
}

.map-sidebar-search {
    background: #00857e;
    color: white;
    border: none;
}

.map-sidebar-more {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.map-container {
    flex: 1;
    height: 100vh;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.map-search-box {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    z-index: 5;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.map-search-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.map-filter-tags {
    position: absolute;
    top: 60px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.map-filter-tag {
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-filter-tag-edit {
    margin-left: 8px;
    color: #666;
    font-weight: bold;
    cursor: pointer;
}

.map-controls {
    position: absolute;
    bottom: 20px;
    left: 10px;
    z-index: 5;
    display: flex;
    gap: 10px;
}

.map-control-button {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
}

.map-share-button {
    position: absolute;
    bottom: 20px;
    right: 10px;
    z-index: 5;
    background: white;
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 14px;
    cursor: pointer;
}

.map-filter-modal, .map-detailed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0);
    z-index: 100;
    transition: background-color 0.3s ease;
}

.map-filter-modal.active, .map-detailed-modal.active {
    background-color: rgba(0,0,0,0.5);
}

.map-filter-content, .map-detailed-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 8px;
    overflow-y: auto;
    padding: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.map-filter-modal.active .map-filter-content, 
.map-detailed-modal.active .map-detailed-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.map-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.map-filter-title {
    font-size: 18px;
    font-weight: bold;
}

.map-filter-close, .map-property-mobile-close, .map-detailed-close, .map-property-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.map-property-close:hover, .map-property-mobile-close:hover, 
.map-filter-close:hover, .map-detailed-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.map-filter-section {
    margin-bottom: 20px;
}

.map-filter-section-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.map-filter-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.map-filter-select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.map-filter-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.map-filter-checkbox input {
    margin-right: 8px;
}

.map-filter-count {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

.map-filter-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.map-filter-button {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.map-filter-search {
    background: #00857e;
    color: white;
    border: none;
}

.map-filter-clear {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.map-detailed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.map-detailed-title {
    font-size: 18px;
    font-weight: bold;
}

.map-detailed-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.map-detailed-section {
    margin-bottom: 20px;
}

.map-detailed-section-title {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.map-detailed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.map-detailed-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.map-detailed-button {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.map-detailed-search {
    background: #00857e;
    color: white;
    border: none;
}

.map-detailed-clear {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.map-property-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.map-property-panel.active {
    transform: translateX(0);
}

.map-property-header {
    padding: 15px;
    margin-top: 60px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: none;
}

.map-property-title-bar {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.map-property-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-left: 10px;
}

.map-property-close:hover {
    background-color: #e9ecef;
    color: #333;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
    border-color: #b8b9be;
    transition: all 0.2s ease-in-out;
}


.map-property-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.map-property-content {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}

.map-property-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.map-property-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.map-property-info {
    margin-bottom: 15px;
}

.map-property-info-row {
    display: flex;
    margin-bottom: 5px;
}

.map-property-info-label {
    width: 80px;
    font-weight: bold;
    font-size: 14px;
}

.map-property-info-value {
    flex: 1;
    font-size: 14px;
}

.map-property-price {
    font-size: 20px;
    font-weight: bold;
    color: #e53e3e;
    margin: 10px 0;
}

.map-property-tag {
    display: inline-block;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.map-property-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: #00857e;
    color: white;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
}

.map-property-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.map-property-mobile.active {
    transform: translateY(0);
}

.map-property-mobile-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-property-mobile-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.map-property-mobile-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.map-property-mobile-content {
    padding: 15px;
}

.map-property-mobile-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.map-property-mobile-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.map-property-mobile-info {
    margin-bottom: 15px;
}

.map-property-mobile-info-row {
    display: flex;
    margin-bottom: 5px;
}

.map-property-mobile-info-label {
    width: 80px;
    font-weight: bold;
    font-size: 14px;
}

.map-property-mobile-info-value {
    flex: 1;
    font-size: 14px;
}

.map-property-mobile-price {
    font-size: 20px;
    font-weight: bold;
    color: #e53e3e;
    margin: 10px 0;
}

.map-property-mobile-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: #00857e;
    color: white;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
}

.map-property-list {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 40;
    display: none;
}

.map-property-list.active {
    display: block;
}

.map-property-card {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.map-property-card-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 10px;
}

.map-property-card-content {
    flex: 1;
}

.map-property-card-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.map-property-card-price {
    color: #e53e3e;
    font-weight: bold;
}

.map-property-card-info {
    font-size: 12px;
    color: #666;
}

.map-property-card-favorite {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-property-show-more {
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    font-weight: bold;
    cursor: pointer;
}

.map-toggle-sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 15;
    background: white;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    display: none;
}

/* Add a close button for the mobile sidebar */
.map-sidebar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 11;
}

.map-sidebar-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* Loading animation */
.map-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-loading.active {
    opacity: 1;
}

.map-loading-content {
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.map-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00857e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive styles update */
@media (max-width: 768px) {
    .map-sidebar {
        display: none;
        width: 100%;
        height: 50vh;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 20;
        transform: translateY(-100%);
        opacity: 0;
    }
    
    .map-sidebar.active {
        display: block;
        transform: translateY(0);
        opacity: 1;
    }
    
    .map-toggle-sidebar {
        display: flex;
    }
    
    .map-container {
        height: 100vh;
    }
    
    .map-search-box {
        width: calc(100% - 60px);
        left: 60px;
        transform: none;
    }
    
    .map-filter-tags {
        display: none;
    }
    
    .map-property-panel {
        display: none;
    }
    
    .map-property-mobile {
        display: block;
    }
    
    .map-property-list {
        display: block;
    }
}

@media (max-width: 480px) {
    .map-filter-content {
        width: 95%;
        padding: 15px;
    }
    
    .map-detailed-content {
        width: 95%;
        padding: 15px;
    }
    
    .map-detailed-grid {
        grid-template-columns: 1fr;
    }
}