/* ==========================================================================
   pages/maps.css - Estilos específicos para mapas y geolocalización
   ========================================================================== */

/* Map Containers */
.map-container {
    height: 70vh;
    width: 100%;
}

/* Full height map for main map page */
.map-main-container {
    height: calc(100vh - 80px);
}

.map-container:focus {
    outline: none;
    box-shadow: none;
}

.map-form {
    height: 300px;
    border-radius: var(--fd-radius-sm);
    border: 1px solid var(--fd-border-color);
}

.map-profile {
    height: 400px;
    border-radius: var(--fd-radius-sm);
    border: 1px solid var(--fd-border-color);
}

.map-detail {
    border-radius: 0 var(--fd-radius-sm) var(--fd-radius-sm) 0;
}

/* Map Legend Indicators */
.map-legend-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 0.5rem;
    display: inline-block;
}

/* Map Markers for Ratings */
.map-marker-rating {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.map-marker-rating-sm {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Map Loading State */
.map-loading {
    height: 50vh;
    background-color: var(--fd-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Map Icon for Markers */
.map-icon-restaurant {
    color: white;
    font-size: 14px;
}

/* Profile Rating Dots (for map legends) */
.profile-rating-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 0.5rem;
}

.profile-rating-dot.rating-5 { background-color: #28a745; }
.profile-rating-dot.rating-4 { background-color: #007bff; }
.profile-rating-dot.rating-3 { background-color: #ffc107; color: #000; }
.profile-rating-dot.rating-2 { background-color: #fd7e14; }
.profile-rating-dot.rating-1 { background-color: #dc3545; }

/* Map legend specific colors */
.map-legend-dot.orange {
    background-color: orange;
}

/* Floating map legend */
.map-legend-floating {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 200px; /* Ancho fijo para consistencia con el indicador */
}

.map-legend-floating .card {
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Map zoom indicator positioned above legend */
.map-zoom-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: var(--fd-radius-sm);
    font-size: 0.85rem;
    pointer-events: none;
    position: absolute;
    bottom: 215px;
    right: 20px;
    width: 200px; /* Mismo ancho que .map-legend-floating max-width */
    text-align: center;
    z-index: 1001;
    margin: 0;
}

/* Ajuste específico para página de mapas de restaurantes (leyenda más pequeña) */
.restaurant-map-page .map-zoom-indicator {
    bottom: 190px;
}

/* Restaurant Detail Map Specific Styles */
.custom-restaurant-marker {
    background-color: var(--fd-danger);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-icon-restaurant {
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.restaurant-detail-map {
    border-radius: 0;
    min-height: 100%;
}

.card-body.p-0 .restaurant-detail-map {
    border-radius: 0 0 calc(0.375rem - 1px) calc(0.375rem - 1px);
}

/* Map popup content styling */
.map-popup-content {
    min-width: 200px;
}

/* Custom marker base styling */
.custom-marker {
    background: transparent;
    border: none;
}

/* Main map container styling */
.map-main-container {
    border: 1px solid var(--fd-border-color);
    border-radius: var(--fd-radius-sm);
}

.map-main-container:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus from Leaflet map specifically */
#map:focus,
#user-map:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove focus from all map containers */
.leaflet-container:focus,
.leaflet-container:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* User map popup content styling (wider than general maps) */
.user-map-popup-content {
    min-width: 250px;
}

/* Restaurant name links in popups */
.restaurant-name-link {
    color: var(--fd-primary-dark);
    text-decoration: none;
    transition: var(--fd-transition-fast);
}

.restaurant-name-link:hover {
    text-decoration: underline;
}

/* Profile map popup content styling */
.profile-map-popup-content {
    min-width: 220px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-container {
        height: 50vh;
    }

    .map-form,
    .map-profile {
        height: 250px;
    }

    .map-marker-rating {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .user-map-popup-content {
        min-width: 200px;
    }

    .profile-map-popup-content {
        min-width: 180px;
    }

    /* Floating legend responsive */
    .map-legend-floating {
        bottom: 10px;
        right: 10px;
        width: 160px; /* Ancho fijo para móviles, consistente con indicador */
    }

    .map-legend-floating .card-body {
        padding: 0.75rem ;
    }

    .map-legend-floating h6 {
        font-size: 0.9rem;
    }

    .map-legend-floating small {
        font-size: 0.75rem;
    }

    /* Zoom indicator responsive */
    .map-zoom-indicator {
        bottom: 175px;
        right: 10px;
        width: 160px; /* Mismo ancho que .map-legend-floating en móviles */
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    /* Ajuste móvil específico para página de mapas de restaurantes */
    .restaurant-map-page .map-zoom-indicator {
        bottom: 130px;
    }
}
