/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

#map-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    margin-top:128px;
}

#map-container {
    width: 100%;
    height: 100%;
}

/* ========== Property HTML Marker ========== */
.property-html-marker,
.property-html-marker *,
.property-html-marker::before,
.property-html-marker::after {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.property-html-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.property-html-marker .marker-content {
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: 2px solid white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* .property-html-marker:hover .marker-content {
    background: rgba(34, 197, 94, 0.9) !important;
    transform: scale(1.05);
} */

.property-html-marker .house-icon {
    font-size: 16px;
    filter: none !important;
}

.property-html-marker:hover .house-icon {
    filter: brightness(1.2) !important;
}

.property-html-marker:not(.continent-marker):not(.country-marker) {
    background: transparent !important;
}

.property-html-marker:not(.continent-marker):not(.country-marker)::before,
.property-html-marker:not(.continent-marker):not(.country-marker)::after {
    display: none !important;
    content: none !important;
}

/* ========== Marker Content (property pins) ========== */
.marker-content {
    background: linear-gradient(135deg, #6f6f6f, #363636) !important;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    max-width: 150px;
    white-space: nowrap;
    transition: all 0.3s ease;
    overflow: hidden;
}

.house-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.property-title-map {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: 12px !important;
}

.property-html-marker.active .marker-content {
    background: linear-gradient(135deg, #333333, #4a4a4a) !important;
    max-width: 180px;
}

.property-html-marker:hover .marker-content {
    background: linear-gradient(135deg, #333333, #4a4a4a) !important;
    transform: scale(1.15);
    border-radius: 20px;
    z-index: 2;
}

/* ========== City Marker ========== */
.city-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
    gap: 4px;
    position: relative;
}

.city-marker-pin {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 50% 50% 50% 0;
    background: #fff;
    transform: rotate(-45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.city-marker-pin::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.city-marker:hover .city-marker-pin {
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* ========== Country Marker ========== */
.country-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
    gap: 4px;
    position: relative;
    z-index: 2;
}

.country-marker-pin {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    background: #fff;
    transform: rotate(-45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.country-marker-pin::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(180deg, #45d16c 0%, #1fa255 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========== Continent Marker ========== */
.continent-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
    gap: 6px;
    position: relative;
    z-index: 10000;
}

.continent-marker-label {
    padding: 4px 10px;
    border-radius: 999px;
    color: rgba(29, 28, 28, 1);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.continent-marker-label.hover {
    background: rgba(29, 28, 28, 0.3);
    color: rgba(255, 255, 255, 1);
}

.continent-marker-pin {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(180deg, #45d16c 0%, #1fa255 100%);
    transform: rotate(-45deg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.continent-marker-pin::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========== Continent/Country Watermark ========== */
.continent-watermark {
    position: absolute;
    bottom: 100px;
    right: 80px;
    color: rgba(102, 102, 102, 0.2);
    padding: 8px 16px;
    font-size: 50px !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1000;
    pointer-events: none;
    display: none;
}

.continent-watermark.visible {
    display: block;
}

/* ========== Info Window (property hover tooltip) ========== */
.info-window {
    max-width: 200px;
    padding: 8px;
    background-color: #ffffff !important;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(-10px);
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #636363;
    border-radius: 8px;
}

.info-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    margin-top: 8px;
}

/* ========== City Hover Tooltip ========== */
.city-tooltip {
    background: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    /* transform: translate(-50%, -20px); */
    white-space: nowrap;
    z-index: 1000;
    width: auto;
    min-width: fit-content;
    max-width: 200px;
    text-align: center;
    overflow: visible;
}

/* ========== Loading Overlay ========== */
.map-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: none;
}

.map-loading-overlay.visible {
    display: block;
}

.map-spinner {
    width: 40px;
    height: 40px;
    border: 5px solid rgba(255, 255, 255, 0.9);
    border-top-color: rgba(0, 136, 255, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== Back Button ========== */
.map-back-button {
    position: absolute;
    top: 8%;
    left: 4%;
    z-index: 9999;
    background-color: #ffffff;
    color: #333;
    padding: 8px 11px;
    border-radius: 50%;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
    line-height: 1;
}

.map-back-button:hover {
    background-color: rgba(0, 136, 255, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ========== Property Pane (right sidebar) ========== */
.property-pane {
    position: absolute;
    top: 0;
    right: 0%;
    width: 40%;
    min-width: 510px;
    height: 600px;
    background: #ffffff;
    border-left: 1px solid #ccc;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    display: none;
}

.property-pane.visible {
    display: block;
}

.property-pane .close-btn {
    background-color: transparent;
    border: 0px;
    font-size: 20px;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 10px;
    color: #191919;
    padding: 4px 8px;
}

.property-pane .close-btn:hover {
    color: #0088ff;
}

/* ========== Property Card (simplified PropertyBox) ========== */
.property-card {
    margin-top: 20px;
}

.property-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.property-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.property-card-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.property-card-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.property-card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #555;
}

.property-card-stat-icon {
    font-size: 16px;
}

.property-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.property-card-price .currency {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.property-card-description {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    line-height: 1.5;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 820px) {
    #map-pagination{
        bottom: 47% !important;
        width: 70% !important;
   }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .marker-content {
        font-size: 11px;
        padding: 5px 10px;
        max-width: 120px;
    }
    .house-icon { font-size: 10px; }
    .property-pane {
        width: 100%;
        min-width: unset;
        height: 40% !important; /* Take up less vertical space so map is visible */
        bottom: 0;
        top: auto;
    }
    .continent-watermark {
        font-size: 30px !important;
        right: 20px;
        bottom: 60px;
    }
    #map-pagination{
        bottom: 33% !important;
   }
}

@media (max-width: 480px) {
    .marker-content {
        font-size: 10px;
        padding: 4px 8px;
        max-width: 100px;
    }
    .house-icon { font-size: 10px; }
    #map-wrapper { height: 400px; }
    .continent-watermark {
        font-size: 20px !important;
        right: 10px;
        bottom: 40px;
    }
}

.country-marker-label {
    padding: 2px 6px;
    border-radius: 12px;
    background: rgba(29, 28, 28, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.country-marker-label.hover {
    background: rgba(29, 28, 28, 0.9);
    color: #ffffff;
}

/* Ensure labels are visible and don't interfere with clicking the pins */
.city-tooltip.default-visible {
    background: white;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    pointer-events: none; /* Crucial: lets clicks pass through to the marker */
    transform: translate(-50%, -20px); /* Adjust this to position name above the pin */
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dropdown {
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    background: #fff;
    width: 250px;
    display: none;
    z-index: 999;
}

.dropdown div {
    padding: 8px;
    cursor: pointer;
}

.dropdown div:hover {
    background: #f0f0f0;
}

@media (max-width: 440px) {
   #map-pagination{
        bottom: 47% !important;
        width: 91% !important;
   }
   #map-pagination button {
        padding: 5px 6px !important;
    }
    #map-wrapper {
        margin-top: 20px !important;
    }
    .map-back-button{
        top: 29%;
    }
}

@media (max-width: 430px) {
   #map-pagination{
        bottom: 38% !important;
   }
}

@media (max-width: 414px) {
   #map-pagination{
        bottom: 35% !important;
   }
}

@media (max-width: 412px) {
   #map-pagination{
        bottom: 37% !important;
   }
}

@media (max-width: 400px) {
   #map-pagination{
        bottom: 32% !important;
   }
}

@media (max-width: 390px) {
   #map-pagination{
        bottom: 31% !important;
   }
}

@media (max-width: 375px) {
   #map-pagination{
        bottom: 13% !important;
   }
}
.hidden_back_button {
  display: none;
}