/* Map Page Specific Layout */

.map-page-content {
    width: 100%;
}

.map-title-section {
    margin-bottom: 24px;
    padding-top: 8px;
}

.map-title-section .page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.map-title-section .page-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Map Container Card Wrapper */
.map-container-wrapper {
    position: relative;
    width: 100%;
    height: 520px; /* Mobile Map Height */
    background: var(--surface-color);
    border-radius: var(--border-radius-lg, 24px);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
}

/* Sidebar List of Properties - MOBILE HIDDEN */
.map-sidebar {
    display: none;
}

.map-main-area {
    width: 100%;
    height: 100%;
    position: relative;
    flex: 1;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Map Controls Floating inside Map Container Card */
.map-controls-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.map-search-wrap,
.map-filter-chips {
    pointer-events: auto;
}

/* Search Bar Floating Style */
.map-search-wrap {
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.map-search-wrap:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.15);
    background: var(--surface-color);
}

.map-search-wrap i {
    color: var(--primary-light);
    font-size: 1rem;
    margin-right: 10px;
}

.map-search-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-family);
    font-weight: 500;
}

.map-search-wrap input::placeholder {
    color: var(--text-secondary);
}

/* Horizontal Filter Chips inside Map Controls */
.map-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 4px 8px;
    margin: 0 -4px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.map-filter-chips::-webkit-scrollbar {
    display: none;
}

.map-chip {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.map-chip i {
    font-size: 0.85rem;
}

.map-chip:hover {
    background: var(--surface-color);
    transform: translateY(-1px);
}

.map-chip.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.3);
}

/* Custom Pin Markers */
.custom-price-marker {
    background: var(--primary-color);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.35);
    position: relative;
    white-space: nowrap;
    border: 2px solid #ffffff;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-price-marker:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.custom-price-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
}

.custom-price-marker:hover::after {
    border-top-color: var(--accent-color);
}

/* Map Embedded Bottom Sheet */
.bottom-sheet {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--surface-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius, 16px);
    z-index: 100;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.bottom-sheet.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.sheet-handle {
    width: 32px;
    height: 3px;
    background: var(--border-color);
    border-radius: 3px;
    margin: 0 auto 12px;
}

.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.sheet-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.sheet-card {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.sheet-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.sheet-details {
    flex: 1;
}

.sheet-details .price {
    font-size: 1.15rem;
    color: var(--primary-light);
    font-weight: 800;
    margin-bottom: 2px;
}

.sheet-details h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.sheet-details .location {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.sheet-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sheet-actions .btn {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-view {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-view:hover {
    background: var(--border-color);
}

.btn-wa {
    background: #25D366;
    color: white;
}

.btn-wa:hover {
    background: #20ba5a;
}

.btn-gmaps {
    background: #4285F4;
    color: white;
}

.btn-gmaps:hover {
    background: #357ae8;
}

/* Desktop Split-Screen Layout Styles */
@media (min-width: 768px) {
    .map-title-section {
        margin-bottom: 32px;
        padding-top: 16px;
    }

    .map-title-section .page-title {
        font-size: 2.25rem;
        margin-bottom: 8px;
    }

    .map-container-wrapper {
        height: 620px; /* Desktop Map Height */
        border-radius: 32px;
        flex-direction: row;
    }

    /* Split-screen sidebar styling */
    .map-sidebar {
        display: flex;
        flex-direction: column;
        width: 380px;
        height: 100%;
        background: var(--surface-color);
        border-right: 1px solid var(--border-color);
        flex-shrink: 0;
        z-index: 20;
    }

    .sidebar-header {
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-header h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        font-family: 'Outfit', sans-serif;
    }

    .sidebar-header .results-count {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--primary-light);
        background: rgba(4, 120, 87, 0.08);
        padding: 4px 10px;
        border-radius: 12px;
    }

    .sidebar-cards {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Scrollbar style inside sidebar */
    .sidebar-cards::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-cards::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-cards::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }

    /* Premium sidebar property item card */
    .sidebar-item-card {
        display: flex;
        gap: 12px;
        padding: 12px;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.25s ease;
        text-decoration: none;
        color: inherit;
    }

    .sidebar-item-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary-light);
    }

    .sidebar-item-card.active {
        background: rgba(4, 120, 87, 0.04);
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(6, 78, 59, 0.08);
    }

    .sidebar-item-img {
        width: 80px;
        height: 80px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
        border: 1px solid var(--border-color);
    }

    .sidebar-item-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0; /* truncate text safety */
    }

    .sidebar-item-details .price {
        font-size: 1.1rem;
        color: var(--primary-light);
        font-weight: 800;
        margin-bottom: 2px;
    }

    .sidebar-item-details h4 {
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-item-details .loc {
        font-size: 0.75rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .sidebar-item-details .tags {
        display: flex;
        gap: 4px;
        margin-top: 4px;
    }

    .sidebar-item-details .tag {
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--text-secondary);
        background: var(--bg-color);
        padding: 1px 6px;
        border-radius: 4px;
    }

    .map-main-area {
        flex: 1;
        height: 100%;
        position: relative;
    }

    .map-controls-bar {
        top: 20px;
        left: 20px;
        width: 380px;
    }

    /* Reposition bottom sheet inside map main area for split layout */
    .bottom-sheet {
        position: absolute;
        top: auto;
        bottom: 20px;
        left: 400px;
        right: auto;
        width: 380px;
        z-index: 999;
    }
}

/* 📍 Locate Me Floating Action Button */
.locate-me-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.locate-me-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 20px rgba(6, 78, 59, 0.3);
}

.locate-me-btn:active {
    transform: translateY(0) scale(0.95);
}

/* User coordinate marker pulse effects */
.user-gps-pulse {
    background: #3b82f6;
    border: 2px solid #ffffff;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: gpsPulse 2s infinite;
}

@keyframes gpsPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Amenities Toggle Floating Button */
.amenities-toggle-wrap {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
}

.amenities-toggle-btn {
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 30px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.amenities-toggle-btn:hover {
    background: var(--surface-color);
    transform: translateY(-1px);
}

.amenities-toggle-btn.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.amenities-toggle-btn i {
    font-size: 0.9rem;
}

/* Hover effect on amenity bubble markers */
.amenity-marker-bubble:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 14px rgba(0,0,0,0.4) !important;
}

@media (min-width: 768px) {
    .amenities-toggle-wrap {
        top: 20px;
        right: 20px;
    }
}
