/* Map container - Futuristic Design */
.map-card {
    height: calc(100vh - 200px);
    min-height: 600px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.map-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.map-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(197, 255, 155, 0.5), 
        rgba(166, 254, 248, 0.5)
    );
    z-index: 1;
}

.property-map {
    width: 100%;
    height: calc(100% - 70px);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 168, 255, 0.2);
}

/* Map controls */
.map-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding: 0 5px;
}

.map-view-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

/* Custom marker styles */
.custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 36px;
    height: 36px;
    background: rgba(10, 30, 50, 0.8);
    position: absolute;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    margin: -18px 0 0 -18px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: pulse 2.5s infinite;
    z-index: 1;
    border: 2px solid rgba(0, 168, 255, 0.7);
}

.marker-pin::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(10, 30, 50, 0.8);
    z-index: -1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.marker-pin i {
    color: rgba(0, 168, 255, 0.9);
    font-size: 16px;
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.5);
}

/* Specific colors for operation types - Futuristic Design */
.marker-pin[data-operation="Venta"] {
    border: 2px solid rgba(0, 168, 255, 0.7);
    animation: pulse 2.5s infinite;
}

.marker-pin[data-operation="Venta"] i {
    color: rgba(0, 168, 255, 0.9);
}

.marker-pin[data-operation="Alquiler"] {
    border: 2px solid rgba(0, 255, 150, 0.7);
    animation: pulseRent 2.5s infinite;
}

.marker-pin[data-operation="Alquiler"] i {
    color: rgba(0, 255, 150, 0.9);
    text-shadow: 0 0 5px rgba(0, 255, 150, 0.5);
}

.price-tag {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 20, 30, 0.85);
    padding: 3px 10px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(0, 168, 255, 0.9);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    border: 1px solid rgba(0, 168, 255, 0.4);
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
}

.marker-pin[data-operation="Alquiler"] .price-tag {
    color: rgba(0, 255, 150, 0.9);
    border: 1px solid rgba(0, 255, 150, 0.4);
    text-shadow: 0 0 5px rgba(0, 255, 150, 0.3);
}

.marker-pin:hover {
    z-index: 1000;
    animation: none;
    transform: scale(1.15);
}

.marker-pin:hover .price-tag {
    opacity: 1;
}

/* Property popup styles - Futuristic Design */
.property-popup {
    min-width: 270px;
    font-family: var(--font-family);
}

.property-popup-container .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
}

.property-popup-container .leaflet-popup-content {
    margin: 0;
    width: 100% !important;
}

.property-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid rgba(0, 168, 255, 0.2);
    position: relative;
}

.property-popup-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(0, 168, 255, 0), 
        rgba(0, 168, 255, 0.5), 
        rgba(0, 168, 255, 0)
    );
}

.property-popup-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--light-color);
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
}

.property-popup-header .badge {
    padding: 5px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(0, 168, 255, 0.2);
    color: var(--light-color);
    border: 1px solid rgba(0, 168, 255, 0.4);
}

.property-popup-price {
    background: linear-gradient(135deg, rgba(0, 120, 255, 0.8), rgba(0, 200, 255, 0.8));
    color: white;
    padding: 8px 15px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.property-popup-details {
    padding: 12px 15px;
    background-color: rgba(20, 20, 20, 0.9);
}

.property-popup-details p {
    margin: 5px 0;
    font-size: 0.85rem;
    color: rgba(220, 220, 220, 0.8);
}

.property-popup-details strong {
    font-weight: 600;
    color: var(--primary-color);
}

.property-popup-features {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 15px 12px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 168, 255, 0.2);
    padding-top: 12px;
    background: rgba(15, 15, 15, 0.9);
    position: relative;
}

.property-popup-features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(0, 168, 255, 0), 
        rgba(0, 168, 255, 0.3), 
        rgba(0, 168, 255, 0)
    );
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(20, 40, 60, 0.8);
    border-radius: 50%;
    color: rgba(0, 168, 255, 0.9);
    font-size: 0.9rem;
    border: 1px solid rgba(0, 168, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 168, 255, 0.3);
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.5);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    background-color: rgba(0, 168, 255, 0.2);
    color: rgba(0, 168, 255, 1);
    box-shadow: 0 0 12px rgba(0, 168, 255, 0.5);
    transform: scale(1.1);
}

/* Leaflet popup overrides - Futuristic Theme */
.leaflet-popup-tip {
    background-color: rgba(20, 20, 20, 0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 168, 255, 0.2);
}

.leaflet-container a.leaflet-popup-close-button {
    color: rgba(0, 168, 255, 0.7);
    padding: 8px 8px 0 0;
    font-size: 18px;
    font-weight: normal;
    text-shadow: 0 0 5px rgba(0, 168, 255, 0.3);
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: rgba(0, 168, 255, 1);
    text-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
}

/* Cluster custom styles - Futuristic theme */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(0, 50, 80, 0.5);
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.5);
    border: 1px solid rgba(0, 180, 255, 0.3);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(0, 120, 200, 0.7);
    color: white;
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 0 5px rgba(0, 200, 255, 0.8);
}

/* Pulse animation for markers - Futuristic Design */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 168, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 15px 5px rgba(0, 168, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 168, 255, 0);
    }
}

/* Pulse animation for rent markers */
@keyframes pulseRent {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 150, 0.7);
    }
    50% {
        box-shadow: 0 0 15px 5px rgba(0, 255, 150, 0.5);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 150, 0);
    }
}

/* Estilos para marcadores resaltados y atenuados */
.marker-pin.highlighted {
    border-width: 3px !important;
    animation: pulseFast 1.5s infinite !important;
    transform: scale(1.2) !important;
    z-index: 1000 !important;
}

.marker-pin.highlighted[data-operation="Venta"] {
    border-color: #a6fef8 !important; /* Azul brillante */
    box-shadow: 0 0 20px rgba(166, 254, 248, 0.8) !important;
}

.marker-pin.highlighted[data-operation="Alquiler"] {
    border-color: #c5ff9b !important; /* Verde brillante */
    box-shadow: 0 0 20px rgba(197, 255, 155, 0.8) !important;
}

.marker-pin.highlighted i {
    color: #FFFFFF !important;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8) !important;
    font-size: 18px !important;
}

.marker-pin.highlighted .name-tag {
    display: block !important;
    opacity: 1 !important;
    color: #FFFFFF !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9) !important;
}

.marker-pin.highlighted .price-tag {
    display: none !important; /* Ocultamos el precio en marcadores resaltados */
}

.marker-pin.dimmed {
    opacity: 0.25;
    animation: none !important;
    filter: grayscale(80%);
    border-color: rgba(100, 100, 100, 0.4) !important;
    box-shadow: none !important;
}

.marker-pin.dimmed i {
    color: rgba(150, 150, 150, 0.6) !important;
    text-shadow: none !important;
}

.marker-pin.dimmed:hover {
    opacity: 0.5;
    transform: scale(1.05);
}

/* Animación más rápida para marcadores resaltados con colores personalizados */
@keyframes pulseFast {
    0% {
        box-shadow: 0 0 0 0 rgba(197, 255, 155, 0.8);
    }
    50% {
        box-shadow: 0 0 20px 8px rgba(166, 254, 248, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(197, 255, 155, 0);
    }
}

/* Nombre de la propiedad sobre el marcador */
.name-tag {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 20, 30, 0.85);
    padding: 3px 10px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    border: 1px solid rgba(166, 254, 248, 0.6);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.marker-pin:hover .name-tag {
    opacity: 1;
}

/* Loading indicator */
#map-loading {
    z-index: 1000;
    animation: fadein 0.3s;
}

/* Error message styling */
.map-error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(20, 20, 30, 0.95);
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    z-index: 1000;
    max-width: 80%;
    width: 380px;
    text-align: center;
    border: 2px solid #ff5252;
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.4);
    backdrop-filter: blur(4px);
    animation: fadein 0.5s;
}

.map-error-message h3 {
    color: #ff5252;
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

.map-error-message p {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: #e0e0e0;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.map-error-message button {
    background-color: #00c2ff;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 180px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.map-error-message button:first-child {
    background-color: #c5ff9b;
}

.map-error-message button:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 194, 255, 0.4);
}

@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .map-card {
        height: 450px;
    }
    
    .property-map {
        height: calc(100% - 70px);
    }
    
    .map-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .map-view-buttons {
        margin-top: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .map-card {
        height: 350px;
    }
}
