/**
 * map-enhanced.css - Styles pour la carte interactive Leaflet
 */

/* Conteneur carte */
.mapbox-container {
    width: 100%;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.mapbox-container.mini {
    height: 350px;
}

.mapbox-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
}

/* Marqueurs personnalisés */
.custom-marker {
    cursor: pointer;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #2563eb;
    position: relative;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.marker-pin::after {
    content: '';
    width: 14px;
    height: 14px;
    margin: 8px 0 0 8px;
    background: #ffffff;
    position: absolute;
    border-radius: 50%;
}

/* Popup personnalisée */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    padding: 0 !important;
    font-family: 'Poppins', sans-serif !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 15px !important;
    min-width: 250px;
}

.leaflet-popup-close-button {
    font-size: 18px !important;
    color: #64748b !important;
    padding: 8px 8px 0 0 !important;
}

.leaflet-popup-close-button:hover {
    color: #1e293b !important;
    background: none !important;
}

.leaflet-popup-tip {
    background: white !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Boutons de contrôle */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    color: #1e293b !important;
    background: white !important;
    border: none !important;
}

.leaflet-control-zoom a:hover {
    background: #f8fafc !important;
    color: #2563eb !important;
}

.leaflet-control-zoom a.leaflet-disabled {
    color: #cbd5e1 !important;
}

/* Échelle */
.leaflet-control-scale {
    margin-left: 10px !important;
    margin-bottom: 10px !important;
}

.leaflet-control-scale-line {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    color: #475569 !important;
    font-size: 10px !important;
    padding: 2px 5px !important;
}

/* Bouton géolocalisation amélioré */
.hmap-geo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 1.5px solid #2563eb;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hmap-geo-btn:hover {
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(37, 99, 235, 0.2);
}

.hmap-geo-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.hmap-geo-btn svg {
    width: 18px;
    height: 18px;
}

/* Animation de spin */
@keyframes hmap-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hmap-spin {
    display: inline-block;
    animation: hmap-spin 1s linear infinite;
}

/* Panneau d'information */
.location-info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.location-info-panel h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.location-info-panel p {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.location-info-panel .actions {
    display: flex;
    gap: 12px;
}

.location-info-panel .btn-primary {
    flex: 2;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-info-panel .btn-primary:hover {
    background: #1d4ed8;
}

.location-info-panel .btn-secondary {
    flex: 1;
    padding: 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-info-panel .btn-secondary:hover {
    background: #e2e8f0;
}

/* Mode plein écran */
.map-fullscreen-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e293b;
    transition: all 0.2s;
}

.map-fullscreen-toggle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.map-fullscreen-toggle i {
    font-size: 14px;
}

/* Loading overlay */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.map-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Instructions */
.map-instructions {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    backdrop-filter: blur(5px);
}

.map-instructions i {
    color: #2563eb;
    margin-right: 6px;
}

/* Marqueur utilisateur */
.user-location-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Adaptation mobile */
@media (max-width: 768px) {
    .mapbox-container {
        height: 400px;
    }
    
    .location-info-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 16px;
    }
    
    .hmap-geo-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .map-instructions {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .map-fullscreen-toggle {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .map-instructions {
        background: #1e293b;
        color: #f1f5f9;
        border-color: #334155;
    }
    
    .location-info-panel {
        background: #1e293b;
        border-color: #334155;
    }
    
    .location-info-panel h3 {
        color: #f1f5f9;
    }
    
    .location-info-panel p {
        color: #94a3b8;
    }
    
    .location-info-panel .btn-secondary {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .location-info-panel .btn-secondary:hover {
        background: #475569;
    }
    
    .map-fullscreen-toggle {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
    
    .map-fullscreen-toggle:hover {
        background: #334155;
    }
    
    .leaflet-popup-content-wrapper {
        background: #1e293b !important;
        color: #f1f5f9 !important;
    }
    
    .leaflet-popup-tip {
        background: #1e293b !important;
    }
    
    .leaflet-control-zoom a {
        background: #1e293b !important;
        color: #f1f5f9 !important;
        border-color: #334155 !important;
    }
    
    .leaflet-control-zoom a:hover {
        background: #334155 !important;
    }
}