/* property-listings-map.css - Complete Map View Styles */

/* ===== MAP CONTAINER ===== */
.map-view {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef1f4;
    margin-top: 10px;
}

.map-container {
    width: 100%;
    height: 100%;
    background: #eef1f4;
}

/* ===== PROPERTY OVERLAY ===== */
.map-property-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 340px;
    max-height: calc(100% - 30px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a365d, #2c5282);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.map-overlay-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.map-overlay-title i {
    font-size: 16px;
}

.map-property-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.map-overlay-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-overlay-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.map-overlay-toggle.collapsed {
    transform: rotate(180deg);
}

.map-property-list {
    overflow-y: auto;
    padding: 10px;
    flex: 1;
    max-height: calc(70vh - 80px);
    scroll-behavior: smooth;
    background: rgba(248, 250, 252, 0.9);
}

.map-property-list::-webkit-scrollbar {
    width: 5px;
}

.map-property-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.map-property-list::-webkit-scrollbar-thumb {
    background: rgba(26, 54, 93, 0.3);
    border-radius: 10px;
}

.map-property-list::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 54, 93, 0.5);
}

/* ===== PROPERTY CARDS ===== */
.map-property-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
}

.map-property-card:last-child {
    margin-bottom: 0;
}

.map-property-card:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-left-color: #2c5282;
}

.map-property-card.active {
    border-left-color: #2c5282;
    background: linear-gradient(135deg, #ebf4ff, #f0f7ff);
    box-shadow: 0 4px 16px rgba(44, 82, 130, 0.15);
}

.map-property-card-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.map-property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.map-property-card:hover .map-property-card-image img {
    transform: scale(1.05);
}

.map-property-card-image .video-indicator-small {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    gap: 3px;
}

.map-property-card-info {
    flex: 1;
    min-width: 0;
}

.map-property-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a365d;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-property-card-location {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-property-card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    color: #555;
    flex-wrap: wrap;
}

.map-property-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.map-property-card-price {
    font-weight: 700;
    color: #1a365d;
    font-size: 0.85rem;
    margin-top: 4px;
}

.map-property-card-availability {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.map-property-card-availability.ready-now {
    background: #d4edda;
    color: #155724;
}

.map-property-card-availability.ready-soon {
    background: #fff3cd;
    color: #856404;
}

.map-property-card-availability.ask {
    background: #f8d7da;
    color: #721c24;
}

/* ===== LOADING STATE ===== */
.map-loading-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.map-loading-cards .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #1a365d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

.map-loading-cards p {
    margin: 0;
    font-size: 0.9rem;
}

/* ===== MAP CONTROLS ===== */
.map-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.map-control-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.map-control-btn:hover {
    background: rgba(26, 54, 93, 0.1);
    color: #1a365d;
}

.map-control-btn:active {
    transform: scale(0.95);
}

.map-control-btn i {
    font-size: 1rem;
}

/* ===== MARKERS ===== */
.map-marker {
    background: white;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.25s ease;
}

.map-marker i {
    color: #1a365d;
    font-size: 0.9rem;
    transition: color 0.25s ease;
}

.map-marker:hover {
    transform: scale(1.15);
    border-color: #2c5282;
    box-shadow: 0 0 20px rgba(26, 54, 93, 0.3);
}

.map-marker.active {
    background: #1a365d;
    border-color: #1a365d;
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(26, 54, 93, 0.4);
}

.map-marker.active i {
    color: white;
}

.map-marker .marker-number {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ===== POPUP ===== */
.map-popup {
    min-width: 200px;
    max-width: 260px;
    font-family: inherit;
}

.map-popup-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px 6px 0 0;
    margin: -12px -12px 0 -12px;
    width: calc(100% + 24px);
}

.map-popup-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a365d;
    margin: 8px 0 2px;
}

.map-popup-location {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0 0 4px;
}

.map-popup-meta {
    font-size: 0.75rem;
    color: #555;
    margin: 0 0 4px;
}

.map-popup-price {
    font-weight: 700;
    color: #1a365d;
    font-size: 0.9rem;
}

.map-popup-availability {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    margin: 4px 0 6px;
}

.map-popup-availability.ready-now {
    background: #2f855a;
}

.map-popup-availability.ready-soon {
    background: #b7791f;
}

.map-popup-availability.ask {
    background: #718096;
}

.map-popup-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #1a365d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 6px;
}

.map-popup-btn:hover {
    background: #142c4a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .map-view {
        height: 60vh;
        min-height: 400px;
        border-radius: 8px;
    }

    .map-property-overlay {
        top: 10px;
        right: 10px;
        width: 280px;
        max-height: calc(100% - 20px);
    }

    .map-property-overlay.collapsed {
        width: 48px;
    }

    .map-property-overlay.collapsed .map-property-list {
        display: none;
    }

    .map-property-overlay.collapsed .map-overlay-title span:not(:first-child) {
        display: none;
    }

    .map-property-list {
        max-height: calc(60vh - 60px);
        padding: 8px;
    }

    .map-property-card {
        padding: 10px;
        gap: 10px;
    }

    .map-property-card-image {
        width: 55px;
        height: 55px;
    }

    .map-property-card-title {
        font-size: 0.75rem;
    }

    .map-controls {
        bottom: 12px;
        left: 12px;
        padding: 4px;
    }

    .map-control-btn {
        padding: 6px 10px;
        min-width: 32px;
        min-height: 32px;
    }

    .map-control-btn i {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .map-property-overlay {
        width: 220px;
        right: 5px;
        top: 5px;
        max-height: calc(100% - 10px);
        border-radius: 8px;
    }

    .map-property-overlay.collapsed {
        width: 40px;
    }

    .map-overlay-header {
        padding: 8px 12px;
        font-size: 12px;
    }

    .map-overlay-title {
        font-size: 12px;
        gap: 6px;
    }

    .map-property-card-image {
        width: 45px;
        height: 45px;
    }

    .map-property-card-title {
        font-size: 0.7rem;
    }

    .map-property-card-meta {
        font-size: 0.6rem;
        gap: 4px;
    }

    .map-property-card-price {
        font-size: 0.75rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.map-property-card {
    animation: slideIn 0.3s ease forwards;
}

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 12px !important;
    min-width: 180px;
}

.leaflet-popup-tip {
    background: white !important;
}

/* ===== SCROLLBAR STYLING ===== */
.map-property-list::-webkit-scrollbar {
    width: 5px;
}

.map-property-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.map-property-list::-webkit-scrollbar-thumb {
    background: rgba(26, 54, 93, 0.3);
    border-radius: 10px;
}

.map-property-list::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 54, 93, 0.5);
}